]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Reload gs register in baremetal-private adjustgs()
authorAntti Kantee <pooka@iki.fi>
Tue, 5 May 2015 14:01:44 +0000 (14:01 +0000)
committerAntti Kantee <pooka@iki.fi>
Tue, 5 May 2015 14:01:44 +0000 (14:01 +0000)
Xen will require using the update_descriptor() hypercall.

lib/libbmk_core/arch/i386/cpu_sched_switch.S
platform/baremetal/arch/i386/locore32.S
platform/baremetal/arch/i386/machdep.c

index cc9ec7d34c90345a91b5cb138a436e762f889542..810b4fc7948e2804f7c3d1fa451831c04e0293f5 100644 (file)
@@ -51,10 +51,6 @@ ENTRY(bmk__cpu_switch)
        movl 4(%esp), %ecx              /* prev */
        movl 8(%esp), %edx              /* next */
 
-       /* reload tls for new thread */
-       movl $0x18, %eax
-       movl %eax, %gs
-
        pushl %ebp
        pushl %ebx
        pushl %esi
index 165db51415c5beb70db5202d8154061f1381072e..f262ec67d618af25357e1326c07bafef07382a95 100644 (file)
@@ -82,10 +82,8 @@ ENTRY(bmk_cpu_lgdt)
        movl $0x10, %eax
        movl %eax, %ds
        movl %eax, %es
-       movl %eax, %ss
        movl %eax, %fs
-
-       movl $0x18, %eax
+       movl %eax, %ss
        movl %eax, %gs
 
        popl %eax
index 86855b9a6300824332fa8e7c07f1fb4b51261dae..8119bb5f895b9093ccd10678cf6cdcd89309559c 100644 (file)
@@ -130,6 +130,8 @@ adjustgs(uintptr_t p, size_t s)
        sd->sd_lobase = p & 0xffffff;
        sd->sd_hibase = (p >> 24) & 0xff;
        sd->sd_lolimit = s;
+
+       __asm__ __volatile__("mov %0, %%gs" :: "r"(8*SEGMENT_GS));
 }
 
 #define PIC1_CMD       0x20