Commit 18aeeeb5 authored by Oliver Upton's avatar Oliver Upton
Browse files

KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps



KVM uses a sanity-check to avoid infinite recursion in trap combinations
that could potentially depend on itself. Narrow the scope of this sanity
check to the exact CGT IDs that correspond w/ trap combos, opening the
door to using 'complex' traps as part of a combination.

Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241025182354.3364124-7-oliver.upton@linux.dev


Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
parent eb609638
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2021,7 +2021,8 @@ int __init populate_nv_trap_config(void)
		cgids = coarse_control_combo[id - __MULTIPLE_CONTROL_BITS__];

		for (int i = 0; cgids[i] != __RESERVED__; i++) {
			if (cgids[i] >= __MULTIPLE_CONTROL_BITS__) {
			if (cgids[i] >= __MULTIPLE_CONTROL_BITS__ &&
			    cgids[i] < __COMPLEX_CONDITIONS__) {
				kvm_err("Recursive MCB %d/%d\n", id, cgids[i]);
				ret = -EINVAL;
			}