[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/boot: Drop all use of lmsw

On 19.08.2019 15:42, Andrew Cooper wrote:
lmsw is an obsolete relic of the 286 processor - so much so that it even lacks
intercept assistance on AMD processors.

Use a plain mov to %cr0 which is easier to follow, certainly faster to
virtualise on AMD hardware, and almost certainly a faster microcode path in
real hardware.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

with one further suggestion:

--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -54,9 +54,10 @@ GLOBAL(trampoline_realmode_entry)
         lidt    bootsym(idt_48)
         lgdt    bootsym(gdt_48)
         mov     $1,%bl                    # EBX != 0 indicates we are an AP
-        xor     %ax, %ax
-        inc     %ax
-        lmsw    %ax                       # CR0.PE = 1 (enter protected mode)
+        mov     $X86_CR0_PE, %eax
+        mov     %eax, %cr0

Why don't you use %ebx here, allowing the move to %bl to be
dropped at the same time?


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.