[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: Mon, 10 Mar 2025 10:08:28 -0400
  • 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=rdEKG3qGFChkZMm+IJrY7AJtUUvY1IHQN3x+lbK+tjQ=; b=xph24kukvoEt1xVlGMi/mJEwzM/1uV4USQUQfLeWC0PDxZm5uTI6k7oUFlkLPEhjRqYZOJo82lZJSp4Zx3jX0iZXs3YYT3dIHrHDI0V+VItzU/h4z4NEwmMIP0eRacZb/sOp6tfaSbd5ReusC6rYyUIaDQR6xJ/y5EwT2skS+hQtFIJKUd0eTNS0xtS6t+9QNpjQM51TkmZZefutEmgeJ8CrFVvN1Owvx9K5f7zMdww6gfNqRtT8ySZgaYvymCHKSzHoMBIxGMz+hdWl+0hBl/XVeS9xesxj7aZ4N7AuAsCiDeFFqe+z1Hg4zAnRR5/dlW8VtQ67Wsqhj8GLRvfjuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O9Y7Yr0UC52vmSF1VzpdUWSjsVUS4ZnTdYt4bn/UkgwDIM/mcFQ1kXopTAMsXSSV43vFlTJqK8SxxjnpYxqb+Dst/ovWr0yqwPaJZAfB1J3wfr93JX9eXc6f9XhBU1PXk9TCxwCAbfKQpOmX2WxWEPPxeLWxKf7rYNGLe6tyHFVOnyUcJW2+PiIFANeZqArFfYH2Fc1YLIj+dhCvyCRhbwiN3cM0lNZcEjWEt0fAJTYqSTsFrDWIyLfhOp2rbnFP3xPQ6lmzYs1kZL6D69aQ2SYnmkmqH2rC37iyTB4tVvMKrgVgSuhTVIfM2gRFIaRNFhe2DCmin5htyxWojQ8cLQ==
  • 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: Mon, 10 Mar 2025 14:08:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-03-07 11:26, Andrew Cooper wrote:
On 07/03/2025 2:55 pm, Jason Andryuk wrote:
On 2025-03-06 17:39, Andrew Cooper wrote:
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.

Multiple domains can pass in CDF_hardware and latest-takes-precedence
for hardware_domain.

That only exists because late_hwdom is a bodge and relies on stealing.

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

Another option might be to strip out late_hwdom, and do this more
nicely.  I have little confidence that it works, seeing as it only gets
touched to fix build issues.

I don't want late_hwdom to hold up ARM side changes. I'm not using late_hwdom, so I'd be fine removing it. But until Hyperlaunch is merged, removal seems a little premature.

Either way, I think the common code wants to be ultimately responsible
for refusing to create multiple hardware domains.


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.

Would just an addition check be okay? Only allow the late_hwdom behaviour for dom0.

--- i/xen/common/domain.c
+++ w/xen/common/domain.c
@@ -704,6 +704,10 @@ struct domain *domain_create(domid_t domid,
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 -EINVAL;
+
         old_hwdom = hardware_domain;
         hardware_domain = d;
     }

CDF_hardware is a Xen-internal flag, so it's not something the toolstack can pass in.

Regards,
Jason



 


Rackspace

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