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

Re: [RFC 03/38] x86/hyperlaunch: convert max vcpu determination to domain builder


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 22 Apr 2025 16:36:18 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.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=8oXO5QoTi8r8Dw8E3bAp/gKVmnB2ON8qNU9lNTLxzRQ=; b=e8RWv3TWkuwmOhbHFBi4L6XhAF9Wqfd4Gr+jyKH2jZjOEv5ASfgKIJb8PxCYYKXZamSi9MhOtNuuxJSNfmmGhB037xPnNkbLjlZ2+pU+t49+P96XRq77BmOo5igIXwSJnaxO8Ixn2Bwbuhx4OA7jTKd0LsbjVCWrFUIQS0lvCp7UWugGYsM/D9rLCpcV766BM5BgyxMfzCzZPFfwkREg4Ij/ja3RtSSTFXHVTchNcel7hB6/w0LxCVdeLKPR1Qk6zEoX5uK10i//oN+yUhO1dtzzHOpo80S+c97OTAN6me8BFMJWzzq+Y6LWiKYZCulOBmwl8N2Q03yT6X71olB/wA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qHzXARSI4O/Vott8ctBucqHfvJJNzSXzhIwoU5vPWZWlo4/4iEiMqexxhUvbzu5H9FzjyuAi9MBrx3RnqPV6XfKq8lt4InAbY6Z4/k5+BF10gnbvlPpAMmFoqUlz9/Ua5n7Wmo1dbgct3/Dz4tl5nNGMyGMSn4sO3NecMs5BMbn1ewCyUnvKSoRHD/Q0KDjwv7mIo6Y1j6pOPEsiT3Hbb3pYk+OnyeUoklmg6WAjiF5ud+V/RzmlOXiZu1FXSl/NQA2JtAdV4ugZrSKedS2gsFbLAXTZVPLvCUMEdc09K9sWrwYNMi3qsFr95mdiqhVkQPs9lLIXo72HOqdNidu39g==
  • Cc: <stefano.stabellini@xxxxxxx>, <agarciav@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 22 Apr 2025 20:36:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-04-19 18:07, Daniel P. Smith wrote:
The domain configuration may request more vcpus than are present in the system.
For dom0, the function dom0_max_vcpus() was used to clamp down to physically
available vcpus. Here we are introducing a generalized version,
dom_max_vcpus(), that takes a boot domain and sets the max vcpus based on the
lesser of the requested max and the available vcpus.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---

diff --git a/xen/arch/x86/domain-builder/domain.c 
b/xen/arch/x86/domain-builder/domain.c
new file mode 100644
index 000000000000..f2277b9e3cf3
--- /dev/null
+++ b/xen/arch/x86/domain-builder/domain.c
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2024, Apertus Solutions, LLC
+ */
+
+#include <xen/cpumask.h>
+#include <xen/domain.h>
+#include <xen/init.h>
+#include <xen/sched.h>
+
+#include <asm/bootinfo.h>
+
+unsigned int __init dom_max_vcpus(struct boot_domain *bd)
+{
+    unsigned int limit = bd->mode & BUILD_MODE_PARAVIRT ?
+                                    MAX_VIRT_CPUS : HVM_MAX_VCPUS;
+
+    if ( bd->capabilities & BUILD_CAPS_CONTROL )

I added xen/include/public/bootfdt.h with DOMAIN_CAPS_CONTROL and the other capabilities to provide common values.

+        limit = dom0_max_vcpus();

dom0_max_vcpus() applies Xen's dom0_max_vcpus command line option. That is desirable for a traditional dom0. For a disaggregated, Hyperlaunch system, I'm not sure it's appropriate. Considering there can multiple control domains, it's more questionable.

Might it be better to only apply Xen "dom0" command line options to non-hyperlaunch dom0? Or a domain with all of BUILD_CAPS_CONTROL/HARDWARE/XENSTORE?

I guess it could stay as-is, but it seems unusual.

Regards,
Jason



 


Rackspace

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