* [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
@ 2026-02-18 21:08 Sean Christopherson
2026-02-18 22:30 ` Edgecombe, Rick P
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sean Christopherson @ 2026-02-18 21:08 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini
Cc: kvm, linux-kernel, Rick Edgecombe, Kai Huang
When splitting hugepages in the TDP MMU, don't zero the new page table on
allocation since tdp_mmu_split_huge_page() is guaranteed to write every
entry and thus every byte.
Unless someone peeks at the memory between allocating the page table and
writing the child SPTEs, no functional change intended.
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Kai Huang <kai.huang@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/mmu/tdp_mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 9c26038f6b77..7b1102d26f9c 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -1507,7 +1507,7 @@ static struct kvm_mmu_page *tdp_mmu_alloc_sp_for_split(void)
if (!sp)
return NULL;
- sp->spt = (void *)get_zeroed_page(GFP_KERNEL_ACCOUNT);
+ sp->spt = (void *)__get_free_page(GFP_KERNEL_ACCOUNT);
if (!sp->spt) {
kmem_cache_free(mmu_page_header_cache, sp);
return NULL;
base-commit: 183bb0ce8c77b0fd1fb25874112bc8751a461e49
--
2.53.0.345.g96ddfc5eaa-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
2026-02-18 21:08 [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage Sean Christopherson
@ 2026-02-18 22:30 ` Edgecombe, Rick P
2026-02-19 0:06 ` Huang, Kai
2026-03-05 17:07 ` Sean Christopherson
2 siblings, 0 replies; 4+ messages in thread
From: Edgecombe, Rick P @ 2026-02-18 22:30 UTC (permalink / raw)
To: pbonzini@redhat.com, seanjc@google.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Huang, Kai
On Wed, 2026-02-18 at 13:08 -0800, Sean Christopherson wrote:
> When splitting hugepages in the TDP MMU, don't zero the new page table on
> allocation since tdp_mmu_split_huge_page() is guaranteed to write every
> entry and thus every byte.
>
> Unless someone peeks at the memory between allocating the page table and
> writing the child SPTEs
>
Didn't see any way for this to happen.
> , no functional change intended.
>
> Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Cc: Kai Huang <kai.huang@intel.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
2026-02-18 21:08 [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage Sean Christopherson
2026-02-18 22:30 ` Edgecombe, Rick P
@ 2026-02-19 0:06 ` Huang, Kai
2026-03-05 17:07 ` Sean Christopherson
2 siblings, 0 replies; 4+ messages in thread
From: Huang, Kai @ 2026-02-19 0:06 UTC (permalink / raw)
To: pbonzini@redhat.com, seanjc@google.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Edgecombe, Rick P
On Wed, 2026-02-18 at 13:08 -0800, Sean Christopherson wrote:
> When splitting hugepages in the TDP MMU, don't zero the new page table on
> allocation since tdp_mmu_split_huge_page() is guaranteed to write every
> entry and thus every byte.
>
> Unless someone peeks at the memory between allocating the page table and
> writing the child SPTEs, no functional change intended.
>
> Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Cc: Kai Huang <kai.huang@intel.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
>
Reviewed-by: Kai Huang <kai.huang@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
2026-02-18 21:08 [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage Sean Christopherson
2026-02-18 22:30 ` Edgecombe, Rick P
2026-02-19 0:06 ` Huang, Kai
@ 2026-03-05 17:07 ` Sean Christopherson
2 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2026-03-05 17:07 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini
Cc: kvm, linux-kernel, Rick Edgecombe, Kai Huang
On Wed, 18 Feb 2026 13:08:20 -0800, Sean Christopherson wrote:
> When splitting hugepages in the TDP MMU, don't zero the new page table on
> allocation since tdp_mmu_split_huge_page() is guaranteed to write every
> entry and thus every byte.
>
> Unless someone peeks at the memory between allocating the page table and
> writing the child SPTEs, no functional change intended.
>
> [...]
Applied to kvm-x86 mmu, thanks!
[1/1] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
https://github.com/kvm-x86/linux/commit/ecb806293213
--
https://github.com/kvm-x86/linux/tree/next
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-05 17:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 21:08 [PATCH] KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage Sean Christopherson
2026-02-18 22:30 ` Edgecombe, Rick P
2026-02-19 0:06 ` Huang, Kai
2026-03-05 17:07 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox