Skip to contentSkip to conversation

target/i386: Add Snowridge-v2 (noMPX) CPU model

PATCH Superseded Xiaoyao Li 2 participants 6 messages Oct 11, 2019 – Oct 12, 2019

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Xiaoyao Li

author
#0 lore raw

PATCH v2 1/1 target/i386: Add Snowridge-v2 (noMPX) CPU model

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
 target/i386/cpu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
target/i386/cpu.c +13 -0
index 44f1bbdcac76..27b0a17b46a8 100644
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
             CPUID_6_EAX_ARAT,
         .xlevel = 0x80000008,
         .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },
+                    { /* end of list */ },
+                },
+            },
+            { /* end of list */ },
+        },
     },
     {
         .name = "KnightsMill",
Signature · 1 line
2.19.1
#1 lore raw
Quoted 18 lines · Xiaoyao Li

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
 target/i386/cpu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
target/i386/cpu.c +0 -0
index 44f1bbdcac76..27b0a17b46a8 100644

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2800

Quoted 8 lines
target/i386/cpu.c +5 -0
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
             CPUID_6_EAX_ARAT,
         .xlevel = 0x80000008,
         .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",

The intention is to stop creating new funny names for CPU model variations, now, and stick to -v1, -v2, -v3, etc.

The .alias field is optional, and was added only for compatibility with the existing -noTSX and -IBRS CPU models.

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2803

Quoted 3 lines
target/i386/cpu.c +3 -0
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },

Do you think it's important to report a different model-id? I would keep it the same and only add mpx=off.

Quoted 11 lines
target/i386/cpu.c +5 -0
+                    { /* end of list */ },
+                },
+            },
+            { /* end of list */ },
+        },
     },
     {
         .name = "KnightsMill",
Signature · 1 line
2.19.1
Signature · 1 line
Eduardo
author
#2 lore raw
Quoted 31 lines · Eduardo Habkost
Quoted 18 lines · Xiaoyao Li

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
  target/i386/cpu.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)
target/i386/cpu.c +0 -0
index 44f1bbdcac76..27b0a17b46a8 100644

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2800

Quoted 8 lines
target/i386/cpu.c +5 -0
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
              CPUID_6_EAX_ARAT,
          .xlevel = 0x80000008,
          .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",

The intention is to stop creating new funny names for CPU model variations, now, and stick to -v1, -v2, -v3, etc.

Quoted 2 lines

The .alias field is optional, and was added only for compatibility with the existing -noTSX and -IBRS CPU models.

Got it.

Quoted 6 lines

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2803

Quoted 3 lines
target/i386/cpu.c +3 -0
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },

Do you think it's important to report a different model-id? I would keep it the same and only add mpx=off.

I just want to let user know easily the differences between Snowridge-v1 and Snowridge-v2. Unfortunately, it seems ugly.

When testing with Cascadelake-Server, it puzzles every time that which one should I choose between Cascadelake-Server-v1 and Cascadelake-Server-v2. From the output of "-cpu ?", I don't know the differences between them. Everytime I have to go to the source code to see the difference.

Maybe there is a way to see/report the differences between different versions of the same CPU model that I just don't know?

Quoted 12 lines
Quoted 11 lines
target/i386/cpu.c +5 -0
+                    { /* end of list */ },
+                },
+            },
+            { /* end of list */ },
+        },
      },
      {
          .name = "KnightsMill",
Signature · 1 line
2.19.1
#3 lore raw
Quoted 47 lines · Xiaoyao Li
Quoted 31 lines · Eduardo Habkost
Quoted 18 lines · Xiaoyao Li

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
  target/i386/cpu.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)
target/i386/cpu.c +0 -0
index 44f1bbdcac76..27b0a17b46a8 100644

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2800

Quoted 8 lines
target/i386/cpu.c +5 -0
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
              CPUID_6_EAX_ARAT,
          .xlevel = 0x80000008,
          .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",

The intention is to stop creating new funny names for CPU model variations, now, and stick to -v1, -v2, -v3, etc.

Quoted 2 lines

The .alias field is optional, and was added only for compatibility with the existing -noTSX and -IBRS CPU models.

Got it.

Quoted 6 lines

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2803

Quoted 3 lines
target/i386/cpu.c +3 -0
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },

Do you think it's important to report a different model-id? I would keep it the same and only add mpx=off.

I just want to let user know easily the differences between Snowridge-v1 and Snowridge-v2. Unfortunately, it seems ugly.

Quoted 7 lines

When testing with Cascadelake-Server, it puzzles every time that which one should I choose between Cascadelake-Server-v1 and Cascadelake-Server-v2. From the output of "-cpu ?", I don't know the differences between them. Everytime I have to go to the source code to see the difference.

Maybe there is a way to see/report the differences between different versions of the same CPU model that I just don't know?

Good point. I forgot that model-id is also the model description in "-cpu ?".

Well, it doesn't hurt to have a different model-id in v2 that's more informative. Feel free to keep the model-id line in v3.

Thanks!

Signature · 1 line
Eduardo
author
#4 lore raw
Quoted 53 lines · Eduardo Habkost
Quoted 52 lines · Xiaoyao Li
Quoted 31 lines · Eduardo Habkost
Quoted 18 lines · Xiaoyao Li

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
   target/i386/cpu.c | 13 +++++++++++++
   1 file changed, 13 insertions(+)
target/i386/cpu.c +0 -0
index 44f1bbdcac76..27b0a17b46a8 100644

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2800

Quoted 8 lines
target/i386/cpu.c +5 -0
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
               CPUID_6_EAX_ARAT,
           .xlevel = 0x80000008,
           .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",

The intention is to stop creating new funny names for CPU model variations, now, and stick to -v1, -v2, -v3, etc.

Quoted 2 lines

The .alias field is optional, and was added only for compatibility with the existing -noTSX and -IBRS CPU models.

Got it.

Quoted 6 lines

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2803

Quoted 3 lines
target/i386/cpu.c +3 -0
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },

Do you think it's important to report a different model-id? I would keep it the same and only add mpx=off.

I just want to let user know easily the differences between Snowridge-v1 and Snowridge-v2. Unfortunately, it seems ugly.

When testing with Cascadelake-Server, it puzzles every time that which one should I choose between Cascadelake-Server-v1 and Cascadelake-Server-v2.
From the output of "-cpu ?", I don't know the differences between them.
Everytime I have to go to the source code to see the difference.

Quoted 8 lines
Quoted 2 lines

Maybe there is a way to see/report the differences between different versions of the same CPU model that I just don't know?

Good point. I forgot that model-id is also the model description in "-cpu ?".

Well, it doesn't hurt to have a different model-id in v2 that's more informative. Feel free to keep the model-id line in v3.

OK. I will send out the v3 patch keeping the model-id while removing the alias.

BTW, do you have better idea to tell the differences among versions of the same CPU model?

#5 lore raw
Quoted 60 lines · Xiaoyao Li
Quoted 59 lines · Eduardo Habkost
Quoted 47 lines · Xiaoyao Li
Quoted 31 lines · Eduardo Habkost
Quoted 18 lines · Xiaoyao Li

Add new version of Snowridge CPU model that removes MPX feature.

MPX support is being phased out by Intel. GCC has dropped it, Linux kernel and kvm are also going to do that in the future.

---
Changes in v2:
- Use CPU model versioning mechanism instead of machine-type compat

---
   target/i386/cpu.c | 13 +++++++++++++
   1 file changed, 13 insertions(+)
target/i386/cpu.c +0 -0
index 44f1bbdcac76..27b0a17b46a8 100644

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2800

Quoted 8 lines
target/i386/cpu.c +5 -0
@@ -2793,6 +2793,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
               CPUID_6_EAX_ARAT,
           .xlevel = 0x80000008,
           .model_id = "Intel Atom Processor (SnowRidge)",
+        .versions = (X86CPUVersionDefinition[]) {
+            { .version = 1 },
+            {
+                .version = 2,
+                .alias = "Snowridge-noMPX",

The intention is to stop creating new funny names for CPU model variations, now, and stick to -v1, -v2, -v3, etc.

Quoted 2 lines

The .alias field is optional, and was added only for compatibility with the existing -noTSX and -IBRS CPU models.

Got it.

Quoted 6 lines

target/i386/cpu.c static X86CPUDefinition builtin_x86_defs[] = { · line 2803

Quoted 3 lines
target/i386/cpu.c +3 -0
+                .props = (PropValue[]) {
+                    { "mpx", "off" },
+                    { "model-id", "Intel Atom Processor (Snowridge, no MPX)" },

Do you think it's important to report a different model-id? I would keep it the same and only add mpx=off.

I just want to let user know easily the differences between Snowridge-v1 and Snowridge-v2. Unfortunately, it seems ugly.

Quoted 7 lines

When testing with Cascadelake-Server, it puzzles every time that which one should I choose between Cascadelake-Server-v1 and Cascadelake-Server-v2.
From the output of "-cpu ?", I don't know the differences between them.
Everytime I have to go to the source code to see the difference.

Maybe there is a way to see/report the differences between different versions of the same CPU model that I just don't know?

Good point. I forgot that model-id is also the model description in "-cpu ?".

Quoted 8 lines
Quoted 2 lines

Well, it doesn't hurt to have a different model-id in v2 that's more informative. Feel free to keep the model-id line in v3.

OK. I will send out the v3 patch keeping the model-id while removing the alias.

BTW, do you have better idea to tell the differences among versions of the same CPU model?

We could add a new field for a human-readable description of the CPU model version, and print that field on "-cpu help" if set.

We could also try to generate a description automatically (e.g. automatically describe SnowRidge-v2 as "SnowRidge-v1 plus mpx" based on .props). I'm not sure if it would be worth the effort, though.

Signature · 1 line
Eduardo