]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Make full address space accessible via %gs
authorAntti Kantee <pooka@iki.fi>
Wed, 6 May 2015 09:16:59 +0000 (09:16 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 6 May 2015 09:16:59 +0000 (09:16 +0000)
Since we access gs both forwards and backwards, this seems to be
the only option.  At least it fixes tls with qemu -enable-kvm.

platform/baremetal/arch/i386/machdep.c

index e38b16bbe6480562d269026b3d141e0f11a6d734..c24c3276409c9ef9662f4b9a7930ee2a36c16aad 100644 (file)
@@ -132,8 +132,6 @@ adjustgs(uintptr_t p, size_t s)
 
        sd->sd_lobase = p & 0xffffff;
        sd->sd_hibase = (p >> 24) & 0xff;
-       sd->sd_lolimit = s & 0xffff;
-       sd->sd_hilimit = (s >> 16) & 0xf;
 
        __asm__ __volatile__("mov %0, %%gs" :: "r"(8*SEGMENT_GS));
 }
@@ -188,7 +186,7 @@ bmk_cpu_init(void)
 
        fillsegment(&gdt[SEGMENT_CODE], SDT_MEMERA, SEG_PAGEGRAN);
        fillsegment(&gdt[SEGMENT_DATA], SDT_MEMRWA, SEG_PAGEGRAN);
-       fillsegment(&gdt[SEGMENT_GS], SDT_MEMRWA, SEG_BYTEGRAN);
+       fillsegment(&gdt[SEGMENT_GS], SDT_MEMRWA, SEG_PAGEGRAN);
 
        region.rd_limit = sizeof(gdt)-1;
        region.rd_base = (unsigned int)(uintptr_t)(void *)gdt;