]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: arm64: Get rid of FIXED_VALUE altogether
authorMarc Zyngier <maz@kernel.org>
Mon, 2 Feb 2026 18:43:24 +0000 (18:43 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 5 Feb 2026 09:02:13 +0000 (09:02 +0000)
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>
arch/arm64/kvm/config.c

index ae72f3b8e50b13df6529cd9d9c72896cbcf91fe9..274ae049c4b33d5eec853737b74af1c36eac77d9 100644 (file)
@@ -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;