Re: [PATCH] qemu: S390 does not provide physical address size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/14/23 16:38, Boris Fiuczynski wrote:
> Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size"
> which is not including on S390 and therefore reports an internal error.
> Lets remove the parsing on S390.
> 
> Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
> Reviewed-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
> Reviewed-by: Collin Walling <walling@xxxxxxxxxxxxx>
> ---
>  src/cpu/cpu_x86.c                         |  2 +-
>  src/qemu/qemu_capabilities.c              |  2 +-
>  src/util/virhostcpu.c                     | 11 +++++++++--
>  src/util/virhostcpu.h                     |  3 ++-
>  tests/domaincapsdata/qemu_4.2.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_5.2.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_6.0.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_8.1.0.s390x.xml |  1 -
>  tests/domaincapsmock.c                    |  7 +++++--
>  9 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
> index 8d371d5501..3c0163c4d1 100644
> --- a/src/cpu/cpu_x86.c
> +++ b/src/cpu/cpu_x86.c
> @@ -2795,7 +2795,7 @@ virCPUx86GetHost(virCPUDef *cpu,
>          VIR_DEBUG("Host CPU does not support invariant TSC");
>      }
>  
> -    if (virHostCPUGetPhysAddrSize(&addrsz) == 0) {
> +    if (virHostCPUGetPhysAddrSize(cpuData->arch, &addrsz) == 0) {
>          virCPUMaxPhysAddrDef *addr = g_new0(virCPUMaxPhysAddrDef, 1);
>  
>          addr->bits = addrsz;
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index c9f4b17208..d82fe88057 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -3911,7 +3911,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps,
>      }
>  
>      if (virQEMUCapsTypeIsAccelerated(type))
> -        virHostCPUGetPhysAddrSize(&physAddrSize);
> +        virHostCPUGetPhysAddrSize(hostArch, &physAddrSize);
>  
>      virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, fullCPU);
>  
> diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
> index 19195a1470..41be4bffe0 100644
> --- a/src/util/virhostcpu.c
> +++ b/src/util/virhostcpu.c
> @@ -1646,10 +1646,16 @@ virHostCPUGetSignature(char **signature)
>  }
>  
>  int
> -virHostCPUGetPhysAddrSize(unsigned int *size)
> +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size)
>  {

Nit pick. Here ^^^ ...

> diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
> index cecb333602..6a23f2cb11 100644
> --- a/tests/domaincapsmock.c
> +++ b/tests/domaincapsmock.c
> @@ -37,9 +37,12 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED)
>  }
>  
>  int
> -virHostCPUGetPhysAddrSize(unsigned int *size)
> +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size)
>  {

.. and here ^^^ arguments should be on separate lines. It allows for
smaller diffs should we ever introduce another argument.

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

and pushed. Thanks for catching this.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux