]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
x86/domain: Implement arch_init_idle_domain()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jul 2024 20:12:31 +0000 (21:12 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jul 2024 10:14:50 +0000 (11:14 +0100)
The idle domain needs d->arch.ctxt_switch initialised on x86.  Implement the
new arch_init_idle_domain() in order to do this.

Intentionally remove cpu_policy's initialisation to ZERO_BLOCK_PTR.  It has
never tripped since it's introduction, and is weird to have in isolation
without a similar approach on other pointers.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/include/asm/domain.h

index ccadfe0c9e70dfa5c8ec34873f4743646768e2e6..a6cb7a98ed1713c3f74066128b34ab4da42966c8 100644 (file)
@@ -768,6 +768,17 @@ static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
     return true;
 }
 
+void __init arch_init_idle_domain(struct domain *d)
+{
+    static const struct arch_csw idle_csw = {
+        .from = paravirt_ctxt_switch_from,
+        .to   = paravirt_ctxt_switch_to,
+        .tail = idle_loop,
+    };
+
+    d->arch.ctxt_switch = &idle_csw;
+}
+
 int arch_domain_create(struct domain *d,
                        struct xen_domctl_createdomain *config,
                        unsigned int flags)
@@ -783,16 +794,6 @@ int arch_domain_create(struct domain *d,
     /* Minimal initialisation for the idle domain. */
     if ( unlikely(is_idle_domain(d)) )
     {
-        static const struct arch_csw idle_csw = {
-            .from = paravirt_ctxt_switch_from,
-            .to   = paravirt_ctxt_switch_to,
-            .tail = idle_loop,
-        };
-
-        d->arch.ctxt_switch = &idle_csw;
-
-        d->arch.cpu_policy = ZERO_BLOCK_PTR; /* Catch stray misuses. */
-
         return 0;
     }
 
index f5daeb182baaa6426aad94faa2f0bcfb25243648..bca3258d69ac5fde4d0325d08f3f1f794cd566a8 100644 (file)
@@ -779,6 +779,9 @@ struct arch_vcpu_io {
 /* Maxphysaddr supportable by the paging infrastructure. */
 unsigned int domain_max_paddr_bits(const struct domain *d);
 
+#define arch_init_idle_domain arch_init_idle_domain
+void arch_init_idle_domain(struct domain *d);
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*