From: Andrew Cooper Date: Sat, 28 Dec 2019 15:01:00 +0000 (+0000) Subject: x86/boot: Drop INVALID_VCPU X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~905 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=af01d330cbb350a7f8cd11189c49cd7904d2a9ff;p=xen.git x86/boot: Drop INVALID_VCPU 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 Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 29f3f9c5e3..198595ff97 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -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; diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 4a07cfb18e..dd32712d2f 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -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; /* diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 62adc9e2a8..1b6ca4a47d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -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(); diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 3e828fe204..5020c4ad49 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -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)(); diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 861d46d6ac..28257bc5c8 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -4,9 +4,6 @@ #include #include -/* 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[];