From: H. Peter Anvin Date: Mon, 27 Apr 2009 20:48:24 +0000 (-0700) Subject: bcopyxx: align the relocated code to a 16-byte boundary X-Git-Tag: syslinux-3.80-pre2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=071394c8fe611d6c75338d80dfafc76264599096;p=platform%2Fupstream%2Fsyslinux.git bcopyxx: align the relocated code to a 16-byte boundary Align the relocated bcopyxx code to a 16-byte boundary. There are CPUs which have errata relating to GDTs which are not 16-byte aligned. Signed-off-by: H. Peter Anvin --- diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc index b237b00..06b03b2 100644 --- a/core/bcopyxx.inc +++ b/core/bcopyxx.inc @@ -205,7 +205,8 @@ pm_bcopy: ; pm_shuffle: mov ebx,edi ; EBX <- descriptor list - lea edx,[edi+ecx] ; EDX <- shuffler end location + lea edx,[edi+ecx+15] ; EDX <- where to relocate our code to + and edx,~15 ; Align 16 to benefit the GDT call pm_bcopy mov edi,edx mov esi,bcopyxx_start @@ -299,7 +300,8 @@ bcopyxx_len equ $-bcopyxx_start bcopyxx_dwords equ bcopyxx_len >> 2 bcopyxx_stack equ 128 ; We want this much stack -bcopyxx_safe equ bcopyxx_len + bcopyxx_stack + ; The +15 is for alignment +bcopyxx_safe equ bcopyxx_len + bcopyxx_stack + 15 ; ; Space for a dummy task state segment. It should never be actually