Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2040387rdf; Mon, 6 Nov 2023 03:03:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSyjtgbRJ2ilP7A7UC41/LQF/GhcX+bgG4YoWw69d7bvDrpJ1sN/T+76Zb+F4+ZdO0mYAS X-Received: by 2002:a17:902:e892:b0:1cc:5691:5124 with SMTP id w18-20020a170902e89200b001cc56915124mr17582285plg.21.1699268619630; Mon, 06 Nov 2023 03:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699268619; cv=none; d=google.com; s=arc-20160816; b=PUbjhOLoAYe/09LvR8WWm35/rwkOLW2dr6kEnDyr80024bX+C328D5UoXZHYSaka+1 9+lPOElZYGGwA2Pm7QyWAhS5wyqIJCF2xZSoNGaSpy7KaCGIiDf0OJWjDxHONe1J9U3o 5ZQyHAWXONDluR6HBOuJWZDn9cvJSLPziRhrBbYx8ShzAOoB4Pn2WYkOlf1CQmkBMq89 ezYt5PaHB6MTIP69sUPzgX15oXtQ6JudER5pfMIOiiiQzNXkx/aiym/odK0lyGFf9cmU seQ3qwPb4A22pFR4JeM7pq2a5Isr75LDEplV3V1YUUdiwG1i/81BZjJzpxMJV+vMyaC4 2hfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KU+b2mECXXvQ5slHB7/YEPM4eq1YPpk0J5Rl/yZ7AP8=; fh=6NDLbPegWN39ihzRI+XD38qv7OUBTPlYZUUvtWMZU2Q=; b=C3IU7IK9PNO78wSZuzWjkpyrB/PzBX1+1GfvdnufKWuTrLuYEgkF/JNx0g0K3rrl8Y N3QsCnYIxQ14Elladb5modbTUVilZeAdO1AQYoT7nsWbu/KJb2fjlLgLyPq5/vccZV8s 3aBbSmCKwx4W8Z85OTkzfyvEDlHRXfTF3BeJRpYNAaoRj1Z/tHVBW6x+KslLFEEmp4k7 XS8FORoOS4Epd+rJhHNXHtr4l/9OMTvUickxEGb5+lpmSHWul3g2P8fCxC0q41nnSFsv 1gMcJAkNjXJaziGEzdHybJT4UjUBA8498qrc+EM7cmMW/FHuGk7FPrybmpj712TqEBeT UsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gPnY9VQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id jx16-20020a170903139000b001c724cd1128si7426580plb.276.2023.11.06.03.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 03:03:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gPnY9VQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 478CE80A366A; Mon, 6 Nov 2023 03:03:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbjKFLDV (ORCPT + 99 others); Mon, 6 Nov 2023 06:03:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbjKFLDU (ORCPT ); Mon, 6 Nov 2023 06:03:20 -0500 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C701C6 for ; Mon, 6 Nov 2023 03:03:17 -0800 (PST) Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-672096e0e89so28253746d6.1 for ; Mon, 06 Nov 2023 03:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1699268596; x=1699873396; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KU+b2mECXXvQ5slHB7/YEPM4eq1YPpk0J5Rl/yZ7AP8=; b=gPnY9VQ5ux3WodG09bnggGbMNCn/5I95R1UQmFsMf/bKsbXoc/QSaB20dnAkMrnEbd HN+IkAuGXXiyDw3HF8T9ceKfj0xHwar5NDQHmDkmYd726EBC2uL1P1SeyG1sSwlnfZ/u tcntB7xS1L9Fed0nzTGayk8h6OMjfDgwAOoiCwfdTdQqlMVJxSg57jfhklE6slN2IJg6 1B/cnKd8cozSja5f8vgFwgTIHF0HnOyhfctEOFSvWp7JSkBgKzWbYoHEAoGM72m5KNSy a2QT43u3S5eYY0dZxAZlCY51R1wD8A3CIf6KcHfeGrv1yY375DZcNPKD03n0SQCm/RE9 hZwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268596; x=1699873396; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KU+b2mECXXvQ5slHB7/YEPM4eq1YPpk0J5Rl/yZ7AP8=; b=Ok7h65bqSD1Xo1nM+b1njvptjfzuYR9C6L/1jWmJoo71XwH/pShVHMlY1mcxQNB+Tn TXcS0rgpS3pCZTqYKQGvRUDQPEsGr1X+/Sp1ZRUWNM2kRwhAfa9Y5GYt4ndM5os++LAX yVNVF5i0mLumjF6zNrwS/reHtmDY5IanTM7HnHripaFw8+GpMqpWrg2WoMl5SLqj27qo CFN4g2+lLdYImNfYdVObzG1FAAjDaWX8A/VXbjHnGbPmDVhCuQtq+6YFCLhvoQnldRMA u68X8ch2sDF3lHZMEw2fG49TdB1XafUhI6EGUMVT3T9ts0U5oM7IzNmygnr2n/1Fbuj3 0LOw== X-Gm-Message-State: AOJu0YzvddR3ku7uO01J1dUX6CUhHdB4j6RCjIaAZgVVwDtCekNm391I M0oI1oqAdAFEdsn/Nlldr0ImPHTo8cJvbp9i6cAGEQ== X-Received: by 2002:a05:6214:2582:b0:671:3493:61e8 with SMTP id fq2-20020a056214258200b00671349361e8mr28685929qvb.26.1699268596310; Mon, 06 Nov 2023 03:03:16 -0800 (PST) MIME-Version: 1.0 References: <20231105163040.14904-1-pbonzini@redhat.com> <20231105163040.14904-23-pbonzini@redhat.com> In-Reply-To: <20231105163040.14904-23-pbonzini@redhat.com> From: Fuad Tabba Date: Mon, 6 Nov 2023 11:02:40 +0000 Message-ID: Subject: Re: [PATCH 22/34] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper To: Paolo Bonzini Cc: Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 03:03:34 -0800 (PST) On Sun, Nov 5, 2023 at 4:33=E2=80=AFPM Paolo Bonzini = wrote: > > From: Sean Christopherson > > Drop kvm_userspace_memory_region_find(), it's unused and a terrible API > (probably why it's unused). If anything outside of kvm_util.c needs to > get at the memslot, userspace_mem_region_find() can be exposed to give > others full access to all memory region/slot information. > > Signed-off-by: Sean Christopherson > Message-Id: <20231027182217.3615211-25-seanjc@google.com> > Signed-off-by: Paolo Bonzini > --- Reviewed-by: Fuad Tabba Tested-by: Fuad Tabba Cheers, /fuad > .../selftests/kvm/include/kvm_util_base.h | 4 --- > tools/testing/selftests/kvm/lib/kvm_util.c | 29 ------------------- > 2 files changed, 33 deletions(-) > > diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/= testing/selftests/kvm/include/kvm_util_base.h > index a18db6a7b3cf..967eaaeacd75 100644 > --- a/tools/testing/selftests/kvm/include/kvm_util_base.h > +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h > @@ -776,10 +776,6 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, u= nsigned int num_guest_pages) > return n; > } > > -struct kvm_userspace_memory_region * > -kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start, > - uint64_t end); > - > #define sync_global_to_guest(vm, g) ({ \ > typeof(g) *_p =3D addr_gva2hva(vm, (vm_vaddr_t)&(g)); \ > memcpy(_p, &(g), sizeof(g)); \ > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/s= elftests/kvm/lib/kvm_util.c > index 7a8af1821f5d..f09295d56c23 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -590,35 +590,6 @@ userspace_mem_region_find(struct kvm_vm *vm, uint64_= t start, uint64_t end) > return NULL; > } > > -/* > - * KVM Userspace Memory Region Find > - * > - * Input Args: > - * vm - Virtual Machine > - * start - Starting VM physical address > - * end - Ending VM physical address, inclusive. > - * > - * Output Args: None > - * > - * Return: > - * Pointer to overlapping region, NULL if no such region. > - * > - * Public interface to userspace_mem_region_find. Allows tests to look u= p > - * the memslot datastructure for a given range of guest physical memory. > - */ > -struct kvm_userspace_memory_region * > -kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start, > - uint64_t end) > -{ > - struct userspace_mem_region *region; > - > - region =3D userspace_mem_region_find(vm, start, end); > - if (!region) > - return NULL; > - > - return ®ion->region; > -} > - > __weak void vcpu_arch_free(struct kvm_vcpu *vcpu) > { > > -- > 2.39.1 > >