Re: [PATCH v4 03/29] KVM: arm64: Merge guest's HCRX_EL2 using NV_HCRX_GUEST_EXCLUDE
Marc Zyngier <[email protected]> Thu, 30 Jul 2026 14:39:58 +0100
| Newsgroups | dev.linux.lists.sashiko-reviews,dev.linux.lists.kvmarm,org.kernel.vger.kvm |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 30 Jul 2026 09:01:33 +0100, Marc Zyngier <[email protected]> wrote: > > > Furthermore, trapping non-matching CPUs is a guest decision, and L0 is > not in charge of deciding this. However, what is missing is the > redirection of the exception to L1 when it fires. I've changed my tune on this. Flipping between L0 and L1 to fixup the brokenness of the architecture is not great, because the vcpu could have migrated in the interval and, and be subjected to another similar exception. This results in forward-progress issues on top of the obvious performance overhead. I'll add something like this, either as a separate patch or as a fixup if I have to respin the series. M. diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index 7b27296c94607..5311a0dd16af7 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -330,7 +330,7 @@ static inline void __deactivate_traps_mpam(void) * Just like for HCR_EL2, we can't let the guest mess with some of the * basics we rely on in HCRX_EL2. However, the major difference is that * HCRX_EL2 only affects EL1, and never EL2 (sudden outburst of sanity, I - * guess). So it is always the guest inflicting it on its own guestx. + * guess). So it is always the guest inflicting it on its own guest. * * Things we don't want to let the guest control are: * @@ -339,10 +339,14 @@ static inline void __deactivate_traps_mpam(void) * - PTTWI: Similarly, it is for us to decide whether Reduced Coherency for * the PTW is a thing. It really isn't. * + * - MCE2: FEAT_MOPS generated exceptions for Option-{A,B} interoperability + * are always handled on the host and not forwarded to a guest hypervisor + * in order to give the (poor) illusion of a homogeneous system. + * * - EnIDCP128: We don't allow IMPDEF sysregs -- full stop. */ #define NV_HCRX_GUEST_EXCLUDE (HCRX_EL2_TMEA | HCRX_EL2_PTTWI | \ - HCRX_EL2_EnIDCP128) + HCRX_EL2_MCE2 | HCRX_EL2_EnIDCP128) static inline void __activate_traps_common(struct kvm_vcpu *vcpu) { -- Without deviation from the norm, progress is not possible.