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 2176215 - [libvirt] allow configuring host-phys-bits-limit
Summary: [libvirt] allow configuring host-phys-bits-limit
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.3
Assignee: Ján Tomko
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks: 2171860
TreeView+ depends on / blocked
 
Reported: 2023-03-07 16:43 UTC by Ján Tomko
Modified: 2023-11-07 09:38 UTC (History)
6 users (show)

Fixed In Version: libvirt-9.3.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:31:00 UTC
Type: Feature Request
Target Upstream Version: 9.3.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab libvirt libvirt issues 450 0 None opened qemu: Support host-phys-bits-limit=int 2023-03-07 16:43:08 UTC
Red Hat Issue Tracker LIBVIRTAT-14267 0 None None None 2023-06-01 04:05:26 UTC
Red Hat Issue Tracker RHELPLAN-150965 0 None None None 2023-03-07 16:44:13 UTC
Red Hat Product Errata RHSA-2023:6409 0 None None None 2023-11-07 08:31:30 UTC

Description Ján Tomko 2023-03-07 16:43:08 UTC
Description of problem:
For migration compatibility, libvirt needs a knob to set the host-phys-bits-limit.
See bug 2171860 for more details.

Upstream issue:
https://gitlab.com/libvirt/libvirt/-/issues/450
Upstream patches:
https://listman.redhat.com/archives/libvir-list/2023-March/238231.html

Comment 2 Ján Tomko 2023-04-25 09:22:44 UTC
Pushed upstream as:
commit e3d95a1eba78f2b797dbdce7d8bd604a8e004961
Author:     Ján Tomko <jtomko>
CommitDate: 2023-04-25 11:19:37 +0200

    qemu: add support for setting host-phys-bits-limit
    
    Translate <maxphysaddr limit='39'/> to:
    host-phys-bits-limit=39
    
    https://gitlab.com/libvirt/libvirt/-/issues/450
    https://bugzilla.redhat.com/show_bug.cgi?id=2171860
    
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Martin Kletzander <mkletzan>

git describe: v9.2.0-304-g03ca889b15

Comment 6 Luyao Huang 2023-05-19 02:30:20 UTC
Verify this bug with libvirt-9.3.0-2.el9.x86_64:

S1: Test set guest maxphysaddr limit < host Address sizes

1. check host Address sizes:
# lscpu |grep "Address sizes:"
Address sizes:                   46 bits physical, 48 bits virtual

2. Add limit in maxphysaddr element
# virsh edit vm1
...
  <cpu mode='host-model' check='partial'>
    <maxphysaddr mode='passthrough' limit='36'/>
    <numa>
      <cell id='0' cpus='0-5' memory='1048576' unit='KiB'/>
      <cell id='1' cpus='6-11' memory='1048576' unit='KiB'/>
    </numa>
  </cpu>
...

3. start guest
# virsh start vm1
Domain 'vm1' started

4. check qemu command line:
# ps aux|grep qemu
...host-phys-bits=on,host-phys-bits-limit=36

5. login guest and check guest Address sizes:
IN GUEST:
# lscpu|grep Address
Address sizes:                   36 bits physical, 48 bits virtual


S2: Test set guest maxphysaddr limit >= host Address sizes

1. check host Address sizes:
# lscpu |grep "Address sizes:"
Address sizes:                   46 bits physical, 48 bits virtual

2. Add limit in maxphysaddr element
# virsh edit vm1
...
  <cpu mode='host-model' check='partial'>
    <maxphysaddr mode='passthrough' limit='50'/>
    <numa>
      <cell id='0' cpus='0-5' memory='1048576' unit='KiB'/>
      <cell id='1' cpus='6-11' memory='1048576' unit='KiB'/>
    </numa>
  </cpu>
...

3. start guest
# virsh start vm1
Domain 'vm1' started

4. check qemu command line:
# ps aux|grep qemu
...host-phys-bits=on,host-phys-bits-limit=50


5. login guest and check guest Address sizes:

IN GUEST:
# lscpu|grep Address
Address sizes:                   46 bits physical, 48 bits virtual

S3: some negative scenarios

1. 
xml: <maxphysaddr mode='emulate' limit='50'/>

# virsh edit vm1
error: unsupported configuration: attribute 'limit' is only supported for maxphysaddr mode 'passthrough'
Failed. Try again? [y,n,i,f,?]: 

2.
xml: <maxphysaddr mode='passthrough' limit='0'/>

# virsh edit vm1
error: XML error: Invalid value for attribute 'limit' in element 'maxphysaddr': Zero is not permitted
Failed. Try again? [y,n,i,f,?]: 

3.
xml: <maxphysaddr mode='passthrough' limit='-1'/>

# virsh edit vm1
error: XML error: Invalid value for attribute 'limit' in element 'maxphysaddr': '-1'. Expected non-negative integer value
Failed. Try again? [y,n,f,?]: 


Migration and cross migration related scenarios will be tested in bug 2171860

Comment 7 smitterl 2023-08-07 12:45:49 UTC
Note: this is not supported on s390x:

error: unsupported configuration: CPU maximum physical address bits specification is not supported for 's390x' architecture

Comment 9 errata-xmlrpc 2023-11-07 08:31:00 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 (Moderate: libvirt security, 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/RHSA-2023:6409


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