Skip to contentSkip to conversation

Revert exposure of PCONFIG to guest

PATCH In review Robert Hoo 3 participants 12 messages Dec 19, 2018 – Dec 22, 2018

lore
Share & tools
lore

Robert Hoo

author
#0 lore raw

cover Revert exposure of PCONFIG to guest

PCONFIG is not supposed to be exposed to guest. These 2 patches fix this.

Robert Hoo (2):
i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model Revert "i386: Add CPUID bit for PCONFIG"

 target/i386/cpu.c | 5 ++---
 target/i386/cpu.h | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/2 i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

---
 target/i386/cpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +1 -2
index 677a3bd..b6113d0 100644
@@ -2613,8 +2613,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
             CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
             CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57,
         .features[FEAT_7_0_EDX] =
-            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL |
-            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
         /* Missing: XSAVES (not supported by some Linux versions,
                 * including v4.1 to v4.12).
                 * KVM doesn't yet expose any XSAVES state save component,
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 10 lines · Robert Hoo
---
 target/i386/cpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +0 -0
index 677a3bd..b6113d0 100644

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

Quoted 9 lines
target/i386/cpu.c +1 -2
@@ -2613,8 +2613,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
             CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
             CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57,
         .features[FEAT_7_0_EDX] =
-            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL |
-            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
         /* Missing: XSAVES (not supported by some Linux versions,
                 * including v4.1 to v4.12).
                 * KVM doesn't yet expose any XSAVES state save component,

This was shipped in QEMU 3.1.0, so I don't think we can unconditionally remove it like this without breaking CPU model migration compat.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
author
#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 20 lines · Daniel P. Berrangé
Quoted 19 lines · Robert Hoo

---
 target/i386/cpu.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +0 -0
index 677a3bd..b6113d0 100644
@@ -2613,8 +2613,7 @@ static X86CPUDefinition builtin_x86_defs[] =
 {

             CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
             CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57, .features[FEAT_7_0_EDX] =
-            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL | -            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,

Quoted 9 lines
Quoted 4 lines

         /* Missing: XSAVES (not supported by some Linux versions,
                 * including v4.1 to v4.12).
                 * KVM doesn't yet expose any XSAVES state save component,

This was shipped in QEMU 3.1.0, so I don't think we can unconditionally
remove it like this without breaking CPU model migration compat.

I think the sooner, the better. Take the time window that Icelake CPU model has just shipped with QEMU 3.1.0 and is not publicly/widely used yet.

Quoted 3 lines

Regards,
Daniel

#4 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 30 lines · Robert Hoo
Quoted 20 lines · Daniel P. Berrangé
Quoted 19 lines · Robert Hoo

---
 target/i386/cpu.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +0 -0
index 677a3bd..b6113d0 100644
@@ -2613,8 +2613,7 @@ static X86CPUDefinition builtin_x86_defs[] =
 {

             CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
             CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57, .features[FEAT_7_0_EDX] =
-            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL | -            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,

Quoted 9 lines
Quoted 4 lines

         /* Missing: XSAVES (not supported by some Linux versions,
                 * including v4.1 to v4.12).
                 * KVM doesn't yet expose any XSAVES state save component,

This was shipped in QEMU 3.1.0, so I don't think we can unconditionally
remove it like this without breaking CPU model migration compat.

Quoted 3 lines

I think the sooner, the better. Take the time window that Icelake CPU model has just shipped with QEMU 3.1.0 and is not publicly/widely used yet.

We should still leave it in the 3.1 machine types. I've just sent a patch to do the same with MPX.

Paolo

author
#5 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 37 lines · Paolo Bonzini
Quoted 36 lines · Robert Hoo
Quoted 34 lines · Daniel P. Berrangé
Quoted 16 lines · Robert Hoo

---
 target/i386/cpu.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +0 -0
index 677a3bd..b6113d0 100644
@@ -2613,8 +2613,7 @@ static X86CPUDefinition

builtin_x86_defs[] =
{
             CPUID_7_0_ECX_AVX512VNNI |
CPUID_7_0_ECX_AVX512BITALG

Quoted 1 line
Quoted 12 lines

             CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57,
         .features[FEAT_7_0_EDX] =
-            CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL | -            CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+            CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
         /* Missing: XSAVES (not supported by some Linux versions,
                 * including v4.1 to v4.12).
                 * KVM doesn't yet expose any XSAVES state save component,

This was shipped in QEMU 3.1.0, so I don't think we can unconditionally
remove it like this without breaking CPU model migration compat.

Quoted 9 lines
Quoted 5 lines

I think the sooner, the better. Take the time window that Icelake CPU
model has just shipped with QEMU 3.1.0 and is not publicly/widely used
yet.

We should still leave it in the 3.1 machine types.  I've just sent a patch to do the same with MPX.

I took a look your patch of "Disable MPX support on named CPU models". Seems you do the same as I do to PCONFIG. So you agree with my above patch?:-)

I won't object that keep it in 3.1 machine type as you do to MPX.

Quoted 2 lines

Paolo

#6 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 6 lines · Robert Hoo
Quoted 3 lines

We should still leave it in the 3.1 machine types.  I've just sent a patch to do the same with MPX.

I took a look your patch of "Disable MPX support on named CPU models". Seems you do the same as I do to PCONFIG. So you agree with my above patch?:-)

If you add send a version that keeps it in the 3.1 machine type, I do.

Paolo

Quoted 2 lines

I won't object that keep it in 3.1 machine type as you do to MPX.

#7 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

In reply to Robert Hoo
Quoted 8 lines · Robert Hoo
Quoted 7 lines · Paolo Bonzini
Quoted 5 lines · Robert Hoo

I think the sooner, the better. Take the time window that Icelake CPU
model has just shipped with QEMU 3.1.0 and is not publicly/widely used
yet.

Quoted 8 lines
Quoted 3 lines

We should still leave it in the 3.1 machine types.  I've just sent a patch to do the same with MPX.

I took a look your patch of "Disable MPX support on named CPU models". Seems you do the same as I do to PCONFIG. So you agree with my above patch?:-)

I won't object that keep it in 3.1 machine type as you do to MPX.

Sorry Robert, I changed my mind. If no hypervisor exists that enables PCONFIG for guests (using the PCONFIG_ENABLE processor control), effectively no one can ever have used it. We should disable it in all machine types and Cc qemu-stable.

In fact, the same is true for INTEL_PT, which is not supported by any released kernel version and, even is going to be available only with a module parameter when it will be.

This is not the same as MPX, which did work even though nobody was probably using it.

So this series is correct and I will follow up with one for INTEL_PT; however, this begs the question of how the patches are being tested.

Paolo

author
#8 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 22 lines · Paolo Bonzini
Quoted 21 lines · Robert Hoo
Quoted 9 lines · Paolo Bonzini
Quoted 7 lines · Robert Hoo

I think the sooner, the better. Take the time window that Icelake
CPU
model has just shipped with QEMU 3.1.0 and is not publicly/widely
used
yet.

Quoted 4 lines

We should still leave it in the 3.1 machine types.  I've just sent a
patch to do the same with MPX.

I took a look your patch of "Disable MPX support on named CPU models".
Seems you do the same as I do to PCONFIG. So you agree with my above
patch?:-)

Quoted 8 lines
Quoted 1 line

I won't object that keep it in 3.1 machine type as you do to MPX.

Sorry Robert, I changed my mind.  If no hypervisor exists that enables
PCONFIG for guests (using the PCONFIG_ENABLE processor control), effectively no one can ever have used it.  We should disable it in all
machine types and Cc qemu-stable.

Thanks Paolo.

Quoted 5 lines

In fact, the same is true for INTEL_PT, which is not supported by any released kernel version and, even is going to be available only with a
module parameter when it will be.

Add Luwei in judging this.

Quoted 7 lines

This is not the same as MPX, which did work even though nobody was probably using it.

So this series is correct and I will follow up with one for INTEL_PT; however, this begs the question of how the patches are being tested.

My apologies for carelessness.

I've seen you patch for INTEL_PT. So am I going to resend these 2 patches and Cc qemu-stable? or simply reply these 2 patches adding qemu-stable in Cc list?

Quoted 1 line

Paolo

#9 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 4 lines · Robert Hoo
Quoted 2 lines

So this series is correct and I will follow up with one for INTEL_PT; however, this begs the question of how the patches are being tested.

My apologies for carelessness.

No problem. In the future please check that "-cpu Icelake-Client" doesn't have warnings such as

qemu-system-x86_64: warning: host doesn't support requested feature:
CPUID.07H:EBX.intel-pt [bit 25]

when run on an Icelake-Client host.

Quoted 3 lines

I've seen you patch for INTEL_PT. So am I going to resend these 2 patches and Cc qemu-stable? or simply reply these 2 patches adding qemu-stable in Cc list?

I can take care of that, thanks.

Paolo

author
#10 lore raw

Re: [Qemu-devel] [PATCH 1/2] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model

Quoted 8 lines · Paolo Bonzini
Quoted 6 lines · Robert Hoo
Quoted 4 lines

So this series is correct and I will follow up with one for INTEL_PT;
however, this begs the question of how the patches are being tested.

My apologies for carelessness.

Quoted 7 lines

No problem.  In the future please check that "-cpu Icelake-Client" doesn't have warnings such as

qemu-system-x86_64: warning: host doesn't support requested feature:
CPUID.07H:EBX.intel-pt [bit 25]

when run on an Icelake-Client host.

Sure. I'm going to ask our validation team to add these in test criteria.

Quoted 9 lines
Quoted 4 lines

I've seen you patch for INTEL_PT. So am I going to resend these 2 patches and Cc qemu-stable? or simply reply these 2 patches adding qemu-stable in Cc list?

I can take care of that, thanks.

Paolo

author
#11 lore raw

PATCH 2/2 Revert "i386: Add CPUID bit for PCONFIG"

In reply to Robert Hoo

This reverts commit 5131dc433df54b37e8e918d8fba7fe10344e7a7b. For new instruction 'PCONFIG' will not be exposed to guest.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.c +1 -1
index b6113d0..08d4307 100644
@@ -1040,7 +1040,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
-            NULL, NULL, "pconfig", NULL,
+            NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, "spec-ctrl", "stibp",
             NULL, "arch-capabilities", NULL, "ssbd",
target/i386/cpu.h +0 -1
index ef41a03..66707d7 100644
@@ -692,7 +692,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
-#define CPUID_7_0_EDX_PCONFIG (1U << 18)       /* Platform Configuration */
 #define CPUID_7_0_EDX_SPEC_CTRL     (1U << 26) /* Speculation Control */
 #define CPUID_7_0_EDX_ARCH_CAPABILITIES (1U << 29)  /*Arch Capabilities*/
 #define CPUID_7_0_EDX_SPEC_CTRL_SSBD  (1U << 31) /* Speculative Store Bypass Disable */
Signature · 1 line
1.8.3.1