22 Jul, 2015

1 commit

  • commit 60df4642a83546fa6ea8286f5094ce8c0906c3ec upstream.

    Make 3.81 doesn't have the 'undefine' command. Using undefine
    to clear LDFLAGS fails when make version 3.81 is used. Fix it
    to use override to clear LDFLAGS.

    Tested-by: Shuah Khan
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Michael Ellerman
    Link: http://lkml.kernel.org/r/20150514151225.GH23588@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Shuah Khan
    Cc: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Arnaldo Carvalho de Melo
     

30 May, 2015

1 commit

  • Test a couple of special cases in 32-bit kernels for entries
    from vm86 mode. This will OOPS both old kernels due to a bug
    and and 4.1-rc5 due to a regression I introduced, and it should
    make sure that the SYSENTER-from-vm86-mode hack in the kernel
    keeps working.

    Signed-off-by: Andy Lutomirski
    Cc: Jan Beulich
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/09a9916761e0a9e42d4922f147af45a0079cc1e8.1432936374.git.luto@kernel.org
    Tests: 394838c96013 x86/asm/entry/32: Fix user_mode() misuses
    Tests: 7ba554b5ac69 x86/asm/entry/32: Really make user_mode() work correctly for VM86 mode
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     

17 May, 2015

1 commit

  • …/git/shuah/linux-kselftest

    Pull kselftest fixes from Shuah Khan:
    "Urgent fix for Kselftest regression introduced in 4.1-rc1 by the new
    x86 test due to its hard dependency on 32-bit build environment.

    A set of 5 patches fix the make kselftest run and kselftest install"

    * tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests, x86: Rework x86 target architecture detection
    selftests, x86: Remove useless run_tests rule
    selftests/x86: install tests
    selftest/x86: have no dependency on all when cross building
    selftest/x86: build both bitnesses

    Linus Torvalds
     

13 May, 2015

5 commits


01 May, 2015

1 commit


30 Apr, 2015

1 commit

  • This reverts commit feba40362b11341bee6d8ed58d54b896abbd9f84.

    Although the principle of this change is good, the implementation has a
    few issues.

    Firstly we can sometimes fail to abort a syscall because r12 may have
    been clobbered by C code if we went down the virtual CPU accounting
    path, or if syscall tracing was enabled.

    Secondly we have decided that it is safer to abort the syscall even
    earlier in the syscall entry path, so that we avoid the syscall tracing
    path when we are transactional.

    So that we have time to thoroughly test those changes we have decided to
    revert this for this merge window and will merge the fixed version in
    the next window.

    NB. Rather than reverting the selftest we just drop tm-syscall from
    TEST_PROGS so that it's not run by default.

    Fixes: feba40362b11 ("powerpc/tm: Abort syscalls in active transactions")
    Signed-off-by: Michael Ellerman

    Michael Ellerman
     

18 Apr, 2015

1 commit

  • Pull x86 fixes from Ingo Molnar:
    "This tree includes:

    - an FPU related crash fix

    - a ptrace fix (with matching testcase in tools/testing/selftests/)

    - an x86 Kconfig DMA-config defaults tweak to better avoid
    non-working drivers"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected
    x86/fpu: Load xsave pointer *after* initialization
    x86/ptrace: Fix the TIF_FORCED_TF logic in handle_signal()
    x86, selftests: Add single_step_syscall test

    Linus Torvalds
     

17 Apr, 2015

1 commit

  • Pull powerpc updates from Michael Ellerman:

    - Numerous minor fixes, cleanups etc.

    - More EEH work from Gavin to remove its dependency on device_nodes.

    - Memory hotplug implemented entirely in the kernel from Nathan
    Fontenot.

    - Removal of redundant CONFIG_PPC_OF by Kevin Hao.

    - Rewrite of VPHN parsing logic & tests from Greg Kurz.

    - A fix from Nish Aravamudan to reduce memory usage by clamping
    nodes_possible_map.

    - Support for pstore on powernv from Hari Bathini.

    - Removal of old powerpc specific byte swap routines by David Gibson.

    - Fix from Vasant Hegde to prevent the flash driver telling you it was
    flashing your firmware when it wasn't.

    - Patch from Ben Herrenschmidt to add an OPAL heartbeat driver.

    - Fix for an oops causing get/put_cpu_var() imbalance in perf by Jan
    Stancek.

    - Some fixes for migration from Tyrel Datwyler.

    - A new syscall to switch the cpu endian by Michael Ellerman.

    - Large series from Wei Yang to implement SRIOV, reviewed and acked by
    Bjorn.

    - A fix for the OPAL sensor driver from Cédric Le Goater.

    - Fixes to get STRICT_MM_TYPECHECKS building again by Michael Ellerman.

    - Large series from Daniel Axtens to make our PCI hooks per PHB rather
    than per machine.

    - Small patch from Sam Bobroff to explicitly abort non-suspended
    transactions on syscalls, plus a test to exercise it.

    - Numerous reworks and fixes for the 24x7 PMU from Sukadev Bhattiprolu.

    - Small patch to enable the hard lockup detector from Anton Blanchard.

    - Fix from Dave Olson for missing L2 cache information on some CPUs.

    - Some fixes from Michael Ellerman to get Cell machines booting again.

    - Freescale updates from Scott: Highlights include BMan device tree
    nodes, an MSI erratum workaround, a couple minor performance
    improvements, config updates, and misc fixes/cleanup.

    * tag 'powerpc-4.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (196 commits)
    powerpc/powermac: Fix build error seen with powermac smp builds
    powerpc/pseries: Fix compile of memory hotplug without CONFIG_MEMORY_HOTREMOVE
    powerpc: Remove PPC32 code from pseries specific find_and_init_phbs()
    powerpc/cell: Fix iommu breakage caused by controller_ops change
    powerpc/eeh: Fix crash in eeh_add_device_early() on Cell
    powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
    powerpc/perf/hv-24x7: Fail 24x7 initcall if create_events_from_catalog() fails
    powerpc/pseries: Correct memory hotplug locking
    powerpc: Fix missing L2 cache size in /sys/devices/system/cpu
    powerpc: Add ppc64 hard lockup detector support
    oprofile: Disable oprofile NMI timer on ppc64
    powerpc/perf/hv-24x7: Add missing put_cpu_var()
    powerpc/perf/hv-24x7: Break up single_24x7_request
    powerpc/perf/hv-24x7: Define update_event_count()
    powerpc/perf/hv-24x7: Whitespace cleanup
    powerpc/perf/hv-24x7: Define add_event_to_24x7_request()
    powerpc/perf/hv-24x7: Rename hv_24x7_event_update
    powerpc/perf/hv-24x7: Move debug prints to separate function
    powerpc/perf/hv-24x7: Drop event_24x7_request()
    powerpc/perf/hv-24x7: Use pr_devel() to log message
    ...

    Conflicts:
    tools/testing/selftests/powerpc/Makefile
    tools/testing/selftests/powerpc/tm/Makefile

    Linus Torvalds
     

16 Apr, 2015

2 commits

  • This is a very simple test that makes system calls with TF set.

    This test currently fails when running the 32-bit build on a
    64-bit kernel on an Intel CPU. This bug will be fixed by the
    next commit.

    Signed-off-by: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Denys Vlasenko
    Cc: Oleg Nesterov
    Cc: Shuah Khan
    Link: http://lkml.kernel.org/r/20e68021155f6ab5c60590dcad81d37c68ea2c4f.1429139075.git.luto@kernel.org
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • When MAP_HUGETLB memory is unmapped, the length must be hugepage aligned,
    otherwise it fails with -EINVAL.

    All tests currently behave correctly, but it's better to explcitly test
    the return value for completeness and document the requirement, especially
    if users copy map_hugetlb.c as a sample implementation.

    Signed-off-by: David Rientjes
    Cc: Jonathan Corbet
    Cc: Davide Libenzi
    Cc: Luiz Capitulino
    Cc: Shuah Khan
    Cc: Hugh Dickins
    Cc: Andrea Arcangeli
    Cc: Joern Engel
    Cc: Jianguo Wu
    Cc: Eric B Munson
    Acked-by: Michael Ellerman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

15 Apr, 2015

1 commit

  • Pull RCU changes from Ingo Molnar:
    "The main changes in this cycle were:

    - changes permitting use of call_rcu() and friends very early in
    boot, for example, before rcu_init() is invoked.

    - add in-kernel API to enable and disable expediting of normal RCU
    grace periods.

    - improve RCU's handling of (hotplug-) outgoing CPUs.

    - NO_HZ_FULL_SYSIDLE fixes.

    - tiny-RCU updates to make it more tiny.

    - documentation updates.

    - miscellaneous fixes"

    * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (58 commits)
    cpu: Provide smpboot_thread_init() on !CONFIG_SMP kernels as well
    cpu: Defer smpboot kthread unparking until CPU known to scheduler
    rcu: Associate quiescent-state reports with grace period
    rcu: Yet another fix for preemption and CPU hotplug
    rcu: Add diagnostics to grace-period cleanup
    rcutorture: Default to grace-period-initialization delays
    rcu: Handle outgoing CPUs on exit from idle loop
    cpu: Make CPU-offline idle-loop transition point more precise
    rcu: Eliminate ->onoff_mutex from rcu_node structure
    rcu: Process offlining and onlining only at grace-period start
    rcu: Move rcu_report_unblock_qs_rnp() to common code
    rcu: Rework preemptible expedited bitmask handling
    rcu: Remove event tracing from rcu_cpu_notify(), used by offline CPUs
    rcutorture: Enable slow grace-period initializations
    rcu: Provide diagnostic option to slow down grace-period initialization
    rcu: Detect stalls caused by failure to propagate up rcu_node tree
    rcu: Eliminate empty HOTPLUG_CPU ifdef
    rcu: Simplify sync_rcu_preempt_exp_init()
    rcu: Put all orphan-callback-related code under same comment
    rcu: Consolidate offline-CPU callback initialization
    ...

    Linus Torvalds
     

14 Apr, 2015

1 commit

  • Pull x86 asm changes from Ingo Molnar:
    "There were lots of changes in this development cycle:

    - over 100 separate cleanups, restructuring changes, speedups and
    fixes in the x86 system call, irq, trap and other entry code, part
    of a heroic effort to deobfuscate a decade old spaghetti asm code
    and its C code dependencies (Denys Vlasenko, Andy Lutomirski)

    - alternatives code fixes and enhancements (Borislav Petkov)

    - simplifications and cleanups to the compat code (Brian Gerst)

    - signal handling fixes and new x86 testcases (Andy Lutomirski)

    - various other fixes and cleanups

    By their nature many of these changes are risky - we tried to test
    them well on many different x86 systems (there are no known
    regressions), and they are split up finely to help bisection - but
    there's still a fair bit of residual risk left so caveat emptor"

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (148 commits)
    perf/x86/64: Report regs_user->ax too in get_regs_user()
    perf/x86/64: Simplify regs_user->abi setting code in get_regs_user()
    perf/x86/64: Do report user_regs->cx while we are in syscall, in get_regs_user()
    perf/x86/64: Do not guess user_regs->cs, ss, sp in get_regs_user()
    x86/asm/entry/32: Tidy up JNZ instructions after TESTs
    x86/asm/entry/64: Reduce padding in execve stubs
    x86/asm/entry/64: Remove GET_THREAD_INFO() in ret_from_fork
    x86/asm/entry/64: Simplify jumps in ret_from_fork
    x86/asm/entry/64: Remove a redundant jump
    x86/asm/entry/64: Optimize [v]fork/clone stubs
    x86/asm/entry: Zero EXTRA_REGS for stub32_execve() too
    x86/asm/entry/64: Move stub_x32_execvecloser() to stub_execveat()
    x86/asm/entry/64: Use common code for rt_sigreturn() epilogue
    x86/asm/entry/64: Add forgotten CFI annotation
    x86/asm/entry/irq: Simplify interrupt dispatch table (IDT) layout
    x86/asm/entry/64: Move opportunistic sysret code to syscall code path
    x86, selftests: Add sigreturn selftest
    x86/alternatives: Guard NOPs optimization
    x86/asm/entry: Clear EXTRA_REGS for all executable formats
    x86/signal: Remove pax argument from restore_sigcontext
    ...

    Linus Torvalds
     

13 Apr, 2015

1 commit

  • …/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This is a milestone update in a sense. Several new tests and install
    and packaging support is added in this update.

    This update adds install and packaging tools developed on top of
    back-end shared logic enhancemnets to run and install tests. In
    addition several timer tests are added.

    - New timer tests from John Stultz

    - rtc test from Prarit Bhargava

    - Enhancements to un and install tests from Michael Ellerman

    - Install and packaging tools from Shuah Khan

    - Cross-compilation enablement from Tyler Baker

    - A couple of bug fixes"

    * tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (42 commits)
    ftracetest: Do not use usleep directly
    selftest/mqueue: enable cross compilation
    selftest/ipc: enable cross compilation
    selftest/memfd: include default header install path
    selftest/mount: enable cross compilation
    selftest/memfd: enable cross compilation
    kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
    selftests: Change memory on-off-test.sh name to be unique
    selftests: change cpu on-off-test.sh name to be unique
    selftests/mount: Make git ignore all binaries in mount test suite
    kselftests: timers: Reduce default runtime on inconsistency-check and set-timer-lat
    ftracetest: Convert exit -1 to exit $FAIL
    ftracetest: Cope properly with stack tracer not being enabled
    tools, update rtctest.c to verify passage of time
    Documentation, split up rtc.txt into documentation and test file
    selftests: Add tool to generate kselftest tar archive
    selftests: Add kselftest install tool
    selftests: Set CC using CROSS_COMPILE once in lib.mk
    selftests: Add install support for the powerpc tests
    selftests/timers: Use shared logic to run and install tests
    ...

    Linus Torvalds
     

11 Apr, 2015

2 commits


08 Apr, 2015

2 commits

  • Conflicts:
    arch/x86/kernel/entry_64.S

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • This is my sigreturn test, added mostly unchanged from its old
    home. It exercises the sigreturn(2) syscall, specifically
    focusing on its interactions with various IRET corner cases.

    It tests for correct behavior in several areas that were
    historically dangerously buggy. For example, it exercises espfix
    on kernels of both bitnesses under various conditions, and it
    contains testcases for several now-fixed bugs in IRET error
    handling.

    If you run it on older kernels without the fixes, your system will
    crash. It probably won't eat your data in the process.

    There is no released kernel on which the sigreturn_64 test will
    pass, but it passes on tip:x86/asm.

    I plan to switch to lib.mk for Linux 4.2.

    I'm not using the ksft_ helpers at all yet. I can do that later.

    Signed-off-by: Andy Lutomirski
    Acked-by: Shuah Khan
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Michael Ellerman
    Cc: Shuah Khan
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/89d10b76b92c7202d8123654dc8d36701c017b3d.1428386971.git.luto@kernel.org
    [ Fixed empty format string GCC build warning in trivial_32bit_program.c ]
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     

03 Apr, 2015

7 commits


02 Apr, 2015

2 commits


01 Apr, 2015

4 commits

  • This patch includes the mount test binaries into the .gitignore
    file listing in their respective directories. This will make sure
    that git ignores all of these test binaries when displaying status.

    Signed-off-by: Zhang Zhen
    Signed-off-by: Shuah Khan

    Zhang Zhen
     
  • For the default run_timers target, the timers tests takes the
    majority of kselftests runtime.

    So this patch reduces the default runtime for inconsistentcy-check
    and set-timer-lat, which reduced the runtime almost in half.

    Before: 11m48.629s
    After: 6m47.723s

    Cc: Shuah Khan
    Cc: Prarit Bhargava
    Cc: Thomas Gleixner
    Cc: Richard Cochran
    Signed-off-by: John Stultz
    Signed-off-by: Shuah Khan

    John Stultz
     
  • POSIX says that exit takes an unsigned integer between 0 and 255, so
    using -1 doesn't work on POSIX shells.

    There is already a well-defined failure code, $FAIL (1), so use that.

    Signed-off-by: Michael Ellerman
    Acked-by: Steven Rostedt
    Signed-off-by: Shuah Khan

    Michael Ellerman
     
  • If the stack tracer (CONFIG_STACK_TRACER) is disabled, the
    fgraph-filter-stack test blows chunks:

    [8] ftrace - function graph filters with stack tracer [FAIL]
    + reset_tracer
    + echo nop
    ./ftracetest: 19: /home/michael/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc:
    cannot create /proc/sys/kernel/stack_tracer_enabled: Directory nonexistent

    Fix it by checking if the proc file exists before echoing to it. With
    the patch applied it fails correctly with:

    [8] ftrace - function graph filters with stack tracer [UNSUPPORTED]

    Signed-off-by: Michael Ellerman
    Acked-by: Steven Rostedt
    Signed-off-by: Shuah Khan

    Michael Ellerman
     

28 Mar, 2015

1 commit

  • This adds a test of the switch_endian() syscall we added in the previous
    commit.

    We test it by calling the endian switch syscall, and then executing some
    code in the other endian to check everything went as expected. That code
    checks registers we expect to be maintained are. If the endian switch
    failed to happen that code sequence will be illegal and cause the test
    to abort.

    We then switch back to the original endian, do the same checks and
    finally write a success message and exit(0).

    Signed-off-by: Michael Ellerman

    Michael Ellerman
     

27 Mar, 2015

1 commit

  • …k/linux-rcu into core/rcu

    Pull RCU updates from Paul E. McKenney:

    - Documentation updates.

    - Changes permitting use of call_rcu() and friends very early in
    boot, for example, before rcu_init() is invoked.

    - Miscellaneous fixes.

    - Add in-kernel API to enable and disable expediting of normal RCU
    grace periods.

    - Improve RCU's handling of (hotplug-) outgoing CPUs.

    Note: ARM support is lagging a bit here, and these improved
    diagnostics might generate (harmless) splats.

    - NO_HZ_FULL_SYSIDLE fixes.

    - Tiny RCU updates to make it more tiny.

    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

25 Mar, 2015

2 commits

  • rtctest.c checks to see if PIE is functioning by testing if 20 interrupts occur
    at rates from 2HZ to 64HZ. While this check is good, it does not check to
    see if the correct amount of time has actually passed. This misses
    situations where the RTC may be operating at a higher or lower frequency
    than expected.

    This patch introduces a simple check to verify if the time passed is
    less than 10% of what was programmed into the RTC.

    Signed-off-by: Prarit Bhargava
    Acked-by: John Stultz
    Cc: corbet@lwn.net
    Cc: rtc-linux@googlegroups.com
    Cc: linux-doc@vger.kernel.org
    Cc: a.zummo@towertech.it
    Cc: prarit@redhat.com
    Cc: john.stultz@linaro.org
    Cc: shuahkh@osg.samsung.com
    Signed-off-by: Shuah Khan

    Prarit Bhargava
     
  • This patch splits rtc.txt into two separate files, one for the
    documentation itself, and the other for the rtctest.c file. The rtctest
    file is moved into the kernel tools/testing/selftests/timers directory.
    This will make automated testing easier. Note that the only difference in
    the rtc.txt file is that the location of the rtctest.c file has changed.

    Signed-off-by: Prarit Bhargava
    Acked-by: Jonathan Corbet
    Acked-by: John Stultz
    Cc: corbet@lwn.net
    Cc: rtc-linux@googlegroups.com
    Cc: linux-doc@vger.kernel.org
    Cc: a.zummo@towertech.it
    Cc: prarit@redhat.com
    Cc: john.stultz@linaro.org
    Cc: shuahkh@osg.samsung.com
    Signed-off-by: Shuah Khan

    Prarit Bhargava
     

24 Mar, 2015

2 commits

  • gen_kselftest_tar.sh tool generates kselftest tar archive. This tool
    supports uncompressed tar, gz, bz, and xz compression formats and the
    default compression format is gzip. This tool runs kselftest install
    tool as its back-end.

    Usage:
    cd tools/testing/selftests
    ./gen_kselftest_tar [ tar | targz | tarbz2 | tarxz ]

    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • kselftest_install.sh tool installs selftests in default location
    which is tools/testing/selftests/kselftest or an user specified
    location. This tool invokes back-end selftests install target with
    the install location.

    Usage:
    cd tools/testing/selftests
    ./kselftest_install.sh [ install_dir ]

    Signed-off-by: Shuah Khan

    Shuah Khan