linux/arch/arm64/kvm/hyp
Marc Zyngier af22df997d KVM: arm64: Fix CPU interface MMIO compatibility detection
In order to detect whether a GICv3 CPU interface is MMIO capable,
we switch ICC_SRE_EL1.SRE to 0 and check whether it sticks.

However, this is only possible if *ALL* of the HCR_EL2 interrupt
overrides are set, and the CPU is perfectly allowed to ignore
the write to ICC_SRE_EL1 otherwise. This leads KVM to pretend
that a whole bunch of ARMv8.0 CPUs aren't MMIO-capable, and
breaks VMs that should work correctly otherwise.

Fix this by setting IMO/FMO/IMO before touching ICC_SRE_EL1,
and clear them afterwards. This allows us to reliably detect
the CPU interface capabilities.

Tested-by: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Fixes: 9739f6ef05 ("KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility")
Signed-off-by: Marc Zyngier <maz@kernel.org>
2021-03-24 17:26:38 +00:00
..
include KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available 2021-03-06 04:18:40 -05:00
nvhe More fixes for ARM and x86. 2021-03-14 12:35:02 -07:00
vhe KVM: arm64: Ensure I-cache isolation between vcpus of a same VM 2021-03-09 17:58:56 +00:00
aarch32.c KVM: arm64: Move kvm_vcpu_trap_il_is32bit into kvm_skip_instr32() 2020-11-10 08:34:24 +00:00
entry.S KVM: arm64: Don't use cbz/adr with external symbols 2021-03-09 08:48:24 +00:00
exception.c KVM: arm64: Inject AArch32 exceptions from HYP 2020-11-10 08:34:26 +00:00
fpsimd.S KVM: arm64: Remove __hyp_text macro, use build rules instead 2020-07-05 18:38:45 +01:00
hyp-entry.S KVM: arm64: make the hyp vector table entries local 2021-02-24 11:20:43 +00:00
Makefile KVM: arm64: Allocate hyp vectors statically 2020-11-16 10:43:05 +00:00
pgtable.c KVM: arm64: Fix range alignment when walking page tables 2021-03-06 04:18:41 -05:00
vgic-v2-cpuif-proxy.c KVM: arm64: Remove hyp_symbol_addr 2021-01-23 14:01:00 +00:00
vgic-v3-sr.c KVM: arm64: Fix CPU interface MMIO compatibility detection 2021-03-24 17:26:38 +00:00