stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: David Matlack <dmatlack@google.com>,
	Isaku Yamahata <isaku.yamahata@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15.y 6/6] KVM: x86/mmu: Rename __direct_map() to direct_map()
Date: Thu, 30 Jul 2026 15:29:33 -0400	[thread overview]
Message-ID: <20260730192933.3123642-6-sashal@kernel.org> (raw)
In-Reply-To: <20260730192933.3123642-1-sashal@kernel.org>

From: David Matlack <dmatlack@google.com>

[ Upstream commit 6c882ef4fc7bd99b67ad152e75428b669281c521 ]

Rename __direct_map() to direct_map() since the leading underscores are
unnecessary. This also makes the page fault handler names more
consistent: kvm_tdp_mmu_page_fault() calls kvm_tdp_mmu_map() and
direct_page_fault() calls direct_map().

Opportunistically make some trivial cleanups to comments that had to be
modified anyway since they mentioned __direct_map(). Specifically, use
"()" when referring to functions, and include kvm_tdp_mmu_map() among
the various callers of disallowed_hugepage_adjust().

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220921173546.2674386-11-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: 2abd5287f083 ("KVM: x86: Check for invalid/obsolete root *after* making MMU pages available")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kvm/mmu/mmu.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 04e814816b17..c274ab0ceff9 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -2991,11 +2991,11 @@ void disallowed_hugepage_adjust(u64 spte, gfn_t gfn, int cur_level,
 	    is_shadow_present_pte(spte) &&
 	    !is_large_pte(spte)) {
 		/*
-		 * A small SPTE exists for this pfn, but FNAME(fetch)
-		 * and __direct_map would like to create a large PTE
-		 * instead: just force them to go down another level,
-		 * patching back for them into pfn the next 9 bits of
-		 * the address.
+		 * A small SPTE exists for this pfn, but FNAME(fetch),
+		 * direct_map(), or kvm_tdp_mmu_map() would like to create a
+		 * large PTE instead: just force them to go down another level,
+		 * patching back for them into pfn the next 9 bits of the
+		 * address.
 		 */
 		u64 page_mask = KVM_PAGES_PER_HPAGE(level) -
 				KVM_PAGES_PER_HPAGE(level - 1);
@@ -3004,9 +3004,9 @@ void disallowed_hugepage_adjust(u64 spte, gfn_t gfn, int cur_level,
 	}
 }
 
-static int __direct_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
-			int map_writable, int max_level, kvm_pfn_t pfn,
-			bool prefault, bool is_tdp)
+static int direct_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
+		      int map_writable, int max_level, kvm_pfn_t pfn,
+		      bool prefault, bool is_tdp)
 {
 	bool nx_huge_page_workaround_enabled = is_nx_huge_page_enabled();
 	bool write = error_code & PFERR_WRITE_MASK;
@@ -4037,8 +4037,8 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
 	if (r)
 		goto out_unlock;
 
-	r = __direct_map(vcpu, gpa, error_code, map_writable, max_level, pfn,
-			 prefault, is_tdp);
+	r = direct_map(vcpu, gpa, error_code, map_writable, max_level, pfn,
+		       prefault, is_tdp);
 
 out_unlock:
 	write_unlock(&vcpu->kvm->mmu_lock);
-- 
2.53.0


  parent reply	other threads:[~2026-07-30 19:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  6:52 FAILED: patch "[PATCH] KVM: x86: Check for invalid/obsolete root *after* making MMU" failed to apply to 5.15-stable tree gregkh
2026-07-30 19:29 ` [PATCH 5.15.y 1/6] KVM: x86/mmu: Directly "destroy" PTE list when recycling rmaps Sasha Levin
2026-07-30 19:29   ` [PATCH 5.15.y 2/6] KVM: x86/mmu: Rename pte_list_{destroy,remove}() to show they zap SPTEs Sasha Levin
2026-07-30 19:29   ` [PATCH 5.15.y 3/6] KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level() Sasha Levin
2026-07-30 19:29   ` [PATCH 5.15.y 4/6] KVM: Rename mmu_notifier_* to mmu_invalidate_* Sasha Levin
2026-07-30 19:29   ` [PATCH 5.15.y 5/6] KVM: x86/mmu: Split out TDP MMU page fault handling Sasha Levin
2026-07-30 19:29   ` Sasha Levin [this message]
2026-08-06 16:19     ` [PATCH 5.15.y 6/6] KVM: x86/mmu: Rename __direct_map() to direct_map() Harshit Mogalapalli
2026-08-06 16:50       ` Sasha Levin
2026-08-21 12:38     ` Kenta Akagi
2026-08-23  3:42       ` Sasha Levin
2026-08-23 13:07 ` [PATCH 5.15.y v2 0/8] backport for CVE-2026-64561 Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 1/8] KVM: x86/mmu: Retry page fault if root is invalidated by memslot update Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 2/8] KVM: x86/mmu: Directly "destroy" PTE list when recycling rmaps Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 3/8] KVM: x86/mmu: Rename pte_list_{destroy,remove}() to show they zap SPTEs Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 4/8] KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level() Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 5/8] KVM: Rename mmu_notifier_* to mmu_invalidate_* Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 6/8] KVM: x86/mmu: Split out TDP MMU page fault handling Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 7/8] KVM: x86/mmu: Rename __direct_map() to direct_map() Kenta Akagi
2026-08-23 13:07   ` [PATCH 5.15.y v2 8/8] KVM: x86: Check for invalid/obsolete root *after* making MMU pages available Kenta Akagi
2026-08-25 11:49   ` [PATCH 5.15.y v2 0/8] backport for CVE-2026-64561 Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260730192933.3123642-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dmatlack@google.com \
    --cc=isaku.yamahata@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).