[Bug 219085] kvm_spurious_fault in L1 when running a nested kvm instance on AMD Opteron_G5_qemu L0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=219085

--- Comment #3 from ununpta@xxxxxxxxxxx ---
> Do you you see the same behavior on other kernel (L1) version?  Have you
> changed any other components (especially in L0)?

Thank you for your help.

What I tried:
* Opened Hyper-V manager built in Windows and created Ubuntu 22.04 LTS
available by default.
* Opened PowerShell console and ran `Set-VMProcessor -VMName "Ubuntu 22.04 LTS"
-ExposeVirtualizationExtensions $true` to allow Nested Virtualization in
Hyper-V.

I have to notice, though, that even without `ExposeVirtualizationExtensions
$true`, KVM inside Hyper-V manager didn't crash as it did in qemu. Bash just
printed a warning that nested virtualization is restricted.

* Booted into "Ubuntu 22.04 LTS", installed qemu and `qemu-system-x86_64 -accel
kvm` was successfull - BIOS was shown up.
Default kernel was vmlinuz-5.15.0-27-generic - After qemu launch, only
kvm-related messages were:
[2.485820] kvm: Nested Virtualization enabled
[2.485822] SVM: kvm: Nested Paging enabled
[2.485823] SVM: kvm: Hyper-V enlightened NPT TLB flush enabled
[2.485824] SVM: kvm: Hyper-V Direct TLB flush enabled
[2.485828] SVM: Virtual VMLOAD VMSAVE supported

Then I recompiled latest kernel and installed it with the same successful
KVM-accelerated qemu BIOS boot.
vmlinuz-6.10.0 - After qemu launch, only kvm-related messages are:

[1.701988] kvm_amd: TSC scaling supported
[1.701992] kvm_amd: Nested Virtualization enabled
[1.701993] kvm_amd: Nested Paging enabled
[1.701996] kvm_amd: kvm_amd: Hyper-V enlightened NPT TLB flush enabled
[1.701997] kvm_amd: kvm_amd: Hyper-V Direct TLB flush enabled
[1.701999] kvm_amd: Virtual VMLOAD VMSAVE supported
[1.702000] kvm_amd: PMU virtualization is disabled

I have to guess how to allow `Set-VMProcessor -VMName "Ubuntu 22.04 LTS"
-ExposeVirtualizationExtensions $true` for third-party software, not only for
machines created by Hyper-V manager. Maybe Qemu has to be run under admin
priveleges as well.

I also saw a claim from Peter Maydell, qemu developer, who had said this about
qemu command line parameter `-cpu _processor_type_`:
> using a specific cpu type will only work with KVM if the host CPU really is
> that exact CPU type, otherwise, use "-cpu host" or "-cpu max".
> This is a restriction in the kernel's KVM handling, and not something that
> can be worked around in the QEMU side.
Per https://gitlab.com/qemu-project/qemu/-/issues/239

I was somewhat confused by this claim because 
> --- Comment #1 from ununpta@xxxxxxxxxxx ---
> Command I used on L0 AMD Ryzen:
> qemu-system-x86_64.exe -m 4096 -machine q35 -accel whpx -smp 1 -cpu
> Opteron_G5

Let me ask you a few questions.
Q1: Can one use an older cpu (but still supporting SVM), not the actual bare
one in qemu command line for nested virtualization or KVM will crash due to
restriction in the kernel's KVM handling?
Q2: Is there a command in bare Kernel/KVM console to figure out if EFER.SVME
register/bit is writeable? If not,
Q3: Can you recommend any package to figure out it?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux