From patchwork Fri Oct 27 18:22:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13438951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5038C25B72 for ; Fri, 27 Oct 2023 18:23:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66F8980020; Fri, 27 Oct 2023 14:23:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5FA3D80018; Fri, 27 Oct 2023 14:23:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 423F480020; Fri, 27 Oct 2023 14:23:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2BA3680018 for ; Fri, 27 Oct 2023 14:23:16 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0AA5740D0D for ; Fri, 27 Oct 2023 18:23:16 +0000 (UTC) X-FDA: 81392063592.12.54C54ED Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf12.hostedemail.com (Postfix) with ESMTP id 4068840002 for ; Fri, 27 Oct 2023 18:23:14 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=cjNv74Az; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of 3EQA8ZQYKCDIgSObXQUccUZS.QcaZWbil-aaYjOQY.cfU@flex--seanjc.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3EQA8ZQYKCDIgSObXQUccUZS.QcaZWbil-aaYjOQY.cfU@flex--seanjc.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698430994; h=from:from:sender:reply-to: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+S4AiipPfUUKpJ2ruaZ4ElxK7cYS7w8+XYANZ6GAwNM=; b=CE9174exbTgXcfocc1KCc6ZCgsDmdVJuqH9dGZiwQ6pEjh9qbCn/bnSeiMrdPvFnXEnBFv k6MNwvG/DghBdV87euw8ZoO6lexjK4h0UQr6Rn3H/74fwbRbYcCewVXXshgCciBRsFaSJI 3EpubL1PpbNDRJCbn7r4ttPNdqOK/UU= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=cjNv74Az; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of 3EQA8ZQYKCDIgSObXQUccUZS.QcaZWbil-aaYjOQY.cfU@flex--seanjc.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3EQA8ZQYKCDIgSObXQUccUZS.QcaZWbil-aaYjOQY.cfU@flex--seanjc.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698430994; a=rsa-sha256; cv=none; b=a9vgE33a4Nz4iryWW74YJtaL4O0JDhoOr0aM2Nh4MK0HwarBV1Aludo37ks7lDyW/sNHRk dPpd2EVeGc+nos3/A8q07j45MVS1rd9r6h5GEGm2+yLqCokMCp+VMItaDc18CYJ3/i3OTd BSviiqIUYhqOi/RLKLGL/ft3uzNfuBg= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1cc252cbde2so6362855ad.0 for ; Fri, 27 Oct 2023 11:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698430993; x=1699035793; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=+S4AiipPfUUKpJ2ruaZ4ElxK7cYS7w8+XYANZ6GAwNM=; b=cjNv74AzlsjIK+bN7tsQStNwM08cYWP3QgQqX/tmckPZCiDcWAG8Gw5/R0FE3fS83a gbdmkoRg9yKdAjFFkTwnbEAK4ZdVcJljQ/eVgCY1jYUoNuH9su7RD4YhTliWdsK0DQZe aJlYJ+dfZcyL1wNjUKpwHPuvXOMgLX/0tlp7u9BECQnb18d9fvZz8+3+hUw+2cFRSd6W pECmqRBPe2vYLnBu6KFT+xONhclH10VcZ43T5yIzHaaZzc/0+91S2NYLo8zSt6GStJ2x x4RAeZ3c9Gdrub2wepAJa6xvgLGc4Fx8UPRl76cuJUw2JNxMeE85Uf1bZLdFNvDm05lK Mkxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698430993; x=1699035793; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+S4AiipPfUUKpJ2ruaZ4ElxK7cYS7w8+XYANZ6GAwNM=; b=feGtJDzroMGxX1Bg+yrCAvHQkyBJYzy0fHXyP8ghLuuvkoAolZkCVoTiOINsvhOHNu U5QJP0LE9QlS9rZMt9zxedTBcYkUoQ6WAy8dPceDWy/O8oAHbG/kBbqxP8/vz8GC8X91 PX4gbVZMrx5UjtABCs67q3pwQv21PZ2ybQQJu68lUwjjvLVwVvW92BhpJHO2vtB/F/Ts PrG58ZO90POCNd7D2EvG5lkhHY5WY3wkJjozFZFu5i8cz1b9nN+ZySY1ZSPdZHp9uCl3 ZekIvIByneGaPhgokmJMYtJXGi3lEbmNCO4NIGGLfCKW8ms6lDpcPwi3sYQfp+dgll1G 8Spg== X-Gm-Message-State: AOJu0Yz2XNpY0jGKNvWpksLkFkO4ZH5R0rxf2qOrs8vB39StOrXX742f bluQt4F/RfF3q0mSIx+5jpO4TL5PHPk= X-Google-Smtp-Source: AGHT+IEqIkKuv5DX25uHuP2fYVc0fUSbsifhQGdV1yLQ889bX1DKci/qdjsCIFlDcD5dVWlFtax8M8nrsME= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:4296:b0:1c9:e3ea:750d with SMTP id ju22-20020a170903429600b001c9e3ea750dmr58852plb.11.1698430993223; Fri, 27 Oct 2023 11:23:13 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 27 Oct 2023 11:22:06 -0700 In-Reply-To: <20231027182217.3615211-1-seanjc@google.com> Mime-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog Message-ID: <20231027182217.3615211-25-seanjc@google.com> Subject: [PATCH v13 24/35] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper From: Sean Christopherson 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_Sala?= =?utf-8?q?=C3=BCn?= " , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" X-Rspamd-Queue-Id: 4068840002 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: wty9z9rrncc4mba6xf34m3iq1a6puzkz X-HE-Tag: 1698430994-653585 X-HE-Meta: U2FsdGVkX1901uqWLGow4m1OuMIWNoNgZRLydKlxK9tu3+3wSQ4CczzSzKnT6vg/X/K16JFEF0shd6WeCgR5QrCqlCgNr3rnu6ULH+Y8RvEguZYBWcpDjG8Y7KSn+d9y4c5iu7MHSjUD1PVlgvwnqSqYy9xO8UTqJcPlLQ8OMHQI9KWKef7Ih+5WCq6Daq4Nf2Cuxe0bOE8GDvwgvGtr/PQ1akqvjRwnhXMeITXH/MfTeAnSWhZf+qdd3zCox44Qm4iQIpyO4V/gCqRfEDcIX4ChqVIGaEDPHnFTZetQJEhe2UfGKmlOXFOqbB2VnxK6rXCZmMW2t1CR8rZKBG/3O/xu7BKOK5HVfJdgbkIwJLNSM4L4VvZO5tIHD9TGF60VR1XW7VEtNusplPDEaeoTD539nOAVzGIgc1347Zy9ROblEQc7bB9isR6lveL9l+bknZazSRGV01as6ZJZVc3+T2qYluqFemW/iZmHQPty1ta+VnnbwrNOgcSIBrpb43kSiL9iDmUfx6Xf70d8FgD3uAIvhRo7XxpLmuPkDikBSUoyQ4rPztZc8zirkh+I07TXtHw8R2aJBB8V56lM6nOswhgeVxaM0IJi/9GUoTIqJ7MK+mNidAJdYfJ95xv5INQyaJb0PxNgMPsk/7ePoA0dvFhgfQ2igojfIeSqJAM4ahS3M2LvOHMRhUI4o/cDuDSe/xt5OQmzEBISBDuYewLjDBFGqNrjvVViAUT3P0LUHcr9HJeFHu3TZ+Hb003Qz6B/Rr1aVQwAxbBND/pJD010YEooOUO8lC9SxDjhCTdwaCVSK7f+QASDj2fJTP67DdlTWn/uFeXcpuUxYKLorxyCblilvjeBVii7wkAZosqj/mYItkQtEKBn/FlSeB3AiOxkwZqsrr8cV6GZVDxufwbkmkTOcreCgABMkLgIfRTVhAsPubY2bdYib3EQ+t0bkL8vnqhdHWDmN7WPG/oGUzu XxKljNx2 VMAdhvGU+ybJQyuDnZUJdYsazTBsEPWGcjGI1VL8O7g75ZCYRYIlqptBM0Q1MhonoQ0SBZVmjwusSY3UJcTBiWEVredQOcJ7FRvzDv6nYAo86Hx6nSuErnEhb7uuykBODx3dgjQ8GJsLbs5yeDkky+GYcetv96vSkFe7MGCIjoggdkxymW22zeKqT5ZSrB4j1mgUrMY+Mu1MavcuwwvSRITsll4ezZ3sOQo3IKLFjrc2z4frJHj+GNIBjsOvYqMUTzqKCpDK+7xY/Z/GxUxlPpQPjXhukqPi3MuafehOVFwlSXS4W7wImHY6IfcQ1QaEqdUgXy7mkF/2I9FwHQgRF/sPvoqTAr6XsW8G2d5kpDGwrK2sEn8HJWhvxiTarlS7YPMoxIY03bQ+Jin1kWnLKE9YFUc0itHaXRlOi3P6WrKimtZdNnh0l/oq0xR6IrJIa6fhevyHyKeMyhmhZx1ZjjrxsbugFu489zgRxqHN3Tg3a/XhGYi7+n1QP0UkF2bQkP9Ko99ejxfKJTaZiGcVxXnTo0ktkUzFs86dpfLpbZMkWzjzfMAvMPt1koZVivHPAiBduVLt/0Wadi7aAufF3Mt/cU4yyQUx9q9TTHnyTHz3yPlMsP+h+BrJIHQdk9QlpGhULFb4F5DCUVjlH3alN+MLb+4S7ZGPb+/KN8Z7GVO5gSk7OmohvaM2SI05edtKBQotG4xcZ7kywHq+5EhiaWetcuMT8GAdp9mYYHchuFbBDzKcFZ/osCe3Z2nE+9QUQuz70WWoUVSRPuaXQ13OrPhiIWOaUQ9f1TkxtLJX6BC/vNHqGHSx6a/+YyA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 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) {