RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 962396 - [RFE] provide support for PMU with -cpu other than -cpu host
Summary: [RFE] provide support for PMU with -cpu other than -cpu host
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-13 10:55 UTC by Sibiao Luo
Modified: 2015-09-18 13:09 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-11 12:34:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
biosencode (1.79 KB, text/plain)
2013-05-28 07:05 UTC, Xu Tian
no flags Details

Description Sibiao Luo 2013-05-13 10:55:13 UTC
Description of problem:
boot up a guest and then do system_reset var HMP monitor, the kernel console will output the '[Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 38d is b0)'. if i quit the qemu and reboot it again, it will not have this prompt. This issue only can be triggered by system_reset var HMP monitor. 
BTW, this issue can be hit both in Q35 and pc-i440fx-1.4 machine type, and i also tried the ahci, ide and virtio disk interface, all of them have this issue.

Version-Release number of selected component (if applicable):
host info:
kernel-3.9.0-0.55.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
seabios-bin-1.7.2-0.2.gita810e4e7.el7.noarch
guest info:
rhel tree: RHEL-7.0-20130403.0

How reproducible:
100%

Steps to Reproduce:
1.boot up a guest.
e.g:# /usr/libexec/qemu-kvm -M q35 -cpu SandyBridge -enable-kvm -m 2G -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo-test -uuid a5fd4bfe-ccbf-403d-9a26-41b1b3843729 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pcie.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/RHEL-7.0-20130403.0_x86_64.qcow3,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native -device ide-hd,unit=0,drive=drive-system-disk,id=system-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:0d:a1,bus=pcie.0,addr=0x5,bootindex=2 -device virtio-balloon-pci,id=ballooning,bus=pcie.0,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -vnc :1 -spice port=5931,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -serial unix:/tmp/ttyS0,server,nowait -boot menu=on -monitor stdio -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
2.do system_reset var HMP monitor.
(qemu) system_reset 
  
Actual results:
after step 2, the guest kernel console will output like:
# nc -U /tmp/ttyS0 
[    0.012015] [Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 38d is b0)
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Reached target Basic System.

Welcome to Linux!

         Expecting device dev-ttyS0.device...
[  OK  ] Listening on Syslog Socket.
[  OK  ] Reached target Syslog.
[  OK  ] Reached target Remote File Systems.
         Starting Load legacy module configuration...
...

Expected results:
there should not have '[    0.012015] [Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 38d is b0)'.

Additional info:

Comment 1 Luiz Capitulino 2013-05-21 17:16:57 UTC
This also happens if you reboot from the guest.

The warning has been introduced by upstream commit a5ebe0ba3dff658c5286e8d5f20e4328f719d5a3 in 3.9 kernel, and it makes the PMU code be able to detect broken PMU support in the BIOS.

I have the impression that we're not fully resetting vPMU state in kvm_pmu_reset() (which is called on vCPU reset), but I might be wrong.

Paolo is the new owner of vPMU support, re-assining to him.

PS: If I'm right about kvm_pmu_reset() being incomplete, this is a kernel bug rather a QEMU one.

Comment 2 Luiz Capitulino 2013-05-21 17:23:37 UTC
After a quick talk with Gerd I realized that vPMU state is not reset on guest reboot, that might the problem then.

Comment 3 Xu Tian 2013-05-28 07:05:25 UTC
Created attachment 753760 [details]
biosencode

also meet this issue on rhel7 host with kernel kernel-3.9.0-0.55.el7.x86_64

please download coredump from nfs://10.66.90.128:/vol/S2/kvmauto/fileshare-kvm/xu/vmcore-bz962396

thanks,
Xu

Comment 4 Xiaoqing Wei 2013-06-03 08:38:21 UTC
This looks like SandyBridge specific issue, and qemu-kvm emulation issue
I tried boot guest w/ -cpu host / Westmere, didn't have any problem,
only Sandybrdige met.

-cpu host   recognized as SandyBridge and work fine
[    0.019862] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.019865] smpboot: CPU0: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (fam: 06, model: 2d, stepping: 07)
[    0.019882] TSC deadline timer enabled
[    0.019891] Performance Events: 16-deep LBR, SandyBridge events, Intel PMU driver.
[    0.020023] perf_event_intel: PEBS disabled due to CPU errata, please upgrade microcode
[    0.020027] ... version:                2
[    0.020029] ... bit width:              48
[    0.020030] ... generic registers:      4
[    0.020031] ... value mask:             0000ffffffffffff
[    0.020033] ... max period:             000000007fffffff
[    0.020034] ... fixed-purpose events:   3
[    0.020035] ... event mask:             000000070000000f
[    0.022292] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.


-cpu Westmere
[    0.019629] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.019632] smpboot: CPU0: Intel Westmere E56xx/L56xx/X56xx (Nehalem-C) (fam: 06, model: 2c, stepping: 01)
[    0.020000] Performance Events: 16-deep LBR, Westmere events, Intel PMU driver.
[    0.020028] ... version:                2
[    0.020030] ... bit width:              48
[    0.020032] ... generic registers:      4
[    0.020033] ... value mask:             0000ffffffffffff
[    0.020034] ... max period:             000000007fffffff
[    0.020036] ... fixed-purpose events:   3
[    0.020037] ... event mask:             000000070000000f
[    0.024294] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.


-cpu SandyBridge, recognized as SandyBridge, but looked buggy
[    0.020928] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.020930] smpboot: CPU0: Intel Xeon E312xx (Sandy Bridge) (fam: 06, model: 2a, stepping: 01)
[    0.020952] TSC deadline timer enabled
[    0.020962] Performance Events: 16-deep LBR, SandyBridge events, Broken BIOS detected, complain to your hardware vendor.
[    0.021024] [Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 38d is b0)
[    0.022006] Intel PMU driver.
[    0.022008] perf_event_intel: PEBS disabled due to CPU errata, please upgrade microcode
[    0.022013] ... version:                2
[    0.022014] ... bit width:              48
[    0.022015] ... generic registers:      4
[    0.022016] ... value mask:             0000ffffffffffff
[    0.022017] ... max period:             000000007fffffff
[    0.022018] ... fixed-purpose events:   3
[    0.022019] ... event mask:             000000070000000f
[    0.024103] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.











host cpu:
processor	: 23
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping	: 7
microcode	: 0x70d
cpu MHz		: 1180.000
cache size	: 15360 KB
physical id	: 1
siblings	: 12
core id		: 5
cpu cores	: 6
apicid		: 43
initial apicid	: 43
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 4004.57
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:



and also tried
-cpu Haswell on this SandyBridge host, not rasing firmware issue,
so this could be a qemu-kvm emulation issue.

[    0.020285] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.020288] smpboot: CPU0: Intel Core Processor (Haswell) (fam: 06, model: 3c, stepping: 01)
[    0.020304] TSC deadline timer enabled
[    0.020314] Performance Events: generic architected perfmon, Intel PMU driver.
[    0.021022] ... version:                2
[    0.021024] ... bit width:              48
[    0.021025] ... generic registers:      4
[    0.021026] ... value mask:             0000ffffffffffff
[    0.021027] ... max period:             000000007fffffff
[    0.021029] ... fixed-purpose events:   3
[    0.021030] ... event mask:             000000070000000f
[    0.022298] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.



Regards,
Xiaoqing.

Comment 5 Paolo Bonzini 2013-06-03 20:09:23 UTC
This is a special case of supporting the vPMU with -cpu options other than "-cpu host".  It is not supported yet.

Comment 6 Gleb Natapov 2013-09-09 06:51:12 UTC
(In reply to Paolo Bonzini from comment #5)
> This is a special case of supporting the vPMU with -cpu options other than
> "-cpu host".  It is not supported yet.

This looks like an issue cause by QEMU not resetting PMU MSRs and should exists with -cpu host also. Isn't it fixed by 0d89436786b02a9e7d561c4d7dc4982e4a2739db?


Note You need to log in before you can comment on or make changes to this bug.