Print this page
Bring back LX zones.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/os/archdep.c
          +++ new/usr/src/uts/intel/ia32/os/archdep.c
↓ open down ↓ 624 lines elided ↑ open up ↑
 625  625  #error  "IS_CS and IS_NOT_CS already defined"
 626  626  #endif
 627  627  
 628  628  #define IS_CS           1
 629  629  #define IS_NOT_CS       0
 630  630  
 631  631  /*ARGSUSED*/
 632  632  static greg_t
 633  633  fix_segreg(greg_t sr, int iscs, model_t datamodel)
 634  634  {
      635 +        kthread_t *t = curthread;
      636 +        
 635  637          switch (sr &= 0xffff) {
 636  638  
 637  639          case 0:
 638  640                  if (iscs == IS_CS)
 639  641                          return (0 | SEL_UPL);
 640  642                  else
 641  643                          return (0);
 642  644  
 643  645  #if defined(__amd64)
 644  646          /*
↓ open down ↓ 13 lines elided ↑ open up ↑
 658  660          case UCS_SEL:
 659  661  #endif
 660  662          /*FALLTHROUGH*/
 661  663          case UDS_SEL:
 662  664          case LWPFS_SEL:
 663  665          case LWPGS_SEL:
 664  666          case SEL_UPL:
 665  667                  return (sr);
 666  668          default:
 667  669                  break;
      670 +        }
      671 +
      672 +        /*
      673 +         * Allow this process's brand to do any necessary segment register
      674 +         * manipulation.
      675 +         */
      676 +        if (PROC_IS_BRANDED(t->t_procp) && BRMOP(t->t_procp)->b_fixsegreg) {
      677 +                greg_t bsr = BRMOP(t->t_procp)->b_fixsegreg(sr, datamodel);
      678 +
      679 +                if (bsr == 0 && iscs == IS_CS)
      680 +                        return (0 | SEL_UPL);
      681 +                else
      682 +                        return (bsr);
 668  683          }
 669  684  
 670  685          /*
 671  686           * Force it into the LDT in ring 3 for 32-bit processes, which by
 672  687           * default do not have an LDT, so that any attempt to use an invalid
 673  688           * selector will reference the (non-existant) LDT, and cause a #gp
 674  689           * fault for the process.
 675  690           *
 676  691           * 64-bit processes get the null gdt selector since they
 677  692           * are not allowed to have a private LDT.
↓ open down ↓ 868 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX