diff options
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r-- | usr/src/uts/common/exec/elf/elf.c | 19 | ||||
-rw-r--r-- | usr/src/uts/common/io/cpuid_drv.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/os/exec.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/auxv.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/auxv_386.h | 16 | ||||
-rw-r--r-- | usr/src/uts/common/sys/cpuid_drv.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/elf.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/user.h | 5 |
8 files changed, 44 insertions, 18 deletions
diff --git a/usr/src/uts/common/exec/elf/elf.c b/usr/src/uts/common/exec/elf/elf.c index 14c70821d6..4f888d6feb 100644 --- a/usr/src/uts/common/exec/elf/elf.c +++ b/usr/src/uts/common/exec/elf/elf.c @@ -27,7 +27,7 @@ /* All Rights Reserved */ /* * Copyright (c) 2019, Joyent, Inc. - * Copyright 2021 Oxide Computer Company + * Copyright 2022 Oxide Computer Company */ #include <sys/types.h> @@ -415,11 +415,12 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap, * AT_SUN_AUXFLAGS * AT_SUN_HWCAP * AT_SUN_HWCAP2 + * AT_SUN_HWCAP3 * AT_SUN_PLATFORM (added in stk_copyout) * AT_SUN_EXECNAME (added in stk_copyout) * AT_NULL * - * total == 9 + * total == 10 */ if (hasintp && hasu) { /* @@ -434,7 +435,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap, * * total = 5 */ - args->auxsize = (9 + 5) * sizeof (aux_entry_t); + args->auxsize = (10 + 5) * sizeof (aux_entry_t); } else if (hasintp) { /* * Has PT_INTERP but no PT_PHDR @@ -444,9 +445,9 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap, * * total = 2 */ - args->auxsize = (9 + 2) * sizeof (aux_entry_t); + args->auxsize = (10 + 2) * sizeof (aux_entry_t); } else { - args->auxsize = 9 * sizeof (aux_entry_t); + args->auxsize = 10 * sizeof (aux_entry_t); } } else { args->auxsize = 0; @@ -837,18 +838,16 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap, * Used for choosing faster library routines. * (Potentially different between 32-bit and 64-bit ABIs) */ -#if defined(_LP64) if (args->to_model == DATAMODEL_NATIVE) { ADDAUX(aux, AT_SUN_HWCAP, auxv_hwcap) ADDAUX(aux, AT_SUN_HWCAP2, auxv_hwcap_2) + ADDAUX(aux, AT_SUN_HWCAP3, auxv_hwcap_3) } else { ADDAUX(aux, AT_SUN_HWCAP, auxv_hwcap32) ADDAUX(aux, AT_SUN_HWCAP2, auxv_hwcap32_2) + ADDAUX(aux, AT_SUN_HWCAP3, auxv_hwcap32_3) } -#else - ADDAUX(aux, AT_SUN_HWCAP, auxv_hwcap) - ADDAUX(aux, AT_SUN_HWCAP2, auxv_hwcap_2) -#endif + if (branded) { /* * Reserve space for the brand-private aux vectors, diff --git a/usr/src/uts/common/io/cpuid_drv.c b/usr/src/uts/common/io/cpuid_drv.c index ef3a21793f..5711258f9e 100644 --- a/usr/src/uts/common/io/cpuid_drv.c +++ b/usr/src/uts/common/io/cpuid_drv.c @@ -169,14 +169,17 @@ cpuid_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cr, int *rval) if (strcmp(areq, architecture) == 0) { STRUCT_FSET(h, cgh_hwcap[0], auxv_hwcap); STRUCT_FSET(h, cgh_hwcap[1], auxv_hwcap_2); + STRUCT_FSET(h, cgh_hwcap[2], auxv_hwcap_3); #if defined(_SYSCALL32_IMPL) } else if (strcmp(areq, architecture_32) == 0) { STRUCT_FSET(h, cgh_hwcap[0], auxv_hwcap32); STRUCT_FSET(h, cgh_hwcap[1], auxv_hwcap32_2); + STRUCT_FSET(h, cgh_hwcap[2], auxv_hwcap32_3); #endif } else { STRUCT_FSET(h, cgh_hwcap[0], 0); STRUCT_FSET(h, cgh_hwcap[1], 0); + STRUCT_FSET(h, cgh_hwcap[2], 0); } if (ddi_copyout(STRUCT_BUF(h), (void *)arg, STRUCT_SIZE(h), mode)) diff --git a/usr/src/uts/common/os/exec.c b/usr/src/uts/common/os/exec.c index f51e2c5ca1..37ca15be86 100644 --- a/usr/src/uts/common/os/exec.c +++ b/usr/src/uts/common/os/exec.c @@ -24,9 +24,10 @@ */ /* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright 2017 Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ #include <sys/types.h> @@ -93,9 +94,11 @@ static int hold_execsw(struct execsw *); uint_t auxv_hwcap = 0; /* auxv AT_SUN_HWCAP value; determined on the fly */ uint_t auxv_hwcap_2 = 0; /* AT_SUN_HWCAP2 */ +uint_t auxv_hwcap_3 = 0; /* AT_SUN_HWCAP3 */ #if defined(_SYSCALL32_IMPL) uint_t auxv_hwcap32 = 0; /* 32-bit version of auxv_hwcap */ uint_t auxv_hwcap32_2 = 0; /* 32-bit version of auxv_hwcap2 */ +uint_t auxv_hwcap32_3 = 0; /* 32-bit version of auxv_hwcap3 */ #endif #define PSUIDFLAGS (SNOCD|SUGID) diff --git a/usr/src/uts/common/sys/auxv.h b/usr/src/uts/common/sys/auxv.h index 1fb5011970..e591320025 100644 --- a/usr/src/uts/common/sys/auxv.h +++ b/usr/src/uts/common/sys/auxv.h @@ -30,6 +30,7 @@ */ /* * Copyright (c) 2018, Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ #ifndef _SYS_AUXV_H @@ -141,6 +142,7 @@ typedef struct { */ #define AT_SUN_HWCAP 2009 #define AT_SUN_HWCAP2 2023 +#define AT_SUN_HWCAP3 2029 #if defined(_KERNEL) /* @@ -149,9 +151,11 @@ typedef struct { */ extern uint_t auxv_hwcap; extern uint_t auxv_hwcap_2; +extern uint_t auxv_hwcap_3; #if defined(_SYSCALL32) extern uint_t auxv_hwcap32; extern uint_t auxv_hwcap32_2; +extern uint_t auxv_hwcap32_3; #endif /* _SYSCALL32 */ #else extern uint_t getisax(uint32_t *, uint_t); diff --git a/usr/src/uts/common/sys/auxv_386.h b/usr/src/uts/common/sys/auxv_386.h index 3654474787..d8e6938be0 100644 --- a/usr/src/uts/common/sys/auxv_386.h +++ b/usr/src/uts/common/sys/auxv_386.h @@ -21,6 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2019, Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ #ifndef _SYS_AUXV_386_H @@ -115,9 +116,13 @@ extern "C" { #define AV_386_2_AVX512_VNNI 0x04000000 /* AVX512_VNNI */ #define AV_386_2_VPCLMULQDQ 0x08000000 /* VPCLMULQDQ */ #define AV_386_2_VAES 0x10000000 /* VAES */ +#define AV_386_2_GFNI 0x20000000 /* GFNI */ +#define AV_386_2_AVX512_VP2INT 0x40000000 /* AVX512 VP2INTERESECT */ +#define AV_386_2_AVX512_BITALG 0x80000000 /* AVX512 BITALG */ #define FMT_AV_386_2 \ - "\035vaes\034vpclmulqdq\033avx512_vnni" \ + "\040avx512_vbmi2\037avx512_vp2intersect" \ + "\036gfni\035vaes\034vpclmulqdq\033avx512_vnni" \ "\032clzero\031monitorx\030clwb\027clflushopt\026fsgsbase" \ "\025sha\024avx512_4fmaps\023avx512_4nniw\022avx512vpopcntdq" \ "\021avx512vbmi\020avx512vl\017avx512bw\016avx512cd" \ @@ -125,6 +130,15 @@ extern "C" { "\010rdseed\07adx\06avx2\05fma\04bmi2\03bmi1\02rdrand\01f16c" /* + * Flags used in AT_SUN_HWCAP3 elements + */ +#define AV_386_3_AVX512_VBMI2 0x00000001 /* AVX512_VBMI2 */ +#define AV_386_3_AVX512_BF16 0x00000002 /* AVX512_BF16 */ + +#define FMT_AV_386_3 \ + "\02avx512_bf16\01avx512_vbmi2" + +/* * Flags used in AT_SUN_FPTYPE on x86. * * We don't currently support xsavec in illumos. However, when we do, then we diff --git a/usr/src/uts/common/sys/cpuid_drv.h b/usr/src/uts/common/sys/cpuid_drv.h index c26bc7e422..2321f2446f 100644 --- a/usr/src/uts/common/sys/cpuid_drv.h +++ b/usr/src/uts/common/sys/cpuid_drv.h @@ -25,6 +25,7 @@ */ /* * Copyright 2019 Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ #ifndef _SYS_CPUID_DRV_H @@ -68,7 +69,7 @@ extern "C" { struct cpuid_get_hwcap { char *cgh_archname; - uint_t cgh_hwcap[2]; + uint_t cgh_hwcap[3]; }; struct cpuid_rdmsr { @@ -82,7 +83,7 @@ struct cpuid_rdmsr { struct cpuid_get_hwcap32 { caddr32_t cgh_archname; - uint32_t cgh_hwcap[2]; + uint32_t cgh_hwcap[3]; }; #endif /* _SYSCALL32_IMPL */ diff --git a/usr/src/uts/common/sys/elf.h b/usr/src/uts/common/sys/elf.h index 3d053de531..1f290c282c 100644 --- a/usr/src/uts/common/sys/elf.h +++ b/usr/src/uts/common/sys/elf.h @@ -21,7 +21,7 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2018, Joyent, Inc. - * Copyright 2020 Oxide Computer Company + * Copyright 2022 Oxide Computer Company */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -956,7 +956,8 @@ typedef Elf64_Word Elf64_Capchain; #define CA_SUNW_PLAT 4 /* platform capability entry */ #define CA_SUNW_MACH 5 /* machine capability entry */ #define CA_SUNW_ID 6 /* capability identifier */ -#define CA_SUNW_NUM 7 +#define CA_SUNW_HW_3 7 /* third hardware capabilities entry */ +#define CA_SUNW_NUM 8 /* * Define software capabilities (CA_SUNW_SF_1 values). Note, hardware diff --git a/usr/src/uts/common/sys/user.h b/usr/src/uts/common/sys/user.h index e8013be325..7f54dcf3ab 100644 --- a/usr/src/uts/common/sys/user.h +++ b/usr/src/uts/common/sys/user.h @@ -27,6 +27,7 @@ /* All Rights Reserved */ /* * Copyright (c) 2018, Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ @@ -111,7 +112,7 @@ typedef struct uf_entry { short uf_busy; /* file is allocated [grow, fork] */ kcondvar_t uf_wanted_cv; /* waiting for setf() [never copied] */ kcondvar_t uf_closing_cv; /* waiting for close() [never copied] */ - struct portfd *uf_portfd; /* associated with port [grow] */ + struct portfd *uf_portfd; /* associated with port [grow] */ uf_entry_gen_t uf_gen; /* assigned fd generation [grow,fork] */ /* Avoid false sharing - pad to coherency granularity (64 bytes) */ char uf_pad[64 - sizeof (kmutex_t) - 2 * sizeof (void*) - @@ -204,7 +205,7 @@ typedef struct { /* kernel syscall set type */ #if defined(__sparc) #define __KERN_NAUXV_IMPL 20 #elif defined(__i386) || defined(__amd64) -#define __KERN_NAUXV_IMPL 25 +#define __KERN_NAUXV_IMPL 26 #endif struct execsw; |