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

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


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 28 Mar 2023 12:14:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=mhSDwoQ4kqHBumKlLoGgNQ2DGi7mV2osGT+cRRBdg+M=; b=MoQcSk3b3NzJWcI9zS8CRYzTCfLeYbhbW4yQKRnglxKCWYnL2CSA09foX+vLsO14JVQq8w3RTUwwmBkgWMU8jypdiX4awgvo1GLaPbfh/trOPmp0381EAoGZyRzltz9fkXMwGNxJE3K8dsLRXK6mzOW5vc4Lr1mqAeiuxj5A+mNdLeFBbWXCF0oTGCQSBoy/43BOoFVVaZl2kX2TMZf4At1ajtmgyjt9pjbXOQISFe5f7Ny8/RDjbC31ZbPyOZwCksbzucB++H13/mr1GsJPdm3cxHl71O+wSFoiDjGWW20U0RSIdWRPBedjMxJPlW7lizRQdfIwf0io8TeciK1bwg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KpD16FrxGofH2NKJuvEIFtS8Otx8MBjco/h/tgvYzfJ68x+rjo2sNvhV/YUAEVB8i0QiRR3HzW4+zHFactxzHVL26Ew+8pAyPgfR1bMkZtJ0sYYrrCVOjTUGjdxtO3r2I1S5BDUhPrY0PTgpOgEMSW8RJtwBUxG71XvpHGphI1D6hQsWTebayfEnrBAZBnaEOmcCm+9RwaluX0n7Ne9ASCdzFon6apxdBGqgd71MYKE8zGiNfS3XZygFmF/v1dXnq/bL+r/pF7lp2CmSKAlIum390o6xkWV/vkeMvrVZrEkQ6+fE9b7jpw9SMPjC8Bb7Flu7cmQWsPR6YhiJ+Sm9xA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, 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>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 28 Mar 2023 10:15:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.03.2023 12:59, Luca Fancellu wrote:
> --- a/xen/arch/arm/arm64/sve.c
> +++ b/xen/arch/arm/arm64/sve.c
> @@ -124,3 +124,15 @@ int __init sve_parse_dom0_param(const char *str_begin, 
> const char *str_end)
>  {
>      return parse_integer("sve", str_begin, str_end, (int*)&opt_dom0_sve);
>  }
> +
> +void sve_arch_cap_physinfo(uint32_t *arch_capabilities)
> +{
> +    if ( cpu_has_sve )
> +    {
> +        /* Vector length is divided by 128 to save some space */
> +        uint32_t sve_vl = MASK_INSR(sve_encode_vl(get_sys_vl_len()),
> +                                    XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
> +
> +        *arch_capabilities |= sve_vl;
> +    }
> +}

I'm again wondering why a separate function is needed, when everything
that's needed is ...

> --- a/xen/arch/arm/sysctl.c
> +++ b/xen/arch/arm/sysctl.c
> @@ -11,11 +11,14 @@
>  #include <xen/lib.h>
>  #include <xen/errno.h>
>  #include <xen/hypercall.h>
> +#include <asm/arm64/sve.h>

... becoming available here for use ...

>  #include <public/sysctl.h>
>  
>  void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
>  {
>      pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
> +
> +    sve_arch_cap_physinfo(&pi->arch_capabilities);

... here. That would be even more so if, like suggested before,
get_sys_vl_len() returned 0 when !cpu_has_sve.

Jan



 


Rackspace

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