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 1275596 - [kvm-qe]Cpu flag nonstop_tsc cannot pass through from host to guest with "-cpu host" option
Summary: [kvm-qe]Cpu flag nonstop_tsc cannot pass through from host to guest with "-cp...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.2
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: 7.3
Assignee: Marcelo Tosatti
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On:
Blocks: 1018952
TreeView+ depends on / blocked
 
Reported: 2015-10-27 10:01 UTC by Guo, Zhiyi
Modified: 2016-08-30 17:23 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-30 17:23:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Guo, Zhiyi 2015-10-27 10:01:01 UTC
Description of problem:
Cpu flag nonstop_tsc cannot pass through from host to guest with "-cpu host" option

Version-Release number of selected component (if applicable):
kernel version(host&guest):3.10.0-326.el7.x86_64
qemu version: qemu-kvm-rhev-2.3.0-31.el7.x86_64

How reproducible:
100% reproduce rate.

Steps to Reproduce:
1. qemu-kvm command: qemu-kvm -name rhel7.2 -m 6144 \
        -cpu host\
        -smp 2,cores=1,threads=2,sockets=2,maxcpus=4 \
         -vga qxl\
        -spice port=3001,disable-ticketing \
        -device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent \
        -serial unix:/tmp/m,server,nowait \
        -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
        -drive file=rhev7_2_gpu_test.qcow2,if=none,id=drive-scsi-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0 -device scsi-hd,drive=drive-scsi-disk0,bus=scsi0.0,scsi-id=0,lun=0,id=scsi-disk0,bootindex=1 \
        -monitor stdio \
        -netdev tap,id=idinWyYp,vhost=on -device virtio-net-pci,mac=42:ce:a9:d2:4d:d7,id=idlbq7eA,netdev=idinWyYp \

2. login into rhev 7.2 system and check cpu flag by cat /proc/cpuinfo

Actual results:
nonstop_tsc doesn't exist in flags of /proc/cpuinfo

Expected results:
nonstop_tsc exists in flags of /proc/cpuinfo

Additional info:

Comment 2 djdumas 2016-06-30 20:23:27 UTC
This also happens for me with <cpu mode='custom' match='exact'> on a SandyBridge 2-socket.

When I try to force with <feature policy='require' name='nonstop_tsc'/> I get
error: internal error: Unknown CPU feature nonstop_tsc

Need this feature as part of a SAP HANA/KVM certification effort going on now.
Same version as submitter: qemu-kvm-rhev 2.3.0-31

Thanks,
Dave

Comment 3 Marcelo Tosatti 2016-07-02 00:15:08 UTC
(In reply to Guo, Zhiyi from comment #0)
> Description of problem:
> Cpu flag nonstop_tsc cannot pass through from host to guest with "-cpu host"
> option
> 
> Version-Release number of selected component (if applicable):
> kernel version(host&guest):3.10.0-326.el7.x86_64
> qemu version: qemu-kvm-rhev-2.3.0-31.el7.x86_64
> 
> How reproducible:
> 100% reproduce rate.
> 
> Steps to Reproduce:
> 1. qemu-kvm command: qemu-kvm -name rhel7.2 -m 6144 \
>         -cpu host\
>         -smp 2,cores=1,threads=2,sockets=2,maxcpus=4 \
>          -vga qxl\
>         -spice port=3001,disable-ticketing \
>         -device virtio-serial -chardev
> spicevmc,id=vdagent,debug=0,name=vdagent \
>         -serial unix:/tmp/m,server,nowait \
>         -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
>         -drive
> file=rhev7_2_gpu_test.qcow2,if=none,id=drive-scsi-disk0,format=qcow2,
> cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0 -device
> scsi-hd,drive=drive-scsi-disk0,bus=scsi0.0,scsi-id=0,lun=0,id=scsi-disk0,
> bootindex=1 \
>         -monitor stdio \
>         -netdev tap,id=idinWyYp,vhost=on -device
> virtio-net-pci,mac=42:ce:a9:d2:4d:d7,id=idlbq7eA,netdev=idinWyYp \
> 
> 2. login into rhev 7.2 system and check cpu flag by cat /proc/cpuinfo
> 
> Actual results:
> nonstop_tsc doesn't exist in flags of /proc/cpuinfo
> 
> Expected results:
> nonstop_tsc exists in flags of /proc/cpuinfo
> 
> Additional info:

-cpu host,+invtsc,migratable=no

exposes nonstop_tsc on

qemu-kvm-rhev-2.3.0-31.el7_2.17.x86_64

for me.

Comment 4 Marcelo Tosatti 2016-07-02 00:42:07 UTC
(In reply to djdumas from comment #2)
> This also happens for me with <cpu mode='custom' match='exact'> on a
> SandyBridge 2-socket.
> 
> When I try to force with <feature policy='require' name='nonstop_tsc'/> I get
> error: internal error: Unknown CPU feature nonstop_tsc
> 
> Need this feature as part of a SAP HANA/KVM certification effort going on
> now.
> Same version as submitter: qemu-kvm-rhev 2.3.0-31
> 
> Thanks,
> Dave

Dave,

I haven't tried it myself, but this is what the libvirt commit which introduced 
support for invtsc says:

commit fba6bc47cbcabbe08d42279691efb0dff3b9c997
Author: Ján Tomko <jtomko>
Date:   Tue May 6 13:55:44 2014 +0200

    Add invariant TSC cpu flag
    
    Add suport for invariant TSC flag (CPUID 0x80000007, bit 8 of EDX).
    If this flag is enabled, the TSC ticks at a constant rate across
    all ACPI P-, C- and T-states.
    
    This can be enabled by adding:
    <feature name='invtsc'/>
    to the <cpu> element.
    
    Migration and saving the domain does not work with this flag.
    
    QEMU support: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=303752a
    
    The feature name "invtsc" differs from the name "" used by the linux kernel:
    https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/cpu/powerflags.c?id=30321c7b#n18

Perhaps you can try adding that option?

Comment 5 djdumas 2016-07-05 18:02:01 UTC
(In reply to Marcelo Tosatti from comment #4)

>     This can be enabled by adding:
>     <feature name='invtsc'/>
>     to the <cpu> element.
>     

....

> Perhaps you can try adding that option?

Hi Marcelo,

Nice call there - that worked, thank you.  I have nonstop_tsc in the guest now.

Dave

Comment 6 Karen Noel 2016-08-30 17:23:12 UTC
(In reply to djdumas from comment #5)
> (In reply to Marcelo Tosatti from comment #4)
> 
> >     This can be enabled by adding:
> >     <feature name='invtsc'/>
> >     to the <cpu> element.
> >     
> 
> ....
> 
> > Perhaps you can try adding that option?
> 
> Hi Marcelo,
> 
> Nice call there - that worked, thank you.  I have nonstop_tsc in the guest
> now.
> 
> Dave

Looks like this was not a bug afterall. Closing. 

Please reopen if there is still an issue. Thanks.


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