#define NEVER_FGU BIT(0) /* Can trap, but never UNDEF */
#define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */
-#define FIXED_VALUE BIT(2) /* RAZ/WI or RAO/WI in KVM */
+#define FORCE_RESx BIT(2) /* Unconditional RESx */
#define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */
#define AS_RES1 BIT(4) /* RES1 when not supported */
#define REQUIRES_E2H1 BIT(5) /* Add HCR_EL2.E2H RES1 as a pre-condition */
#define RES1_WHEN_E2H0 BIT(6) /* RES1 when E2H=0 and not supported */
#define RES1_WHEN_E2H1 BIT(7) /* RES1 when E2H=1 and not supported */
-#define FORCE_RESx BIT(8) /* Unconditional RESx */
unsigned long flags;
s8 lo_lim;
};
bool (*match)(struct kvm *);
- bool (*fval)(struct kvm *, struct resx *);
};
};
.lo_lim = id ##_## fld ##_## lim \
}
-#define __NEEDS_FEAT_2(m, f, w, fun, dummy) \
- { \
- .w = (m), \
- .flags = (f) | CALL_FUNC, \
- .fval = (fun), \
- }
-
#define __NEEDS_FEAT_1(m, f, w, fun) \
{ \
.w = (m), \
#define NEEDS_FEAT_FLAG(m, f, ...) \
__NEEDS_FEAT_FLAG(m, f, bits, __VA_ARGS__)
-#define NEEDS_FEAT_FIXED(m, ...) \
- __NEEDS_FEAT_FLAG(m, FIXED_VALUE, bits, __VA_ARGS__, 0)
-
#define NEEDS_FEAT_MASKS(p, ...) \
__NEEDS_FEAT_FLAG(p, MASKS_POINTER, masks, __VA_ARGS__)
if (map[i].flags & exclude)
continue;
- switch (map[i].flags & (FORCE_RESx | CALL_FUNC | FIXED_VALUE)) {
- case CALL_FUNC | FIXED_VALUE:
- map[i].fval(kvm, &resx);
- continue;
- case CALL_FUNC:
- match = map[i].match(kvm);
- break;
- case FORCE_RESx:
+ if (map[i].flags & FORCE_RESx)
match = false;
- break;
- default:
+ else if (map[i].flags & CALL_FUNC)
+ match = map[i].match(kvm);
+ else
match = idreg_feat_match(kvm, &map[i]);
- }
if (map[i].flags & REQUIRES_E2H1)
match &= !e2h0;