Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with qemu after system upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Tue Sep 08, 2020 8:53 pm    Post subject: Problem with qemu after system upgrade Reply with quote

Hi,

After system upgrade virt-manager/qemu stopped working. Neither existing VMs can be started nor new created:

Code:
Nie można ukończyć instalacji: „internal error: qemu unexpectedly closed the monitor: 2020-09-08T20:51:07.282295Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-register [bit 8]
2020-09-08T20:51:07.282346Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-vid [bit 9]
2020-09-08T20:51:07.282362Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48DH).vmx-posted-intr [bit 7]
2020-09-08T20:51:07.282366Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-09-08T20:51:07.282371Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-09-08T20:51:07.282880Z qemu-system-x86_64: error: failed to set MSR 0x48e to 0xfff9fffe04006172
qemu-system-x86_64: /var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/target/i386/kvm.c:2695: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.”

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2089, in _do_async_install
    guest.installer_instance.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 544, in start_install
    doboot, transient)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 491, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3.7/site-packages/libvirt.py", line 4035, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2020-09-08T20:51:07.282295Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-register [bit 8]
2020-09-08T20:51:07.282346Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-vid [bit 9]
2020-09-08T20:51:07.282362Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48DH).vmx-posted-intr [bit 7]
2020-09-08T20:51:07.282366Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-09-08T20:51:07.282371Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-09-08T20:51:07.282880Z qemu-system-x86_64: error: failed to set MSR 0x48e to 0xfff9fffe04006172
qemu-system-x86_64: /var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/target/i386/kvm.c:2695: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.


How can it be fixed?
Back to top
View user's profile Send private message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Thu Sep 10, 2020 5:52 am    Post subject: Reply with quote

I have found workaround. The default cpu setting is copy host configuration. And for my cpu it results with thise qemu parameters:

Code:
IvyBridge,ss=on,vmx=on,pcid=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,arch-capabilities=on,xsaveopt=on,skip-l1dfl-vmentry=on


I have disabled it and manually put IvyBridge and now it looks like this:

Code:
-cpu IvyBridge


And now it works. But why magically copy host cpu configuration stopped working?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21192

PostPosted: Thu Sep 10, 2020 4:14 pm    Post subject: Reply with quote

It is probably the case that a bare -cpu IvyBridge omits at least one of those other feature flags, that the older version of the packages did not enable those flags even with -cpu host, that the new version does (as you showed), and that there is a bug in the implementation of one of those parameters. It's also possible that the old version enabled all those flags too, but that the assertion failure is a recent regression, and it went unnoticed because it only applies when one of those feature flags is enabled.
Back to top
View user's profile Send private message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Thu Sep 10, 2020 4:43 pm    Post subject: Reply with quote

But then why issue also occurs for new VM installations? I need to manually change CPU type.I guess this is about vmx=on. But I have this flag on /proc/cpuinfo. I cannot figure out what has changed.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6074
Location: Dallas area

PostPosted: Thu Sep 10, 2020 4:55 pm    Post subject: Reply with quote

From an arch bug report

Quote:
Hi,
I'm seeing the same warnings about vmx-exit-load-perf-global-ctrl & vmx-entry-load-perf-global-ctrl but I doubt they are related to your migration issue.
They are just emitted when qemu starts on the target but way before migration starts and you said you got to 57%.

I've seen many those warnings when qemu/libvirt is newer than the kernel, since qemu tries to set sub-features but the kernel doesn't allow that yet.

To avoid people trail a red herring and actually look into your migration issue I'd recommend disabling vmx for the guest which will make the warning disappear.

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21192

PostPosted: Thu Sep 10, 2020 5:12 pm    Post subject: Reply with quote

pablocool wrote:
But then why issue also occurs for new VM installations? I need to manually change CPU type.I guess this is about vmx=on. But I have this flag on /proc/cpuinfo. I cannot figure out what has changed.
In your first post, you said you upgraded system components, presumably including qemu itself. Are you trying to create those new VM installations using an old version of the system, from before the upgrade?
Back to top
View user's profile Send private message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Tue Sep 15, 2020 11:07 am    Post subject: Reply with quote

Hi

@Ho I am not sure what do you mean by " Are you trying to create those new VM installations using an old version of the system, from before the upgrade?". I upgraded system and first thing I noticed was that my previous VM installations that were working before upgrade, do not work any more. Second thing I noticed I cannot create new VM installation with default settings. I need to tweak settings to manually set cpu type. This fixes both old VM installations and new ones. Following what @Anon-E-moose wrote I will try to upgrade kernel to check if this fixes vmx issue.
Back to top
View user's profile Send private message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Tue Sep 15, 2020 11:43 am    Post subject: Reply with quote

@Anon-E-moose upgrading kernel from 5.1.0 to latest solved issue. Thank you!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21192

PostPosted: Tue Sep 15, 2020 4:47 pm    Post subject: Reply with quote

You asked why new VMs were also broken. My question was to confirm that the newly created non-working VMs were running under the same new qemu that was also failing to run old VMs. If so, then it seems reasonable that the issue was with new qemu generally (and based on your later success, new qemu with old kernel), and is not specific to the old VMs being incompatible with the upgraded qemu.
Back to top
View user's profile Send private message
pablocool
n00b
n00b


Joined: 27 Jul 2017
Posts: 58

PostPosted: Wed Sep 16, 2020 9:31 am    Post subject: Reply with quote

Quote:
My question was to confirm that the newly created non-working VMs were running under the same new qemu that was also failing to run old VMs

Yes, same qemu.

Quote:
the issue was with new qemu generally

Yes.

Thanks all for the input.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum