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

Re: [PATCH v5 08/12] xen/physinfo: encode Arm SVE vector length in arch_capabilities


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 18 Apr 2023 12:49:36 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hhKNfkA7X9/PI1wjLsH1O+OSaDiuEY666L8i7LUNEKA=; b=ev9VzoAWbC0tV9JmQNYTCWijSOwqsKo5lP0yjTLBf2Poe2QqmcuWLpn+elGPyUT+QMV9ovdg8b12Y/38aTJqOIo2sVECBTHFJO/dsJrFNq9XTFgbmycIf5PU/RXVduC+j38cODyDlUL6ZnfrHnuxTO90jBQn8fgzFLGN5C87Bv/ixrKvoBv5QyPwptQlFTb52CYpxHWg+2b6A57NPlWwV/2J25xryZIHL5AGfZgQZclX78Wisz960Y35kCrodxz9UDDbvlGgn2PYQjbF6CyhwKwDlUM4zmfvWv03rv6UPAwU6xml4ASszHTBL6Rz2Jkb+6DhYArPFNqVlz5pIhbSeA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ny/UYCJIu6oEfVSc+SOme31Vp+7WStPzzbTqasH1P9FU6ewbjdIrZBs7j5GCaVJZMCe2ZVpL5nZOYRZDCQZZ/blxUydLaTJQhncd2zNh6UD7W77nLSZcel0FBWNYLkSZFwhUguD0h+BJlUeEC9RHNKyBwZiQ372a0QZQOaJsF2UhKY80d2sOWwfqsTGR9AgbSpIYtoBmFVdaMP8B2VXjHI+FIS83YsHSTpM1vfgpCOBx8nTvgdbDt4NPcUCVcJIfHTQTnxsLBYGkrSbsJT1l+bXJlVt9xU6gBub6fQRpUAom/elCRcsknwv+rY0W3PnbzT6R2EQBFi0HOwy12Yg8YQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 18 Apr 2023 12:50:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZbSQst7ttECjUJEKfLWpPDMYlwq8xDiEA
  • Thread-topic: [PATCH v5 08/12] xen/physinfo: encode Arm SVE vector length in arch_capabilities

Hi Luca,

> On 12 Apr 2023, at 11:49, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> When the arm platform supports SVE, advertise the feature in the
> field arch_capabilities in struct xen_sysctl_physinfo by encoding
> the SVE vector length in it.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> Changes from v4:
> - Write arch_capabilities from arch_do_physinfo instead of using
>   stub functions (Jan)
> Changes from v3:
> - domainconfig_encode_vl is now named sve_encode_vl
> Changes from v2:
> - Remove XEN_SYSCTL_PHYSCAP_ARM_SVE_SHFT, use MASK_INSR and
>   protect with ifdef XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK (Jan)
> - Use the helper function sve_arch_cap_physinfo to encode
>   the VL into physinfo arch_capabilities field.
> Changes from v1:
> - Use only arch_capabilities and some defines to encode SVE VL
>   (Bertrand, Stefano, Jan)
> Changes from RFC:
> - new patch
> ---
> xen/arch/arm/sysctl.c       | 4 ++++
> xen/include/public/sysctl.h | 4 ++++
> 2 files changed, 8 insertions(+)
> 
> diff --git a/xen/arch/arm/sysctl.c b/xen/arch/arm/sysctl.c
> index b0a78a8b10d0..e9a0661146e4 100644
> --- a/xen/arch/arm/sysctl.c
> +++ b/xen/arch/arm/sysctl.c
> @@ -11,11 +11,15 @@
> #include <xen/lib.h>
> #include <xen/errno.h>
> #include <xen/hypercall.h>
> +#include <asm/arm64/sve.h>
> #include <public/sysctl.h>
> 
> void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
> {
>     pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
> +
> +    pi->arch_capabilities |= MASK_INSR(sve_encode_vl(get_sys_vl_len()),
> +                                       XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
> }
> 
> long arch_do_sysctl(struct xen_sysctl *sysctl,
> diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> index 2b24d6bfd00e..9d06e92d0f6a 100644
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -94,6 +94,10 @@ struct xen_sysctl_tbuf_op {
> /* Max XEN_SYSCTL_PHYSCAP_* constant.  Used for ABI checking. */
> #define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_gnttab_v2
> 
> +#if defined(__arm__) || defined(__aarch64__)
> +#define XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK  (0x1FU)
> +#endif
> +
> struct xen_sysctl_physinfo {
>     uint32_t threads_per_core;
>     uint32_t cores_per_socket;
> -- 
> 2.34.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.