x86: simplify ljmp to 32-bit code
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 3 Dec 2019 05:28:58 +0000 (14:28 +0900)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 8 Dec 2019 11:10:21 +0000 (19:10 +0800)
You can directly specify the label as the operand for ljmp.

This commit saves 4-byte code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fixed the gas warning]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/start16.S

index bcabd76741eff6fcbd9737a05a374b75254c9416..54f4ff6662a8d8999311be3e7553882b1b245c2a 100644 (file)
@@ -44,10 +44,8 @@ data32 cs    lgdt    gdt_ptr
 ff:
 
        /* Finally restore BIST and jump to the 32-bit initialization code */
-       movw    $code32start, %ax
-       movw    %ax, %bp
        movl    %ecx, %eax
-data32 cs      ljmp    *(%bp)
+data32 cs      ljmp    *code32start
 
        /* 48-bit far pointer */
 code32start: