Message ID | 20240726235234.228822-43-seanjc@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C94FC3DA49 for <linux-arm-kernel@archiver.kernel.org>; Sat, 27 Jul 2024 00:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To: From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=66tkjZePX8REZ4BHWwuGWSSOzSubgrfSmhtIFHX3PRM=; b=qaEHQSUdExEPHG76SfOd10NGhw xn3cSddN0XLP/2Yq1iNkoBgBA/37jotF0RXm+lDRVzXjTxiBDpy02ibWnwSPuR51p0nNYhZpRIK7L 3LppHOWudqPb+TN/io4a37kY5hxvseaak78lHb1aKBI+HGpNv/J6GtIf5b8E/LIC0FxpjOAfJWGPp v2jJaAPAtPe1LsIsLvn0zFF6TAG1kNlR17RgofsGdwy3ZbG3oV8a8qfMugqKhqEgRwCErNpU4JOEK bfmK7uuUbd701vAh5cn6F6SQuwMl+auBH/CD+yZIP1x4q1tuAI0nraWBCFv04DMIRfhURIaRSWs+5 HRgG2PWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXV1Q-00000005Zbg-2qsG; Sat, 27 Jul 2024 00:10:52 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXUlB-00000005QHz-1nlL for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 23:54:07 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-672bea19bedso6263307b3.3 for <linux-arm-kernel@lists.infradead.org>; Fri, 26 Jul 2024 16:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722038044; x=1722642844; darn=lists.infradead.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=66tkjZePX8REZ4BHWwuGWSSOzSubgrfSmhtIFHX3PRM=; b=ju9p12X6+p/wDCj4zrSzx9/mhrb1zDVyOW9r7wxMqRb8NYmjAwtIFiJGGexQL5m4j0 ZIOPgjki2wu4af6yEX8NIcndPzvQE9VDNW9Z7f4BY2LZGpqhsZme6kf4Gona6LJeX7qU uVX3qdmF6zRPTkQ3ylh0O22ITk9LaixbXYH1xMAwQrYRaiRNhnhtT4CO49iIqChF184p aPFXcyQgmoG36OkGV2SU75GHbu9oSLMM7BM6YrMSdflBZSoxR8TwQLLOWv3l116AblTw giH3fB2yzx5rBumzR11mFuF60VCtpPI5VK53DdBSpDjPc898qju+AvC90enREb1a76pt IQKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722038044; x=1722642844; 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=66tkjZePX8REZ4BHWwuGWSSOzSubgrfSmhtIFHX3PRM=; b=XGwZyGTR/MWFCNBaHWBJzludcNz1mdhO8Z+R+7lPDZbgfyjPN4AqPwZBNK2heJlV5Q uv7ODGi/o+k4LMcjx1nyNBV7VKkBsWikbmaQ/A7ZLp0J8YRpe74stE0ThsaPiyAZkHPi z5XTXs9jmiPrkvzDb2YjUmeES6jZ+De3CP5x6ehMKCdN3lD/5DczmlZYJBI/braS+zQL aIyZeP56rNeAQhbo4X8MpHCrbB34hM4ygcKQNjAbgYVhIVXJrGEZADpCRIQnEniY7NpE XpkwyQ/qYC1lMJEs2I88/tIePT5qdCyYgqx82jxRLgfeRsuInlVvVdkaMDfm1oJvYqBR zVdA== X-Forwarded-Encrypted: i=1; AJvYcCVak5idlG32MAJn2aTvv41PKlyGbBTUBTJKX+dz80euAlNyXeAobJzwLiOOy1SGZDpN6TeWzMw58E3K+g4qvqLc4N45jPUGsATo9id3nNhZvgSPBPw= X-Gm-Message-State: AOJu0Yz87oyn3cA1pW6/T41cnFh6AHGwEppp+iz/oInRAvvhwM0ByWZ9 TyOZNUuC/qjH5ylZ+6fEVDxduUtXqU25hgbN8l6szwMRuLphF7fSDY6140NZ6t15RDDBoI1dBCc Asg== X-Google-Smtp-Source: AGHT+IEXCHhy0parcxZWaUKhAkA9z5ds6aScUvbMwsWWyatCr0tT87bBO0XasR4cX5mU+wgB/x+9BeJQnC8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:f92:b0:673:b39a:92f2 with SMTP id 00721157ae682-67a0a7fd778mr244297b3.7.1722038044118; Fri, 26 Jul 2024 16:54:04 -0700 (PDT) Date: Fri, 26 Jul 2024 16:51:51 -0700 In-Reply-To: <20240726235234.228822-1-seanjc@google.com> Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240726235234.228822-43-seanjc@google.com> Subject: [PATCH v12 42/84] KVM: Move declarations of memslot accessors up in kvm_host.h From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Tianrui Zhao <zhaotianrui@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Sean Christopherson <seanjc@google.com> Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack <dmatlack@google.com>, David Stevens <stevensd@chromium.org> Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_165405_623785_9FDCD03E X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Reply-To: Sean Christopherson <seanjc@google.com> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: Stop grabbing references to PFNMAP'd pages
|
expand
|
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 5a572cef4adc..ef0277b77375 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1153,6 +1153,10 @@ static inline bool kvm_memslot_iter_is_valid(struct kvm_memslot_iter *iter, gfn_ kvm_memslot_iter_is_valid(iter, end); \ kvm_memslot_iter_next(iter)) +struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); +struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); +struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn); + /* * KVM_SET_USER_MEMORY_REGION ioctl allows the following operations: * - create a new memory slot @@ -1290,15 +1294,13 @@ int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, }) int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); -struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); bool kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); bool kvm_vcpu_is_visible_gfn(struct kvm_vcpu *vcpu, gfn_t gfn); unsigned long kvm_host_page_size(struct kvm_vcpu *vcpu, gfn_t gfn); void mark_page_dirty_in_slot(struct kvm *kvm, const struct kvm_memory_slot *memslot, gfn_t gfn); void mark_page_dirty(struct kvm *kvm, gfn_t gfn); -struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); -struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn); + kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn); int __kvm_vcpu_map(struct kvm_vcpu *vcpu, gpa_t gpa, struct kvm_host_map *map,
Move the memslot lookup helpers further up in kvm_host.h so that they can be used by inlined "to pfn" wrappers. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> --- include/linux/kvm_host.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)