Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1661879rdf; Sun, 5 Nov 2023 08:35:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtPSbKeKyhvx5jDRlBRs2sBCgXlP4jTYYSDOTf9xv5pDtRv/ZPIXRNO7rBBm02bUcPcMtN X-Received: by 2002:a92:cc4e:0:b0:359:4c77:6499 with SMTP id t14-20020a92cc4e000000b003594c776499mr10278147ilq.32.1699202126671; Sun, 05 Nov 2023 08:35:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699202126; cv=none; d=google.com; s=arc-20160816; b=NuHbuje7oXSC7A0FAcoFItLTNbdzLh03eblzzcJbkolzZfa7Q9fv8EMrwOgxjgTTqq nBnUPzfOFfe6lTLbyeVJNhmEM9zerRlNl5mW4gONtdDlUkWZr5ptDHLTqw9fbgYp967Y 2jKuTo53Cbg/vwMkGNG2ko5ZlMwFZGSC2NsPw/QCcWRqnf65qIS2P1JjpNEOu6UeLF+l G/1Tw4kyzvUsVR9k2Yh6IWUCRYyrgayjzBlkcslktNuLj50J6Lx7EOAfoPjji9j4O8qH k8PSQuRH+7XewQpRp2UJRYyTBrtWeQYFiz3j74KK4UbQwDjcbWoTL04PAlPT6U8usT4z 21TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fRP3AdCuPldlN/4xgmE0wyZH8InceIme7Yx9aataN94=; fh=HrMuB0qA2qw4RqBwyiyN+RBlGw+Ob1hcALwHW/PphXs=; b=gkfUfDcT4z/dHDY2v4rITAsKsAgncDuq/UIZkOe3cuViiBkdjp+DutZOBExFHE42iq aLZ49/rd7FMFouuJlDVeqGudCSmryiJRPODQ+xwH7dI0HNh7WEyAZInX4ga31UfUwWmD cJT4HqFmKtJbGa6Xr3r0I1Q8A14/PMM87+IafMf3AlQsT384WzI5Tn/v3mPyJG5Vn2e/ IkpkUUVNu1tjtQLm7R5OeMKuDH3jY8zAh0Sk6ISQ0SBbn0zTPXqKh9fN9DtdclShJ9aU 3anqXzmK6wRsrdWumZpzJM8tmVw9HKchcEToXUN47ot/6TQrzf40qep7HCnWb21TXscK A38w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aurp+BRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n37-20020a635c65000000b00578d3f8d4d4si5966382pgm.448.2023.11.05.08.35.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:35:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aurp+BRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A90A380B2333; Sun, 5 Nov 2023 08:35:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbjKEQfO (ORCPT + 99 others); Sun, 5 Nov 2023 11:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjKEQep (ORCPT ); Sun, 5 Nov 2023 11:34:45 -0500 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 7250D10D4 for ; Sun, 5 Nov 2023 08:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699202032; 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=fRP3AdCuPldlN/4xgmE0wyZH8InceIme7Yx9aataN94=; b=aurp+BRnOgApwuQz2hQprGKU6gaXDqp4kcRwUPxg/4DcWCD169qqxoKPWAZ3NJkhbw3Njv S3gNlJhy31WzZ5nZua+j1/5YGNaNPh4d7zrZqhjDDULz5kzcXRvbmde1VQ4KiExXNu+d2X Rl7T4XY8Wh9CCpwZLasy2Q3u/bMLJNU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-8GMKX0gaNwalOtRVdMIGuQ-1; Sun, 05 Nov 2023 11:33:45 -0500 X-MC-Unique: 8GMKX0gaNwalOtRVdMIGuQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 168C8101A52D; Sun, 5 Nov 2023 16:33:43 +0000 (UTC) Received: from avogadro.redhat.com (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 417422166B26; Sun, 5 Nov 2023 16:33:36 +0000 (UTC) From: Paolo Bonzini To: Paolo Bonzini , 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 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-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Subject: [PATCH 22/34] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper Date: Sun, 5 Nov 2023 17:30:25 +0100 Message-ID: <20231105163040.14904-23-pbonzini@redhat.com> In-Reply-To: <20231105163040.14904-1-pbonzini@redhat.com> References: <20231105163040.14904-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:35:25 -0800 (PST) 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 --- .../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, 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 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 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) { -- 2.39.1