]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage
authorSean Christopherson <seanjc@google.com>
Wed, 18 Feb 2026 21:08:20 +0000 (13:08 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 3 Mar 2026 20:16:27 +0000 (12:16 -0800)
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>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://patch.msgid.link/20260218210820.2828896-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/tdp_mmu.c

index 9c26038f6b77ec84287046f408a6b8d8a314f3f2..7b1102d26f9cd5e14e12238a76e79e0d7eddd7d8 100644 (file)
@@ -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;