21 Jan, 2016

14 commits

  • UBSAN uses compile-time instrumentation to catch undefined behavior
    (UB). Compiler inserts code that perform certain kinds of checks before
    operations that could cause UB. If check fails (i.e. UB detected)
    __ubsan_handle_* function called to print error message.

    So the most of the work is done by compiler. This patch just implements
    ubsan handlers printing errors.

    GCC has this capability since 4.9.x [1] (see -fsanitize=undefined
    option and its suboptions).
    However GCC 5.x has more checkers implemented [2].
    Article [3] has a bit more details about UBSAN in the GCC.

    [1] - https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html
    [2] - https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
    [3] - http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/

    Issues which UBSAN has found thus far are:

    Found bugs:

    * out-of-bounds access - 97840cb67ff5 ("netfilter: nfnetlink: fix
    insufficient validation in nfnetlink_bind")

    undefined shifts:

    * d48458d4a768 ("jbd2: use a better hash function for the revoke
    table")

    * 10632008b9e1 ("clockevents: Prevent shift out of bounds")

    * 'x << -1' shift in ext4 -
    http://lkml.kernel.org/r/

    * undefined rol32(0) -
    http://lkml.kernel.org/r/

    * undefined dirty_ratelimit calculation -
    http://lkml.kernel.org/r/

    * undefined roundown_pow_of_two(0) -
    http://lkml.kernel.org/r/

    * [WONTFIX] undefined shift in __bpf_prog_run -
    http://lkml.kernel.org/r/

    WONTFIX here because it should be fixed in bpf program, not in kernel.

    signed overflows:

    * 32a8df4e0b33f ("sched: Fix odd values in effective_load()
    calculations")

    * mul overflow in ntp -
    http://lkml.kernel.org/r/

    * incorrect conversion into rtc_time in rtc_time64_to_tm() -
    http://lkml.kernel.org/r/

    * unvalidated timespec in io_getevents() -
    http://lkml.kernel.org/r/

    * [NOTABUG] signed overflow in ktime_add_safe() -
    http://lkml.kernel.org/r/

    [akpm@linux-foundation.org: fix unused local warning]
    [akpm@linux-foundation.org: fix __int128 build woes]
    Signed-off-by: Andrey Ryabinin
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Randy Dunlap
    Cc: Rasmus Villemoes
    Cc: Jonathan Corbet
    Cc: Michal Marek
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Yury Gribov
    Cc: Dmitry Vyukov
    Cc: Konstantin Khlebnikov
    Cc: Kostya Serebryany
    Cc: Johannes Berg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     
  • The clz table (__clz_tab) in lib/clz_tab.c is also provided as part of
    libgcc.a, and many architectures link against libgcc. To allow the
    linker to avoid a multiple-definition link failure, clz_tab.o has to be
    in lib/lib.a rather than lib/builtin.o. The specific issue is that
    libgcc.a comes before lib/builtin.o on vmlinux.o's link command line, so
    its _clz.o is pulled to satisfy __clz_tab, and then when the remainder
    of lib/builtin.o is pulled in to satisfy all the other dependencies, the
    __clz_tab symbols conflict. By putting clz_tab.o in lib.a, the linker
    can simply avoid pulling it into vmlinux.o when this situation arises.

    The definitions of __clz_tab are the same in libgcc.a and in the kernel;
    arguably we could also simply rename the kernel version, but it's
    unlikely the libgcc version will ever change to become incompatible, so
    just using it seems reasonably safe.

    Signed-off-by: Chris Metcalf
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Like others test are doing print the gathered statistics after test module
    is finished. Return from the module based on the result.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Currently the only one combination is tested for overflow, i.e. rowsize =
    16, groupsize = 1, len = 1. Do various test to go through all possible
    branches.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • After processing by hex_dump_to_buffer() check all the parts to be expected.

    Part 1. The actual expected hex dump with or without ASCII part.

    Part 2. Check if the buffer is dirty beyond needed.

    Part 3. Return code should be as expected.

    This is done by using comparison of the return code and memcmp() against
    the test buffer. We fill the buffer by FILL_CHAR ('#') characters, so, we
    expect to have a tail of the buffer will be left untouched. The
    terminating NUL is also checked by memcmp().

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Better to use memcmp() against entire buffer to check that nothing is
    happened to the data in the tail.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The magic numbers of the length are converted to their actual meaning,
    such as end of the buffer with and without ASCII part.

    We don't touch the rest of the magic constants that will be removed in the
    following commits.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • When test for overflow do iterate the buffer length in a range 0 ..
    BUF_SIZE.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Define a character to fill the test buffers. Though the character should
    be printable since it's used when errors are reported. It should neither
    be from hex digit [a-fA-F0-9] dictionary nor space. It is recommended not
    to use one which is present in ASCII part of the test data. Later on we
    might switch to unprintable character to make test case more robust.

    Signed-off-by: Andy Shevchenko
    Suggested-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The function prepares the expected result in the provided buffer.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The test suite currently doesn't cover many corner cases when
    hex_dump_to_buffer() runs into overflow. Refactor and amend test suite
    to cover most of the cases.

    This patch (of 9):

    Just to follow the scheme that most of the test modules are using.

    There is no fuctional change.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Some drivers need to read data out of iomem areas 32-bits at a time.
    Add an API to do this.

    Signed-off-by: Stephen Boyd
    Cc: Bjorn Andersson
    Cc:
    Cc: David Howells
    Cc: Hauke Mehrtens
    Cc: Paul Walmsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • It was noticed that we lose precision in the final calculation for some
    inputs. The most egregious example is size=3000 blk_size=1900 in units
    of 10 should yield 5.70 MB but in fact yields 3.00 MB (oops).

    This is because the current algorithm doesn't correctly account for
    all the remainders in the logarithms. Fix this by doing a correct
    calculation in the remainders based on napier's algorithm.

    Additionally, now we have the correct result, we have to account for
    arithmetic rounding because we're printing 3 digits of precision. This
    means that if the fourth digit is five or greater, we have to round up,
    so add a section to ensure correct rounding. Finally account for all
    possible inputs correctly, including zero for block size.

    Fixes: b9f28d863594c429e1df35a0474d2663ca28b307
    Signed-off-by: James Bottomley
    Reported-by: Vitaly Kuznetsov
    Cc: [delay until after 4.4 release]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • Fix the following build warning:

    lib/libcrc32c.c:42:5: warning: no previous prototype for "crc32c" [-Wmissing-prototypes]
    u32 crc32c(u32 crc, const void *address, unsigned int length)
    ^

    Signed-off-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     

18 Jan, 2016

1 commit

  • …/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This 14 patch update:

    - adds a new test for intel_pstate driver
    - adds empty string and async test cases to firmware class tests
    - fixes and cleans up several existing tests"

    * tag 'linux-kselftest-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests: firmware: add empty string and async tests
    firmware: actually return NULL on failed request_firmware_nowait()
    test: firmware_class: add asynchronous request trigger
    test: firmware_class: use kstrndup() where appropriate
    test: firmware_class: report errors properly on failure
    selftests/seccomp: fix 32-bit build warnings
    add breakpoints/.gitignore
    add ptrace/.gitignore
    update .gitignore in selftests/timers
    update .gitignore in selftests/vm
    tools, testing, add test for intel_pstate driver
    selftest/ipc: actually test it
    selftests/capabilities: actually test it
    selftests/capabilities: clean up for Makefile

    Linus Torvalds
     

17 Jan, 2016

17 commits

  • Move switch case to the netdev_features_string() and rename it to
    netdev_bits(). In the future we can extend it as needed.

    Here we replace the fallback of %pN from '%p' with possible flags to
    sticter '0x%p' without any flags variation.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • special_hex_number() is a helper to print a fixed size type in a hex
    format with '0x' prefix, zero padding, and small letters. In the module
    we have already several copies of such code. Consolidate them under
    special_hex_number() helper.

    There are couple of differences though.

    It seems nobody cared about the output in case of CONFIG_KALLSYMS=n,
    when printing symbol address, because the asked field width is not
    enough to care last 2 characters in the string represantation of the
    pointer. Fixed here.

    The %pNF specifier used to be allowed with a specific field width,
    though there is neither any user of it nor mention the possibility in
    the documentation.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Following "lib/vsprintf.c: expand field_width to 24 bits", let's add a
    test to see that we now actually support bitmaps with 65536 bits.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • These should also count as performed tests.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This adds a few tests to test_number, one of which serves to document
    another deviation from POSIX/C99 (printing 0 with an explicit precision
    of 0).

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The kernel's printf doesn't follow the standards in a few corner cases
    (which are probably mostly irrelevant). Add tests that document the
    current behaviour.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Add a few padding bytes on either side of the test buffer, and check
    that these (and the part of the buffer not used) are untouched by
    vsnprintf.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • BUG is a completely unnecessarily big hammer, and we're more likely to
    get the internal bug reported if we just pr_err() and ensure the test
    suite fails.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Kees Cook
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • kasprintf relies on being able to replay the formatting and getting the
    same result (in particular, the same length). This will almost always
    work, but it is possible that the object pointed to by a %s or %p
    argument changed under us (so we might get truncated output). Add a
    somewhat paranoid sanity check and let's see if it ever triggers.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The field width is overloaded to pass some extra information for some %p
    extensions (e.g. #bits for %pb). But we might silently truncate the
    passed value when we stash it in struct printf_spec (see e.g.
    "lib/vsprintf.c: expand field_width to 24 bits"). Hopefully 23 value
    bits should now be enough for everybody, but if not, let's make some
    noise.

    Do the same for the precision. In both cases, clamping seems more
    sensible than truncating. While, according to POSIX, "A negative
    precision is taken as if the precision were omitted.", the kernel's
    printf has always treated that case as if the precision was 0, so we use
    that as lower bound. For the field width, the smallest representable
    value is actually -(1<
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • One consequence of the reorganization of struct printf_spec to make
    field_width 24 bits was that number() gained about 180 bytes. Since
    spec is never passed to other functions, we can help gcc make number()
    lose most of that extra weight by using local variables for the field
    width and precision.

    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Maurizio Lombardi reported a problem [1] with the %pb extension: It
    doesn't work for sufficiently large bitmaps, since the size is stashed
    in the field_width field of the struct printf_spec, which is currently
    an s16. Concretely, this manifested itself in
    /sys/bus/pseudo/drivers/scsi_debug/map being empty, since the bitmap
    printer got a size of 0, which is the 16 bit truncation of the actual
    bitmap size.

    We do want to keep struct printf_spec at 8 bytes so that it can cheaply
    be passed by value. The qualifier field is only used for internal
    bookkeeping in format_decode, so we might as well use a local variable
    for that. This gives us an additional 8 bits, which we can then use for
    the field width.

    To stay in 8 bytes, we need to do a little rearranging and make the type
    member a bitfield as well. For consistency, change all the members to
    bit fields. gcc doesn't generate much worse code with these changes (in
    fact, bloat-o-meter says we save 300 bytes - which I think is a little
    surprising).

    I didn't find a BUILD_BUG/compiletime_assertion/... which would work
    outside function context, so for now I just open-coded it.

    [1] http://thread.gmane.org/gmane.linux.kernel/2034835

    [akpm@linux-foundation.org: avoid open-coded BUILD_BUG_ON]
    Signed-off-by: Rasmus Villemoes
    Reported-by: Maurizio Lombardi
    Acked-by: Tejun Heo
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • If the string corresponding to a %s specifier can change under us, we
    might end up copying a \0 byte to the output buffer. There might be
    callers who expect the output buffer to contain a genuine C string whose
    length is exactly the snprintf return value (assuming truncation hasn't
    happened or has been checked for).

    We can avoid this by only passing over the source string once, stopping
    the first time we meet a nul byte (or when we reach the given
    precision), and then letting widen_string() handle left/right space
    padding. As a small bonus, this code reuse also makes the generated
    code slightly smaller.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This is pure code movement, making sure the widen_string() helper is
    defined before the string() function.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Pull out the logic in dentry_name() which handles field width space
    padding, in preparation for reusing it from string(). Rename the
    widen() helper to move_right(), since it is used for handling the
    !(flags & LEFT) case.

    Signed-off-by: Rasmus Villemoes
    Cc: Al Viro
    Cc: Andy Shevchenko
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Kees Cook
    Cc: Maurizio Lombardi
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • As illustrated by commit a3afe70b83fd ("[S390] latencytop s390
    support."), HAVE_LATENCYTOP_SUPPORT is defined by an architecture to
    advertise an implementation of save_stack_trace_tsk.

    However, as of 9212ddb5eada ("stacktrace: provide save_stack_trace_tsk()
    weak alias") a dummy implementation is provided if STACKTRACE=y. Given
    that LATENCYTOP already depends on STACKTRACE_SUPPORT and selects
    STACKTRACE, we can remove HAVE_LATENCYTOP_SUPPORT altogether.

    Signed-off-by: Will Deacon
    Acked-by: Heiko Carstens
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: James Hogan
    Cc: Michal Simek
    Cc: Helge Deller
    Acked-by: Michael Ellerman
    Cc: "David S. Miller"
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     

16 Jan, 2016

4 commits

  • get_dev_page() enables paths like get_user_pages() to pin a dynamically
    mapped pfn-range (devm_memremap_pages()) while the resulting struct page
    objects are in use. Unlike get_page() it may fail if the device is, or
    is in the process of being, disabled. While the initial lookup of the
    range may be an expensive list walk, the result is cached to speed up
    subsequent lookups which are likely to be in the same mapped range.

    devm_memremap_pages() now requires a reference counter to be specified
    at init time. For pmem this means moving request_queue allocation into
    pmem_alloc() so the existing queue usage counter can track "device
    pages".

    ZONE_DEVICE pages always have an elevated count and will never be on an
    lru reclaim list. That space in 'struct page' can be redirected for
    other uses, but for safety introduce a poison value that will always
    trip __list_add() to assert. This allows half of the struct list_head
    storage to be reclaimed with some assurance to back up the assumption
    that the page count never goes to zero and a list_add() is never
    attempted.

    Signed-off-by: Dan Williams
    Tested-by: Logan Gunthorpe
    Cc: Dave Hansen
    Cc: Matthew Wilcox
    Cc: Ross Zwisler
    Cc: Alexander Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • This patch adds a third argument to macros which create function
    definitions for page flags. This argument defines how page-flags
    helpers behave on compound functions.

    For now we define four policies:

    - PF_ANY: the helper function operates on the page it gets, regardless
    if it's non-compound, head or tail.

    - PF_HEAD: the helper function operates on the head page of the
    compound page if it gets tail page.

    - PF_NO_TAIL: only head and non-compond pages are acceptable for this
    helper function.

    - PF_NO_COMPOUND: only non-compound pages are acceptable for this
    helper function.

    For now we use policy PF_ANY for all helpers, which matches current
    behaviour.

    We do not enforce the policy for TESTPAGEFLAG, because we have flags
    checked for random pages all over the kernel. Noticeable exception to
    this is PageTransHuge() which triggers VM_BUG_ON() for tail page.

    Signed-off-by: Kirill A. Shutemov
    Cc: Andrea Arcangeli
    Cc: Hugh Dickins
    Cc: Dave Hansen
    Cc: Mel Gorman
    Cc: Rik van Riel
    Cc: Vlastimil Babka
    Cc: Christoph Lameter
    Cc: Naoya Horiguchi
    Cc: Steve Capper
    Cc: "Aneesh Kumar K.V"
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Jerome Marchand
    Cc: Jérôme Glisse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Pull powerpc updates from Michael Ellerman:
    "Core:
    - Ground work for the new Power9 MMU from Aneesh Kumar K.V
    - Optimise FP/VMX/VSX context switching from Anton Blanchard

    Misc:
    - Various cleanups from Krzysztof Kozlowski, John Ogness, Rashmica
    Gupta, Russell Currey, Gavin Shan, Daniel Axtens, Michael Neuling,
    Andrew Donnellan
    - Allow wrapper to work on non-english system from Laurent Vivier
    - Add rN aliases to the pt_regs_offset table from Rashmica Gupta
    - Fix module autoload for rackmeter & axonram drivers from Luis de
    Bethencourt
    - Include KVM guest test in all interrupt vectors from Paul Mackerras
    - Fix DSCR inheritance over fork() from Anton Blanchard
    - Make value-returning atomics & {cmp}xchg* & their atomic_ versions
    fully ordered from Boqun Feng
    - Print MSR TM bits in oops messages from Michael Neuling
    - Add TM signal return & invalid stack selftests from Michael Neuling
    - Limit EPOW reset event warnings from Vipin K Parashar
    - Remove the Cell QPACE code from Rashmica Gupta
    - Append linux_banner to exception information in xmon from Rashmica
    Gupta
    - Add selftest to check if VSRs are corrupted from Rashmica Gupta
    - Remove broken GregorianDay() from Daniel Axtens
    - Import Anton's context_switch2 benchmark into selftests from
    Michael Ellerman
    - Add selftest script to test HMI functionality from Daniel Axtens
    - Remove obsolete OPAL v2 support from Stewart Smith
    - Make enter_rtas() private from Michael Ellerman
    - PPR exception cleanups from Michael Ellerman
    - Add page soft dirty tracking from Laurent Dufour
    - Add support for Nvlink NPUs from Alistair Popple
    - Add support for kexec on 476fpe from Alistair Popple
    - Enable kernel CPU dlpar from sysfs from Nathan Fontenot
    - Copy only required pieces of the mm_context_t to the paca from
    Michael Neuling
    - Add a kmsg_dumper that flushes OPAL console output on panic from
    Russell Currey
    - Implement save_stack_trace_regs() to enable kprobe stack tracing
    from Steven Rostedt
    - Add HWCAP bits for Power9 from Michael Ellerman
    - Fix _PAGE_PTE breaking swapoff from Aneesh Kumar K.V
    - Fix _PAGE_SWP_SOFT_DIRTY breaking swapoff from Hugh Dickins
    - scripts/recordmcount.pl: support data in text section on powerpc
    from Ulrich Weigand
    - Handle R_PPC64_ENTRY relocations in modules from Ulrich Weigand

    cxl:
    - cxl: Fix possible idr warning when contexts are released from
    Vaibhav Jain
    - cxl: use correct operator when writing pcie config space values
    from Andrew Donnellan
    - cxl: Fix DSI misses when the context owning task exits from Vaibhav
    Jain
    - cxl: fix build for GCC 4.6.x from Brian Norris
    - cxl: use -Werror only with CONFIG_PPC_WERROR from Brian Norris
    - cxl: Enable PCI device ID for future IBM CXL adapter from Uma
    Krishnan

    Freescale:
    - Freescale updates from Scott: Highlights include moving QE code out
    of arch/powerpc (to be shared with arm), device tree updates, and
    minor fixes"

    * tag 'powerpc-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (149 commits)
    powerpc/module: Handle R_PPC64_ENTRY relocations
    scripts/recordmcount.pl: support data in text section on powerpc
    powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages
    powerpc/mm: fix _PAGE_SWP_SOFT_DIRTY breaking swapoff
    powerpc/mm: Fix _PAGE_PTE breaking swapoff
    cxl: Enable PCI device ID for future IBM CXL adapter
    cxl: use -Werror only with CONFIG_PPC_WERROR
    cxl: fix build for GCC 4.6.x
    powerpc: Add HWCAP bits for Power9
    powerpc/powernv: Reserve PE#0 on NPU
    powerpc/powernv: Change NPU PE# assignment
    powerpc/powernv: Fix update of NVLink DMA mask
    powerpc/powernv: Remove misleading comment in pci.c
    powerpc: Implement save_stack_trace_regs() to enable kprobe stack tracing
    powerpc: Fix build break due to paca mm_context_t changes
    cxl: Fix DSI misses when the context owning task exits
    MAINTAINERS: Update Scott Wood's e-mail address
    powerpc/powernv: Fix minor off-by-one error in opal_mce_check_early_recovery()
    powerpc: Fix style of self-test config prompts
    powerpc/powernv: Only delay opal_rtc_read() retry when necessary
    ...

    Linus Torvalds
     
  • Merge first patch-bomb from Andrew Morton:

    - A few hotfixes which missed 4.4 becasue I was asleep. cc'ed to
    -stable

    - A few misc fixes

    - OCFS2 updates

    - Part of MM. Including pretty large changes to page-flags handling
    and to thp management which have been buffered up for 2-3 cycles now.

    I have a lot of MM material this time.

    [ It turns out the THP part wasn't quite ready, so that got dropped from
    this series - Linus ]

    * emailed patches from Andrew Morton : (117 commits)
    zsmalloc: reorganize struct size_class to pack 4 bytes hole
    mm/zbud.c: use list_last_entry() instead of list_tail_entry()
    zram/zcomp: do not zero out zcomp private pages
    zram: pass gfp from zcomp frontend to backend
    zram: try vmalloc() after kmalloc()
    zram/zcomp: use GFP_NOIO to allocate streams
    mm: add tracepoint for scanning pages
    drivers/base/memory.c: fix kernel warning during memory hotplug on ppc64
    mm/page_isolation: use macro to judge the alignment
    mm: fix noisy sparse warning in LIBCFS_ALLOC_PRE()
    mm: rework virtual memory accounting
    include/linux/memblock.h: fix ordering of 'flags' argument in comments
    mm: move lru_to_page to mm_inline.h
    Documentation/filesystems: describe the shared memory usage/accounting
    memory-hotplug: don't BUG() in register_memory_resource()
    hugetlb: make mm and fs code explicitly non-modular
    mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
    mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
    mm: make sure isolate_lru_page() is never called for tail page
    vmstat: make vmstat_updater deferrable again and shut down on idle
    ...

    Linus Torvalds
     

15 Jan, 2016

2 commits

  • Pull trivial tree updates from Jiri Kosina.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
    floppy: make local variable non-static
    exynos: fixes an incorrect header guard
    dt-bindings: fixes some incorrect header guards
    cpufreq-dt: correct dead link in documentation
    cpufreq: ARM big LITTLE: correct dead link in documentation
    treewide: Fix typos in printk
    Documentation: filesystem: Fix typo in fs/eventfd.c
    fs/super.c: use && instead of & for warn_on condition
    Documentation: fix sysfs-ptp
    lib: scatterlist: fix Kconfig description

    Linus Torvalds
     
  • In include/asm-generic/sections.h:

    /*
    * Usage guidelines:
    * _text, _data: architecture specific, don't use them in
    * arch-independent code
    * [_stext, _etext]: contains .text.* sections, may also contain
    * .rodata.*
    * and/or .init.* sections

    _text is not guaranteed across architectures. Architectures such as ARM
    may reuse parts which are not actually text and erroneously trigger a bug.
    Switch to using _stext which is guaranteed to contain text sections.

    Came out of https://lkml.kernel.org/g/

    Signed-off-by: Laura Abbott
    Reviewed-by: Kees Cook
    Cc: Russell King
    Cc: Arnd Bergmann
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laura Abbott
     

14 Jan, 2016

1 commit

  • Pull libnvdimm updates from Dan Williams:
    "The bulk of this has appeared in -next and independently received a
    build success notification from the kbuild robot. The 'for-4.5/block-
    dax' topic branch was rebased over the weekend to drop the "block
    device end-of-life" rework that Al would like to see re-implemented
    with a notifier, and to address bug reports against the badblocks
    integration.

    There is pending feedback against "libnvdimm: Add a poison list and
    export badblocks" received last week. Linda identified some localized
    fixups that we will handle incrementally.

    Summary:

    - Media error handling: The 'badblocks' implementation that
    originated in md-raid is up-levelled to a generic capability of a
    block device. This initial implementation is limited to being
    consulted in the pmem block-i/o path. Later, 'badblocks' will be
    consulted when creating dax mappings.

    - Raw block device dax: For virtualization and other cases that want
    large contiguous mappings of persistent memory, add the capability
    to dax-mmap a block device directly.

    - Increased /dev/mem restrictions: Add an option to treat all
    io-memory as IORESOURCE_EXCLUSIVE, i.e. disable /dev/mem access
    while a driver is actively using an address range. This behavior
    is controlled via the new CONFIG_IO_STRICT_DEVMEM option and can be
    overridden by the existing "iomem=relaxed" kernel command line
    option.

    - Miscellaneous fixes include a 'pfn'-device huge page alignment fix,
    block device shutdown crash fix, and other small libnvdimm fixes"

    * tag 'libnvdimm-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (32 commits)
    block: kill disk_{check|set|clear|alloc}_badblocks
    libnvdimm, pmem: nvdimm_read_bytes() badblocks support
    pmem, dax: disable dax in the presence of bad blocks
    pmem: fail io-requests to known bad blocks
    libnvdimm: convert to statically allocated badblocks
    libnvdimm: don't fail init for full badblocks list
    block, badblocks: introduce devm_init_badblocks
    block: clarify badblocks lifetime
    badblocks: rename badblocks_free to badblocks_exit
    libnvdimm, pmem: move definition of nvdimm_namespace_add_poison to nd.h
    libnvdimm: Add a poison list and export badblocks
    nfit_test: Enable DSMs for all test NFITs
    md: convert to use the generic badblocks code
    block: Add badblock management for gendisks
    badblocks: Add core badblock management code
    block: fix del_gendisk() vs blkdev_ioctl crash
    block: enable dax for raw block devices
    block: introduce bdev_file_inode()
    restrict /dev/mem to idle io memory ranges
    arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug
    ...

    Linus Torvalds
     

13 Jan, 2016

1 commit

  • Pull tracing updates from Steven Rostedt:
    "Not much new with tracing for this release. Mostly just clean ups and
    minor fixes.

    Here's what else is new:

    - A new TRACE_EVENT_FN_COND macro, combining both _FN and _COND for
    those that want both.

    - New selftest to test the instance create and delete

    - Better debug output when ftrace fails"

    * tag 'trace-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (24 commits)
    ftrace: Fix the race between ftrace and insmod
    ftrace: Add infrastructure for delayed enabling of module functions
    x86: ftrace: Fix the comments for ftrace_modify_code_direct()
    tracing: Fix comment to use tracing_on over tracing_enable
    metag: ftrace: Fix the comments for ftrace_modify_code
    sh: ftrace: Fix the comments for ftrace_modify_code()
    ia64: ftrace: Fix the comments for ftrace_modify_code()
    ftrace: Clean up ftrace_module_init() code
    ftrace: Join functions ftrace_module_init() and ftrace_init_module()
    tracing: Introduce TRACE_EVENT_FN_COND macro
    tracing: Use seq_buf_used() in seq_buf_to_user() instead of len
    bpf: Constify bpf_verifier_ops structure
    ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too
    ftrace: Remove use of control list and ops
    ftrace: Fix output of enabled_functions for showing tramp
    ftrace: Fix a typo in comment
    ftrace: Show all tramps registered to a record on ftrace_bug()
    ftrace: Add variable ftrace_expected for archs to show expected code
    ftrace: Add new type to distinguish what kind of ftrace_bug()
    tracing: Update cond flag when enabling or disabling a trigger
    ...

    Linus Torvalds