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
v2: https://listman.redhat.com/archives/libvir-list/2023-April/239625.html
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
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
Note: this is not supported on s390x: error: unsupported configuration: CPU maximum physical address bits specification is not supported for 's390x' architecture