diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/futimens.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/hurd/futimes.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/sigreturn.c | 37 | ||||
-rw-r--r-- | sysdeps/mach/hurd/symlinkat.c | 2 | ||||
-rw-r--r-- | sysdeps/mach/hurd/utime-helper.c | 62 | ||||
-rw-r--r-- | sysdeps/mach/hurd/x86/trampoline.c | 16 | ||||
-rw-r--r-- | sysdeps/mach/hurd/x86_64/sigreturn.c | 37 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/Makefile | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/fcntl-linux.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/ioctl-types.h | 11 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h | 12 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h | 11 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/termio.h | 6 | ||||
-rw-r--r-- | sysdeps/x86_64/Makefile | 1 | ||||
-rw-r--r-- | sysdeps/x86_64/tst-auditmod10b.c | 109 |
15 files changed, 175 insertions, 153 deletions
diff --git a/sysdeps/mach/hurd/futimens.c b/sysdeps/mach/hurd/futimens.c index 30ef0a6..1212529 100644 --- a/sysdeps/mach/hurd/futimens.c +++ b/sysdeps/mach/hurd/futimens.c @@ -32,7 +32,9 @@ __futimens (int fd, const struct timespec tsp[2]) struct timespec atime, mtime; error_t err; - utime_ts_from_tspec (tsp, &atime, &mtime); + err = utime_ts_from_tspec (tsp, &atime, &mtime); + if (err) + return err; err = HURD_DPORT_USE (fd, __file_utimens (port, atime, mtime)); @@ -40,7 +42,9 @@ __futimens (int fd, const struct timespec tsp[2]) { time_value_t atim, mtim; - utime_tvalue_from_tspec (tsp, &atim, &mtim); + err = utime_tvalue_from_tspec (tsp, &atim, &mtim); + if (err) + return err; err = HURD_DPORT_USE (fd, __file_utimes (port, atim, mtim)); } diff --git a/sysdeps/mach/hurd/futimes.c b/sysdeps/mach/hurd/futimes.c index 20f47f3..97385d7 100644 --- a/sysdeps/mach/hurd/futimes.c +++ b/sysdeps/mach/hurd/futimes.c @@ -32,7 +32,9 @@ __futimes (int fd, const struct timeval tvp[2]) struct timespec atime, mtime; error_t err; - utime_ts_from_tval (tvp, &atime, &mtime); + err = utime_ts_from_tval (tvp, &atime, &mtime); + if (err) + return err; err = HURD_DPORT_USE (fd, __file_utimens (port, atime, mtime)); @@ -40,7 +42,9 @@ __futimes (int fd, const struct timeval tvp[2]) { time_value_t atim, mtim; - utime_tvalue_from_tval (tvp, &atim, &mtim); + err = utime_tvalue_from_tval (tvp, &atim, &mtim); + if (err) + return err; err = HURD_DPORT_USE (fd, __file_utimes (port, atim, mtim)); } diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c index 37fa984..dc57d61 100644 --- a/sysdeps/mach/hurd/i386/sigreturn.c +++ b/sysdeps/mach/hurd/i386/sigreturn.c @@ -126,24 +126,27 @@ __sigreturn (struct sigcontext *scp) ss->sigaltstack.ss_flags &= ~SS_ONSTACK; #ifdef i386_XFLOAT_STATE - if ((scp->xstate) && (scp->xstate->initialized)) + if (scp->xstate) { - unsigned eax, ebx, ecx, edx; - __cpuid_count(0xd, 0, eax, ebx, ecx, edx); - switch (scp->xstate->fp_save_kind) - { - case 0: // FNSAVE - asm volatile("frstor %0" : : "m" (scp->xstate->hw_state)); - break; - case 1: // FXSAVE - asm volatile("fxrstor %0" : : "m" (scp->xstate->hw_state), \ - "a" (eax), "d" (edx)); - break; - default: // XSAVE, XSAVEOPT, XSAVEC, XSAVES - asm volatile("xrstor %0" : : "m" (scp->xstate->hw_state), \ - "a" (eax), "d" (edx)); - break; - } + if (scp->xstate->initialized) + { + unsigned eax, ebx, ecx, edx; + __cpuid_count(0xd, 0, eax, ebx, ecx, edx); + switch (scp->xstate->fp_save_kind) + { + case 0: // FNSAVE + asm volatile("frstor %0" : : "m" (scp->xstate->hw_state)); + break; + case 1: // FXSAVE + asm volatile("fxrstor %0" : : "m" (scp->xstate->hw_state), \ + "a" (eax), "d" (edx)); + break; + default: // XSAVE, XSAVEOPT, XSAVEC, XSAVES + asm volatile("xrstor %0" : : "m" (scp->xstate->hw_state), \ + "a" (eax), "d" (edx)); + break; + } + } } else #endif diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c index e7dfb67..cb6250e 100644 --- a/sysdeps/mach/hurd/symlinkat.c +++ b/sysdeps/mach/hurd/symlinkat.c @@ -47,7 +47,7 @@ __symlinkat (const char *from, int fd, const char *to) if (! *name) /* Can't link to the existing directory itself. */ - err = ENOTDIR; + err = EEXIST; else /* Create a new, unlinked node in the target directory. */ err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node); diff --git a/sysdeps/mach/hurd/utime-helper.c b/sysdeps/mach/hurd/utime-helper.c index d88bccd..6afa871 100644 --- a/sysdeps/mach/hurd/utime-helper.c +++ b/sysdeps/mach/hurd/utime-helper.c @@ -21,8 +21,14 @@ #include <stddef.h> #include <sys/time.h> +static inline bool +check_tval (const struct timeval *tvp) +{ + return tvp->tv_usec >= 0 && tvp->tv_usec < USEC_PER_SEC; +} + /* Initializes atime/mtime timespec structures from an array of timeval. */ -static inline void +static inline error_t utime_ts_from_tval (const struct timeval tvp[2], struct timespec *atime, struct timespec *mtime) { @@ -37,13 +43,19 @@ utime_ts_from_tval (const struct timeval tvp[2], } else { + if (!check_tval (&tvp[0])) + return EINVAL; + if (!check_tval (&tvp[1])) + return EINVAL; + TIMEVAL_TO_TIMESPEC (&tvp[0], atime); TIMEVAL_TO_TIMESPEC (&tvp[1], mtime); } + return 0; } /* Initializes atime/mtime time_value_t structures from an array of timeval. */ -static inline void +static inline error_t utime_tvalue_from_tval (const struct timeval tvp[2], time_value_t *atime, time_value_t *mtime) { @@ -53,11 +65,17 @@ utime_tvalue_from_tval (const struct timeval tvp[2], atime->microseconds = mtime->microseconds = -1; else { + if (!check_tval (&tvp[0])) + return EINVAL; + if (!check_tval (&tvp[1])) + return EINVAL; + atime->seconds = tvp[0].tv_sec; atime->microseconds = tvp[0].tv_usec; mtime->seconds = tvp[1].tv_sec; mtime->microseconds = tvp[1].tv_usec; } + return 0; } /* Changes the access time of the file behind PORT using a timeval array. */ @@ -67,7 +85,9 @@ hurd_futimes (const file_t port, const struct timeval tvp[2]) error_t err; struct timespec atime, mtime; - utime_ts_from_tval (tvp, &atime, &mtime); + err = utime_ts_from_tval (tvp, &atime, &mtime); + if (err) + return err; err = __file_utimens (port, atime, mtime); @@ -75,7 +95,9 @@ hurd_futimes (const file_t port, const struct timeval tvp[2]) { time_value_t atim, mtim; - utime_tvalue_from_tval (tvp, &atim, &mtim); + err = utime_tvalue_from_tval (tvp, &atim, &mtim); + if (err) + return err; err = __file_utimes (port, atim, mtim); } @@ -83,8 +105,16 @@ hurd_futimes (const file_t port, const struct timeval tvp[2]) return err; } +static inline bool +check_tspec (const struct timespec *tsp) +{ + return tsp->tv_nsec == UTIME_NOW + || tsp->tv_nsec == UTIME_OMIT + || tsp->tv_nsec >= 0 && tsp->tv_nsec < NSEC_PER_SEC; +} + /* Initializes atime/mtime timespec structures from an array of timespec. */ -static inline void +static inline error_t utime_ts_from_tspec (const struct timespec tsp[2], struct timespec *atime, struct timespec *mtime) { @@ -99,13 +129,19 @@ utime_ts_from_tspec (const struct timespec tsp[2], } else { + if (!check_tspec (&tsp[0])) + return EINVAL; + if (!check_tspec (&tsp[1])) + return EINVAL; + *atime = tsp[0]; *mtime = tsp[1]; } + return 0; } /* Initializes atime/mtime time_value_t structures from an array of timespec. */ -static inline void +static inline error_t utime_tvalue_from_tspec (const struct timespec tsp[2], time_value_t *atime, time_value_t *mtime) { @@ -115,6 +151,11 @@ utime_tvalue_from_tspec (const struct timespec tsp[2], atime->microseconds = mtime->microseconds = -1; else { + if (!check_tspec (&tsp[0])) + return EINVAL; + if (!check_tspec (&tsp[1])) + return EINVAL; + if (tsp[0].tv_nsec == UTIME_NOW) atime->microseconds = -1; else if (tsp[0].tv_nsec == UTIME_OMIT) @@ -128,6 +169,7 @@ utime_tvalue_from_tspec (const struct timespec tsp[2], else TIMESPEC_TO_TIME_VALUE (mtime, &(tsp[1])); } + return 0; } /* Changes the access time of the file behind PORT using a timespec array. */ @@ -137,7 +179,9 @@ hurd_futimens (const file_t port, const struct timespec tsp[2]) error_t err; struct timespec atime, mtime; - utime_ts_from_tspec (tsp, &atime, &mtime); + err = utime_ts_from_tspec (tsp, &atime, &mtime); + if (err) + return err; err = __file_utimens (port, atime, mtime); @@ -145,7 +189,9 @@ hurd_futimens (const file_t port, const struct timespec tsp[2]) { time_value_t atim, mtim; - utime_tvalue_from_tspec (tsp, &atim, &mtim); + err = utime_tvalue_from_tspec (tsp, &atim, &mtim); + if (err) + return err; err = __file_utimes (port, atim, mtim); } diff --git a/sysdeps/mach/hurd/x86/trampoline.c b/sysdeps/mach/hurd/x86/trampoline.c index db756e8..6f23c56 100644 --- a/sysdeps/mach/hurd/x86/trampoline.c +++ b/sysdeps/mach/hurd/x86/trampoline.c @@ -289,7 +289,7 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action (thread_state_t) stackframe->xstate, &got) && got == (xstate_size / sizeof (int))); - if (((struct i386_xfloat_state*) stackframe->xstate)->fp_save_kind > 5) + if (ok && ((struct i386_xfloat_state*) stackframe->xstate)->fp_save_kind > 5) /* We support up to XSAVES */ ok = 0; @@ -461,7 +461,10 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action - in gdb: gdb/i386-gnu-tdep.c gnu_sigtramp_code. */ #ifdef __x86_64__ -asm ("rpc_wait_trampoline:\n" +asm ("trampoline:\n" + "fnclex\n" /* Clear any pending exception. */ + "jmp _trampoline\n" + "rpc_wait_trampoline:\n" /* This is the entry point when we have an RPC reply message to receive before running the handler. The MACH_MSG_SEND bit has already been cleared in the OPTION argument in our %rsi. The interrupted user @@ -480,7 +483,7 @@ asm ("rpc_wait_trampoline:\n" /* Switch to the signal stack. */ "movq %rbx, %rsp\n" - "trampoline:\n" + "_trampoline:\n" /* Entry point for running the handler normally. The arguments to the handler function are on the top of the stack, same as in the i386 version: @@ -506,7 +509,10 @@ asm ("rpc_wait_trampoline:\n" "movq 16(%rsp), %rdi\n" "ret"); #else -asm ("rpc_wait_trampoline:\n"); +asm ("trampoline:\n" + "fnclex\n" /* Clear any pending exception. */ + "jmp _trampoline\n" + "rpc_wait_trampoline:\n"); /* This is the entry point when we have an RPC reply message to receive before running the handler. The MACH_MSG_SEND bit has already been cleared in the OPTION argument on our stack. The interrupted user @@ -526,7 +532,7 @@ asm (/* Retry the interrupted mach_msg system call. */ /* Switch to the signal stack. */ "movl %ebx, %esp\n"); - asm ("trampoline:\n"); +asm ("_trampoline:\n"); /* Entry point for running the handler normally. The arguments to the handler function are already on the top of the stack: diff --git a/sysdeps/mach/hurd/x86_64/sigreturn.c b/sysdeps/mach/hurd/x86_64/sigreturn.c index dff8e76..773c00f 100644 --- a/sysdeps/mach/hurd/x86_64/sigreturn.c +++ b/sysdeps/mach/hurd/x86_64/sigreturn.c @@ -119,24 +119,27 @@ __sigreturn (struct sigcontext *scp) ss->sigaltstack.ss_flags &= ~SS_ONSTACK; #ifdef i386_XFLOAT_STATE - if ((scp->xstate) && (scp->xstate->initialized)) + if (scp->xstate) { - unsigned eax, ebx, ecx, edx; - __cpuid_count(0xd, 0, eax, ebx, ecx, edx); - switch (scp->xstate->fp_save_kind) - { - case 0: // FNSAVE - asm volatile("frstor %0" : : "m" (scp->xstate->hw_state)); - break; - case 1: // FXSAVE - asm volatile("fxrstor %0" : : "m" (scp->xstate->hw_state), \ - "a" (eax), "d" (edx)); - break; - default: // XSAVE, XSAVEOPT, XSAVEC, XSAVES - asm volatile("xrstor %0" : : "m" (scp->xstate->hw_state), \ - "a" (eax), "d" (edx)); - break; - } + if (scp->xstate->initialized) + { + unsigned eax, ebx, ecx, edx; + __cpuid_count(0xd, 0, eax, ebx, ecx, edx); + switch (scp->xstate->fp_save_kind) + { + case 0: // FNSAVE + asm volatile("frstor %0" : : "m" (scp->xstate->hw_state)); + break; + case 1: // FXSAVE + asm volatile("fxrstor %0" : : "m" (scp->xstate->hw_state), \ + "a" (eax), "d" (edx)); + break; + default: // XSAVE, XSAVEOPT, XSAVEC, XSAVES + asm volatile("xrstor %0" : : "m" (scp->xstate->hw_state), \ + "a" (eax), "d" (edx)); + break; + } + } } else #endif diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index dcd87b2..ebcf820 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -506,12 +506,6 @@ sysdep_headers += \ # sysdep_headers endif -ifeq ($(subdir),termios) -sysdep_headers += \ - termio.h \ - # sysdep_headers -endif - ifeq ($(subdir),posix) sysdep_headers += \ bits/initspin.h \ diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h index dfc554a..f425a4b 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h @@ -379,6 +379,8 @@ struct file_handle identity and may not be usable to open_by_handle_at. */ +# define AT_HANDLE_MNT_ID_UNIQUE 1 /* Return the 64-bit unique mount + ID. */ #endif __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h index cc2c9d7..e8e5084 100644 --- a/sysdeps/unix/sysv/linux/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h index 03ebf1e..84bb6fc 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h @@ -31,18 +31,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - char c_line; /* line discipline */ - /* Yes, this is really NCCS. */ - unsigned char c_cc[32 /* NCCS */]; /* control characters */ - }; - /* modem lines */ #define TIOCM_LE 0x001 /* line enable */ #define TIOCM_DTR 0x002 /* data terminal ready */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h index f2b360c..267fa09 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 10 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/sysdeps/unix/sysv/linux/termio.h b/sysdeps/unix/sysv/linux/termio.h deleted file mode 100644 index 0e610f0..0000000 --- a/sysdeps/unix/sysv/linux/termio.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Compatible <termio.h> for old `struct termio' ioctl interface. - This is obsolete; use the POSIX.1 `struct termios' interface - defined in <termios.h> instead. */ - -#include <termios.h> -#include <sys/ioctl.h> diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index 9d31685..5723ec1 100644 --- a/sysdeps/x86_64/Makefile +++ b/sysdeps/x86_64/Makefile @@ -142,7 +142,6 @@ CFLAGS-tst-avxmod.c += $(AVX-CFLAGS) AVX512-CFLAGS = -mavx512f CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS) CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS) -CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS) CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS) CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS) diff --git a/sysdeps/x86_64/tst-auditmod10b.c b/sysdeps/x86_64/tst-auditmod10b.c index 6eb21b6..0b994ef 100644 --- a/sysdeps/x86_64/tst-auditmod10b.c +++ b/sysdeps/x86_64/tst-auditmod10b.c @@ -125,7 +125,6 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook, #include <tst-audit.h> -#ifdef __AVX512F__ #include <immintrin.h> #include <cpuid.h> @@ -148,9 +147,37 @@ check_avx512 (void) return (eax & 0xe6) == 0xe6; } -#else -#include <emmintrin.h> -#endif +void +__attribute__ ((target ("avx512f"))) +pltenter_avx512f (La_regs *regs, long int *framesizep) +{ + __m512i zero = _mm512_setzero_si512 (); + if (memcmp (®s->lr_vector[0], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[1], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[2], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[3], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[4], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[5], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[6], &zero, sizeof (zero)) + || memcmp (®s->lr_vector[7], &zero, sizeof (zero))) + abort (); + + for (int i = 0; i < 8; i++) + regs->lr_vector[i].zmm[0] + = (La_x86_64_zmm) _mm512_set1_epi64 (i + 1); + + __m512i zmm = _mm512_set1_epi64 (-1); + asm volatile ("vmovdqa64 %0, %%zmm0" : : "x" (zmm) : "xmm0" ); + asm volatile ("vmovdqa64 %0, %%zmm1" : : "x" (zmm) : "xmm1" ); + asm volatile ("vmovdqa64 %0, %%zmm2" : : "x" (zmm) : "xmm2" ); + asm volatile ("vmovdqa64 %0, %%zmm3" : : "x" (zmm) : "xmm3" ); + asm volatile ("vmovdqa64 %0, %%zmm4" : : "x" (zmm) : "xmm4" ); + asm volatile ("vmovdqa64 %0, %%zmm5" : : "x" (zmm) : "xmm5" ); + asm volatile ("vmovdqa64 %0, %%zmm6" : : "x" (zmm) : "xmm6" ); + asm volatile ("vmovdqa64 %0, %%zmm7" : : "x" (zmm) : "xmm7" ); + + *framesizep = 1024; +} ElfW(Addr) pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook, @@ -160,39 +187,33 @@ pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook, printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n", symname, (long int) sym->st_value, ndx, *flags); -#ifdef __AVX512F__ if (check_avx512 () && strcmp (symname, "audit_test") == 0) + pltenter_avx512f (regs, framesizep); + + return sym->st_value; +} + +void +__attribute__ ((target ("avx512f"))) +pltexit_avx512f (const La_regs *inregs, La_retval *outregs) +{ + __m512i zero = _mm512_setzero_si512 (); + if (memcmp (&outregs->lrv_vector0, &zero, sizeof (zero))) + abort (); + + for (int i = 0; i < 8; i++) { - __m512i zero = _mm512_setzero_si512 (); - if (memcmp (®s->lr_vector[0], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[1], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[2], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[3], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[4], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[5], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[6], &zero, sizeof (zero)) - || memcmp (®s->lr_vector[7], &zero, sizeof (zero))) - abort (); - - for (int i = 0; i < 8; i++) - regs->lr_vector[i].zmm[0] - = (La_x86_64_zmm) _mm512_set1_epi64 (i + 1); - - __m512i zmm = _mm512_set1_epi64 (-1); - asm volatile ("vmovdqa64 %0, %%zmm0" : : "x" (zmm) : "xmm0" ); - asm volatile ("vmovdqa64 %0, %%zmm1" : : "x" (zmm) : "xmm1" ); - asm volatile ("vmovdqa64 %0, %%zmm2" : : "x" (zmm) : "xmm2" ); - asm volatile ("vmovdqa64 %0, %%zmm3" : : "x" (zmm) : "xmm3" ); - asm volatile ("vmovdqa64 %0, %%zmm4" : : "x" (zmm) : "xmm4" ); - asm volatile ("vmovdqa64 %0, %%zmm5" : : "x" (zmm) : "xmm5" ); - asm volatile ("vmovdqa64 %0, %%zmm6" : : "x" (zmm) : "xmm6" ); - asm volatile ("vmovdqa64 %0, %%zmm7" : : "x" (zmm) : "xmm7" ); - - *framesizep = 1024; + __m512i zmm = _mm512_set1_epi64 (i + 1); + if (memcmp (&inregs->lr_vector[i], &zmm, sizeof (zmm)) != 0) + abort (); } -#endif - return sym->st_value; + outregs->lrv_vector0.zmm[0] + = (La_x86_64_zmm) _mm512_set1_epi64 (0x12349876); + + __m512i zmm = _mm512_set1_epi64 (-1); + asm volatile ("vmovdqa64 %0, %%zmm0" : : "x" (zmm) : "xmm0" ); + asm volatile ("vmovdqa64 %0, %%zmm1" : : "x" (zmm) : "xmm1" ); } unsigned int @@ -204,28 +225,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook, symname, (long int) sym->st_value, ndx, (ptrdiff_t) outregs->int_retval); -#ifdef __AVX512F__ if (check_avx512 () && strcmp (symname, "audit_test") == 0) - { - __m512i zero = _mm512_setzero_si512 (); - if (memcmp (&outregs->lrv_vector0, &zero, sizeof (zero))) - abort (); - - for (int i = 0; i < 8; i++) - { - __m512i zmm = _mm512_set1_epi64 (i + 1); - if (memcmp (&inregs->lr_vector[i], &zmm, sizeof (zmm)) != 0) - abort (); - } - - outregs->lrv_vector0.zmm[0] - = (La_x86_64_zmm) _mm512_set1_epi64 (0x12349876); - - __m512i zmm = _mm512_set1_epi64 (-1); - asm volatile ("vmovdqa64 %0, %%zmm0" : : "x" (zmm) : "xmm0" ); - asm volatile ("vmovdqa64 %0, %%zmm1" : : "x" (zmm) : "xmm1" ); - } -#endif + pltexit_avx512f (inregs, outregs); return 0; } |