diff mbox series

[1/2] tools: Fix ifdef for aarch64 that should include also arm

Message ID 20230608135913.560413-1-luca.fancellu@arm.com (mailing list archive)
State Accepted
Headers show
Series [1/2] tools: Fix ifdef for aarch64 that should include also arm | expand

Commit Message

Luca Fancellu June 8, 2023, 1:59 p.m. UTC
Commit 56a7aaa16bfe introduced some SVE related code that is protected by
'#if defined(__aarch64__)', the issue is that this doesn't take into
consideration when the toolstack is compiled for an arm32 Dom0 running on
an arm64 platform, it should be able to create SVE enabled guests but with
the current code it's not.

So fix the issue by compiling the code when the toolstack is compiled for
both arm32 and arm64.

Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/include/xen-tools/arm-arch-capabilities.h | 2 +-
 tools/python/xen/lowlevel/xc/xc.c               | 2 +-
 tools/xl/xl_info.c                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Luca Fancellu June 22, 2023, 9:17 a.m. UTC | #1
> On 8 Jun 2023, at 14:59, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
> 
> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
> '#if defined(__aarch64__)', the issue is that this doesn't take into
> consideration when the toolstack is compiled for an arm32 Dom0 running on
> an arm64 platform, it should be able to create SVE enabled guests but with
> the current code it's not.
> 
> So fix the issue by compiling the code when the toolstack is compiled for
> both arm32 and arm64.
> 
> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---

Hi all,

Is there any chance to have this one reviewed by the end of the month?
I’m asking because I have a Jira task attached to this patch and my PM is chasing me :)

If it’s not possible it’s fine either and I’ll have just to report that.

Cheers,
Luca


> tools/include/xen-tools/arm-arch-capabilities.h | 2 +-
> tools/python/xen/lowlevel/xc/xc.c               | 2 +-
> tools/xl/xl_info.c                              | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/include/xen-tools/arm-arch-capabilities.h b/tools/include/xen-tools/arm-arch-capabilities.h
> index 3849e897925d..4aa4c6c34a99 100644
> --- a/tools/include/xen-tools/arm-arch-capabilities.h
> +++ b/tools/include/xen-tools/arm-arch-capabilities.h
> @@ -14,7 +14,7 @@
> static inline
> unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
> {
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>     unsigned int sve_vl = MASK_EXTR(arch_capabilities,
>                                     XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
> 
> diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
> index 491e88977fd3..e14e223ec903 100644
> --- a/tools/python/xen/lowlevel/xc/xc.c
> +++ b/tools/python/xen/lowlevel/xc/xc.c
> @@ -911,7 +911,7 @@ static PyObject *pyxc_physinfo(XcObject *self)
>                            "hw_caps",          cpu_cap,
>                            "virt_caps",        virt_caps);
> 
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>     if ( objret ) {
>         unsigned int sve_vl_bits;
>         PyObject *py_arm_sve_vl;
> diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
> index ddc42f96b979..72e87eac46d1 100644
> --- a/tools/xl/xl_info.c
> +++ b/tools/xl/xl_info.c
> @@ -226,7 +226,7 @@ static void output_physinfo(void)
>         );
> 
>     /* Print arm SVE vector length only on ARM platforms */
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>     maybe_printf("arm_sve_vector_length  : %u\n",
>          arch_capabilities_arm_sve(info.arch_capabilities)
>         );
> -- 
> 2.34.1
> 
>
Marek Marczykowski-Górecki June 26, 2023, 6:52 p.m. UTC | #2
On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
> '#if defined(__aarch64__)', the issue is that this doesn't take into
> consideration when the toolstack is compiled for an arm32 Dom0 running on
> an arm64 platform, it should be able to create SVE enabled guests but with
> the current code it's not.
> 
> So fix the issue by compiling the code when the toolstack is compiled for
> both arm32 and arm64.
> 
> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

> ---
>  tools/include/xen-tools/arm-arch-capabilities.h | 2 +-
>  tools/python/xen/lowlevel/xc/xc.c               | 2 +-
>  tools/xl/xl_info.c                              | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/include/xen-tools/arm-arch-capabilities.h b/tools/include/xen-tools/arm-arch-capabilities.h
> index 3849e897925d..4aa4c6c34a99 100644
> --- a/tools/include/xen-tools/arm-arch-capabilities.h
> +++ b/tools/include/xen-tools/arm-arch-capabilities.h
> @@ -14,7 +14,7 @@
>  static inline
>  unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
>  {
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>      unsigned int sve_vl = MASK_EXTR(arch_capabilities,
>                                      XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
>  
> diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
> index 491e88977fd3..e14e223ec903 100644
> --- a/tools/python/xen/lowlevel/xc/xc.c
> +++ b/tools/python/xen/lowlevel/xc/xc.c
> @@ -911,7 +911,7 @@ static PyObject *pyxc_physinfo(XcObject *self)
>                             "hw_caps",          cpu_cap,
>                             "virt_caps",        virt_caps);
>  
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>      if ( objret ) {
>          unsigned int sve_vl_bits;
>          PyObject *py_arm_sve_vl;
> diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
> index ddc42f96b979..72e87eac46d1 100644
> --- a/tools/xl/xl_info.c
> +++ b/tools/xl/xl_info.c
> @@ -226,7 +226,7 @@ static void output_physinfo(void)
>          );
>  
>      /* Print arm SVE vector length only on ARM platforms */
> -#if defined(__aarch64__)
> +#if defined(__arm__) || defined(__aarch64__)
>      maybe_printf("arm_sve_vector_length  : %u\n",
>           arch_capabilities_arm_sve(info.arch_capabilities)
>          );
> -- 
> 2.34.1
>
Anthony PERARD July 4, 2023, 9:42 a.m. UTC | #3
On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
> '#if defined(__aarch64__)', the issue is that this doesn't take into
> consideration when the toolstack is compiled for an arm32 Dom0 running on
> an arm64 platform, it should be able to create SVE enabled guests but with
> the current code it's not.
> 
> So fix the issue by compiling the code when the toolstack is compiled for
> both arm32 and arm64.
> 
> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,
Julien Grall July 4, 2023, 7:11 p.m. UTC | #4
Hi,

Replying here because there is no cover letter (in the future please add 
one if you have more than two patches bundled together).

On 04/07/2023 10:42, Anthony PERARD wrote:
> On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
>> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
>> '#if defined(__aarch64__)', the issue is that this doesn't take into
>> consideration when the toolstack is compiled for an arm32 Dom0 running on
>> an arm64 platform, it should be able to create SVE enabled guests but with
>> the current code it's not.
>>
>> So fix the issue by compiling the code when the toolstack is compiled for
>> both arm32 and arm64.
>>
>> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

I have now committed the series.

Cheers,
Luca Fancellu July 5, 2023, 6:26 a.m. UTC | #5
> On 4 Jul 2023, at 20:11, Julien Grall <julien@xen.org> wrote:
> 
> Hi,
> 
> Replying here because there is no cover letter (in the future please add one if you have more than two patches bundled together).

Sure I will

> 
> On 04/07/2023 10:42, Anthony PERARD wrote:
>> On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
>>> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
>>> '#if defined(__aarch64__)', the issue is that this doesn't take into
>>> consideration when the toolstack is compiled for an arm32 Dom0 running on
>>> an arm64 platform, it should be able to create SVE enabled guests but with
>>> the current code it's not.
>>> 
>>> So fix the issue by compiling the code when the toolstack is compiled for
>>> both arm32 and arm64.
>>> 
>>> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> I have now committed the series.

Thank you

> 
> Cheers,
> 
> -- 
> Julien Grall
diff mbox series

Patch

diff --git a/tools/include/xen-tools/arm-arch-capabilities.h b/tools/include/xen-tools/arm-arch-capabilities.h
index 3849e897925d..4aa4c6c34a99 100644
--- a/tools/include/xen-tools/arm-arch-capabilities.h
+++ b/tools/include/xen-tools/arm-arch-capabilities.h
@@ -14,7 +14,7 @@ 
 static inline
 unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
 {
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     unsigned int sve_vl = MASK_EXTR(arch_capabilities,
                                     XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 491e88977fd3..e14e223ec903 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -911,7 +911,7 @@  static PyObject *pyxc_physinfo(XcObject *self)
                            "hw_caps",          cpu_cap,
                            "virt_caps",        virt_caps);
 
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     if ( objret ) {
         unsigned int sve_vl_bits;
         PyObject *py_arm_sve_vl;
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index ddc42f96b979..72e87eac46d1 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -226,7 +226,7 @@  static void output_physinfo(void)
         );
 
     /* Print arm SVE vector length only on ARM platforms */
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     maybe_printf("arm_sve_vector_length  : %u\n",
          arch_capabilities_arm_sve(info.arch_capabilities)
         );