Skip to content

Commit

Permalink
fix: kernel panic on AMD CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshVij authored Mar 19, 2024
1 parent ebec6f6 commit 28bf0d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/pvm/pvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,9 @@ static void pvm_set_host_cr3_for_guest_without_host_pcid(struct vcpu_pvm *pvm)
{
u64 root_hpa = pvm->vcpu.arch.mmu->root.hpa;
u64 switch_root = 0;
u64 prev_root_hpa = pvm->vcpu.arch.mmu->prev_roots[0].hpa;

if (pvm->vcpu.arch.mmu->prev_roots[0].pgd == pvm->msr_switch_cr3) {
if (VALID_PAGE(prev_root_hpa) && (pvm->vcpu.arch.mmu->prev_roots[0].pgd == pvm->msr_switch_cr3)) {
switch_root = pvm->vcpu.arch.mmu->prev_roots[0].hpa;
pvm->switch_flags &= ~SWITCH_FLAGS_NO_DS_CR3;
} else {
Expand Down

0 comments on commit 28bf0d2

Please sign in to comment.