Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp150169rwo; Fri, 21 Jul 2023 09:43:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlG19MHAE9iAS9jybKMktEJSM5ntLQAOFAzSj3D+7lrzygfZKSDi398TGsS2paajD32newSC X-Received: by 2002:a17:90b:38c8:b0:25e:d013:c22c with SMTP id nn8-20020a17090b38c800b0025ed013c22cmr1833496pjb.47.1689957821962; Fri, 21 Jul 2023 09:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689957821; cv=none; d=google.com; s=arc-20160816; b=o8AncgG0MUH+nASjDPSMEToQQAOd01RpCzniozIpMLJEdqAP/WJqglDiqiMt5O38CP j5nzFfoIzQvdrn5zw6zwjFh0GyV7UA9P3PTpEZttoN7AbGfKcLraVnh1o69y2H1ozXBF mq9s0yDp/XWbz5TqXfxRAH1NW7DlqhAsE24BKmwKEMSqIWwVd6v4auOpHmYohJDa70uu q8ywuAYnLcXXsAj4uJMzfy2YDFYOvbb6kftLpvWsOkxAazaOGqnducq5I6C1DydLP1CV DLgcWm8QrDPClRKaDVC9ga579eXqp8wiPmcvHe5/Zsn/oIrrMx6Z+Zo64CIMxjxiMMwx JF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BrJmJjnrV3+4TK5GKS3+EEIdaYEFXLT6GE196jD6rfg=; fh=Ha0fK0q/QRDhu63ZqG+O6WFFibL7W0Vai9siCdqdoHU=; b=d56a6raoZpN41DquLF1DAjssHmJ6YuqhopAOvdUit8OobKyNL76nNU7BDhIC0/cAnv llVQebxMAF4tubT/xQVT+ADTs9GdMny4dbhlffuXxuRKZJXA1VO1bU0+ltdeSDjD1MlW RuDmAHrf+pL0FEAE0+foUestpP9BW/n+QHVV7VBn7x/mF7QqQVEZhnTSlJlordReDD/o GRlNSRDmTJXe89QXebhs2Xlouq/vxoQv1vMWuIF69InDKRa6CS0kWjKf6q5cAXlEFXk0 WXp0B4ApsE7KFp8aBrLdhD391fkhZdG93m3NimdAI+RhSmrPpUBklrzlzmQKlt/A0Uim gr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GSAqMAqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o29-20020a63921d000000b005633776f01csi3245973pgd.793.2023.07.21.09.43.29; Fri, 21 Jul 2023 09:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GSAqMAqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbjGUPQQ (ORCPT + 99 others); Fri, 21 Jul 2023 11:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbjGUPQE (ORCPT ); Fri, 21 Jul 2023 11:16:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 563E13588 for ; Fri, 21 Jul 2023 08:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689952481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BrJmJjnrV3+4TK5GKS3+EEIdaYEFXLT6GE196jD6rfg=; b=GSAqMAqtw8bpBMNQ/k37eLgiQyRDBCbx6G6eDU2JBW5XMIuPMqmZ9CK1hzDmIEm4K9I89S x+6iWzOwOORx713vDZJYJAufEimfVtbRD6KgcpfybD2fEsNsqwre9NNAqWla4KErsciL+C IsdfXAvM0svvQnCfDLOtZsPxDf3zcyM= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-xy-aYvYGNYidLl71gnR-PQ-1; Fri, 21 Jul 2023 11:14:36 -0400 X-MC-Unique: xy-aYvYGNYidLl71gnR-PQ-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4fb7d06a7e6so2074811e87.2 for ; Fri, 21 Jul 2023 08:14:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689952475; x=1690557275; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BrJmJjnrV3+4TK5GKS3+EEIdaYEFXLT6GE196jD6rfg=; b=KydqdYLdpII85fmw3ox8VCCiZCO+Zn5n2l7QX80IORu7j88yQPQNw318lFQkOL9qit 0m8kzuW8us2EiqPlJtgvT5qyY3yY2Mq7G8gqEv1l4lmv2FtKUZeuJdMc/2bwVuEOtZzj fkiYmwkOu7Yz2vFPNAEni9kgh+OPWXDGa3WnPeTqIaPt+z7xO8oHO2ESJg7VZu9frWY3 NAlHYxBDPvEdt5R4gItYWhn4epDUkOAcL+3kcMxZJ6G7EUaDzAjr/1RX+lZujnub/xao dbEcV1gMRq8/pgyl1rZrymt/+33sbQ7LqcZEcaXy5EsZ3nle1P10tU5A6pKJ26JJqNLc eyIQ== X-Gm-Message-State: ABy/qLayO1Jb6Cs39/+Mu1iwJu5BB3cGkkikGW0pg1vAhotmizk7qCA8 YsfKX1SAyH1A1g0+ZiQrBnxZpQLMYwAO6jl/0FEswwbsP9xf+GNNZc95DJ7WfS4uuK4X5fdkgNc yS1O8ga0Zi8ag5NgC33ANH4df X-Received: by 2002:a05:6512:1150:b0:4f8:661f:60a4 with SMTP id m16-20020a056512115000b004f8661f60a4mr1702785lfg.41.1689952475234; Fri, 21 Jul 2023 08:14:35 -0700 (PDT) X-Received: by 2002:a05:6512:1150:b0:4f8:661f:60a4 with SMTP id m16-20020a056512115000b004f8661f60a4mr1702736lfg.41.1689952474795; Fri, 21 Jul 2023 08:14:34 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id l23-20020a056402345700b00521d2cf5f3bsm2224721edc.96.2023.07.21.08.14.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jul 2023 08:14:34 -0700 (PDT) Message-ID: <75f13a8a-132f-99ee-d3c6-24a12f2f23d5@redhat.com> Date: Fri, 21 Jul 2023 17:14:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH v11 18/29] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper Content-Language: en-US To: Sean Christopherson , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" Cc: 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-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-19-seanjc@google.com> From: Paolo Bonzini In-Reply-To: <20230718234512.1690985-19-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/23 01:45, Sean Christopherson wrote: > 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 > --- > .../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 07732a157ccd..6aeb008dd668 100644 > --- a/tools/testing/selftests/kvm/include/kvm_util_base.h > +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h > @@ -753,10 +753,6 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned 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 = 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/selftests/kvm/lib/kvm_util.c > index 9741a7ff6380..45d21e052db0 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -586,35 +586,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 up > - * 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 = userspace_mem_region_find(vm, start, end); > - if (!region) > - return NULL; > - > - return ®ion->region; > -} > - > __weak void vcpu_arch_free(struct kvm_vcpu *vcpu) > { > Will queue this. Paolo