Bug 1857671 - <hint-dedicated> should not require <cpu mode='host-passthrough'>
Summary: <hint-dedicated> should not require <cpu mode='host-passthrough'>
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.3
Assignee: Tim Wiederhake
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks: 2034942
TreeView+ depends on / blocked
 
Reported: 2020-07-16 10:25 UTC by Stefan Hajnoczi
Modified: 2022-01-12 13:16 UTC (History)
12 users (show)

Fixed In Version: libvirt-7.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2034942 (view as bug list)
Environment:
Last Closed: 2021-11-16 07:50:50 UTC
Type: Bug
Target Upstream Version: 7.1.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:51:20 UTC

Description Stefan Hajnoczi 2020-07-16 10:25:58 UTC
Description of problem:

The guest Linux cpuidle-haltpoll feature requires <hints-dedicated state='on'/>. Libvirt currently only allows hints-dedicated to be enabled when <cpu mode='host-passthrough'> is used.

KVM_HINTS_REALTIME (formerly called KVM_HINTS_DEDICATED) is documented in
Linux as follows:

  guest checks this feature bit to determine that vCPUs are never
  preempted for an unlimited time, allowing optimizations

Any KVM vCPU should be able to support this feature, regardless of whether
host-passthrough is used or not.

The original author of the libvirt code has confirmed that limiting hints-dedicate to host-passthrough is too restrictive:
https://www.mail-archive.com/libvir-list@redhat.com/msg202968.html

Paolo Bonzini noted that mwait behavior may be affected by hints-dedicated, but now I can't find the code that does this.

How reproducible:
100%

Steps to Reproduce:
1. Add <hint-dedicated state='on'/> to the domain XML without <cpu mode='host-passthrough'/>

Actual results:
Libvirt does not allow this.

Expected results:
Libvirt allows this.

Comment 2 Tim Wiederhake 2021-01-18 14:44:49 UTC
Proposed patch: https://www.redhat.com/archives/libvir-list/2021-January/msg00756.html

Comment 6 Luyao Huang 2021-06-03 09:25:42 UTC
Verify this bug with libvirt-daemon-7.4.0-1.module+el8.5.0+11218+83343022.x86_64:

1. define a guest with host-model cpu mode & hint-dedicated=on


# virsh dumpxml vm1
...
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <kvm>
      <hint-dedicated state='on'/>
    </kvm>
  </features>
  <cpu mode='host-model' check='partial'>
    <numa>
      <cell id='0' cpus='0-1' memory='524288' unit='KiB'/>
      <cell id='1' cpus='2-3' memory='524288' unit='KiB'/>
    </numa>
  </cpu>
...

2. start guest

# virsh start vm1
Domain 'vm1' started

3. check qemu command line:

# ps uax|grep qemu
... -cpu Skylake-Server-IBRS,...,kvm-hint-dedicated=on ...

Comment 8 errata-xmlrpc 2021-11-16 07:50:50 UTC
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 (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2021:4684


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