[GIT PULL] KVM: x86: MMU changes for 7.1

From: Sean Christopherson

Date: Fri Apr 10 2026 - 20:01:32 EST


Fix an amusing UBSAN warning where nx_huge_pages can be read before KVM is
fully loaded, optimize the unsync flow, and micro-optimize hugepage splitting
in the TDP MMU.

The following changes since commit 11439c4635edd669ae435eec308f4ab8a0804808:

Linux 7.0-rc2 (2026-03-01 15:39:31 -0800)

are available in the Git repository at:

https://github.com/kvm-x86/linux.git tags/kvm-x86-mmu-7.1

for you to fetch changes up to b3ae3ceb556945724d0c046ddb4ea0cf492a0ce6:

KVM: x86/mmu: KVM: x86/mmu: Skip unsync when large pages are allowed (2026-03-12 10:36:01 -0700)

----------------------------------------------------------------
KVM x86 MMU changes for 7.1

- Fix an undefined behavior warning where a crafty userspace can read kvm.ko's
nx_huge_pages before it's fully initialized.

- Don't zero-allocate page tables that are used for splitting hugepages in the
TDP MMU, as KVM is guaranteed to set all SPTEs in the page table and thus
write all bytes.

- Bail early when trying to unsync 4KiB mappings if the target gfn can be
mapped with a 2MiB hugepage, to avoid the gfn hash lookup.

----------------------------------------------------------------
Gal Pressman (1):
KVM: x86/mmu: Fix UBSAN warning when reading nx_huge_pages parameter

Lai Jiangshan (1):
KVM: x86/mmu: KVM: x86/mmu: Skip unsync when large pages are allowed

Sean Christopherson (1):
KVM: x86/mmu: Don't zero-allocate page table used for splitting a hugepage

arch/x86/kvm/mmu/mmu.c | 14 ++++++++++++++
arch/x86/kvm/mmu/tdp_mmu.c | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)