Bug 1056205 - new cpu's flags, to control hyper-v related features - hv-time
Summary: new cpu's flags, to control hyper-v related features - hv-time
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1057173
Blocks: 817925
TreeView+ depends on / blocked
 
Reported: 2014-01-21 17:05 UTC by Ronen Hod
Modified: 2019-07-11 07:50 UTC (History)
12 users (show)

Fixed In Version: libvirt-1.1.1-23.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:56:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 784836 'unspecified' 'CLOSED' 'new cpu''s flags, to control hyper-v related features' 2019-12-08 09:41:45 UTC
Red Hat Bugzilla 1083525 None None None 2019-12-08 09:41:45 UTC
Red Hat Bugzilla 1083529 'high' 'CLOSED' '[RFE] When running a KVM Windows guest, need to turn on all the "hv_*" flags' 2019-12-08 09:41:45 UTC

Internal Links: 784836 1083525 1083529

Description Ronen Hod 2014-01-21 17:05:29 UTC
Description of problem:
We are adding yet another CPU flag for Hyper-V Enlightenment.
- "hv-time" to enable the use of Hyper-V reference counter. hv_time is disabled if this parameter is not specified.

See http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg02569.html

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Peter Krempa 2014-01-21 17:56:13 UTC
Patch posted for upstream review:

http://www.redhat.com/archives/libvir-list/2014-January/msg00963.html

The patch will need to wait until qemu accepts the feature.

Comment 4 Peter Krempa 2014-02-10 12:34:59 UTC
Fixed in libvirt upstream:

commit 600bca592b2352b683856f4b7f2694f366feac36
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Jan 21 18:50:12 2014 +0100

    qemu: hyperv: Add support for timer enlightenments
    
    Add a new <timer> for the HyperV reference time counter enlightenment
    and the iTSC reference page for Windows guests.
    
    This feature provides a paravirtual approach to track timer events for
    the guest (similar to kvmclock) with the option to use real hardware
    clock on systems with a iTSC with compensation across various hosts.

commit 8ffaa42d7bc42f110ea9015a1c8f5528c3eb3bbf
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Wed Feb 5 10:10:14 2014 +0100

    conf: Enforce supported options for certain timers
    
    According to the documentation various timer options are only supported
    by certain timer types. Add a post parse check to verify that the user
    didn't specify invalid options.
    
    Also fix the qemu command line parsing function to set correct default
    values for the kvmclock timer so that it passes the new check.

commit bbd392ff86249434ca63bb5977d2b1bd2d72a538
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Feb 4 19:02:04 2014 +0100

    schema: Fix guest timer specification schema according to the docs
    
    According to the documentation describing various tunables for domain
    timers not all the fields are supported by all the driver types. Express
    these in the RNG:
    
    - rtc, platform: Only these support the "track" attribute.
    - tsc: only one to support "frequency" and "mode" attributes
    - hpet, pit: tickpolicy/catchup attribute/element
    - kvmclock: no extra attributes are supported
    
    Additionally the attributes of the <catchup> element for
    tickpolicy='catchup' are optional according to the parsing code. Express
    this in the XML and fix a spurious space added while formatting the
    <catchup> element and add tests for it.

Comment 7 Jincheng Miao 2014-02-14 05:23:36 UTC
Hi peter,

When testing this bug, I met two problem:
1. for hv_time, I alway get:
"error: internal error: process exited while connecting to monitor: qemu-kvm: feature string `hv_time' not in format (+feature|-feature|feature=xyz)"
Even if I use the qemu package provided by https://bugzilla.redhat.com/show_bug.cgi?id=1057173#c1
the error is still there.

2. for clock-catchup
I set xml like:
<timer name='rtc' tickpolicy='catchup'>
  <catchup slew='4636'/>
</timer>
And I can see '-rtc base=utc,driftfix=slew' in command line.

But if xml is:
<timer name='rtc' tickpolicy='catchup'>
  <catchup threshold='123'/>
</timer>

or 
<timer name='rtc' tickpolicy='catchup'>
  <catchup limit='2342'/>
</timer>
I still can see '-rtc base=utc,driftfix=slew' in qemu command line.

The problem is why slew is always there even no catchup slew attribute?
And what is affected by these three attributes of catchup?

Comment 8 Peter Krempa 2014-02-14 09:55:38 UTC
(In reply to Jincheng Miao from comment #7)
> Hi peter,
> 
> When testing this bug, I met two problem:
> 1. for hv_time, I alway get:
> "error: internal error: process exited while connecting to monitor:
> qemu-kvm: feature string `hv_time' not in format
> (+feature|-feature|feature=xyz)"
> Even if I use the qemu package provided by
> https://bugzilla.redhat.com/show_bug.cgi?id=1057173#c1
> the error is still there.

This is a bug in the backport of the feature from upstream in qemu. Please wait for a working version of the qemu backport.

> 
> 2. for clock-catchup
> I set xml like:
> <timer name='rtc' tickpolicy='catchup'>
>   <catchup slew='4636'/>
> </timer>
> And I can see '-rtc base=utc,driftfix=slew' in command line.
> 
> But if xml is:
> <timer name='rtc' tickpolicy='catchup'>
>   <catchup threshold='123'/>
> </timer>
> 
> or 
> <timer name='rtc' tickpolicy='catchup'>
>   <catchup limit='2342'/>
> </timer>
> I still can see '-rtc base=utc,driftfix=slew' in qemu command line.
> 
> The problem is why slew is always there even no catchup slew attribute?
> And what is affected by these three attributes of catchup?

This is apparently how it works. The code explicitly formats the commandline as "slew":
            case VIR_DOMAIN_TIMER_TICKPOLICY_CATCHUP:
                /* deliver ticks at a faster rate until caught up */
                virBufferAddLit(&buf, ",driftfix=slew");
                break;

The part of the patchset modifying the code isn't changing the way this is handled. If you think it's a bug please open a separate bz for it as isn't related to this one.

Comment 9 Jincheng Miao 2014-03-08 09:13:41 UTC
The hv_time option is passed to qemu-kvm when setting like this:

# virsh edit r7
<domain type='kvm'>
...
  <clock offset='utc'>
    <timer name='hypervclock' present='yes'/>
  </clock>
...
</domain>

# virsh start r7
Domain r7 started

# ps -ef | grep hv_time
qemu     25085     1 92 17:10 ?        00:00:05 /usr/libexec/qemu-kvm -name r7 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu qemu64,hv_time -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 5d8bcdb9-f61a-4031-b4ac-817b873d356e -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/r7.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/r7.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:df:85:42,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -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=0x7
root     25096 16076  0 17:10 pts/1    00:00:00 grep --color=auto hv_time

This hv_time option is working on libvirt, so the status could be changed to VERIFIED.

Comment 10 Ludek Smid 2014-06-13 09:56:10 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.