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

Re: [PATCH 01/23] xen: introduce hardware domain create flag


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Fri, 7 Mar 2025 09:55:51 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com 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=PFaYEivUuXyQSV+HkU/ttBd/P0Jev+Ka6o6RT4UJfI4=; b=WyCaL8xsum/EXQoKXgnMHtyHwhtlv6NGRTBBZ8Lb0EATL4EDTg6BGuUnd+P2KIia0YzpbMrg9YWY6xD1T5JbHN10xfxgVuesVUN1wKgv/oDW14yraTD0EABojRssk6Kv+jHF189pPjiPFq3sVpVIbY7IXiHgi11CTH4PUGCSjcBdUuQbnVoLrb0/6wXx1VoxYUHeU4ReBiiF/JMsxr7usTTZ8zFl7Nh47M8WgwRBBqa9TCbpaUN3wglrhOaK7GPGt+2rvML55i/y/O+ItJoj+E0YQJ8qxE/kCb1tmfidK+9XT3QrkSViyTAjw66rjlHeDLABilV3KOa2Ka7Pqw7Ybg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hYZRdj3g4SCm1r9h0MIRZhbXPPpcjDvmaTcR5oBxzh+V9Uxd4UVoTiGqTtjyjg1V9zxb2bkaQE9IneylU8oBjwinFKzP/xrL+7i5wjgxLaiYT4W8Gf1p/XbEL0yLIx+bOYhuORDlfeUXm64ihTKe1XHMW1V2BoF3menrc2D4EHJRYwWyFVD0VpQ7uraJ4OEWew2UlRk/ouyRi+cq0c+3OFeAXTlydj+Li9w8uOssJDZOYCcj2rpl0WkVj/zzRY6JPZA+lgFfM0XglZu/wpstd9K8simxygDr/h7CcG+Fz0+dtH5Z/GTFm1S2Vu0fSc6+ohgZXx9MamLYVI8EJYbNJw==
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 07 Mar 2025 14:56:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-03-06 17:39, Andrew Cooper wrote:
On 06/03/2025 10:03 pm, Jason Andryuk wrote:
From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>

Add and use a new internal create domain flag to specify the hardware
domain.  This removes the hardcoding of domid 0 as the hardware domain.

This allows more flexibility with domain creation.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>

I definitely like the removal of the late_hwdom bodges.

However, there are several things to be aware of here.

First, CDF_privileged probably wants renaming to CDF_control, now that
CDF_hardware is being split out.

Second, you've created a case where we can make multiple hardware
domains, yet it is very much a singleton object from Xen's point of view.

hardware_domain still remains the check for is_hardware_domain(), so it's still a singleton.

A later ARM patch for the dom0less code adds a panic() if the device tree defines a second hardware domains.

This might be ok it's addressed by later in the series.  One especially
nasty bit of late_hwdom was how dom0 started as both, then the
late_hwdom stole dom0's hw-ness.  I expect untangling this is more
complicated than a single patch.

I didn't address the late_hwdom path. I don't think I broken anything. But this hardware stealing is why I added the 2nd hwdom check in the ARM code.

But, by the end, I think we do need to have reasonable confidence that
only a single domain can be constructed as the hardware domain.

What do you think about multiple control/privileged domains?

diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3de5635291..b5e82578c3 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -50,6 +50,8 @@ void arch_get_domain_info(const struct domain *d,
  #else
  #define CDF_staticmem            0
  #endif
+/* Is this the hardware? */
+#define CDF_hardware             (1U << 3)

No, this one CDF flag isn't the hardware.  That would be the CPU we're
running on.

:)

-Jason



 


Rackspace

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