Skip to content

Commit 9049fb1

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Ignore HCR_EL2.FIEN set by L1 guest's EL2
An EL2 guest can set HCR_EL2.FIEN, which gives access to the RASv1p1 fault injection mechanism. This would allow an EL1 guest to inject error records into the system, which does sound like a terrible idea. Prevent this situation by added FIEN to the list of bits we silently exclude from being inserted into the host configuration. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Joey Gouly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent d7b3e23 commit 9049fb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm64/kvm/hyp/vhe/switch.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ DEFINE_PER_CPU(unsigned long, kvm_hyp_vector);
4343
*
4444
* - API/APK: they are already accounted for by vcpu_load(), and can
4545
* only take effect across a load/put cycle (such as ERET)
46+
*
47+
* - FIEN: no way we let a guest have access to the RAS "Common Fault
48+
* Injection" thing, whatever that does
4649
*/
47-
#define NV_HCR_GUEST_EXCLUDE (HCR_TGE | HCR_API | HCR_APK)
50+
#define NV_HCR_GUEST_EXCLUDE (HCR_TGE | HCR_API | HCR_APK | HCR_FIEN)
4851

4952
static u64 __compute_hcr(struct kvm_vcpu *vcpu)
5053
{

0 commit comments

Comments
 (0)