[libvirt] [PATCH 2/2] qemu: Remove host-passthrough validation check for host-phys-bits=on

Jim Fehlig jfehlig at suse.com
Wed Aug 17 17:18:39 UTC 2022


On 8/17/22 08:47, Jim Fehlig wrote:
> On 8/17/22 02:19, Lin Ma wrote:
>> Besides the -cpu host, The host-phys-bits=on applies to custom or max
>> cpu model, So the host-passthrough validation check is unnecessary for
>> maxphysaddr with mode='passthrough'.
> 
> I wonder why Dario added the check? He even added a test for it: 
> cpu-phys-bits-passthrough2 in qemuxml2argvtest. He is off now, so we'll have to 
> await his return for an answer.

BTW, I'm not doubting your analysis. In fact, I tested with one of the known CPU 
models (-cpu Cascadelake-Server,...,host-phys-bits=on) and it worked fine with a 
7TB VM. I'd still like to know why Dario added the check. Perhaps he encountered 
some problematic corner cases.

Thanks!
Jim

> 
>> Signed-off-by: Lin Ma <lma at suse.com>
>> ---
>>   src/qemu/qemu_validate.c | 7 -------
>>   1 file changed, 7 deletions(-)
>>
>> diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
>> index 6e457f3814..e60575d8a0 100644
>> --- a/src/qemu/qemu_validate.c
>> +++ b/src/qemu/qemu_validate.c
>> @@ -344,13 +344,6 @@ qemuValidateDomainDefCpu(virQEMUDriver *driver,
>>           switch (addr->mode) {
>>           case VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH:
>> -            if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
>> -                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> -                               _("CPU maximum physical address bits mode '%s' 
>> can only be used with '%s' CPUs"),
>> -                               virCPUMaxPhysAddrModeTypeToString(addr->mode),
>> -                               
>> virCPUModeTypeToString(VIR_CPU_MODE_HOST_PASSTHROUGH));
>> -                return -1;
>> -            }
> 
> If the check is removed the above mentioned test needs removed too.
> 
> Regards,
> Jim
> 
>>               if (addr->bits != -1) {
>>                   virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>>                                  _("CPU maximum physical address bits number 
>> specification cannot be used with mode='%s'"),
> 



More information about the libvir-list mailing list