qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	Halil Pasic <pasic@linux.ibm.com>,
	Richard Henderson <rth@twiddle.net>,
	Collin Walling <walling@linux.ibm.com>,
	"Jason J . Herne" <jjherne@linux.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v3 8/9] s390x/cpumodel: add gen15 defintions
Date: Mon, 29 Apr 2019 12:18:32 +0200	[thread overview]
Message-ID: <87f1441f-f081-e693-065c-b930fba588da@redhat.com> (raw)
In-Reply-To: <20190429090250.7648-9-borntraeger@de.ibm.com>

On 29.04.19 11:02, Christian Borntraeger wrote:
> add several new features (msa9, sort, deflate, additional vector
> instructions, new general purpose instructions) to generation 15.
> 
> Also disable csske and bpb from the default and base models >=15.
> This will allow to migrate gen15 machines to future machines that
> do not have these features.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  target/s390x/gen-features.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
> index 8fc2e8e72f..c346b76bdf 100644
> --- a/target/s390x/gen-features.c
> +++ b/target/s390x/gen-features.c
> @@ -13,6 +13,7 @@
>  
>  #include <inttypes.h>
>  #include <stdio.h>
> +#include <string.h>
>  #include "cpu_features_def.h"
>  
>  #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
> @@ -419,6 +420,10 @@ static uint16_t base_GEN14_GA1[] = {
>  
>  #define base_GEN14_GA2 EmptyFeat
>  
> +static uint16_t base_GEN15_GA1[] = {
> +    S390_FEAT_MISC_INSTRUCTION_EXT3,
> +};
> +
>  /* Full features (in order of release)
>   * Automatically includes corresponding base features.
>   * Full features are all features this hardware supports even if kvm/QEMU do not
> @@ -548,6 +553,16 @@ static uint16_t full_GEN14_GA1[] = {
>  
>  #define full_GEN14_GA2 EmptyFeat
>  
> +static uint16_t full_GEN15_GA1[] = {
> +    S390_FEAT_VECTOR_ENH2,
> +    S390_FEAT_GROUP_ENH_SORT,
> +    S390_FEAT_GROUP_DEFLATE_CONVERSION,
> +    S390_FEAT_VECTOR_BCD_ENH,
> +    S390_FEAT_GROUP_MSA_EXT_9,
> +    S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
> +    S390_FEAT_ETOKEN,
> +};
> +
>  /* Default features (in order of release)
>   * Automatically includes corresponding base features.
>   * Default features are all features this version of QEMU supports for this
> @@ -624,6 +639,16 @@ static uint16_t default_GEN14_GA1[] = {
>  
>  #define default_GEN14_GA2 EmptyFeat
>  
> +static uint16_t default_GEN15_GA1[] = {
> +    S390_FEAT_VECTOR_ENH2,
> +    S390_FEAT_GROUP_ENH_SORT,
> +    S390_FEAT_GROUP_DEFLATE_CONVERSION,
> +    S390_FEAT_VECTOR_BCD_ENH,
> +    S390_FEAT_GROUP_MSA_EXT_9,
> +    S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
> +    S390_FEAT_ETOKEN,
> +};
> +
>  /* QEMU (CPU model) features */
>  
>  static uint16_t qemu_V2_11[] = {
> @@ -740,6 +765,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
>      CPU_FEAT_INITIALIZER(GEN13_GA2),
>      CPU_FEAT_INITIALIZER(GEN14_GA1),
>      CPU_FEAT_INITIALIZER(GEN14_GA2),
> +    CPU_FEAT_INITIALIZER(GEN15_GA1),
>  };
>  
>  #define FEAT_GROUP_INITIALIZER(_name)                  \
> @@ -808,6 +834,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
>      }
>  }
>  
> +static inline void clear_bit(uint64_t list[], unsigned long nr)
> +{
> +    list[nr / 64] &= ~(1ULL << (nr % 64));
> +}
> +
>  static void print_feature_defs(void)
>  {
>      uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
> @@ -818,6 +849,12 @@ static void print_feature_defs(void)
>      printf("\n/* CPU model feature list data */\n");
>  
>      for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
> +        /* With gen15 CSSKE and BPB are deprecated */
> +        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
> +            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_BPB);
> +        }
>          set_bits(base_feat, CpuFeatDef[i].base_bits);
>          /* add the base to the default features */
>          set_bits(default_feat, CpuFeatDef[i].base_bits);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

WARNING: multiple messages have this Message-ID (diff)
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: "Jason J . Herne" <jjherne@linux.ibm.com>,
	Collin Walling <walling@linux.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Halil Pasic <pasic@linux.ibm.com>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 8/9] s390x/cpumodel: add gen15 defintions
Date: Mon, 29 Apr 2019 12:18:32 +0200	[thread overview]
Message-ID: <87f1441f-f081-e693-065c-b930fba588da@redhat.com> (raw)
Message-ID: <20190429101832.dlciRxIGmQ5D2gXxX84vAlCBl3BvhKy8K9O3EUtzRSY@z> (raw)
In-Reply-To: <20190429090250.7648-9-borntraeger@de.ibm.com>

On 29.04.19 11:02, Christian Borntraeger wrote:
> add several new features (msa9, sort, deflate, additional vector
> instructions, new general purpose instructions) to generation 15.
> 
> Also disable csske and bpb from the default and base models >=15.
> This will allow to migrate gen15 machines to future machines that
> do not have these features.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  target/s390x/gen-features.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
> index 8fc2e8e72f..c346b76bdf 100644
> --- a/target/s390x/gen-features.c
> +++ b/target/s390x/gen-features.c
> @@ -13,6 +13,7 @@
>  
>  #include <inttypes.h>
>  #include <stdio.h>
> +#include <string.h>
>  #include "cpu_features_def.h"
>  
>  #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
> @@ -419,6 +420,10 @@ static uint16_t base_GEN14_GA1[] = {
>  
>  #define base_GEN14_GA2 EmptyFeat
>  
> +static uint16_t base_GEN15_GA1[] = {
> +    S390_FEAT_MISC_INSTRUCTION_EXT3,
> +};
> +
>  /* Full features (in order of release)
>   * Automatically includes corresponding base features.
>   * Full features are all features this hardware supports even if kvm/QEMU do not
> @@ -548,6 +553,16 @@ static uint16_t full_GEN14_GA1[] = {
>  
>  #define full_GEN14_GA2 EmptyFeat
>  
> +static uint16_t full_GEN15_GA1[] = {
> +    S390_FEAT_VECTOR_ENH2,
> +    S390_FEAT_GROUP_ENH_SORT,
> +    S390_FEAT_GROUP_DEFLATE_CONVERSION,
> +    S390_FEAT_VECTOR_BCD_ENH,
> +    S390_FEAT_GROUP_MSA_EXT_9,
> +    S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
> +    S390_FEAT_ETOKEN,
> +};
> +
>  /* Default features (in order of release)
>   * Automatically includes corresponding base features.
>   * Default features are all features this version of QEMU supports for this
> @@ -624,6 +639,16 @@ static uint16_t default_GEN14_GA1[] = {
>  
>  #define default_GEN14_GA2 EmptyFeat
>  
> +static uint16_t default_GEN15_GA1[] = {
> +    S390_FEAT_VECTOR_ENH2,
> +    S390_FEAT_GROUP_ENH_SORT,
> +    S390_FEAT_GROUP_DEFLATE_CONVERSION,
> +    S390_FEAT_VECTOR_BCD_ENH,
> +    S390_FEAT_GROUP_MSA_EXT_9,
> +    S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
> +    S390_FEAT_ETOKEN,
> +};
> +
>  /* QEMU (CPU model) features */
>  
>  static uint16_t qemu_V2_11[] = {
> @@ -740,6 +765,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
>      CPU_FEAT_INITIALIZER(GEN13_GA2),
>      CPU_FEAT_INITIALIZER(GEN14_GA1),
>      CPU_FEAT_INITIALIZER(GEN14_GA2),
> +    CPU_FEAT_INITIALIZER(GEN15_GA1),
>  };
>  
>  #define FEAT_GROUP_INITIALIZER(_name)                  \
> @@ -808,6 +834,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
>      }
>  }
>  
> +static inline void clear_bit(uint64_t list[], unsigned long nr)
> +{
> +    list[nr / 64] &= ~(1ULL << (nr % 64));
> +}
> +
>  static void print_feature_defs(void)
>  {
>      uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
> @@ -818,6 +849,12 @@ static void print_feature_defs(void)
>      printf("\n/* CPU model feature list data */\n");
>  
>      for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
> +        /* With gen15 CSSKE and BPB are deprecated */
> +        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
> +            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_BPB);
> +        }
>          set_bits(base_feat, CpuFeatDef[i].base_bits);
>          /* add the base to the default features */
>          set_bits(default_feat, CpuFeatDef[i].base_bits);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb


  parent reply	other threads:[~2019-04-29 10:23 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  9:02 [Qemu-devel] [PATCH v3 0/9] s390x: new guest features Christian Borntraeger
2019-04-29  9:02 ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 1/9] linux header sync Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 2/9] s390x/cpumodel: ignore csske for expansion Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 3/9] s390x/cpumodel: Miscellaneous-Instruction-Extensions Facility 3 Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 4/9] s390x/cpumodel: msa9 facility Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29 19:24   ` David Hildenbrand
2019-04-29 19:24     ` David Hildenbrand
2019-04-30  5:41     ` Christian Borntraeger
2019-04-30  5:41       ` Christian Borntraeger
2019-04-30  7:00       ` David Hildenbrand
2019-04-30  7:00         ` David Hildenbrand
2019-04-30  7:13         ` Cornelia Huck
2019-04-30  7:13           ` Cornelia Huck
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 5/9] s390x/cpumodel: vector enhancements Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 6/9] s390x/cpumodel: enhanced sort facility Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 7/9] s390x/cpumodel: add Deflate-conversion facility Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29 10:19   ` David Hildenbrand
2019-04-29 10:19     ` David Hildenbrand
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 8/9] s390x/cpumodel: add gen15 defintions Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29 10:18   ` David Hildenbrand [this message]
2019-04-29 10:18     ` David Hildenbrand
2019-04-29  9:02 ` [Qemu-devel] [PATCH v3 9/9] s390x/cpumodel: wire up 8561 and 8562 as gen15 machines Christian Borntraeger
2019-04-29  9:02   ` Christian Borntraeger
2019-04-29 10:17   ` David Hildenbrand
2019-04-29 10:17     ` David Hildenbrand
2019-04-29  9:25 ` [Qemu-devel] [PATCH v3 0/9] s390x: new guest features no-reply
2019-04-29  9:25   ` no-reply
2019-04-29  9:30 ` no-reply
2019-04-29  9:30   ` no-reply
2019-04-29  9:35 ` no-reply
2019-04-29  9:35   ` no-reply
2019-04-29  9:40 ` no-reply
2019-04-29  9:40   ` no-reply
2019-04-29 10:28 ` no-reply
2019-04-29 10:28   ` no-reply
2019-04-29 16:08 ` Cornelia Huck
2019-04-29 16:08   ` Cornelia Huck
2019-05-07  9:07   ` [Qemu-devel] [qemu-s390x] " Christian Borntraeger
2019-05-07  9:49     ` Cornelia Huck
2019-04-29 19:28 ` [Qemu-devel] " no-reply
2019-04-29 19:28   ` no-reply
2019-05-01 13:33 ` no-reply
2019-05-01 13:33   ` no-reply
2019-05-01 14:04 ` no-reply
2019-05-01 14:04   ` no-reply
2019-05-20  6:42 ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87f1441f-f081-e693-065c-b930fba588da@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=jjherne@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=walling@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).