#undef _GNU_SOURCE #define _GNU_SOURCE 1 #undef __USE_GNU #define __USE_GNU 1 #include #include #include #include #include #include #include #include #include #include unsigned long long res64 = -1; unsigned int res32 = -1; unsigned short res16 = -1; int test(void) { int ex; feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fld1""\n" " fisttp res16""\n" " fld1""\n" " fisttpl res32""\n" " fld1""\n" " fisttpll res64""\n" : : : "memory" ); if (res16 != 1 || res32 != 1 || res64 != 1) { printf("[BAD]\tfisttp 1\n"); return 1; } ex = fetestexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); if (ex != 0) { printf("[BAD]\tfisttp 1: wrong exception state\n"); return 1; } feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fldpi""\n" " fisttp res16""\n" " fldpi""\n" " fisttpl res32""\n" " fldpi""\n" " fisttpll res64""\n" : : : "memory" ); if (res16 != 3 || res32 != 3 || res64 != 3) { printf("[BAD]\tfisttp pi\n"); return 1; } ex = fetestexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); if (ex != FE_INEXACT) { printf("[BAD]\tfisttp pi: wrong exception state\n"); return 1; } feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fldpi""\n" " fchs""\n" " fisttp res16""\n" " fldpi""\n" " fchs""\n" " fisttpl res32""\n" " fldpi""\n" " fchs""\n" " fisttpll res64""\n" : : : "memory" ); if (res16 != 0xfffd || res32 != 0xfffffffd || res64 != 0xfffffffffffffffdULL) { printf("[BAD]\tfisttp -pi\n"); return 1; } ex = fetestexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); if (ex != FE_INEXACT) { printf("[BAD]\tfisttp -pi: wrong exception state\n"); return 1; } feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); asm volatile ("\n" " fldln2""\n" " fisttp res16""\n" " fldln2""\n" " fisttpl res32""\n" " fldln2""\n" " fisttpll res64""\n" : : : "memory" ); /* Test truncation to zero (round-to-nearest would give 1 here) */ if (res16 != 0 || res32 != 0 || res64 != 0) { printf("[BAD]\tfisttp ln2\n"); return 1; } ex = fetestexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW); if (ex != FE_INEXACT) { printf("[BAD]\tfisttp ln2: wrong exception state\n"); return 1; } return 0; } void sighandler(int sig) { printf("[FAIL]\tGot signal %d, exiting\n", sig); exit(1); } int main(int argc, char **argv, char **envp) { int err = 0; /* SIGILL triggers on 32-bit kernels w/o fisttp emulation * when run with "no387 nofxsr". Other signals are caught * just in case. */ signal(SIGILL, sighandler); signal(SIGFPE, sighandler); signal(SIGSEGV, sighandler); printf("[RUN]\tTesting fisttp instructions\n"); err |= test(); if (!err) printf("[OK]\tfisttp\n"); else printf("[FAIL]\tfisttp errors: %d\n", err); return err; } '>sound/pci/ctxfi/ctsrc.h
t' onchange='this.form.submit();'>
AgeCommit message (Expand)AuthorFilesLines
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-01-31 09:37:34 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-01-31 21:47:58 +0100
commit0becc0ae5b42828785b589f686725ff5bc3b9b25 (patch)
treebe6d0e1f37c38ed0a7dd5da2d4b1e93f0fb43101 /sound/usb/hiface/pcm.h
parent24c2503255d35c269b67162c397a1a1c1e02f6ce (diff)
x86/mce: Make timer handling more robust
Erik reported that on a preproduction hardware a CMCI storm triggers the BUG_ON in add_timer_on(). The reason is that the per CPU MCE timer is started by the CMCI logic before the MCE CPU hotplug callback starts the timer with add_timer_on(). So the timer is already queued which triggers the BUG. Using add_timer_on() is pretty pointless in this code because the timer is strictlty per CPU, initialized as pinned and all operations which arm the timer happen on the CPU to which the timer belongs. Simplify the whole machinery by using mod_timer() instead of add_timer_on() which avoids the problem because mod_timer() can handle already queued timers. Use __start_timer() everywhere so the earliest armed expiry time is preserved. Reported-by: Erik Veijola <erik.veijola@intel.com> Tested-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Borislav Petkov <bp@alien8.de> Cc: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1701310936080.3457@nanos Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'sound/usb/hiface/pcm.h')