summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-07-12 17:13:35 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-07-16 15:56:56 +0200
commit9fe17d2ada6e4ec05502a8725e87def023e1d74e (patch)
tree1e1dbe9efb5502eaa0c0c47e648c5e9c6a083596
parentKVM: x86/mmu: Bug the VM if KVM tries to split a !hugepage SPTE (diff)
downloadlinux-9fe17d2ada6e4ec05502a8725e87def023e1d74e.tar.xz
linux-9fe17d2ada6e4ec05502a8725e87def023e1d74e.zip
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>
-rw-r--r--arch/x86/kvm/mmu/spte.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/kvm/mmu/spte.c b/arch/x86/kvm/mmu/spte.c
index b15ce06edb46..89b1d57e8b4b 100644
--- a/arch/x86/kvm/mmu/spte.c
+++ b/arch/x86/kvm/mmu/spte.c
@@ -291,15 +291,13 @@ static u64 make_spte_executable(u64 spte)
* This is used during huge page splitting to build the SPTEs that make up the
* new page table.
*/
-u64 make_huge_page_split_spte(struct kvm *kvm, u64 huge_spte, union kvm_mmu_page_role role,
- int index)
+u64 make_huge_page_split_spte(struct kvm *kvm, u64 huge_spte,
+ union kvm_mmu_page_role role, int index)
{
- u64 child_spte;
+ u64 child_spte = huge_spte;
KVM_BUG_ON(!is_shadow_present_pte(huge_spte) || !is_large_pte(huge_spte), kvm);
- child_spte = huge_spte;
-
/*
* The child_spte already has the base address of the huge page being
* split. So we just have to OR in the offset to the page at the next