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 956468 - cpu 'host-model' should support features in force or disable mode
Summary: cpu 'host-model' should support features in force or disable mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 799354 870484
Blocks: 865505 1059007
TreeView+ depends on / blocked
 
Reported: 2013-04-25 03:29 UTC by Wayne Sun
Modified: 2014-06-18 00:49 UTC (History)
12 users (show)

Fixed In Version: libvirt-1.1.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 870484
: 1059007 (view as bug list)
Environment:
Last Closed: 2014-06-13 10:57:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wayne Sun 2013-04-25 03:29:24 UTC
This also exist on
libvirt-1.0.4-1.el7.x86_64

+++ This bug was initially created as a clone of Bug #870484 +++

+++ This bug was initially created as a clone of Bug #799354 +++

Would be handy to have <cpu mode='host-model'> support <feature policy='force'/> or policy=disable. That way tools have an option to turn on x2apic for kvm guests which provides a performance boost with no downsides, but doesn't require host CPU support.

--- Additional comment from rjones on 2012-10-25 14:05:16 EDT ---

Also <feature policy='disable'/>.  For one use case, see:
https://bugzilla.redhat.com/show_bug.cgi?id=870071#c2

--- Additional comment from Jiri Denemark on 2012-10-29 09:13:31 EDT ---

I'm the owner of upstream brother of this bug.

--- Additional comment from Andrew Cathrow on 2012-12-31 17:11:37 EST ---

Depending on the implementation of this we may want to close 891015 which covers host passthrough mode.

Comment 2 Peter Krempa 2013-07-16 09:13:24 UTC
Fixed upstream with:

commit 3c8be55c04eb2647fd5c9d51efae78f7afdcec85
Author: Peter Krempa <pkrempa>
Date:   Mon Jul 15 17:38:55 2013 +0200

    cpu: Allow fine tuning of "host-model" cpu
    
    https://bugzilla.redhat.com/show_bug.cgi?id=799354
    
    Until now, the "host-model" cpu mode couldn't be influenced. This patch
    allows to use the <feature> elements to either enable or disable
    specific CPU flags. This can be used to force flags that can be emulated
    even if the host CPU doesn't support them.

commit 13cdd389ed06e81277f208c269d825046cdbb4cb
Author: Peter Krempa <pkrempa>
Date:   Mon Jul 15 14:36:09 2013 +0200

    cpu: Add virCPUDefUpdateFeature()
    
    This new function updates or adds a feature to a existing cpu model
    definition. This function will be helpful to allow tuning of
    "host-model" features in later patches.

v1.1.0-193-g3c8be55

Moving to POST.

Comment 3 Jincheng Miao 2013-07-31 08:32:14 UTC
bug fix verification:
1. add cpu feature policy in xml

# virsh edit guest
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <feature policy='force' name='avx'/>
  </cpu>


# virsh start guest
Domain guest started

2. check avx in guest:
[root@guest ~]# cat /proc/cpuinfo | grep avx
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm xsaveopt fsgsbase smep erms

3.
# virsh destroy guest
Domain guest destroyed

4. change cpu feature policy
# virsh edit guest
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <feature policy='disable' name='avx'/>
  </cpu>

5. check avx in guest:
[root@guest ~]# cat /proc/cpuinfo | grep avx
 <no output>

6. check qemu arguments
# ps -ef | grep avx
qemu     14664     1  1 16:09 ?        00:00:12 /usr/libexec/qemu-kvm -name guest -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu SandyBridge,+erms,+smep,+fsgsbase,+rdrand,+f16c,+osxsave,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme,-avx -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid c43be7a8-e950-a68a-813f-40c7d771167d -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/guest.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/r7m.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=writethrough -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=28,id=hostnet0,vhost=on,vhostfd=30 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:e8:c9:02,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
we can see there is "-avx" in qemu arguments.

According above, libvirt can handle cpu feature policy. So change the status to VERIFIED.

Comment 4 Ludek Smid 2014-06-13 10:57:28 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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