mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Commit56a7aaa16bintroduced 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:56a7aaa16b("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> Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
29 lines
664 B
C
29 lines
664 B
C
/* SPDX-License-Identifier: LGPL-2.1-only */
|
|
/*
|
|
* Copyright (C) 2023 ARM Ltd.
|
|
*/
|
|
|
|
#ifndef ARM_ARCH_CAPABILITIES_H
|
|
#define ARM_ARCH_CAPABILITIES_H
|
|
|
|
#include <stdint.h>
|
|
#include <xen/sysctl.h>
|
|
|
|
#include <xen-tools/common-macros.h>
|
|
|
|
static inline
|
|
unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
|
|
{
|
|
#if defined(__arm__) || defined(__aarch64__)
|
|
unsigned int sve_vl = MASK_EXTR(arch_capabilities,
|
|
XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
|
|
|
|
/* Vector length is divided by 128 before storing it in arch_capabilities */
|
|
return sve_vl * 128U;
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
#endif /* ARM_ARCH_CAPABILITIES_H */
|