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

Re: [PATCH v2 1/6] xen: introduce hardware domain create flag


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 1 Apr 2025 08:39:29 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.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=gl5YIREPVy4diKHm+UdWDNY2Fzpg+ZBzCB3gMcTj42A=; b=kh1HCqAGWRwsTLN+nxQ63InF7Awi7uTq8EKyIOjaotD97CIltxmj2w0FeviWSU5IVuzULo7x8CkkPH9TUbotG8L0f5DtZET8cdBGKKH5zyp3oGUlJweVcABlpC7yCTIaD5gomZymKjRA7TkA4ORWLTmoVggfl6GIQyNmtt8RznXWLYNqLOWfhChh+3tyo8YK3KqhZbwzjJ5zrW9yCdhKdGtILXtHq1vYD48/jSF4PD7LiW3CQdsTWwWojuCNVFjlcOFrRr/I1cOTvFzXXGBKlLOhC48HwrKWvYkHbFsPjnw4m8YOmMg6gLwiB/a1K+hNSnqml98LiepujnkdOt6gEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MIc0jFuX1sG8qthipMKzXGCNFEP9fEba+MY454aWT47DqJaNUlgGXlx8N/Bm2+rrd01sZp2sYoBufGBD0gx2oSc8WHzehw661niKFeJcTPx+37tYi5i6NrEARniYNANkYnE/Ram4+DDg7x4Urka5QjHekBD/5eMlkuuM1/1H9jmbQDCY8akyVizIUjhxeE0az4xPxSM1leMXNWRKegnfETtdYwBxO+w68rEZI1DW8/5qBX4CFNlvtkJNpQRqzw4YzwsVUBHNKepu61B/pR35KTMPsEcQ+g/ICI3oq3nxfPj2UqRiCAOOzDc+56Kd1ZvdtOC+LRCgBg9Da4Mmn1PUgg==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Apr 2025 12:39:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-04-01 08:00, Jan Beulich wrote:
On 31.03.2025 23:43, Jason Andryuk wrote:
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -820,11 +820,15 @@ struct domain *domain_create(domid_t domid,
      d->is_privileged = flags & CDF_privileged;
/* Sort out our idea of is_hardware_domain(). */
-    if ( domid == 0 || domid == hardware_domid )
+    if ( (flags & CDF_hardware) || domid == hardware_domid )

Since it's || here ...

      {
          if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED )
              panic("The value of hardware_dom must be a valid domain ID\n");
+ /* late_hwdom is only allowed for dom0. */
+        if ( hardware_domain && hardware_domain->domain_id )
+            return ERR_PTR(-EINVAL);
+
          old_hwdom = hardware_domain;
          hardware_domain = d;
      }

... doesn't this code then also need to set CDF_hardware if it's unset
in the function argument?

I don't think it matters today - later construction depends on the value of hardware_domain. Which is also used for the check underlying is_hardware_domain().

But I agree that it makes sense to set it here in case the use of CDF_hardware expands in the future.

Then:
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks,
Jason



 


Rackspace

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