Print this page
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
    usr/src/uts/common/fs/proc/prcontrol.c
    usr/src/uts/intel/os/archdep.c
    usr/src/uts/intel/sys/ucontext.h
    usr/src/uts/intel/syscall/getcontext.c

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/sys/x86_archext.h
          +++ new/usr/src/uts/intel/sys/x86_archext.h
↓ open down ↓ 1429 lines elided ↑ open up ↑
1430 1430  #define INTC_MODEL_CEDARVIEW            0x36
1431 1431  #define INTC_MODEL_BAY_TRAIL            0x37
1432 1432  #define INTC_MODEL_AVATON               0x4d
1433 1433  #define INTC_MODEL_AIRMONT              0x4c
1434 1434  #define INTC_MODEL_GOLDMONT             0x5c
1435 1435  #define INTC_MODEL_DENVERTON            0x5f
1436 1436  #define INTC_MODEL_GEMINI_LAKE          0x7a
1437 1437  
1438 1438  /*
1439 1439   * xgetbv/xsetbv support
1440      - * See section 13.3 in vol. 1 of the Intel devlopers manual.
     1440 + * See section 13.3 in vol. 1 of the Intel Developer's manual.
1441 1441   */
1442 1442  
1443 1443  #define XFEATURE_ENABLED_MASK   0x0
1444 1444  /*
1445 1445   * XFEATURE_ENABLED_MASK values (eax)
1446 1446   * See setup_xfem().
1447 1447   */
1448      -#define XFEATURE_LEGACY_FP      0x1
1449      -#define XFEATURE_SSE            0x2
1450      -#define XFEATURE_AVX            0x4
1451      -#define XFEATURE_MPX            0x18    /* 2 bits, both 0 or 1 */
1452      -#define XFEATURE_AVX512         0xe0    /* 3 bits, all 0 or 1 */
     1448 +#define XFEATURE_LEGACY_FP      (1 << 0)
     1449 +#define XFEATURE_SSE            (1 << 1)
     1450 +#define XFEATURE_AVX            (1 << 2)
     1451 +/*
     1452 + * MPX is meant to be all or nothing, therefore for most of the kernel use the
     1453 + * following definition.
     1454 + */
     1455 +#define XFEATURE_MPX_BNDREGS    (1 << 3)
     1456 +#define XFEATURE_MPX_BNDCSR     (1 << 4)
     1457 +#define XFEATURE_MPX            (XFEATURE_MPX_BNDREGS | XFEATURE_MPX_BNDCSR)
     1458 +/*
     1459 + * AVX512 is meant to be all or nothing, therefore for most of the kernel use
     1460 + * the following definition.
     1461 + */
     1462 +#define XFEATURE_AVX512_OPMASK  (1 << 5)
     1463 +#define XFEATURE_AVX512_ZMM     (1 << 6)
     1464 +#define XFEATURE_AVX512_HI_ZMM  (1 << 7)
     1465 +#define XFEATURE_AVX512         (XFEATURE_AVX512_OPMASK | \
     1466 +        XFEATURE_AVX512_ZMM | XFEATURE_AVX512_HI_ZMM)
1453 1467          /* bit 8 unused */
1454      -#define XFEATURE_PKRU           0x200
     1468 +#define XFEATURE_PKRU           (1 << 9)
1455 1469  #define XFEATURE_FP_ALL \
1456 1470          (XFEATURE_LEGACY_FP | XFEATURE_SSE | XFEATURE_AVX | XFEATURE_MPX | \
1457 1471          XFEATURE_AVX512 | XFEATURE_PKRU)
1458 1472  
1459 1473  /*
1460 1474   * Define the set of xfeature flags that should be considered valid in the xsave
1461 1475   * state vector when we initialize an lwp. This is distinct from the full set so
1462 1476   * that all of the processor's normal logic and tracking of the xsave state is
1463 1477   * usable. This should correspond to the state that's been initialized by the
1464 1478   * ABI to hold meaningful values. Adding additional bits here can have serious
↓ open down ↓ 104 lines elided ↑ open up ↑
1569 1583  extern int cpuid_get_chipid(struct cpu *);
1570 1584  extern id_t cpuid_get_coreid(struct cpu *);
1571 1585  extern int cpuid_get_pkgcoreid(struct cpu *);
1572 1586  extern int cpuid_get_clogid(struct cpu *);
1573 1587  extern int cpuid_get_cacheid(struct cpu *);
1574 1588  extern uint32_t cpuid_get_apicid(struct cpu *);
1575 1589  extern uint_t cpuid_get_procnodeid(struct cpu *cpu);
1576 1590  extern uint_t cpuid_get_procnodes_per_pkg(struct cpu *cpu);
1577 1591  extern uint_t cpuid_get_compunitid(struct cpu *cpu);
1578 1592  extern uint_t cpuid_get_cores_per_compunit(struct cpu *cpu);
1579      -extern size_t cpuid_get_xsave_size();
1580      -extern boolean_t cpuid_need_fp_excp_handling();
     1593 +extern size_t cpuid_get_xsave_size(void);
     1594 +extern void cpuid_get_xsave_info(uint64_t, size_t *, size_t *);
     1595 +extern boolean_t cpuid_need_fp_excp_handling(void);
1581 1596  extern int cpuid_is_cmt(struct cpu *);
1582 1597  extern int cpuid_syscall32_insn(struct cpu *);
1583 1598  extern int getl2cacheinfo(struct cpu *, int *, int *, int *);
1584 1599  
1585 1600  extern x86_chiprev_t cpuid_getchiprev(struct cpu *);
1586 1601  extern const char *cpuid_getchiprevstr(struct cpu *);
1587 1602  extern uint32_t cpuid_getsockettype(struct cpu *);
1588 1603  extern const char *cpuid_getsocketstr(struct cpu *);
1589 1604  extern x86_uarchrev_t cpuid_getuarchrev(struct cpu *);
1590 1605  
↓ open down ↓ 138 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX