/* * ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2011-2015 Andrew Lutomirski */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #ifndef SYS_getcpu # ifdef __x86_64__ # define SYS_getcpu 309 # else # define SYS_getcpu 318 # endif #endif int nerrs = 0; #ifdef __x86_64__ # define VSYS(x) (x) #else # define VSYS(x) 0 #endif typedef long (*getcpu_t)(unsigned *, unsigned *, void *); const getcpu_t vgetcpu = (getcpu_t)VSYS(0xffffffffff600800); getcpu_t vdso_getcpu; void fill_function_pointers() { void *vdso = dlopen("linux-vdso.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); if (!vdso) vdso = dlopen("linux-gate.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); if (!vdso) { printf("[WARN]\tfailed to find vDSO\n"); return; } vdso_getcpu = (getcpu_t)dlsym(vdso, "__vdso_getcpu"); if (!vdso_getcpu) printf("Warning: failed to find getcpu in vDSO\n"); } static long sys_getcpu(unsigned * cpu, unsigned * node, void* cache) { return syscall(__NR_getcpu, cpu, node, cache); } static void test_getcpu(void) { printf("[RUN]\tTesting getcpu...\n"); for (int cpu = 0; ; cpu++) { cpu_set_t cpuset; CPU_ZERO(&cpuset); CPU_SET(cpu, &cpuset); if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) return; unsigned cpu_sys, cpu_vdso, cpu_vsys, node_sys, node_vdso, node_vsys; long ret_sys, ret_vdso = 1, ret_vsys = 1; unsigned node; ret_sys = sys_getcpu(&cpu_sys, &node_sys, 0); if (vdso_getcpu) ret_vdso = vdso_getcpu(&cpu_vdso, &node_vdso, 0); if (vgetcpu) ret_vsys = vgetcpu(&cpu_vsys, &node_vsys, 0); if (!ret_sys) node = node_sys; else if (!ret_vdso) node = node_vdso; else if (!ret_vsys) node = node_vsys; bool ok = true; if (!ret_sys && (cpu_sys != cpu || node_sys != node)) ok = false; if (!ret_vdso && (cpu_vdso != cpu || node_vdso != node)) ok = false; if (!ret_vsys && (cpu_vsys != cpu || node_vsys != node)) ok = false; printf("[%s]\tCPU %u:", ok ? "OK" : "FAIL", cpu); if (!ret_sys) printf(" syscall: cpu %u, node %u", cpu_sys, node_sys); if (!ret_vdso) printf(" vdso: cpu %u, node %u", cpu_vdso, node_vdso); if (!ret_vsys) printf(" vsyscall: cpu %u, node %u", cpu_vsys, node_vsys); printf("\n"); if (!ok) nerrs++; } } int main(int argc, char **argv) { fill_function_pointers(); test_getcpu(); return nerrs ? 1 : 0; } e='committer'>committer
path: root/fs/affs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:42:04 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:42:04 -0800
commit83280e90ef001f77a64e2ce59c25ab66e47ab1f0 (patch)
treeec0a5842e2fbc0f4abaff55299acac397b8da5c3 /fs/affs
parentcc250e267bd56c531b0bee455fc724d50af83fac (diff)
parent0a8fd1346254974c3a852338508e4a4cddbb35f1 (diff)
Merge tag 'usb-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a bunch of USB fixes for 4.10-rc3. Yeah, it's a lot, an artifact of the holiday break I think. Lots of gadget and the usual XHCI fixups for reported issues (one day that driver will calm down...) Also included are a bunch of usb-serial driver fixes, and for good measure, a number of much-reported MUSB driver issues have finally been resolved. All of these have been in linux-next with no reported issues" * tag 'usb-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (72 commits) USB: fix problems with duplicate endpoint addresses usb: ohci-at91: use descriptor-based gpio APIs correctly usb: storage: unusual_uas: Add JMicron JMS56x to unusual device usb: hub: Move hub_port_disable() to fix warning if PM is disabled usb: musb: blackfin: add bfin_fifo_offset in bfin_ops usb: musb: fix compilation warning on unused function usb: musb: Fix trying to free already-free IRQ 4 usb: musb: dsps: implement clear_ep_rxintr() callback usb: musb: core: add clear_ep_rxintr() to musb_platform_ops USB: serial: ti_usb_3410_5052: fix NULL-deref at open USB: serial: spcp8x5: fix NULL-deref at open USB: serial: quatech2: fix sleep-while-atomic in close USB: serial: pl2303: fix NULL-deref at open USB: serial: oti6858: fix NULL-deref at open USB: serial: omninet: fix NULL-derefs at open and disconnect USB: serial: mos7840: fix misleading interrupt-URB comment USB: serial: mos7840: remove unused write URB USB: serial: mos7840: fix NULL-deref at open USB: serial: mos7720: remove obsolete port initialisation USB: serial: mos7720: fix parallel probe ...
Diffstat (limited to 'fs/affs')