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

Re: [PATCH 07/10] xen/physinfo: add arm SVE arch capability and vector length


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Feb 2023 13:05:52 +0100
  • 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=HtHsB2GsIBUsPcnfySCFMm62xZmAg6mkNF7ot1sFLCo=; b=K1yPE12nYqsesP/NITffp6unYVKgVTsiMK5ahpG7620AsSLAxCrBuXYPP4sGTUa7tzAYkFmvxEGgbnGtVST0kSaIywGy1qfRVN46YufF8kSnqqcUXsxO/Jb5yoavJuyKMAEirXbur75WRDhmmAHSafxtGywY8DGpU2fD0Vreng7NfRru3MPKniu3UarJDq8LXMIiBct1uPW5SGuuEWdy6+4+LgZGFiUnQODNlpzl2lpQnAnYl2bLDyGBOx7fzk5vr3TqgTaYpw99sDmCj4QOk1NC0/lgf0RQ5bjTcQn4UxHCB05NLfskJDuWvRxANnaN/HLitOxop4bJxs3Tu18wUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YdDvCT4xAJjvTIsHAPA9sl+VjtIIaQynlCt1DZlUmNMMDViX19pFw1jOv23cFoG3H8pChqYRb00bMBACSsGzriCvyvaQFyEGgVDQ5UEb93RdAlJj8vDRGfbXR8hDFXwPQOhst76d76vBKZi1nLqz+PrjwSiqJUmiALrWSW1SnaSi4DuYeY8EZIoMnU0fnsfUs1S3qKNnV2ENCgkRCxgg6bcZ+9Ypq1OqJ/cDhqtbC+dpnZzARMGA3JYToSfXHYp9NdgV4DIJcQAvyEuSf3TK13ReGm+VzlS9/gtcjBa2rLsMHjbUzHelXD3v9cP7/SJpl0ELiwHiTHI//3zaVq10AQ==
  • 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: Thu, 02 Feb 2023 12:06:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.02.2023 12:08, Luca Fancellu wrote:
> When the arm platform supports SVE, advertise the feature by a new
> flag for the arch_capabilities in struct xen_sysctl_physinfo and add
> a new field "arm_sve_vl_bits" where on arm there can be stored the
> maximum SVE vector length in bits.
> 
> Update the padding.
> 
> Bump XEN_SYSCTL_INTERFACE_VERSION for the changes.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> Changes from RFC:
>  - new patch
> ---
> Here I need an opinion from arm and x86 maintainer, I see there is no arch
> specific structure in struct xen_sysctl_physinfo, hw_cap is used only by x86
> and now arch_capabilities and the new arm_sve_vl_bits will be used only by 
> arm.
> So how should we proceed here? Shall we create a struct arch for each
> architecture and for example move arch_capabilities inside it (renaming to
> capabilities) and every arch specific field as well?

Counter question: Why don't you use (part of) arch_capabilities (and not
just a single bit)? It looks to be entirely unused at present. Vector
length being zero would sufficiently indicate absence of the feature
without a separate boolean.


> (is hw_cap only for x86?)

I suppose it is, but I also expect it would better go away than be moved.
It doesn't hold a complete set of information, and it has been superseded.

Question is (and I think I did raise this before, perhaps in different
context) whether Arm wouldn't want to follow x86 in how hardware as well
as hypervisor derived / used ones are exposed to the tool stack
(XEN_SYSCTL_get_cpu_featureset). I guess there's nothing really precluding
that data to consist of more than just boolean fields.

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -18,7 +18,7 @@
>  #include "domctl.h"
>  #include "physdev.h"
>  
> -#define XEN_SYSCTL_INTERFACE_VERSION 0x00000015
> +#define XEN_SYSCTL_INTERFACE_VERSION 0x00000016

Why? You ...

> @@ -104,7 +110,8 @@ struct xen_sysctl_physinfo {
>      uint32_t cpu_khz;
>      uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
>      uint32_t arch_capabilities;/* XEN_SYSCTL_PHYSCAP_{X86,ARM,...}_??? */
> -    uint32_t pad;
> +    uint16_t arm_sve_vl_bits;
> +    uint16_t pad;
>      uint64_aligned_t total_pages;
>      uint64_aligned_t free_pages;
>      uint64_aligned_t scrub_pages;

... add no new fields, and the only producer of the data zero-fills the
struct first thing.

Jan



 


Rackspace

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