KVM fix for QEMU 4.2-rc
[PULL 1/1] target/i386: disable VMX features if nested=0
In reply to Paolo BonziniFrom: Yang Zhong <[email protected]>
If kvm does not support VMX feature by nested=0, the kvm_vmx_basic can't get the right value from MSR_IA32_VMX_BASIC register, which make qemu coredump when qemu do KVM_SET_MSRS.
The coredump info:
error: failed to set MSR 0x480 to 0x0kvm_put_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Message-Id: <[email protected]>
--- target/i386/kvm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
target/i386/kvm.c +8 -0
@@ -2572,6 +2572,14 @@ static void kvm_msr_entry_add_vmx(X86CPU *cpu, FeatureWordArray f)uint64_t kvm_vmx_basic =kvm_arch_get_supported_msr_feature (kvm_state,MSR_IA32_VMX_BASIC ); + +if (!kvm_vmx_basic) { +/* If the kernel doesn't support VMX feature (kvm_intel.nested=0), +* then kvm_vmx_basic will be 0 and KVM_SET_MSR will fail. +*/ +return ; + } +uint64_t kvm_vmx_misc =kvm_arch_get_supported_msr_feature (kvm_state,MSR_IA32_VMX_MISC );
Signature · 1 line
2.21.0
The following changes since commit 1bdc319ab5d289ce6b822e06fb2b13666fd9278e:
Update version for v4.2.0-rc4 release (2019-12-03 17:56:30 +0000)
are available in the Git repository at:
git://github.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to 2605188240f939fa9ae9353f53a0985620b34769:
target/i386: disable VMX features if nested=0 (2019-12-06 12:35:40 +0100)
----------------------------------------------------------------
* fix for x86 KVM on older kernels (Yang Zhong)
----------------------------------------------------------------
Yang Zhong (1):
target/i386: disable VMX features if nested=0
target/i386/kvm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Signature · 1 line
2.21.0
Quoted 7 lines · Paolo Bonzini
The following changes since commit
1bdc319ab5d289ce6b822e06fb2b13666fd9278e:Update version for v4.2.0-rc4 release (2019-12-03 17:56:30 +0000)
are available in the Git repository at:
Quoted 8 lines
git://github.com/bonzini/qemu.gittags/for-upstreamfor you to fetch changes up to
2605188240f939fa9ae9353f53a0985620b34769:target/i386: disable VMX features if nested=0 (2019-12-06 12:35:40 +0100)
----------------------------------------------------------------
* fix for x86 KVM on older kernels (Yang Zhong)
I know you talked to me on irc about this, but pull request cover letters at this stage in the release process really need detailed discussion of what is being fixed, the severity of the bug and why it needs to go into this release rather than waiting for 5.0...
Quoted 9 lines
----------------------------------------------------------------
Yang Zhong (1):
target/i386: disable VMX features if nested=0target/i386/kvm.c | 8 ++++++++ 1 file changed, 8 insertions(+)--
2.21.0
thanks
-- PMM
Peter Maydell
AppliedQuoted 11 lines · Paolo Bonzini
The following changes since commit
1bdc319ab5d289ce6b822e06fb2b13666fd9278e:Update version for v4.2.0-rc4 release (2019-12-03 17:56:30 +0000)
are available in the Git repository at:
git://github.com/bonzini/qemu.gittags/for-upstreamfor you to fetch changes up to
2605188240f939fa9ae9353f53a0985620b34769:
Quoted 8 lines
target/i386: disable VMX features if nested=0 (2019-12-06 12:35:40 +0100)
----------------------------------------------------------------
* fix for x86 KVM on older kernels (Yang Zhong)----------------------------------------------------------------
Yang Zhong (1):
target/i386: disable VMX features if nested=0
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.
-- PMM