[PATCH 15/20] KVM: arm64: Get rid of FIXED_VALUE altogether
Fuad Tabba
tabba at google.com
Thu Jan 29 08:54:19 PST 2026
On Mon, 26 Jan 2026 at 12:17, Marc Zyngier <maz at kernel.org> wrote:
>
> We have now killed every occurrences of FIXED_VALUE, and we can therefore
> drop the whole infrastructure. Good riddance.
Indeed.
> Signed-off-by: Marc Zyngier <maz at kernel.org>
Reviewed-by: Fuad Tabba <tabba at google.com>
Cheers,
/fuad
> ---
> arch/arm64/kvm/config.c | 24 +++---------------------
> 1 file changed, 3 insertions(+), 21 deletions(-)
>
> diff --git a/arch/arm64/kvm/config.c b/arch/arm64/kvm/config.c
> index 187d047a9cf4a..28e534f2850ea 100644
> --- a/arch/arm64/kvm/config.c
> +++ b/arch/arm64/kvm/config.c
> @@ -22,7 +22,7 @@ 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 */
> @@ -30,7 +30,6 @@ struct reg_bits_to_feat_map {
> #define RES0_WHEN_E2H1 BIT(7) /* RES0 when E2H=1 and not supported */
> #define RES1_WHEN_E2H0 BIT(8) /* RES1 when E2H=0 and not supported */
> #define RES1_WHEN_E2H1 BIT(9) /* RES1 when E2H=1 and not supported */
> -#define FORCE_RESx BIT(10) /* Unconditional RESx */
>
> unsigned long flags;
>
> @@ -43,7 +42,6 @@ struct reg_bits_to_feat_map {
> s8 lo_lim;
> };
> bool (*match)(struct kvm *);
> - bool (*fval)(struct kvm *, struct resx *);
> };
> };
>
> @@ -76,13 +74,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), \
> @@ -96,9 +87,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__)
>
> @@ -1306,16 +1294,10 @@ struct resx compute_resx_bits(struct kvm *kvm,
> if (map[i].flags & exclude)
> continue;
>
> - switch (map[i].flags & (CALL_FUNC | FIXED_VALUE)) {
> - case CALL_FUNC | FIXED_VALUE:
> - map[i].fval(kvm, &resx);
> - continue;
> - case CALL_FUNC:
> + if (map[i].flags & CALL_FUNC)
> match = map[i].match(kvm);
> - break;
> - default:
> + else
> match = idreg_feat_match(kvm, &map[i]);
> - }
>
> if (map[i].flags & REQUIRES_E2H1)
> match &= !e2h0;
> --
> 2.47.3
>
More information about the linux-arm-kernel
mailing list