diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-25 07:10:06 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-25 08:20:46 -0400 |
commit | ded410576a6ee8ca021575cd7d9309b2a819878a (patch) | |
tree | c1d6b157fa5cd04def57daeb3908c94f2d4975e5 | |
parent | d589407ff95f6fc121f167c6fddb851934b15697 (diff) | |
download | kvm-unit-tests-ded410576a6ee8ca021575cd7d9309b2a819878a.tar.gz |
x86: setup segment registers before percpu areas
The base of the percpu area is stored in the %gs base, and writing
to %gs destroys it. Move setup_segments earlier, before the %gs
base is written, and keep setup_percpu_area close so that the base
is updated close to the selector.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | x86/cstart.S | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/x86/cstart.S b/x86/cstart.S index 5288252..409cb00 100644 --- a/x86/cstart.S +++ b/x86/cstart.S @@ -109,7 +109,11 @@ MSR_GS_BASE = 0xc0000101 .globl start start: + lgdtl gdt32_descr + setup_segments mov $stacktop, %esp + setup_percpu_area + push %ebx call setup_multiboot addl $4, %esp @@ -117,14 +121,10 @@ start: mov mb_cmdline(%ebx), %eax mov %eax, __args call __setup_args - setup_percpu_area call prepare_32 jmpl $8, $start32 prepare_32: - lgdtl gdt32_descr - setup_segments - mov %cr4, %eax bts $4, %eax // pse mov %eax, %cr4 |