Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: x86/mmu: Clean up make_huge_page_split_spte() definition and intro

Tweak the definition of make_huge_page_split_spte() to eliminate an
unnecessarily long line, and opportunistically initialize child_spte to
make it more obvious that the child is directly derived from the huge
parent.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240712151335.1242633-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Sean Christopherson and committed by
Paolo Bonzini
9fe17d2a 3d4415ed

+3 -5
+3 -5
arch/x86/kvm/mmu/spte.c
··· 291 291 * This is used during huge page splitting to build the SPTEs that make up the 292 292 * new page table. 293 293 */ 294 - u64 make_huge_page_split_spte(struct kvm *kvm, u64 huge_spte, union kvm_mmu_page_role role, 295 - int index) 294 + u64 make_huge_page_split_spte(struct kvm *kvm, u64 huge_spte, 295 + union kvm_mmu_page_role role, int index) 296 296 { 297 - u64 child_spte; 297 + u64 child_spte = huge_spte; 298 298 299 299 KVM_BUG_ON(!is_shadow_present_pte(huge_spte) || !is_large_pte(huge_spte), kvm); 300 - 301 - child_spte = huge_spte; 302 300 303 301 /* 304 302 * The child_spte already has the base address of the huge page being