Skip to contentSkip to conversation

x86/boot: Setup correctly fs segment for bogus_real_magic

PATCH Superseded Frediano Ziglio 2 participants 2 messages Nov 11, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/boot: Setup correctly fs segment for bogus_real_magic

bogus_real_magic code uses fs segment so it should be initialised.

Fixes d8c8fef09054 ("Provide basic Xen PM infrastructure")

---
Changes since v1:
- added "Fixes" comment;
- add initialisation, do not remove old one.

---
 xen/arch/x86/boot/wakeup.S | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/x86/boot/wakeup.S +2 -0
index 08447e1934..99ac8594b8 100644
@@ -20,6 +20,8 @@ ENTRY(wakeup_start)
         movw    %ax, %ds
         movw    %ax, %ss        # A stack required for BIOS call
         movw    $wakesym(wakeup_stack), %sp
+        movw    $0xb800, %ax
+        movw    %ax, %fs
 
         pushl   $0              # Kill dangerous flag early
         popfl
Signature · 1 line
2.34.1
#1 lore raw

xen/arch/x86/boot/wakeup.S ENTRY(wakeup_start) · line 27

Quoted 11 lines · Frediano Ziglio
xen/arch/x86/boot/wakeup.S +2 -0
@@ -20,6 +20,8 @@ ENTRY(wakeup_start)
         movw    %ax, %ds
         movw    %ax, %ss        # A stack required for BIOS call
         movw    $wakesym(wakeup_stack), %sp
+        movw    $0xb800, %ax
+        movw    %ax, %fs
 
         pushl   $0              # Kill dangerous flag early
         popfl

If put here, I think it needs to be accompanied by a comment, to avoid it (wrongly) being deemed redundant again. Personally I would prefer if it was put where it's needed, at bogus_real_magic itself (at which point no commentary would be needed).

Jan