mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
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>
This commit is contained in:
parent
f01e3429cf
commit
ab1f377b4c
|
|
@ -22,13 +22,12 @@ struct reg_bits_to_feat_map {
|
|||
|
||||
#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;
|
||||
|
||||
|
|
@ -41,7 +40,6 @@ struct reg_bits_to_feat_map {
|
|||
s8 lo_lim;
|
||||
};
|
||||
bool (*match)(struct kvm *);
|
||||
bool (*fval)(struct kvm *, struct resx *);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -74,13 +72,6 @@ struct reg_feat_map_desc {
|
|||
.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), \
|
||||
|
|
@ -100,9 +91,6 @@ struct reg_feat_map_desc {
|
|||
#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__)
|
||||
|
||||
|
|
@ -1303,19 +1291,12 @@ static struct resx compute_resx_bits(struct kvm *kvm,
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user