Skip to contentSkip to conversation

ARM/boot: Don't poison 'current' during early boot

PATCH In review Andrew Cooper 2 participants 2 messages Jan 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM/boot: Don't poison 'current' during early boot

This logic was inherited from x86 (which was updated several times since). Unlike x86 (at the time) however, while NULL isn't mapped in ARM, 0xfffff000 is, making this actively dangerous.

Drop the logic entirely, and leave 'current' as NULL during early boot.

---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>

---
 xen/arch/arm/setup.c | 3 ---
 1 file changed, 3 deletions(-)
xen/arch/arm/setup.c +0 -3
index 3c899cd4a0..9dd3738d44 100644
@@ -798,9 +798,6 @@ void __init start_xen(unsigned long boot_phys_offset,
     percpu_init_areas();
     set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    set_current((struct vcpu *)0xfffff000); /* debug sanity */
-    idle_vcpu[0] = current;
-
     setup_virtual_regions(NULL, NULL);
     /* Initialize traps early allow us to get backtrace when an error occurred */
     init_traps();
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Andrew Cooper

This logic was inherited from x86 (which was updated several times since). Unlike x86 (at the time) however, while NULL isn't mapped in ARM, 0xfffff000 is, making this actively dangerous.

Drop the logic entirely, and leave 'current' as NULL during early boot.

Thank you for the cleanup!

Cheers,

Quoted 23 lines

---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>

---
  xen/arch/arm/setup.c | 3 ---
  1 file changed, 3 deletions(-)
xen/arch/arm/setup.c +0 -3
index 3c899cd4a0..9dd3738d44 100644
@@ -798,9 +798,6 @@ void __init start_xen(unsigned long boot_phys_offset,
      percpu_init_areas();
      set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    set_current((struct vcpu *)0xfffff000); /* debug sanity */
-    idle_vcpu[0] = current;
-
      setup_virtual_regions(NULL, NULL);
      /* Initialize traps early allow us to get backtrace when an error occurred */
      init_traps();
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel