]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: Simplify BSS zeroing
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 8 Jan 2020 13:11:13 +0000 (13:11 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 8 Jan 2020 18:48:00 +0000 (18:48 +0000)
There is no need to load a non-flat %es to zero the BSS.  Use sym_esi()
instead, which is easier to follow, faster (avoids two segment loads) and
doesn't require use of the stack.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/head.S

index 8d0ffbd1b071d04543ec5dfa1569ee8713174cfd..c7308104614060d2fedd1d5d83e178223f06d143 100644 (file)
@@ -617,16 +617,12 @@ trampoline_setup:
         jnz     1f
 
         /* Initialize BSS (no nasty surprises!). */
-        mov     $sym_offs(__bss_start),%edi
-        mov     $sym_offs(__bss_end),%ecx
-        push    %fs
-        pop     %es
+        lea     sym_esi(__bss_start), %edi
+        lea     sym_esi(__bss_end), %ecx
         sub     %edi,%ecx
         xor     %eax,%eax
         shr     $2,%ecx
         rep stosl
-        push    %ds
-        pop     %es
 
 1:
         /* Interrogate CPU extended features via CPUID. */