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 fae249d234 "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>
This commit is contained in:
Andrew Cooper committed 2020-01-10 17:45:30 +00:00
1 parent faa85d4fb3
commit af01d330cb
5 files changed
+3 -9

No files matched your search

+1 -1
View 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;
+1 -1
View 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;
/*
-3
View 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();
+1 -1
View 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)();
-3
View 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[];
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.