ia64/xen-unstable

changeset 3411:82ba8bd1ceb2

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.
author kaf24@scramble.cl.cam.ac.uk
date Tue Jan 11 16:22:56 2005 +0000 (2005-01-11)
parents ea428d76cfb3
children 757e2d296e9f
files linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c xen/arch/x86/x86_32/seg_fixup.c
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c	Tue Jan 11 14:30:17 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/fixup.c	Tue Jan 11 16:22:56 2005 +0000
     1.3 @@ -36,7 +36,7 @@
     1.4  
     1.5  #define DP(_f) printk(KERN_ALERT "  " _f "\n")
     1.6  
     1.7 -asmlinkage void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
     1.8 +fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
     1.9  {
    1.10      static unsigned long printed = 0;
    1.11      int i;
     2.1 --- a/xen/arch/x86/x86_32/seg_fixup.c	Tue Jan 11 14:30:17 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/seg_fixup.c	Tue Jan 11 16:22:56 2005 +0000
     2.3 @@ -182,7 +182,7 @@ int fixup_seg(u16 seg, unsigned long off
     2.4          table = (unsigned long *)LDT_VIRT_START;
     2.5          if ( idx >= d->mm.ldt_ents )
     2.6          {
     2.7 -            DPRINTK("Segment %04x out of LDT range (%d)\n",
     2.8 +            DPRINTK("Segment %04x out of LDT range (%ld)\n",
     2.9                      seg, d->mm.ldt_ents);
    2.10              goto fail;
    2.11          }
    2.12 @@ -231,16 +231,9 @@ int fixup_seg(u16 seg, unsigned long off
    2.13      }
    2.14      else
    2.15      {
    2.16 -        /*
    2.17 -         * Expands-up: All the way to Xen space? Assume 4GB if so.
    2.18 -         * NB: we compare offset with limit-15, instead of the "real"
    2.19 -         * comparison of offset+15 (worst case) with limit,
    2.20 -         * to avoid possible unsigned int overflow of offset+15.
    2.21 -         * limit-15 will not underflow here because we don't allow expand-up
    2.22 -         * segments with maxlimit.
    2.23 -         */
    2.24 +        /* Expands-up: All the way to Xen space? Assume 4GB if so. */
    2.25          if ( ((PAGE_OFFSET - (base + limit)) < PAGE_SIZE) &&
    2.26 -             ((offset) > (limit-15)) )
    2.27 +             (offset > limit) )
    2.28          {
    2.29              /* Flip to expands-down. */
    2.30              limit = -(base & PAGE_MASK);
    2.31 @@ -248,8 +241,8 @@ int fixup_seg(u16 seg, unsigned long off
    2.32          }
    2.33      }
    2.34  
    2.35 -    DPRINTK("None of the above! (%08lx:%08lx, %d, %08lx, %08lx, %08lx)\n", 
    2.36 -            a, b, positive_access, base, limit, base+limit);
    2.37 +    DPRINTK("None of the above! (%08lx:%08lx, %08lx, %08lx, %08lx)\n", 
    2.38 +            a, b, base, limit, base+limit);
    2.39  
    2.40   fail:
    2.41      return 0;
    2.42 @@ -312,7 +305,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    2.43  
    2.44      if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
    2.45      {
    2.46 -        DPRINTK("Cannot linearise %04x:%08lx\n", regs->cs, regs->eip);
    2.47 +        DPRINTK("Cannot linearise %04x:%08x\n", regs->cs, regs->eip);
    2.48          goto fail;
    2.49      }
    2.50  
    2.51 @@ -340,25 +333,25 @@ int gpf_emulate_4gb(struct xen_regs *reg
    2.52          case 0xf0: /* LOCK */
    2.53          case 0xf2: /* REPNE/REPNZ */
    2.54          case 0xf3: /* REP/REPE/REPZ */
    2.55 -            continue;
    2.56 +            break;
    2.57          case 0x2e: /* CS override */
    2.58              pseg = &regs->cs;
    2.59 -            continue;
    2.60 +            break;
    2.61          case 0x3e: /* DS override */
    2.62              pseg = &regs->ds;
    2.63 -            continue;
    2.64 +            break;
    2.65          case 0x26: /* ES override */
    2.66              pseg = &regs->es;
    2.67 -            continue;
    2.68 +            break;
    2.69          case 0x64: /* FS override */
    2.70              pseg = &regs->fs;
    2.71 -            continue;
    2.72 +            break;
    2.73          case 0x65: /* GS override */
    2.74              pseg = &regs->gs;
    2.75 -            continue;
    2.76 +            break;
    2.77          case 0x36: /* SS override */
    2.78              pseg = &regs->ss;
    2.79 -            continue;
    2.80 +            break;
    2.81          default: /* Not a prefix byte */
    2.82              goto done_prefix;
    2.83          }
    2.84 @@ -489,7 +482,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    2.85  
    2.86   fixme:
    2.87      DPRINTK("Undecodable instruction %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
    2.88 -            "caused GPF(0) at %04x:%08lx\n",
    2.89 +            "caused GPF(0) at %04x:%08x\n",
    2.90              eip[0], eip[1], eip[2], eip[3],
    2.91              eip[4], eip[5], eip[6], eip[7],
    2.92              regs->cs, regs->eip);