Skip to contentSkip to conversation

resent: fix CPUID vendor override

PATCH In review Andre Przywara 2 participants 2 messages May 21, 2010 – May 24, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 resent: fix CPUID vendor override

the meaning of vendor_override is actually the opposite of how it is currently used :-(
Fix it to allow KVM to export the non-native CPUID vendor if explicitly requested by the user.
The semantic is now as intended:
- With TCG, the guest always sees the configured vendor.
- With KVM, the default is to propagate the host's vendor
- when explicitly requested via -cpu <base>,vendor=xxx obey this and use the specified vendor

---
 target-i386/cpuid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Hi,

this hasn't been picked up the last time I sent it out, are there any objections?

Regards,
Andre.

target-i386/cpuid.c +1 -1
index 56938e2..99d1f44 100644
@@ -962,7 +962,7 @@ static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx,
      * this if you want to use KVM's sysenter/syscall emulation
      * in compatibility mode and when doing cross vendor migration
      */
-    if (kvm_enabled() && env->cpuid_vendor_override) {
+    if (kvm_enabled() && ! env->cpuid_vendor_override) {
         host_cpuid(0, 0, NULL, ebx, ecx, edx);
     }
 }
Signature · 1 line
1.6.4
#1 lore raw
Quoted 10 lines · Andre Przywara

the meaning of vendor_override is actually the opposite of how it is currently used :-(
Fix it to allow KVM to export the non-native CPUID vendor if explicitly requested by the user.
The semantic is now as intended:
- With TCG, the guest always sees the configured vendor.
- With KVM, the default is to propagate the host's vendor
- when explicitly requested via -cpu<base>,vendor=xxx obey this and use the specified vendor

Quoted 2 lines

This should go through uq/master. But I'm not sure that the new behavior is really what's desired. It's certainly going to break compatibility since -M pc-0.12 is going to show a different vendor_id by default.

Regards,

Anthony Liguori

Quoted 26 lines
---
  target-i386/cpuid.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

Hi,

this hasn't been picked up the last time I sent it out, are there any objections?

Regards,
Andre.

target-i386/cpuid.c +1 -1
index 56938e2..99d1f44 100644
@@ -962,7 +962,7 @@ static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx,
       * this if you want to use KVM's sysenter/syscall emulation
       * in compatibility mode and when doing cross vendor migration
       */
-    if (kvm_enabled()&&  env->cpuid_vendor_override) {
+    if (kvm_enabled()&&  ! env->cpuid_vendor_override) {
          host_cpuid(0, 0, NULL, ebx, ecx, edx);
      }
  }