x86/boot: Drop INVALID_VCPU
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 28 Dec 2019 15:01:00 +0000 (15:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 10 Jan 2020 17:45:30 +0000 (17:45 +0000)
Now that NULL will fault at boot, there is no need for a special constant to
signify "current not set up yet".

Since c/s fae249d23413 "x86/boot: Rationalise stack handling during early
boot", the BSP cpu_info block is now consistently zero, so drop the adjacent
re-zeroing.

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

index 29f3f9c5e319c9d476b8faee0abe8acddd51e352..198595ff97d1a866195093d7b01faac403076163 100644 (file)
@@ -260,7 +260,7 @@ static int mca_init_global(uint32_t flags, struct mcinfo_global *mig)
                         &mig->mc_coreid, &mig->mc_core_threadid,
                         &mig->mc_apicid, NULL, NULL, NULL);
 
-    if ( curr != INVALID_VCPU )
+    if ( curr )
     {
         mig->mc_domid = curr->domain->domain_id;
         mig->mc_vcpuid = curr->vcpu_id;
index 4a07cfb18e9478afa4defd89d2d0ee24b371e827..dd32712d2fbeaa3fdc073b3a19a065d86dbf6c1d 100644 (file)
@@ -29,7 +29,7 @@ static inline struct vcpu *mapcache_current_vcpu(void)
      * When current isn't properly set up yet, this is equivalent to
      * running in an idle vCPU (callers must check for NULL).
      */
-    if ( v == INVALID_VCPU )
+    if ( !v )
         return NULL;
 
     /*
index 62adc9e2a8341d182a569249f9511cb8115ae23a..1b6ca4a47db13b57b73c9eac1bc2ed02e95880b1 100644 (file)
@@ -707,9 +707,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     /* Critical region without IDT or TSS.  Any fault is deadly! */
 
-    set_processor_id(0);
-    set_current(INVALID_VCPU); /* debug sanity. */
-    idle_vcpu[0] = current;
     init_shadow_spec_ctrl_state();
 
     percpu_init_areas();
index 3e828fe2040e21ceb8d1ad147947a8687095070b..5020c4ad49b8d5d7ae8dd3eef75890e7183040ce 100644 (file)
@@ -392,7 +392,7 @@ void tboot_shutdown(uint32_t shutdown_type)
      * During early boot, we can be called by panic before idle_vcpu[0] is
      * setup, but in that case we don't need to change page tables.
      */
-    if ( idle_vcpu[0] != INVALID_VCPU )
+    if ( idle_vcpu[0] )
         write_ptbase(idle_vcpu[0]);
 
     ((void(*)(void))(unsigned long)g_tboot_shared->shutdown_entry)();
index 861d46d6ac1e19ee64d5458624deed3640b50e16..28257bc5c8ad1938e81f4f163fc6712499f984ca 100644 (file)
@@ -4,9 +4,6 @@
 #include <xen/multiboot.h>
 #include <asm/numa.h>
 
-/* vCPU pointer used prior to there being a valid one around */
-#define INVALID_VCPU ((struct vcpu *)0xccccccccccccc000UL)
-
 extern const char __2M_text_start[], __2M_text_end[];
 extern const char __2M_rodata_start[], __2M_rodata_end[];
 extern char __2M_init_start[], __2M_init_end[];