Skip to content

Commit 18aeeeb

Browse files
committed
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: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent eb60963 commit 18aeeeb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kvm/emulate-nested.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ int __init populate_nv_trap_config(void)
20212021
cgids = coarse_control_combo[id - __MULTIPLE_CONTROL_BITS__];
20222022

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

0 commit comments

Comments
 (0)