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

Re: [PATCH v5 12/12] x86/hyperlaunch: add capabilities to boot domain


  • To: Alejandro Vallejo <agarciav@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Fri, 25 Apr 2025 16:32:07 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none 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=EF19AcWwzX4Mf+Mvfee+VJ3jfJzBFAX96NRbqe/Paak=; b=tmUNIEyHvBba8nNMdCKiOX8EVeHSg1ndBx7dERhfN6kdxoLcyh3lwe/HpFmw82KEGqUkc2pAix5Flz6v27G+s2rjwuTtcA7w7MdGxxh3ttQP3RzW5xy6fDp7+tZYRlnOcCTYIotTk5ck684htoymGW3imAP2joyoOjNPCM7elsB24g8JVYcNU30oknfPsfNEdp2qMjpHdnVyYrrnL+nPbBQ9GOOPHh06uL6a4iaRvu7ApBzIca5N06wdiJMFvtQGanviX3nwbiqf94xtVp0zX2hefntWp+hkqAPRi6Sy0Y1ClBQndO3wU8XanC4Ioi1+gdmr3aQiymmEoL9WlSiD0Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b6QFvJC+/8KisYvuyKkj6Lk+Xl7PZfKEERZoeShQpBmAI1tIFPbcybIqgDA8Wx8Pf1zznQU/cB7uzIXqUDIcRA83PdtrbV6gycGUDYfm47cbmAUyo+SVybB0GoaQNKTsz0kTA4Q2YgOgT+hw4RJweY+THboID331m32NXp5VGZdovX+0KSR7isexJoTbdO+qQQf9A065WeAF6hrv+Z/gYgxsvMG0JQNN7YkImt1Z84F0s7P4uIhHxPxo/HfpCvkuvbxUK+ny+nBM5YeqcZ6xURf2pVKyskRmJnRUBDLvqC7FA4osvlkmlAjGehlW7ZWO67P174d+rmzbZJ7/+4oJ+A==
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Jason Andryuk" <jason.andryuk@xxxxxxx>, Denis Mukhin <dmukhin@xxxxxxxx>
  • Delivery-date: Fri, 25 Apr 2025 15:32:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu Apr 24, 2025 at 5:10 PM BST, Alejandro Vallejo wrote:
> From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>
> Introduce the ability to assign capabilities to a domain via its definition in
> device tree. The first capability enabled to select is the control domain
> capability. The capability property is a bitfield in both the device tree and
> `struct boot_domain`.
>
> Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
> Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
> Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>
> ---
> v5:
>   * Removed BUILD_CAPS, as DOMAIN_CAPS is now in public/bootfdt.h
>   * Assigned DOMAIN_CAPS_MASK to dom0, rather than only BUILD_CAPS_CONTROL.
>     * So it also gets hardware+xenstore.
> ---
>  xen/arch/x86/include/asm/boot-domain.h |  3 +++
>  xen/arch/x86/setup.c                   |  5 ++++-
>  xen/common/domain-builder/fdt.c        | 23 +++++++++++++++++++++++
>  3 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/include/asm/boot-domain.h 
> b/xen/arch/x86/include/asm/boot-domain.h
> index 969c02a6ea..cb5351241a 100644
> --- a/xen/arch/x86/include/asm/boot-domain.h
> +++ b/xen/arch/x86/include/asm/boot-domain.h
> @@ -13,6 +13,9 @@
>  struct boot_domain {
>      domid_t domid;
>  
> +    /* Bitmap. See DOMAIN_CAPS_MASK for a list */
> +    uint32_t capabilities;
> +
>                                            /* On     | Off    */
>  #define BUILD_MODE_PARAVIRT      (1 << 0) /* PV     | PVH/HVM */
>  #define BUILD_MODE_ENABLE_DM     (1 << 1) /* HVM    | PVH     */
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index d4f839146f..960e43c785 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -61,6 +61,7 @@
>  
>  #include <xsm/xsm.h>
>  
> +#include <public/bootfdt.h>
>  #include <public/version.h>
>  #ifdef CONFIG_COMPAT
>  #include <compat/platform.h>
> @@ -1050,7 +1051,8 @@ static struct domain *__init create_dom0(struct 
> boot_info *bi)
>          /* Create initial domain.  Not d0 for pvshim. */
>          bd->domid = get_initial_domain_id();

Self commenting that I missed XEN_DOMCTL_CDF_iommu being passed if
iommu_enabled is set (out of context, a few lines above). That should be
gated on DOMAIN_CAPS_HARDWARE being set too. Just spotted it when
rebasing the RFC series from Daniel.

Cheers,
Alejandro



 


Rackspace

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