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

Re: [PATCH 2/2] x86: generalise vcpu0 creation for a domain


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 17 Jul 2025 18:09:02 -0400
  • 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=Z2mlEzrKF9Eqo/3p6UjKgH8ItSfhA0VzQRU99+DoLhQ=; b=aOubvMST+VF4rStfaLUhL8KOPkXs0LjFUBTtVLfsAHTvGu8uDiNvi6E+Hy3Ai8Z0Yt7MN5rM2re6CcxZM42VkkHFuHb512m3nGVtfDgQcnajD83pnXyqhzUmz/CfLOvpHBonvdA1e5p5+KlfeHN/w6jqq5EFJQKUcMNi5Gcqo0xIohjhUYLEkG1dBlQfW4RDEGLITPMh8etTX5g1Ac5RGQPvX07yJnEyXDnJtV0w/qcCzxgrz770hOSvMdRTp9Y//HB8Xn/J19moyxCXFDIWM0Ka4Bpg4Ppe9igP+loX9nhlf1G6lF2FYf8Db1vh0JBzkbt+Hvax9WKArET3SahCAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CnuzmkK8dNWKk3J6vDnHMEVmL6WWhrL7a6tYNSfXhQgOCRs2PWDrhdVfdo+MVdlQ3bPzy65bJeZOKxg2Va5TWIThZF0SsUY0RGge/T9a1EXAAEVWfRgl4zvl7aJw/3/2P4tD2g5bQG35mBr9XOYkT+y9kq8FyDwhIf/gBpqrCEKOEOyt0zuxkyzrW6JbX05aXe2m37QPcjH9+LhgfvJiosciJezjiL9Vq+gD4/I2a3gjL3MWBPSkncuO5ui8S+/MTmlYu4iK++mRvhy//1ic+w6//7vWtaxKQMnR0JeJ501Hje++Cb7YiWMJeZIkT1Uf/XH6y11LQufgLIVrmNTmaQ==
  • Cc: 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>, "Daniel P . Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 17 Jul 2025 22:09:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-07-17 13:51, Alejandro Vallejo wrote:
Make alloc_dom0_vcpu0() viable as a general vcpu0 allocator. Keep
behaviour on any hwdom/ctldom identical to that dom0 used to have, and
make non-dom0 have auto node affinity.

Rename the function to alloc_dom_vcpu0() to reflect this change in
scope, and move the prototype to asm/domain.h from xen/domain.h as it's
only used in x86.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
  xen/arch/x86/dom0_build.c             | 12 ++++++++----
  xen/arch/x86/include/asm/dom0_build.h |  5 +++++
  xen/arch/x86/setup.c                  |  6 ++++--
  xen/include/xen/domain.h              |  1 -
  4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 0b467fd4a4..dfae7f888f 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -254,12 +254,16 @@ unsigned int __init dom0_max_vcpus(void)
      return max_vcpus;
  }
-struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
+struct vcpu *__init alloc_dom_vcpu0(struct domain *d)
  {
-    dom0->node_affinity = dom0_nodes;
-    dom0->auto_node_affinity = !dom0_nr_pxms;
+    d->auto_node_affinity = true;
+    if ( is_hardware_domain(d) || is_control_domain(d) )

Do we want dom0 options to apply to:
hardware or control
just hardware
just dom0 (hardware && control && xenstore)

?

I think "just dom0" may make the most sense. My next preference is just hardware. Control I think should be mostly a domU except for having is_privileged = true;

The rest of the patch looks good.

Regards,
Jason



 


Rackspace

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