On 10/28/26 7:30 AM, Michael Tokarev wrote:
On 10/9/26 21:55, Collin Walling wrote:
Move the feature dependency array (dep[][2]) from cpu_models.c to
cpu_features.c, rename the array to s390_feat_deps, and externalize
its length.

This will allow the array to be used between both files.

Signed-off-by: Collin Walling <[email protected]>
Reviewed-by: Hendrik Brueckner <[email protected]>
---
  target/s390x/cpu_features.c | 126 ++++++++++++++++++++++++++++++++++
  target/s390x/cpu_features.h |   4 ++
  target/s390x/cpu_models.c   | 133 ++----------------------------------
  3 files changed, 135 insertions(+), 128 deletions(-)

diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index c634e741236..20f9947c7be 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -223,6 +223,132 @@ void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
      };
  }
+const int s390_feat_deps[][2] = {
+    { S390_FEAT_IPTE_RANGE, S390_FEAT_DAT_ENH },
...
+    { S390_FEAT_SIE_ASTFLEIE2, S390_FEAT_STFLE },
+};
  static void check_consistency(const S390CPUModel *model)
  {
-    static int dep[][2] = {
-        { S390_FEAT_IPTE_RANGE, S390_FEAT_DAT_ENH },
...
-    };

This change moves whole dep[][2] array elsewhere.  When back-porting
it to the older qemu releases, there's always a merge conflict, because
some deps were added later and are not present in the earlier releases.

How these should be hanlded when back-porting?

For example:

 v11.1.0-588-g66deb271528 s390x/diag: Introduce DIAG 320 for Certificate Store Facility
    introduced { S390_FEAT_CERT_STORE, S390_FEAT_EXTENDED_LENGTH_SCCB },

  v11.1.0-602-gd6de77dab6e s390x: Guest support for Secure-IPL Facility
    introduced { S390_FEAT_SIPL, S390_FEAT_EXTENDED_LENGTH_SCCB },

and so on.

I guess I should take actual dep[][] arrray in check_consistency() from
the version I'm back-porting things to.

Hi Michael,

Yeah, agreed. It's not worth dragging the additional bits to stable that went in to that same array prior to this patch. Sorry for that.

Thanks,
Eric


FWIW,

Thanks,

/mjt


Reply via email to