Bug 838469 - (cpu_host) PRD32 - [RFE] Support cpu -host (passthrough) for virtual machines
PRD32 - [RFE] Support cpu -host (passthrough) for virtual machines
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: RFEs (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.2.0
Assigned To: Laszlo Hornyak
Ido Begun
http://wiki.ovirt.org/wiki/Features/C...
sla
: FutureFeature
Depends On: 891729 908420
Blocks: 915537
  Show dependency treegraph
 
Reported: 2012-07-09 04:11 EDT by Andrew Cathrow
Modified: 2016-02-10 15:19 EST (History)
12 users (show)

See Also:
Fixed In Version: sf7
Doc Type: Enhancement
Doc Text:
Support has been added for host CPU passthrough on virtual machines, which allows virtual machines to see and utilize the host's CPU flags. This enables better performance in virtual machines, but it prevents the virtual machine from being migrated to other hosts.
Story Points: ---
Clone Of:
: 891729 (view as bug list)
Environment:
Last Closed: 2013-06-10 17:05:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew Cathrow 2012-07-09 04:11:45 EDT
We should support passing -cpu host to a virtual machine.

Use case :  User wants maximum performance from a virtual machine and does not care about migration.

This should be presented as an advanced CPU option and should block migration.
Comment 1 Yaniv Kaul 2012-09-13 03:15:45 EDT
Really cool and makes sense for non-migratable VMs.
Comment 2 Itamar Heim 2012-09-16 10:06:37 EDT
andrew - can we get detailed requirement (mainly ui mockup)?
Comment 3 Doron Fediuck 2012-11-15 11:06:01 EST
Just filling-in some context, this is needed for cases where kvm will not expose all flags the the guest. So qemu allows exposing all host cpu flags to the guest
by manually specifying 'host'. An example would be:

qemu-kvm -cpu host <the rest of your options>
Comment 4 Doron Fediuck 2012-11-19 03:37:12 EST
Andy, so far no response for the UI request.
For now we assume a simple checkbox near the host cpu-pinning, to enable it.
Please comment if this is not the case.
Comment 5 Doron Fediuck 2012-11-19 03:46:52 EST
In order to check if / how / version where it works, take a look in the libvirt RFE: 
https://bugzilla.redhat.com/show_bug.cgi?id=700272#c18
Comment 7 Yaniv Kaul 2012-12-04 09:58:10 EST
(In reply to comment #5)
> In order to check if / how / version where it works, take a look in the
> libvirt RFE: 
> https://bugzilla.redhat.com/show_bug.cgi?id=700272#c18

Added https://bugzilla.redhat.com/show_bug.cgi?id=700272#c23 :
Why isn't it adding +x2apic?
Comment 8 Doron Fediuck 2012-12-04 12:52:12 EST
(In reply to comment #7)
> (In reply to comment #5)
> > In order to check if / how / version where it works, take a look in the
> > libvirt RFE: 
> > https://bugzilla.redhat.com/show_bug.cgi?id=700272#c18
> 
> Added https://bugzilla.redhat.com/show_bug.cgi?id=700272#c23 :
> Why isn't it adding +x2apic?

Added https://bugzilla.redhat.com/show_bug.cgi?id=700272#c25:

(In reply to comment #23 in bug )
> Why isn't it adding +x2apic?

Yaniv, IIUC x2apic is a specific flag of the cpu, which may / may not be exposed by the host processor. So this will work even with host-passthrough if all hosts have the same processor capabilities.

See also: http://www.linux-kvm.org/page/Tuning_KVM
Comment 10 Doron Fediuck 2012-12-16 11:35:17 EST
I'd like to add one thing about the migration policy;
there are cases where we do not care where the VM will start, as long
as it will not migrate from that host.

Currently in the UI there's no way to set this up (pin to any host),
so in this case we'll also accept an option of checking the existing "Allow VM migration only upon Administrator specific request", and produce a warning
if the cpu-host option is checked.
Comment 12 ofri 2012-12-31 07:02:39 EST
Merged fix for UI: http://gerrit.ovirt.org/#/c/10482/
Comment 13 Itamar Heim 2012-12-31 09:12:14 EST
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #5)
> > > In order to check if / how / version where it works, take a look in the
> > > libvirt RFE: 
> > > https://bugzilla.redhat.com/show_bug.cgi?id=700272#c18
> > 
> > Added https://bugzilla.redhat.com/show_bug.cgi?id=700272#c23 :
> > Why isn't it adding +x2apic?
> 
> Added https://bugzilla.redhat.com/show_bug.cgi?id=700272#c25:
> 
> (In reply to comment #23 in bug )
> > Why isn't it adding +x2apic?
> 
> Yaniv, IIUC x2apic is a specific flag of the cpu, which may / may not be
> exposed by the host processor. So this will work even with host-passthrough
> if all hosts have the same processor capabilities.
> 
> See also: http://www.linux-kvm.org/page/Tuning_KVM

doron - are you sure about this? iirc, x2apic is unrealted to host cpu, rather a feature of kvm (i.e., kvm virtualizes this flag to the guest)?
Comment 14 Doron Fediuck 2012-12-31 09:17:20 EST
(In reply to comment #13)
> 
> doron - are you sure about this? iirc, x2apic is unrealted to host cpu,
> rather a feature of kvm (i.e., kvm virtualizes this flag to the guest)?

Itamar, it was a misunderstanding coming from bad documentation. Indeed x2apic is kvm related and libvirt should decide if they wish to add it.
Comment 15 Andrew Cathrow 2012-12-31 09:30:14 EST
Combining -cpu host and x2apic will give the best CPU performance I'm just not sure how to specify x2apic with libvirt. You can do -cpu host,+x2apic but I'm not sure how to do that in libvirt.
Comment 16 Doron Fediuck 2013-01-01 04:46:44 EST
Once libvirt supports x2apic with -cpu host, we'll re-evaluate to see if additional changes needed in vdsm (hopefully this will be libvirt internally only).
Comment 17 Stephen Gordon 2013-01-03 14:40:47 EST
I'm assuming this will be exposed via the API/CLI/SDK as well (looking at documentation impact)?
Comment 18 Andrew Cathrow 2013-01-03 14:48:43 EST
(In reply to comment #17)
> I'm assuming this will be exposed via the API/CLI/SDK as well (looking at
> documentation impact)?


Yes UI,cli and api.
Comment 19 Ido Begun 2013-01-28 10:17:42 EST
It seems like this PRD did not make it into SF3/4.
Comment 22 Doron Fediuck 2013-02-11 12:07:34 EST
Moving to modified as engine part is in.
Waiting for bug 908420 to be merged.
Comment 23 Ido Begun 2013-03-21 02:30:15 EDT
OK - SF10.1

A VM with CPU mode of "host_passthrough" is running with '-cpu host'.
Comment 24 Cheryn Tan 2013-04-03 02:53:27 EDT
This bug is currently attached to errata RHEA-2013:14491. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.

* Consequence: What happens when the bug presents.

* Fix: What was done to fix the bug.

* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Thanks in advance.
Comment 27 errata-xmlrpc 2013-06-10 17:05:44 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0888.html

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