Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Get rid of FIXED_VALUE altogether

We have now killed every occurrences of FIXED_VALUE, and we can therefore
drop the whole infrastructure. Good riddance.

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260202184329.2724080-16-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

+5 -24
+5 -24
arch/arm64/kvm/config.c
··· 22 22 23 23 #define NEVER_FGU BIT(0) /* Can trap, but never UNDEF */ 24 24 #define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */ 25 - #define FIXED_VALUE BIT(2) /* RAZ/WI or RAO/WI in KVM */ 25 + #define FORCE_RESx BIT(2) /* Unconditional RESx */ 26 26 #define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */ 27 27 #define AS_RES1 BIT(4) /* RES1 when not supported */ 28 28 #define REQUIRES_E2H1 BIT(5) /* Add HCR_EL2.E2H RES1 as a pre-condition */ 29 29 #define RES1_WHEN_E2H0 BIT(6) /* RES1 when E2H=0 and not supported */ 30 30 #define RES1_WHEN_E2H1 BIT(7) /* RES1 when E2H=1 and not supported */ 31 - #define FORCE_RESx BIT(8) /* Unconditional RESx */ 32 31 33 32 unsigned long flags; 34 33 ··· 40 41 s8 lo_lim; 41 42 }; 42 43 bool (*match)(struct kvm *); 43 - bool (*fval)(struct kvm *, struct resx *); 44 44 }; 45 45 }; 46 46 ··· 72 74 .lo_lim = id ##_## fld ##_## lim \ 73 75 } 74 76 75 - #define __NEEDS_FEAT_2(m, f, w, fun, dummy) \ 76 - { \ 77 - .w = (m), \ 78 - .flags = (f) | CALL_FUNC, \ 79 - .fval = (fun), \ 80 - } 81 - 82 77 #define __NEEDS_FEAT_1(m, f, w, fun) \ 83 78 { \ 84 79 .w = (m), \ ··· 90 99 91 100 #define NEEDS_FEAT_FLAG(m, f, ...) \ 92 101 __NEEDS_FEAT_FLAG(m, f, bits, __VA_ARGS__) 93 - 94 - #define NEEDS_FEAT_FIXED(m, ...) \ 95 - __NEEDS_FEAT_FLAG(m, FIXED_VALUE, bits, __VA_ARGS__, 0) 96 102 97 103 #define NEEDS_FEAT_MASKS(p, ...) \ 98 104 __NEEDS_FEAT_FLAG(p, MASKS_POINTER, masks, __VA_ARGS__) ··· 1291 1303 if (map[i].flags & exclude) 1292 1304 continue; 1293 1305 1294 - switch (map[i].flags & (FORCE_RESx | CALL_FUNC | FIXED_VALUE)) { 1295 - case CALL_FUNC | FIXED_VALUE: 1296 - map[i].fval(kvm, &resx); 1297 - continue; 1298 - case CALL_FUNC: 1299 - match = map[i].match(kvm); 1300 - break; 1301 - case FORCE_RESx: 1306 + if (map[i].flags & FORCE_RESx) 1302 1307 match = false; 1303 - break; 1304 - default: 1308 + else if (map[i].flags & CALL_FUNC) 1309 + match = map[i].match(kvm); 1310 + else 1305 1311 match = idreg_feat_match(kvm, &map[i]); 1306 - } 1307 1312 1308 1313 if (map[i].flags & REQUIRES_E2H1) 1309 1314 match &= !e2h0;