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

Re: [PATCH v4 3/6] tools/arm: choose GIC version explicitly instead of relying on GIC_NATIVE


  • To: Julian Vetter <julian.vetter@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Wed, 26 Aug 2026 13:50:02 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 149.199.90.133) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=DeAf8T8FMc5gDq2Yy7gMjj4jkKJy6FbTP5bBEtXmlWY=; b=P44Y+rsydO5+01gc5Fy6ArCfa4cucDBWcIsQSTevSJJtVKTTLFZ6eQW5BBBBWDQW6EDxqYpg/7426i/moLQZgInXdrev25zQG5tDQeVYq2Pe7V9JGV+EVv3iluxUYnXw6BL+zP76VBb77LJVlWwh5iBNnmQZ7ProWrWBIrDe8EO2HT8ETEJ7vn6EmoNmiGgKhI1wopdUJvpaaMAf50qgE6nwRZAaHcb2zN0hjTiMv1Xz0T1+Bq5bSrSvKJmKFwQYipsoa6beYQ2hNSI2wYBCzTbxvrIsST+rhGB7vK6IV2pKpSEhD64rSPb+N5wEYGezZPOFJngAds6ktkJ72lzWmg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mNpeF+1UZ+MkdshT+Gl3+QQeY+rjpiGAKu7OF0uv0QoKTyOLTOizgLnVWKjOJgvpqnECPhbe+6ydDGwg19QIB9aAc7uaNAzi/G1lrxlyCoY+WaedFgYTDQ263ZoC5yWxmHJiOLI/ug3mwGzmYy0EKB00uKb/wYb93qke5FxRfgQHhG8skljB+htAnd7QtRl/lQ3RQz7zB82UlBp72SMv89bTvXpLw+xYgvO8J3baDV2yqmbqGvLNz/31DxqJI6NdRMZ5O8uJeOLfCh/Cq/zDYol53GLcis4qcseGC7L6aKmRsbdQWYygFQo97/EY8qoxzQeEOdrSCQhcyMXONQUt/Q==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>, Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Wed, 26 Aug 2026 11:50:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 20-Aug-26 14:40, Julian Vetter wrote:
> XEN_DOMCTL_CONFIG_GIC_NATIVE lets the toolstack ask Xen to silently
> resolve the domain's GIC version to whatever the host hardware has. Xen
> then writes the resolved value back into the same in/out
> xen_arch_domainconfig the toolstack used as input, which is the kind of
> API abuse we're trying to get rid of. The struct passed to createdomain
> should only be an input parameter.
> 
> Move the "pick the best available GIC version" decision to the
> toolstack, using the XEN_SYSCTL_PHYSCAP_ARM_GIC_V2/V3 capability bits
> already exposed via XEN_SYSCTL_physinfo:
> 
>  * libxl__arch_domain_build_info_setdefault() resolves
>    LIBXL_GIC_VERSION_DEFAULT to v3 if available, else v2, else fails,
`LIBXL_GIC_VERSION_DEFAULT` should be renamed to `LIBXL_GIC_VERSION_NONE` to
denote that the user did not set any particular version. With your change there
is no default and `libxl__arch_domain_build_info_setdefault()` resolves it
before anything else can see it.

>    before the config is built.
>  * The Python xc.domain_create() binding does the same via a call to
>    xc_physinfo().
>  * libxl__arch_domain_prepare_config() therefore only ever sees a
>    concrete v2/v3 request and just validates it. The GIC_NATIVE case is
>    dropped since setdefault() always resolves it first.
> 
> This guarantees no toolstack path can still produce
> XEN_DOMCTL_CONFIG_GIC_NATIVE, in preparation for removing it from the
> Xen side and from the ABI entirely.
> 
> Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
> ---
> Changes in v4:
> - Fix a missing closing bracket in arch_capabilities_arm_has()
> ---
>  .../include/xen-tools/arm-arch-capabilities.h | 17 ++++++++++++++++
>  tools/libs/light/libxl_arm.c                  | 17 +++++++++++++---
>  tools/python/xen/lowlevel/xc/xc.c             | 20 ++++++++++++++++++-
You need to update the documentation (i.e. xl.cfg) too.

>  3 files changed, 50 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/include/xen-tools/arm-arch-capabilities.h 
> b/tools/include/xen-tools/arm-arch-capabilities.h
> index 4aa4c6c34a..ce1b3bdd71 100644
> --- a/tools/include/xen-tools/arm-arch-capabilities.h
> +++ b/tools/include/xen-tools/arm-arch-capabilities.h
> @@ -6,6 +6,7 @@
>  #ifndef ARM_ARCH_CAPABILITIES_H
>  #define ARM_ARCH_CAPABILITIES_H
>  
> +#include <stdbool.h>
>  #include <stdint.h>
>  #include <xen/sysctl.h>
>  
> @@ -25,4 +26,20 @@ unsigned int arch_capabilities_arm_sve(unsigned int 
> arch_capabilities)
>  #endif
>  }
>  
> +/*
> + * Generic test for any single-bit XEN_SYSCTL_PHYSCAP_ARM_* capability, e.g.
What makes the implementation single-bit?

Otherwise, LGTM.

~Michal




 


Rackspace

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