diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2005-01-11 16:22:56 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2005-01-11 16:22:56 +0000 |
commit | 70886c1304633a413f360881c4253f2c88ac13cf (patch) | |
tree | f963ee51d7797bb0714f94c9919284ea690563cc | |
parent | 5d89512faeb066cc2cbbe604690f7383a9726326 (diff) | |
download | xen-70886c1304633a413f360881c4253f2c88ac13cf.tar.gz xen-70886c1304633a413f360881c4253f2c88ac13cf.tar.bz2 xen-70886c1304633a413f360881c4253f2c88ac13cf.zip |
bitkeeper revision 1.1159.170.86 (41e3fd60buTFRdRYvoTdB-SEFDg4cQ)
Segment-flip (TLS) cleanups and fixes. Now can boot FC3 with /lib/tls
in place and it does not hang.
-rw-r--r-- | linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/x86_32/seg_fixup.c | 35 |
2 files changed, 15 insertions, 22 deletions
diff --git a/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c b/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c index c6a90449e3..98eb939816 100644 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c @@ -36,7 +36,7 @@ #define DP(_f) printk(KERN_ALERT " " _f "\n") -asmlinkage void do_fixup_4gb_segment(struct pt_regs *regs, long error_code) +fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code) { static unsigned long printed = 0; int i; diff --git a/xen/arch/x86/x86_32/seg_fixup.c b/xen/arch/x86/x86_32/seg_fixup.c index f08da34cf8..7c53def147 100644 --- a/xen/arch/x86/x86_32/seg_fixup.c +++ b/xen/arch/x86/x86_32/seg_fixup.c @@ -182,7 +182,7 @@ int fixup_seg(u16 seg, unsigned long offset) table = (unsigned long *)LDT_VIRT_START; if ( idx >= d->mm.ldt_ents ) { - DPRINTK("Segment %04x out of LDT range (%d)\n", + DPRINTK("Segment %04x out of LDT range (%ld)\n", seg, d->mm.ldt_ents); goto fail; } @@ -231,16 +231,9 @@ int fixup_seg(u16 seg, unsigned long offset) } else { - /* - * Expands-up: All the way to Xen space? Assume 4GB if so. - * NB: we compare offset with limit-15, instead of the "real" - * comparison of offset+15 (worst case) with limit, - * to avoid possible unsigned int overflow of offset+15. - * limit-15 will not underflow here because we don't allow expand-up - * segments with maxlimit. - */ + /* Expands-up: All the way to Xen space? Assume 4GB if so. */ if ( ((PAGE_OFFSET - (base + limit)) < PAGE_SIZE) && - ((offset) > (limit-15)) ) + (offset > limit) ) { /* Flip to expands-down. */ limit = -(base & PAGE_MASK); @@ -248,8 +241,8 @@ int fixup_seg(u16 seg, unsigned long offset) } } - DPRINTK("None of the above! (%08lx:%08lx, %d, %08lx, %08lx, %08lx)\n", - a, b, positive_access, base, limit, base+limit); + DPRINTK("None of the above! (%08lx:%08lx, %08lx, %08lx, %08lx)\n", + a, b, base, limit, base+limit); fail: return 0; @@ -312,7 +305,7 @@ int gpf_emulate_4gb(struct xen_regs *regs) if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) ) { - DPRINTK("Cannot linearise %04x:%08lx\n", regs->cs, regs->eip); + DPRINTK("Cannot linearise %04x:%08x\n", regs->cs, regs->eip); goto fail; } @@ -340,25 +333,25 @@ int gpf_emulate_4gb(struct xen_regs *regs) case 0xf0: /* LOCK */ case 0xf2: /* REPNE/REPNZ */ case 0xf3: /* REP/REPE/REPZ */ - continue; + break; case 0x2e: /* CS override */ pseg = ®s->cs; - continue; + break; case 0x3e: /* DS override */ pseg = ®s->ds; - continue; + break; case 0x26: /* ES override */ pseg = ®s->es; - continue; + break; case 0x64: /* FS override */ pseg = ®s->fs; - continue; + break; case 0x65: /* GS override */ pseg = ®s->gs; - continue; + break; case 0x36: /* SS override */ pseg = ®s->ss; - continue; + break; default: /* Not a prefix byte */ goto done_prefix; } @@ -489,7 +482,7 @@ int gpf_emulate_4gb(struct xen_regs *regs) fixme: DPRINTK("Undecodable instruction %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " - "caused GPF(0) at %04x:%08lx\n", + "caused GPF(0) at %04x:%08x\n", eip[0], eip[1], eip[2], eip[3], eip[4], eip[5], eip[6], eip[7], regs->cs, regs->eip); |