Skip to content

Commit 51b4786

Browse files
committed
Merge tag 'powerpc-6.12-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fix from Madhavan Srinivasan: - Fix spurious interrupts in Book3S HV Nested KVM Thanks to Gautam Menghani. * tag 'powerpc-6.12-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Book3S HV: Mask off LPCR_MER for a vCPU before running it to avoid spurious interrupts
2 parents 906bd68 + a373830 commit 51b4786

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,6 +4898,18 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
48984898
BOOK3S_INTERRUPT_EXTERNAL, 0);
48994899
else
49004900
lpcr |= LPCR_MER;
4901+
} else {
4902+
/*
4903+
* L1's copy of L2's LPCR (vcpu->arch.vcore->lpcr) can get its MER bit
4904+
* unexpectedly set - for e.g. during NMI handling when all register
4905+
* states are synchronized from L0 to L1. L1 needs to inform L0 about
4906+
* MER=1 only when there are pending external interrupts.
4907+
* In the above if check, MER bit is set if there are pending
4908+
* external interrupts. Hence, explicity mask off MER bit
4909+
* here as otherwise it may generate spurious interrupts in L2 KVM
4910+
* causing an endless loop, which results in L2 guest getting hung.
4911+
*/
4912+
lpcr &= ~LPCR_MER;
49014913
}
49024914
} else if (vcpu->arch.pending_exceptions ||
49034915
vcpu->arch.doorbell_request ||

0 commit comments

Comments
 (0)