Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSR 0xe1 to 0x0 / `ret == cpu->kvm_msr_buf->nmsrs' failed. #1774

Closed
fre4ki opened this issue Jun 5, 2020 · 31 comments
Closed

MSR 0xe1 to 0x0 / `ret == cpu->kvm_msr_buf->nmsrs' failed. #1774

fre4ki opened this issue Jun 5, 2020 · 31 comments
Milestone

Comments

@fre4ki
Copy link

fre4ki commented Jun 5, 2020

Hey guys,

since i moved from bare-metal server to VM i get an error when i try to start a qemu-vm (IOU just fine).


**=> QEMU process has stopped, return code: -6
Start QEMU with /usr/local/bin/qemu-system-x86_64 -name vsr-1 -m 1024M -smp cpus=1 -enable-kvm -machine smm=off -boot order=c -drive file=....

Execution log:
qemu-system-x86_64: error: failed to set MSR 0xe1 to 0x0
qemu-system-x86_64: /root/qemu/target/i386/kvm.c:2659: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.**


gns3-error

  • my System is Ubuntu 20.04 LTS (Ryzen 9 - 3950X) running in a VM (ESXi 7.0)
  • I tried it with qemu 4.2.0 and 5.0.50

gns3-vm-settings

I read already many things about that (often in connection mit older qemu versions) but no solution so far.. :-(

Should i open a qemu bug report?

@cristian-ciobanu
Copy link

cristian-ciobanu commented Jun 5, 2020

A similar bug happened in the past with older Qemu versions 3.1 and AMD Ryzen CPUs and it seem the solution was to upgrade the kernel to a newer release.
Details can be found here: GNS3/gns3-vm#130

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Indeed, for the GNS3 VM (based on Ubuntu 18.04 LTS), we had to enable the LTS enablement stack (https://wiki.ubuntu.com/Kernel/LTSEnablementStack) which installs a newer version of the kernel:

sudo apt-get install -y --install-recommends linux-generic-hwe-18.04

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Since you have Ubuntu 20.04 LTS you may try to install the linux-generic-hwe-20.04 package (I haven't checked it exists) and see if the fixes the issue.

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

Mhmm... is the 5.4.0-33-generic Kernel not new enough?

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

5.4.0-33-generic Kernel not new enough?

That is what I find strange. I am just providing what we did for the GNS3 VM to fix this issue.

5.3.0-51-generic is the one that gets installed on Ubuntu 18.04 LTS after installing the LTS enablement stack package. So it looks like installing linux-generic-hwe-20.04 won't help :(

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

i installed it now and reboot the VM but there is nothing changed

gns3@gns3:~$ uname -r
5.4.0-33-generic

No difference in error..

Any other Ideas?

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Can you execute this simple command qemu-system-x86_64 -enable-kvm and post any error please?

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

Screenshot_1

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

Screenshot_2

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Looks like Qemu doesn't really play well with Ryzen CPUs... :/

Another suggestion would be to enable "Virtualize CPU performance counters" as suggested in minishift/minishift#3210 (comment)

I have seen it is not enabled in the screenshot you provided above.

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

i tried this already, no difference :-(

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Should i open a qemu bug report?

Sorry, I am out of ideas for now. I think he could be good to open a Qemu bug report.

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

Since Intel offers no CPU with so many cores and price/performance i choosed this.

Bare metal all worked well but i have no option for make snapshots and i have many OVA templates and want not convert every image to qcow2.

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

Since Intel offers no CPU with so many cores and price/performance i choosed this.

I don't blame you, this is a good choice, many people buy AMD CPUs and have no issues. There is just this one annoying problem...

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

If you have anys ideas please let me know. In the meantime i open a Qemu bug report.

@cristian-ciobanu
Copy link

You can try and disable MSR on the VM and then check if you can start the qemu machine

echo Y > /sys/module/kvm/parameters/ignore_msrs

@fre4ki
Copy link
Author

fre4ki commented Jun 5, 2020

Amazing, thank you cioby23. It seems that all is running now.

Are any disadvantage with this?

@grossmj grossmj added this to the 2.2.10 milestone Jun 5, 2020
@cristian-ciobanu
Copy link

cristian-ciobanu commented Jun 5, 2020

I cannot tell if this change will have any performance impact on the VMs running. So far when looking on different posts on the Internet I did not see anyone complaining about VM performance when the msrs parameter is set to be ignored.
This needs to be investigated on the Kernel/KVM documentation for more in depth understanding.

I just checked this setting on my PC which has and Intel Xeon CPU and this parameter /sys/module/kvm/parameters/ignore_msrs is also set to be ignored but I do not remember to manually set it somewhere so I guess it's the default.

@grossmj
Copy link
Member

grossmj commented Jun 5, 2020

My understanding is that MSRs are used for debugging, program execution tracing, computer performance monitoring, and toggling certain CPU features (ref. Wikipedia). This sounds okay to ignore them but better check the Kernel/KVM documentation or ask on Qemu forum or mailing list.

@grossmj
Copy link
Member

grossmj commented Jun 6, 2020

I am going to close this since there is nothing we can do on our side. @Cioby23 Thanks for the workaround, I am sure this is going to help some of our users running Qemu with Razen processors.

@fre4ki
Copy link
Author

fre4ki commented Jul 2, 2020

Hey guys,

i upgradet from Kernel "5.4.0-40-generic x86_64" to "5.7.7-050707-generic" and now it works without the "ignore_msrs" parameter.

The upgrade on a ubuntu system is really simple since there is a script available. Just enter these commands:


wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh

sudo install ubuntu-mainline-kernel.sh /usr/local/bin/

ubuntu-mainline-kernel.sh -i


Hope this helps someone..

@tallos673
Copy link

tallos673 commented Aug 16, 2020

You can try and disable MSR on the VM and then check if you can start the qemu machine

echo Y > /sys/module/kvm/parameters/ignore_msrs

It doesn't help for Proxmox and AMD Opterons 62xx series.
I use this options for GPU Passthrough to Windows VM a long time ago from here
https://www.reddit.com/r/homelab/comments/b5xpua/the_ultimate_beginners_guide_to_gpu_passthrough/

@fre4ki
Copy link
Author

fre4ki commented Aug 16, 2020

You can try and disable MSR on the VM and then check if you can start the qemu machine
echo Y > /sys/module/kvm/parameters/ignore_msrs

It doesn't help for Proxmox and AMD Opterons 62xx series.
I use this options for GPU Passthrough to Windows VM a long time ago from here
https://www.reddit.com/r/homelab/comments/b5xpua/the_ultimate_beginners_guide_to_gpu_passthrough/

Have you also tried to upgrade the kernel?

@tallos673
Copy link

tallos673 commented Aug 16, 2020

@fre4ki @grossmj will try tommorow

Screens from guest vm

photo_2020-08-16_22-48-22
photo_2020-08-16_22-50-07

@fre4ki
Copy link
Author

fre4ki commented Aug 16, 2020

@fre4ki @grossmj will try tommorow

Screens from guest vm

photo_2020-08-16_22-48-22
photo_2020-08-16_22-50-07

Please Note: for Ubuntu there is a kernel install script on github. This makes it really easy.

@tallos673
Copy link

Also @fre4ki @grossmj @cristian-ciobanu

root@eve-ng:/opt/unetlab/addons/qemu# ls
veos-4.15.0F  veos-4.20.1F  veos-4.21.1.1F  veos-4.24.1.1F

root@pve:~# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

root@pve:~# pveversion 
pve-manager/6.2-10/a20769ed (running kernel: 5.4.44-2-pve)
root@pve:~# cat /sys/module/kvm/parameters/ignore_msrs
Y

and here thread
https://www.reddit.com/r/Proxmox/comments/i5ekig/has_anyone_got_fully_working_eveng_with_lastest/

@tallos673
Copy link

@fre4ki
Copy link
Author

fre4ki commented Aug 16, 2020

What are the CPU settings of your GNS3 vm in proxmox?

Are you using "Host CPU", qemu64 or kvm64?

@fre4ki
Copy link
Author

fre4ki commented Aug 16, 2020

Don't know what settings you should use for eve. I tried it with GNS3 and Ubuntu 20.04 - build from scratch on a VMware Host.

@tallos673
Copy link

tallos673 commented Aug 16, 2020

@Gamerios
Copy link

Hello,

Ubuntut 20.04 and QEMU Virt-Manager - Nested virtualization suddenly doesnt work

Since Yesterday when i want start Windows 10 VM in Ubuntu 20.04 and QEMU 4.2.1 also tryed 5.2 and 6.2 and latest

i get this error:

Code:

qemu-system-x86_64: error: failed to set MSR 0x48f to 0xffffff00036dfb
qemu-system-x86_64: /home/user/qemu-4.2.1/target/i386/kvm.c:2691: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

i have kvm ignore_msrs=1 and so on tryed ON and OFF like before it worked in XML

Code:

Anyone can help it worked now for years but now not anymore since apt update and apt upgrade need downgrade Ubuntu Linux Kernel?

i need CPU Host-Passthrough otherwise Windows 10 has no good performance like in all Windows 10 Gaming VM GPU Passthrough Tutorials stand and also i tested

Hope any one can help here also GRUB

Code:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on kvm.ignore_msrs=1 video=efifb:off vfio-pci.ids=10de:2486,10de:228b,10de:2503,10de:228e isolcpus=3-13,17-27 nohz_full=3-13,17-27 rcu_nocbs=3-13,17-27 msr.allow_writes=on kvm.intel_nested=1"

A and
Ubuntu Linux Kernel
5.11.0-43-generic

and when start MacOS VM also with CPU Host-Passthrough it work witout an Error hmm

Thank ya
Kind Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants