Skip to contentSkip to conversation

cpu model bug fixes and definition corrections: Add kvm emulated x2apic flag to config defined cpu models

PATCH In review john cooper 8 participants 18 messages May 23, 2011 – May 31, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 cpu model bug fixes and definition corrections: Add kvm emulated x2apic flag to config defined cpu models

Add kvm emulated x2apic flag to config defined cpu models and general support for such hypervisor emulated flags.

In addition to checking user request flags against the host we also selectively check against kvm for emulated flags.

---

hw/pc.c +1 -1
index 8106197..5b94e53 100644
@@ -927,7 +927,7 @@ static CPUState *pc_new_cpu(const char *cpu_model)
 
     env = cpu_init(cpu_model);
     if (!env) {
-        fprintf(stderr, "Unable to find x86 CPU definition\n");
+        fprintf(stderr, "Unable to support requested x86 CPU definition\n");
         exit(1);
     }
     if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
sysconfigs/target/target-x86_64.conf +6 -6
index 0613870..3b85b2e 100644
@@ -8,7 +8,7 @@
    model = "15"
    stepping = "3"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3 ssse3"
+   feature_ecx = "sse3 ssse3 x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx"
    extfeature_ecx = "lahf_lm"
    xlevel = "0x8000000A"
@@ -22,7 +22,7 @@
    model = "23"
    stepping = "3"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3 cx16 ssse3 sse4.1"
+   feature_ecx = "sse3 cx16 ssse3 sse4.1 x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx"
    extfeature_ecx = "lahf_lm"
    xlevel = "0x8000000A"
@@ -36,7 +36,7 @@
    model = "26"
    stepping = "3"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3 cx16 ssse3 sse4.1 sse4.2 popcnt"
+   feature_ecx = "sse3 cx16 ssse3 sse4.1 sse4.2 popcnt x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx"
    extfeature_ecx = "lahf_lm"
    xlevel = "0x8000000A"
@@ -50,7 +50,7 @@
    model = "6"
    stepping = "1"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3"
+   feature_ecx = "sse3 x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx"
 #   extfeature_ecx = ""
    xlevel = "0x80000008"
@@ -64,7 +64,7 @@
    model = "6"
    stepping = "1"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3 cx16"
+   feature_ecx = "sse3 cx16 x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx rdtscp"
    extfeature_ecx = "svm lahf_lm"
    xlevel = "0x80000008"
@@ -78,7 +78,7 @@
    model = "6"
    stepping = "1"
    feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu    mtrr clflush mca pse36"
-   feature_ecx = "sse3 cx16 monitor popcnt"
+   feature_ecx = "sse3 cx16 monitor popcnt x2apic"
    extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu    lm syscall nx rdtscp"
    extfeature_ecx = "svm sse4a  abm misalignsse lahf_lm"
    xlevel = "0x80000008"
target-i386/cpuid.c +44 -17

97 lines not on this page · raw message

Signature · 1 line
[email protected]
#1 lore raw
Quoted 5 lines · john cooper

Add kvm emulated x2apic flag to config defined cpu models and general support for such hypervisor emulated flags.

In addition to checking user request flags against the host we also selectively check against kvm for emulated flags.

As you are already digging through this jungle, could you also check how much of this diff from qemu-kvm is obsolete now?

target-i386/cpuid.c +0 -0
index e479a4d..091d812 100644
@@ -1175,6 +1175,31 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t

index, uint32_t count,

                 *ecx |= 1 << 1;    /* CmpLegacy bit */
             }
         }

+ if (kvm_enabled()) {
+ uint32_t h_eax, h_edx;
+
+ host_cpuid(index, 0, &h_eax, NULL, NULL, &h_edx);
+
+ /* disable CPU features that the host does not support */
+
+ /* long mode */
+ if ((h_edx & 0x20000000) == 0 /* || !lm_capable_kernel */)
+ *edx &= ~0x20000000;
+ /* syscall */
+ if ((h_edx & 0x00000800) == 0)
+ *edx &= ~0x00000800;
+ /* nx */
+ if ((h_edx & 0x00100000) == 0)
+ *edx &= ~0x00100000;
+
+ /* disable CPU features that KVM cannot support */
+
+ /* svm */
+ if (!kvm_nested)
+ *ecx &= ~CPUID_EXT3_SVM;
+ /* 3dnow */
+ *edx &= ~0xc0000000;
+ }

         break;
     case 0x80000002:
     case 0x80000003:

If something is still missing in upstream, it should be ported - except for kvm_nested which should be controllable via '-cpu ...,+/-svm'. TIA!

Jörg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Jan

#2 lore raw
Quoted 2 lines · Jan Kiszka

Jörg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

Joerg

Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
#3 lore raw

drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)

Quoted 8 lines · Joerg
Quoted 2 lines · Jan Kiszka

Jörg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

Does any user land depend on it? I guess we have to flag it deprecated first, trigger some console output when it's specified, and then remove it one or more releases later (the same applies to many other qemu-kvm-specific switches).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#4 lore raw

Re: drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 9 lines · Joerg
Quoted 8 lines · Jan Kiszka
Quoted 3 lines

Jצrg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Signature · 4 lines
Nadav Har'El                        |       Monday, May 30 2011, 26 Iyyar 5771
[email protected]             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Software is like sex, it is better when
http://nadav.harel.org.il           |it's free -- Linus Torvalds
#5 lore raw

Re: drop -enable-nesting

Quoted 7 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 6 lines · Joerg
Quoted 5 lines · Jan Kiszka
Quoted 3 lines

Jצrg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#6 lore raw

Re: drop -enable-nesting

Quoted 16 lines · Jan Kiszka
Quoted 7 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 6 lines · Joerg
Quoted 5 lines · Jan Kiszka
Quoted 3 lines

J�rg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Quoted 5 lines

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

qemu-kvm still needs -enable-nesting, otherwise it is disabled. Upstream qemu should enable it unconditionally (can be disabled with -cpu ,-svm).

Joerg

Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
#7 lore raw

Re: drop -enable-nesting

Quoted 17 lines · Joerg
Quoted 16 lines · Jan Kiszka
Quoted 14 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 9 lines · Joerg
Quoted 8 lines · Jan Kiszka
Quoted 3 lines

J�rg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Quoted 8 lines
Quoted 5 lines

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

qemu-kvm still needs -enable-nesting, otherwise it is disabled. Upstream qemu should enable it unconditionally (can be disabled with -cpu ,-svm).

Then let's start with aligning qemu-kvm defaults to upstream? I guess that's what the diff I was citing yesterday is responsible for.

In the same run, -enable-nesting could dump a warning on the console that this switch is obsolete and will be removed from future versions.

For VMX, I would suggest to keep it off by default until it matured, asking the user to issue -cpu ...,+vmx.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#8 lore raw

Re: drop -enable-nesting

Quoted 24 lines · Jan Kiszka
Quoted 23 lines · Joerg
Quoted 21 lines · Jan Kiszka
Quoted 7 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 6 lines · Joerg
Quoted 5 lines · Jan Kiszka
Quoted 3 lines

J�rg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

Quoted 8 lines
Quoted 2 lines

qemu-kvm still needs -enable-nesting, otherwise it is disabled. Upstream qemu should enable it unconditionally (can be disabled with -cpu ,-svm).

Then let's start with aligning qemu-kvm defaults to upstream? I guess that's what the diff I was citing yesterday is responsible for.

In the same run, -enable-nesting could dump a warning on the console that this switch is obsolete and will be removed from future versions.

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

Quoted 2 lines

For VMX, I would suggest to keep it off by default until it matured, asking the user to issue -cpu ...,+vmx.

We should do that for svm as well (except for -cpu host or -cpu something-with-svm). vmx will be kept disabled by the module option, until it is deemed fit for general consumption.

Signature · 1 line
error compiling committee.c: too many arguments to function
#9 lore raw

Re: drop -enable-nesting

Quoted 28 lines · Avi Kivity
Quoted 27 lines · Jan Kiszka
Quoted 25 lines · Joerg
Quoted 16 lines · Jan Kiszka
Quoted 7 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 6 lines · Joerg
Quoted 5 lines · Jan Kiszka
Quoted 3 lines

J�rg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Quoted 5 lines

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

qemu-kvm still needs -enable-nesting, otherwise it is disabled. Upstream qemu should enable it unconditionally (can be disabled with -cpu ,-svm).

Quoted 8 lines
Quoted 5 lines

Then let's start with aligning qemu-kvm defaults to upstream? I guess that's what the diff I was citing yesterday is responsible for.

In the same run, -enable-nesting could dump a warning on the console that this switch is obsolete and will be removed from future versions.

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

I'm currently checking with some customer who played with Proxmox and nesting if that stack was aware of the switch or accepted it only via a side channel.

Quoted 6 lines
Quoted 3 lines

For VMX, I would suggest to keep it off by default until it matured, asking the user to issue -cpu ...,+vmx.

We should do that for svm as well (except for -cpu host or -cpu something-with-svm).

I assume that's what upstream is doing. Maybe it has it was part of the artificial default qemu64 model which is AMD based.

Quoted 3 lines

vmx will be kept disabled by the module option,
until it is deemed fit for general consumption.

Yes, even better - no need for duplicate controls.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#10 lore raw

Re: drop -enable-nesting

Quoted 7 lines · Jan Kiszka
Quoted 2 lines · Avi Kivity

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

I'm currently checking with some customer who played with Proxmox and nesting if that stack was aware of the switch or accepted it only via a side channel.

It was a side channel for tweaking the command line options.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#11 lore raw

Re: drop -enable-nesting

In reply to Avi Kivity
Quoted 28 lines · Avi Kivity
Quoted 27 lines · Jan Kiszka
Quoted 25 lines · Joerg
Quoted 16 lines · Jan Kiszka
Quoted 7 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "drop -enable-nesting (was: [PATCH 3/7] cpu model bug fixes and definition corrections...)":

Quoted 6 lines · Joerg
Quoted 5 lines · Jan Kiszka
Quoted 3 lines

J�rg, how to deal with -enable-nesting in qemu-kvm to align behavior with upstream?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

My personal preference is to just remove it. In upstream-qemu it is enabled/disabled by +/-svm. -enable-nesting is just a historic thing which can be wiped out.

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Quoted 5 lines

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

BTW, what are the defaults for SVM right now in qemu-kvm and upstream? Enable if the modeled CPU supports it?

qemu-kvm still needs -enable-nesting, otherwise it is disabled. Upstream qemu should enable it unconditionally (can be disabled with -cpu ,-svm).

Quoted 8 lines
Quoted 5 lines

Then let's start with aligning qemu-kvm defaults to upstream? I guess that's what the diff I was citing yesterday is responsible for.

In the same run, -enable-nesting could dump a warning on the console that this switch is obsolete and will be removed from future versions.

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

Yes, but it should be safe to drop it. Currently, if the user specifies a CPU with the 'svm' flag present in libvirt guest XML, then we will pass args '-cpu ....+svm -enable-nesting'. So if we drop --enable-nesting, then libvirt will simply omit it and everything should still work because we have still got +svm set.

Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#12 lore raw

Re: drop -enable-nesting

Quoted 8 lines · Daniel P. Berrange
Quoted 2 lines

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

Yes, but it should be safe to drop it. Currently, if the user specifies a CPU with the 'svm' flag present in libvirt guest XML, then we will pass args '-cpu ....+svm -enable-nesting'. So if we drop --enable-nesting, then libvirt will simply omit it and everything should still work because we have still got +svm set.

But qemu will complain about an option it can't parse.

Signature · 1 line
error compiling committee.c: too many arguments to function
#13 lore raw

Re: drop -enable-nesting

Quoted 11 lines · Avi Kivity
Quoted 8 lines · Daniel P. Berrange
Quoted 2 lines

I think it's safe to drop -enable-nesting immediately. Dan, does libvirt make use of it?

Yes, but it should be safe to drop it. Currently, if the user specifies a CPU with the 'svm' flag present in libvirt guest XML, then we will pass args '-cpu ....+svm -enable-nesting'. So if we drop --enable-nesting, then libvirt will simply omit it and everything should still work because we have still got +svm set.

But qemu will complain about an option it can't parse.

The best choice is probably to keep the option and make it a nop for the lifetime of qemu-kvm. Optionally qemu-kvm can print a warning about the deprecated option.

Joerg

Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
maintainer
#14 lore raw

Re: drop -enable-nesting

In reply to Avi Kivity
Quoted 2 lines · Avi Kivity

But qemu will complain about an option it can't parse.

The presence of -enable-nesting is inferred from the help text.

Paolo

#15 lore raw

Re: drop -enable-nesting

Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Avi Kivity

But qemu will complain about an option it can't parse.

The presence of -enable-nesting is inferred from the help text.

Okay, so it can be safely dropped.

Signature · 1 line
error compiling committee.c: too many arguments to function
#16 lore raw

Re: drop -enable-nesting

In reply to Jan Kiszka

On Mon, May 30, 2011, Jan Kiszka wrote about "Re: drop -enable-nesting":

Quoted 6 lines
Quoted 3 lines

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

As far as I understand (and this was previously discussed on the QEMU mailing list), the default emulated CPU does not include the "vmx" capability, and you need to enable it with something like "-cpu qemu64,+vmx" (or "-cpu host").

I am not sure if it does enable the "svm" capability. If it does, it isn't useful when KVM is enabled and the underlying host has VMX, not SVM.

Nadav.

Signature · 4 lines
Nadav Har'El                        |       Monday, May 30 2011, 27 Iyyar 5771
[email protected]             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Why do we drive on a parkway and park on
http://nadav.harel.org.il           |a driveway?
#17 lore raw

Re: drop -enable-nesting

Quoted 11 lines · Nadav Har'El

On Mon, May 30, 2011, Jan Kiszka wrote about "Re: drop -enable-nesting":

Quoted 6 lines
Quoted 3 lines

"-enable-nesting" could remain as a synonym for enabling either VMX or SVM in the guest, depending on what was available in the host (because KVM now supports both nested SVM and nested VMX, but not SVM-on-VMX or vice versa).

Why? Once nesting is stable (I think SVM already is), there is no reason for an explicit enable. And you can always mask it out via -cpu.

As far as I understand (and this was previously discussed on the QEMU mailing list), the default emulated CPU does not include the "vmx" capability, and you need to enable it with something like "-cpu qemu64,+vmx" (or "-cpu host").

qemu64 is an artificial AMD model. Adding VMX to it may have interesting effects on the guests. Better use host or a recent Intel model.

Quoted 3 lines

I am not sure if it does enable the "svm" capability. If it does, it isn't useful when KVM is enabled and the underlying host has VMX, not SVM.

That's what KVM is supposed to filter based on the host's capabilities. I bet it does already.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux