18 Oct, 2018

2 commits

  • [ Upstream commit 4d85af102a66ee6aeefa596f273169e77fb2b48e ]

    add CONFIG_MEMORY_HOTREMOVE=y in config
    without this config, /sys/devices/system/memory/memory*/removable
    always return 0, I endup getting an early skip during test

    Signed-off-by: Lei Yang
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lei Yang
     
  • [ Upstream commit 53cf59d6c0ad3edc4f4449098706a8f8986258b6 ]

    add config file

    Signed-off-by: Lei Yang
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lei Yang
     

13 Oct, 2018

2 commits

  • commit 02e425668f5c9deb42787d10001a3b605993ad15 upstream.

    When I added the missing memory outputs, I failed to update the
    index of the first argument (ebx) on 32-bit builds, which broke the
    fallbacks. Somehow I must have screwed up my testing or gotten
    lucky.

    Add another test to cover gettimeofday() as well.

    Signed-off-by: Andy Lutomirski
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Fixes: 715bd9d12f84 ("x86/vdso: Fix asm constraints on vDSO syscall fallbacks")
    Link: http://lkml.kernel.org/r/21bd45ab04b6d838278fa5bebfa9163eceffa13c.1538608971.git.luto@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • commit 7c03e7035ac1cf2a6165754e4f3a49c2f1977838 upstream.

    Now that the vDSO implementation of clock_gettime() is getting
    reworked, add a selftest for it. This tests that its output is
    consistent with the syscall version.

    This is marked for stable to serve as a test for commit

    715bd9d12f84 ("x86/vdso: Fix asm constraints on vDSO syscall fallbacks")

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/082399674de2619b2befd8c0dde49b260605b126.1538422295.git.luto@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     

26 Sep, 2018

1 commit

  • [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ]

    In the past we've warned when ADJ_OFFSET was in progress, usually
    caused by ntpd or some other time adjusting daemon running in non
    steady sate, which can cause the skew calculations to be
    incorrect.

    Thus, this patch checks to see if the clock was being adjusted
    when we fail so that we don't cause false negatives.

    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Miroslav Lichvar
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Stephen Boyd
    Cc: Shuah Khan
    Cc: linux-kselftest@vger.kernel.org
    Suggested-by: Miroslav Lichvar
    Signed-off-by: John Stultz
    Signed-off-by: Greg Kroah-Hartman

    John Stultz
     

20 Sep, 2018

2 commits

  • [ Upstream commit 45df5d3dc0c7289c1e67afe6d2ba806ad5174314 ]

    The mock / test version of pmem_direct_access() needs to check the
    validity of pointers kaddr and pfn for NULL assignment. If anyone
    equals to NULL, it doesn't need to calculate the value.

    If pointer equals to NULL, that is to say callers may have no need for
    kaddr or pfn, so this patch is prepared for allowing them to pass in
    NULL instead of having to pass in a local pointer or variable that
    they then just throw away.

    Suggested-by: Dan Williams
    Signed-off-by: Huaisheng Ye
    Reviewed-by: Ross Zwisler
    Signed-off-by: Dave Jiang
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Huaisheng Ye
     
  • [ Upstream commit 0069fb854364da79fd99236ea620affc8e1152d5 ]

    Commit fbeb1603bf4e ("bpf: verifier: MOV64 don't mark dst reg unbounded")
    revealed a typo in commit fb30d4b71214 ("bpf: Add tests for map-in-map"):
    BPF_MOV64_REG(BPF_REG_0, 0) was used instead of
    BPF_MOV64_IMM(BPF_REG_0, 0).

    I've noticed the problem by running bpf kselftests.

    Fixes: fb30d4b71214 ("bpf: Add tests for map-in-map")
    Signed-off-by: Roman Gushchin
    Cc: Martin KaFai Lau
    Cc: Arthur Fabre
    Cc: Daniel Borkmann
    Cc: Alexei Starovoitov
    Acked-by: Martin KaFai Lau
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Roman Gushchin
     

15 Sep, 2018

1 commit

  • [ Upstream commit 7c27a26e1ed5a7dd709aa19685d2c98f64e1cf0c ]

    There are some powerpc selftests, as tm/tm-unavailable, that run for a long
    period (>120 seconds), and if it is interrupted, as pressing CRTL-C
    (SIGINT), the foreground process (harness) dies but the child process and
    threads continue to execute (with PPID = 1 now) in background.

    In this case, you'd think the whole test exited, but there are remaining
    threads and processes being executed in background. Sometimes these
    zombies processes are doing annoying things, as consuming the whole CPU or
    dumping things to STDOUT.

    This patch fixes this problem by attaching an empty signal handler to
    SIGINT in the harness process. This handler will interrupt (EINTR) the
    parent process waitpid() call, letting the code to follow through the
    normal flow, which will kill all the processes in the child process group.

    This patch also fixes a typo.

    Signed-off-by: Breno Leitao
    Signed-off-by: Gustavo Romero
    Signed-off-by: Michael Ellerman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Breno Leitao
     

05 Sep, 2018

1 commit

  • [ Upstream commit 82f4f3e69c5c29bce940dd87a2c0f16c51d48d17 ]

    Add a testcase for checking snapshot and tracing_on
    relationship. This ensures that the snapshotting doesn't
    affect current tracing on/off settings.

    Link: http://lkml.kernel.org/r/153149932412.11274.15289227592627901488.stgit@devbox

    Cc: Tom Zanussi
    Cc: Hiraku Toyooka
    Signed-off-by: Masami Hiramatsu
    Cc: Ingo Molnar
    Cc: Shuah Khan
    Cc: linux-kselftest@vger.kernel.org
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Masami Hiramatsu
     

24 Aug, 2018

10 commits

  • [ Upstream commit e8a445dea219c32727016af14f847d2e8f7ebec8 ]

    We have short names for the requested and resulting register values.
    Use them instead of spelling out the whole register entry for each
    case.

    Signed-off-by: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/bb3bc1f923a2f6fe7912d22a1068fe29d6033d38.1530076529.git.luto@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • [ Upstream commit ec348020566009d3da9b99f07c05814d13969c78 ]

    When I wrote the sigreturn test, I didn't realize that AMD's busted
    IRET behavior was different from Intel's busted IRET behavior:

    On AMD CPUs, the CPU leaks the high 32 bits of the kernel stack pointer
    to certain userspace contexts. Gee, thanks. There's very little
    the kernel can do about it. Modify the test so it passes.

    Signed-off-by: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/86e7fd3564497f657de30a36da4505799eebef01.1530076529.git.luto@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • [ Upstream commit 81e167c2a216e7b54e6add9d2badcda267fe33b1 ]

    The test_kmod.sh script require root privilege for the successful
    execution of the test.

    This patch is to notify the user about the privilege the script
    demands for the successful execution of the test.

    Signed-off-by: Jeffrin Jose T (Rajagiri SET)
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jeffrin Jose T
     
  • [ Upstream commit d6a3e55131fcb1e5ca1753f4b6f297a177b2fc91 ]

    Unless the software synchronization objects (CONFIG_SW_SYNC) is enabled,
    the sync test will be skipped:

    TAP version 13
    1..0 # Skipped: Sync framework not supported by kernel

    Add a config fragment file to be able to run "make kselftest-merge" to
    enable relevant configuration required in order to run the sync test.

    Signed-off-by: Fathi Boudra
    Link: https://lkml.org/lkml/2017/5/5/14
    Signed-off-by: Anders Roxell
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Fathi Boudra
     
  • [ Upstream commit a4d7537789724985cafbc9260a31ca4f2b7cf123 ]

    When vm test is skipped because of unmet dependencies and/or unsupported
    configuration, it exits with error which is treated as a fail by the
    Kselftest framework. This leads to false negative result even when the
    test could not be run.

    Change it to return kselftest skip code when a test gets skipped to
    clearly report that the test could not be run.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Acked-by: Mike Rapoport
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit 685814466bf8398192cf855415a0bb2cefc1930e ]

    When zram test is skipped because of unmet dependencies and/or
    unsupported configuration, it exits with error which is treated as
    a fail by the Kselftest framework. This leads to false negative result
    even when the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to
    clearly report that the test could not be run.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit d7d5311d4aa9611fe1a5a851e6f75733237a668a ]

    When user test is skipped because of unmet dependencies and/or
    unsupported configuration, it exits with error which is treated as
    a fail by the Kselftest framework. This leads to false negative result
    even when the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to
    clearly report that the test could not be run. Add an explicit check
    for module presence and return skip code if module isn't present.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit c7db6ffb831fd36a03485a0d88b1e505378975ad ]

    When sysctl test is skipped because of unmet dependencies and/or
    unsupported configuration, it exits with error which is treated as
    a fail by the Kselftest framework. This leads to false negative result
    even when the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to
    clearly report that the test could not be run.

    Changed return code to kselftest skip code in skip error legs that check
    requirements and module probe test error leg.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Reviewed-by: Kees Cook
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit 8781578087b8fb8829558bac96c3c24e5ba26f82 ]

    When static_keys test is skipped because of unmet dependencies and/or
    unsupported configuration, it exits with error which is treated as a fail
    by the Kselftest framework. This leads to false negative result even when
    the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to clearly
    report that the test could not be run.

    Added an explicit searches for test_static_key_base and test_static_keys
    modules and return skip code if they aren't found to differentiate between
    the failure to load the module condition and module not found condition.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit 856e7c4b619af622d56b3b454f7bec32a170ac99 ]

    When pstore_post_reboot test gets skipped because of unmet dependencies
    and/or unsupported configuration, it returns 0 which is treated as a pass
    by the Kselftest framework. This leads to false positive result even when
    the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to clearly
    report that the test could not be run.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Reviewed-by: Kees Cook
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     

03 Aug, 2018

3 commits

  • [ Upstream commit 5c30a038fb8ec8cdff011e6b5d5d51eb415381d4 ]

    When intel_pstate test is skipped because of unmet dependencies and/or
    unsupported configuration, it returns 0 which is treated as a pass
    by the Kselftest framework. This leads to false positive result even
    when the test could not be run.

    Change it to return kselftest skip code when a test gets skipped to
    clearly report that the test could not be run.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit b27f0259e8cea74c627327c063742a83613dd460 ]

    When memfd test is skipped because of unmet dependencies and/or unsupported
    configuration, it returns non-zero value which is treated as a fail by the
    Kselftest framework. This leads to false negative result even when the test
    could not be run.

    Change it to return kselftest skip code when a test gets skipped to clearly
    report that the test could not be run.

    Added an explicit check for root user at the start of memfd hugetlbfs test
    and return skip code if a non-root user attempts to run it.

    In addition, return skip code when not enough huge pages are available to
    run the test.

    Kselftest framework SKIP code is 4 and the framework prints appropriate
    messages to indicate that the test is skipped.

    Signed-off-by: Shuah Khan (Samsung OSG)
    Reviewed-by: Mike Kravetz
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan (Samsung OSG)
     
  • [ Upstream commit e9d33f149f52981fd856a0b16aa8ebda89b02e34 ]

    A few changes improve the overall usability of the test:
    * fix a hard-coded maximum frequency (3300),
    * don't adjust the CPU frequency if only evaluating results,
    * fix a comparison for multiple frequencies.

    A symptom of that last issue looked like this:
    ./run.sh: line 107: [: too many arguments
    ./run.sh: line 110: 3099
    3099
    3100-3100: syntax error in expression (error token is \"3099
    3100-3100\")

    Because a check will count how many differente frequencies
    there are among the CPUs of the system, and after they are
    tallied another read is performed, which might produce
    different results.

    Signed-off-by: Daniel Díaz
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Daniel Díaz
     

03 Jul, 2018

1 commit

  • commit 756b56a9e832e063edc83be7c3889e98c536dd2b upstream.

    The trigger code is picky in how it can be disabled as there may be
    dependencies between different events and synthetic events. Change the order
    on how triggers are reset.

    1) Reset triggers of all synthetic events first
    2) Remove triggers with actions attached to them
    3) Remove all other triggers

    If this order isn't followed, then some triggers will not be reset, and an
    error may happen because a trigger is busy.

    Cc: stable@vger.kernel.org
    Fixes: cfa0963dc474f ("kselftests/ftrace : Add event trigger testcases")
    Reviewed-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (VMware)
     

21 Jun, 2018

14 commits

  • [ Upstream commit 3488a600d90bcaf061b104dbcfbdc8d99b398312 ]

    Protection key 0 is the default key for all memory and will
    not normally come back from pkey_alloc(). But, you might
    still want pass it to mprotect_pkey().

    This check ensures that you can use pkey 0.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171356.9E40B254@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit acb25d761d6f2f64e785ccefc71e54f244f1eda4 ]

    This makes it possible to to tell what 'prot' a given allocation
    is supposed to have. That way, if we want to change just the
    pkey, we know what 'prot' to pass to mprotect_pkey().

    Also, keep a record of the most recent allocation so the tests
    can easily find it.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171354.AA23E228@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 3d64f4ed15c3c53dba4c514bf59c334464dee373 ]

    We dump out the entire area of the siginfo where the si_pkey_ptr is
    supposed to be. But, we do some math on the poitner, which is a u32.
    We intended to do byte math, not u32 math on the pointer.

    Cast it over to a u8* so it works.

    Also, move this block of code to below th si_code check. It doesn't
    hurt anything, but the si_pkey field is gibberish for other signal
    types.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171352.9BE09819@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit f50b4878329ab61d8e05796f655adeb6f5fb57c6 ]

    In our "exhaust all pkeys" test, we make sure that there
    is the expected number available. Turns out that the
    test did not cover the execute-only key, but discussed
    it anyway. It did *not* discuss the test-allocated
    key.

    Now that we have a test for the mprotect(PROT_EXEC) case,
    this off-by-one issue showed itself. Correct the off-by-
    one and add the explanation for the case we missed.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171350.E1656B95@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 6af17cf89e99b64cf1f660bf848755442ab2f047 ]

    Under the covers, implement executable-only memory with
    protection keys when userspace calls mprotect(PROT_EXEC).

    But, we did not have a selftest for that. Now we do.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171348.9EEE4BEF@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 3fcd2b2d928904cbf30b01e2c5e4f1dd2f9ab262 ]

    We currently have an execute-only test, but it is for
    the explicit mprotect_pkey() interface. We will soon
    add a test for the implicit mprotect(PROT_EXEC)
    enterface. We need this code in both tests.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171347.C64AB733@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 7e7fd67ca39335a49619729821efb7cbdd674eb0 ]

    The exec-only pkey is allocated inside the kernel and userspace
    is not told what it is. So, allow PK faults to occur that have
    an unknown key.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171345.7FC7DA00@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit a50093d60464dd51d1ae0c2267b0abe9e1de77f3 ]

    There is some noisy debug code at the end of the signal handler. It was
    disabled by an early, unconditional "return". However, that return also
    hid a dprint_in_signal=0, which kept dprint_in_signal=1 and effectively
    locked us into permanent dprint_in_signal=1 behavior.

    Remove the return and the dead code, fixing dprint_in_signal.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171342.846B9B2E@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 86b9eea230edf4c67d4d4a70fba9b74505867a25 ]

    If we use assert(), the program "crashes". That can be scary to users,
    so stop doing it. Just exit with a >0 exit code instead.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171340.E63EF7DA@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 55556b0b2016806b2e16a20b62d143383983a34a ]

    do_not_expect_pk_fault() is a helper that we call when we do not expect
    a PK fault to have occurred. But, it is a function, which means that
    it obscures the line numbers from pkey_assert(). It also gives no
    details.

    Replace it with an implementation that gives nice line numbers and
    also lets callers pass in a more descriptive message about what
    happened that caused the unexpected fault.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Michael Ellermen
    Cc: Peter Zijlstra
    Cc: Ram Pai
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20180509171338.55D13B64@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dave Hansen
     
  • [ Upstream commit 59c2a7226fc5130032021c99f05ad5c0a56551cd ]

    This exercises a nasty corner case of the x86 ISA.

    Signed-off-by: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/67e08b69817171da8026e0eb3af0214b06b4d74f.1525800455.git.luto@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • [ Upstream commit 73bb4d6cd192b8629c5125aaada9892d9fc986b6 ]

    Fix this warning:

    mpx-mini-test.c:422:0: warning: "SEGV_BNDERR" redefined

    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: akpm@linux-foundation.org
    Cc: dave.hansen@intel.com
    Cc: linux-mm@kvack.org
    Cc: linuxram@us.ibm.com
    Cc: mpe@ellerman.id.au
    Cc: shakeelb@google.com
    Cc: shuah@kernel.org
    Link: http://lkml.kernel.org/r/20180514085908.GA12798@gmail.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ingo Molnar
     
  • [ Upstream commit 0fb96620dce351608aa82eed5942e2f58b07beda ]

    Ubuntu 18.04 started exporting pkeys details in header files, resulting
    in build failures and warnings in the pkeys self-tests:

    protection_keys.c:232:0: warning: "SEGV_BNDERR" redefined
    protection_keys.c:387:5: error: conflicting types for ‘pkey_get’
    protection_keys.c:409:5: error: conflicting types for ‘pkey_set’
    ...

    Fix these namespace conflicts and double definitions, plus also
    clean up the ABI definitions to make it all a bit more readable ...

    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: akpm@linux-foundation.org
    Cc: dave.hansen@intel.com
    Cc: linux-mm@kvack.org
    Cc: linuxram@us.ibm.com
    Cc: mpe@ellerman.id.au
    Cc: shakeelb@google.com
    Cc: shuah@kernel.org
    Link: http://lkml.kernel.org/r/20180514085623.GB7094@gmail.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ingo Molnar
     
  • [ Upstream commit 25aa50e0ca397a5e5d4d6fcecefa8107877d1dd0 ]

    Add a testcase for multiple actions with different
    parameters on an event trigger, which has been fixed
    by commit 192c283e93bd ("tracing: Add action comparisons
    when testing matching hist triggers").

    Link: http://lkml.kernel.org/r/152292055227.15769.6327959816123227152.stgit@devbox

    Reviewed-by: Tom Zanussi
    Tested-by: Tom Zanussi
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Masami Hiramatsu
     

30 May, 2018

3 commits

  • [ Upstream commit ddd0010392d9cbcb95b53d11b7cafc67b373ab56 ]

    eBPF test fails due to verifier failure because log_buf is too small.
    Fixed by increasing log_buf size

    Signed-off-by: Prashant Bhole
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Prashant Bhole
     
  • [ Upstream commit 88893cf787d3062c631cc20b875068eb11756e03 ]

    Some tests cause the kernel to print things to the kernel log
    buffer (ie. printk), in particular oops and warnings etc. However when
    running all the tests in succession it's not always obvious which
    test(s) caused the kernel to print something.

    We can narrow it down by printing which test directory we're running
    in to /dev/kmsg, if it's writable.

    Example output:

    [ 170.149149] kselftest: Running tests in powerpc
    [ 305.300132] kworker/dying (71) used greatest stack depth: 7776 bytes
    left
    [ 808.915456] kselftest: Running tests in pstore

    Signed-off-by: Michael Ellerman
    Signed-off-by: Shuah Khan
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • [ Upstream commit dfa453bc90eca0febff33c8d292a656e53702158 ]

    Add a testcase for probe point definition. This tests
    symbol, address and symbol+offset syntax. The offset
    must be positive and smaller than UINT_MAX.

    Link: http://lkml.kernel.org/r/152129043097.31874.14273580606301767394.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Masami Hiramatsu