From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
jason.andryuk@amd.com, stefano.stabellini@amd.com,
agarciav@amd.com, "Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Dario Faggioli" <dfaggioli@suse.com>,
"Juergen Gross" <jgross@suse.com>,
"George Dunlap" <gwd@xenproject.org>,
"Christopher Clark" <christopher.w.clark@gmail.com>
Subject: [RFCv2 15/38] x86/boot: move and rename sched_setup_dom0_vcpus
Date: Thu, 15 May 2025 09:17:21 -0400 [thread overview]
Message-ID: <20250515131744.3843-16-dpsmith@apertussolutions.com> (raw)
In-Reply-To: <20250515131744.3843-1-dpsmith@apertussolutions.com>
Relocated the function sched_setup_dom0_vcpus(), which was protected by an
ifdef CONFIG_X86, from common/sched to the hyperlaunch domain builder. Rename
it to alloc_dom_vcpus() to better reflect the purpose of the function.
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
xen/arch/x86/domain-builder/domain.c | 10 ++++++++++
xen/arch/x86/hvm/dom0_build.c | 3 ++-
xen/arch/x86/pv/dom0_build.c | 3 ++-
xen/common/sched/core.c | 12 ------------
xen/include/xen/domain-builder.h | 2 ++
xen/include/xen/sched.h | 1 -
6 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/xen/arch/x86/domain-builder/domain.c b/xen/arch/x86/domain-builder/domain.c
index 258f777cd9ee..d934b240229f 100644
--- a/xen/arch/x86/domain-builder/domain.c
+++ b/xen/arch/x86/domain-builder/domain.c
@@ -45,6 +45,16 @@ struct vcpu *__init domain_vcpu0_create(struct boot_domain *bd)
return vcpu_create(bd->d, 0);
}
+void __init domain_vcpus_create(struct domain *d)
+{
+ unsigned int i;
+
+ for ( i = 1; i < d->max_vcpus; i++ )
+ vcpu_create(d, i);
+
+ domain_update_node_affinity(d);
+}
+
unsigned long __init dom_paging_pages(
const struct boot_domain *bd, unsigned long nr_pages)
{
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 6990c1d3a882..a900138b0311 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -8,6 +8,7 @@
*/
#include <xen/acpi.h>
+#include <xen/domain-builder.h>
#include <xen/init.h>
#include <xen/libelf.h>
#include <xen/multiboot.h>
@@ -833,7 +834,7 @@ static int __init pvh_setup_cpus(struct domain *d, paddr_t entry,
.cpu_regs.x86_32.tr_ar = 0x8b,
};
- sched_setup_dom0_vcpus(d);
+ domain_vcpus_create(d);
rc = arch_set_info_hvm_guest(v, &cpu_ctx);
if ( rc )
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index ad4d1cc3520c..195c0902d5a1 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -5,6 +5,7 @@
*/
#include <xen/domain.h>
+#include <xen/domain-builder.h>
#include <xen/domain_page.h>
#include <xen/init.h>
#include <xen/libelf.h>
@@ -827,7 +828,7 @@ static int __init dom0_construct(struct boot_domain *bd)
printk("Dom%u has maximum %u VCPUs\n", d->domain_id, d->max_vcpus);
- sched_setup_dom0_vcpus(d);
+ domain_vcpus_create(d);
d->arch.paging.mode = 0;
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 9043414290a8..d679d766a4b6 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3479,18 +3479,6 @@ void wait(void)
schedule();
}
-#ifdef CONFIG_X86
-void __init sched_setup_dom0_vcpus(struct domain *d)
-{
- unsigned int i;
-
- for ( i = 1; i < d->max_vcpus; i++ )
- vcpu_create(d, i);
-
- domain_update_node_affinity(d);
-}
-#endif
-
#ifdef CONFIG_COMPAT
#include "compat.c"
#endif
diff --git a/xen/include/xen/domain-builder.h b/xen/include/xen/domain-builder.h
index d3390d368afb..79e4c50ddf85 100644
--- a/xen/include/xen/domain-builder.h
+++ b/xen/include/xen/domain-builder.h
@@ -6,6 +6,7 @@
struct boot_info;
struct boot_domain;
+struct domain;
/* Return status of builder_init(). Shows which boot mechanism was detected */
enum fdt_kind
@@ -37,5 +38,6 @@ int builder_get_cmdline(const struct boot_info *bi, int offset,
unsigned int dom_max_vcpus(struct boot_domain *bd);
struct vcpu *domain_vcpu0_create(struct boot_domain *bd);
+void domain_vcpus_create(struct domain *d);
#endif /* __XEN_DOMAIN_BUILDER_H__ */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 559d201e0c7e..4f184cd76206 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -1084,7 +1084,6 @@ static inline bool sched_has_urgent_vcpu(void)
}
void vcpu_set_periodic_timer(struct vcpu *v, s_time_t value);
-void sched_setup_dom0_vcpus(struct domain *d);
int vcpu_temporary_affinity(struct vcpu *v, unsigned int cpu, uint8_t reason);
int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity);
int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
--
2.30.2
next prev parent reply other threads:[~2025-05-15 13:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 13:17 [RFCv2 00/38] Hyperlaunch domain builder Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 01/38] maintainers: add new section for hyperlaunch Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 02/38] x86/hyperlaunch: correct the naming of domain ramdisk field Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 03/38] x86/hyperlaunch: convert max vcpu determination to domain builder Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 04/38] x86/hyperlaunch: convert vcpu0 creation " Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 05/38] x86/hyperlaunch: move dom0 cpuid policy behind capability check Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 06/38] x86/hyperlaunch: introduce pvh domain builder Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 07/38] x86/hyperlaunch: move initial hwdom setup to dom_construct_pvh Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 08/38] x86/boot: convert dom0 page calculation to use boot domain Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 09/38] x86/boot: refactor dom0 page calculation Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 10/38] x86/boot: generalize paging pages calculation Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 11/38] x86/boot: generalize compute number of domain pages Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 12/38] x86/hyperlaunch: move page computation to domain builder Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 13/38] x86/hyperlaunch: move pvh p2m init " Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 14/38] x86/hyperlaunch: move iommu " Daniel P. Smith
2025-05-15 13:17 ` Daniel P. Smith [this message]
2025-05-15 13:17 ` [RFCv2 16/38] x86/hyperlaunch: move pvh_setup_cpus " Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 17/38] x86/boot: rename pvh acpi setup function Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 18/38] x86/hyperlaunch: add domu memory map construction Daniel P. Smith
2025-05-15 13:17 ` [RFCv2 19/38] x86/hyperlaunch: move populating p2m under domain builder Daniel P. Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250515131744.3843-16-dpsmith@apertussolutions.com \
--to=dpsmith@apertussolutions.com \
--cc=agarciav@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=christopher.w.clark@gmail.com \
--cc=dfaggioli@suse.com \
--cc=gwd@xenproject.org \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=stefano.stabellini@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.