Skip to content

Commit

Permalink
KVM: x86/mmu: Clear 'role.host_mmu_la57_top_p4d' when calculating chi…
Browse files Browse the repository at this point in the history
…ld SP role

The 'role.host_mmu_la57_top_p4d' bit is only allowed for L4 SP and
should not be inherited when calculating the child SP role. Otherwise,
wrong spte will be set in drop_parent_pte() and it will result in a
broken SPT.

Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Link: #6
  • Loading branch information
bysui committed Apr 25, 2024
1 parent 7497a07 commit 5ceb9c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,7 @@ static union kvm_mmu_page_role kvm_mmu_child_role(u64 *sptep, bool direct,
role.access = access;
role.direct = direct;
role.passthrough = 0;
role.host_mmu_la57_top_p4d = 0;

/*
* If the guest has 4-byte PTEs then that means it's using 32-bit,
Expand Down

0 comments on commit 5ceb9c5

Please sign in to comment.