31 Oct, 2018

13 commits

  • When a memblock allocation APIs are called with align = 0, the alignment
    is implicitly set to SMP_CACHE_BYTES.

    Implicit alignment is done deep in the memblock allocator and it can
    come as a surprise. Not that such an alignment would be wrong even
    when used incorrectly but it is better to be explicit for the sake of
    clarity and the prinicple of the least surprise.

    Replace all such uses of memblock APIs with the 'align' parameter
    explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
    in the memblock internal allocation functions.

    For the case when memblock APIs are used via helper functions, e.g. like
    iommu_arena_new_node() in Alpha, the helper functions were detected with
    Coccinelle's help and then manually examined and updated where
    appropriate.

    The direct memblock APIs users were updated using the semantic patch below:

    @@
    expression size, min_addr, max_addr, nid;
    @@
    (
    |
    - memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
    |
    - memblock_alloc(size, 0)
    + memblock_alloc(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_raw(size, 0)
    + memblock_alloc_raw(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from(size, 0, min_addr)
    + memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_nopanic(size, 0)
    + memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low(size, 0)
    + memblock_alloc_low(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low_nopanic(size, 0)
    + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from_nopanic(size, 0, min_addr)
    + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_node(size, 0, nid)
    + memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
    )

    [mhocko@suse.com: changelog update]
    [akpm@linux-foundation.org: coding-style fixes]
    [rppt@linux.ibm.com: fix missed uses of implicit alignment]
    Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
    Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Suggested-by: Michal Hocko
    Acked-by: Paul Burton [MIPS]
    Acked-by: Michael Ellerman [powerpc]
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Drop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of
    identical MEMBLOCK definitions.

    Link: http://lkml.kernel.org/r/1536927045-23536-29-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The conversion is done using

    sed -i 's@free_all_bootmem@memblock_free_all@' \
    $(git grep -l free_all_bootmem)

    Link: http://lkml.kernel.org/r/1536927045-23536-26-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The alloc_bootmem(size) is a shortcut for allocation of SMP_CACHE_BYTES
    aligned memory. When the align parameter of memblock_alloc() is 0, the
    alignment is implicitly set to SMP_CACHE_BYTES and thus alloc_bootmem(size)
    and memblock_alloc(size, 0) are equivalent.

    The conversion is done using the following semantic patch:

    @@
    expression size;
    @@
    - alloc_bootmem(size)
    + memblock_alloc(size, 0)

    Link: http://lkml.kernel.org/r/1536927045-23536-22-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The functions are equivalent, just the later does not require nobootmem
    translation layer.

    The conversion is done using the following semantic patch:

    @@
    expression size, align, goal;
    @@
    - __alloc_bootmem(size, align, goal)
    + memblock_alloc_from(size, align, goal)

    Link: http://lkml.kernel.org/r/1536927045-23536-21-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Both functions attempt to allocate memory with specified alignment from a
    particular node. If the allocation from that node fails, they both fall
    back to allocating from any node in the system.

    Usage of native memblock API eliminates the nobootmem translation layer.

    Link: http://lkml.kernel.org/r/1536927045-23536-18-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Use memblock_alloc_try_nid whenever goal (i.e. minimal address is
    specified) and memblock_alloc_node otherwise.

    Link: http://lkml.kernel.org/r/1536927045-23536-17-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The functions are equivalent, just the later does not require nobootmem
    translation layer.

    Link: http://lkml.kernel.org/r/1536927045-23536-16-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • All architecures use memblock for early memory management. There is no need
    for the CONFIG_HAVE_MEMBLOCK configuration option.

    [rppt@linux.vnet.ibm.com: of/fdt: fixup #ifdefs]
    Link: http://lkml.kernel.org/r/20180919103457.GA20545@rapoport-lnx
    [rppt@linux.vnet.ibm.com: csky: fixups after bootmem removal]
    Link: http://lkml.kernel.org/r/20180926112744.GC4628@rapoport-lnx
    [rppt@linux.vnet.ibm.com: remove stale #else and the code it protects]
    Link: http://lkml.kernel.org/r/1538067825-24835-1-git-send-email-rppt@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/r/1536927045-23536-4-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Tested-by: Jonathan Cameron
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • All achitectures select NO_BOOTMEM which essentially becomes 'Y' for any
    kernel configuration and therefore it can be removed.

    [alexander.h.duyck@linux.intel.com: remove now defunct NO_BOOTMEM from depends list for deferred init]
    Link: http://lkml.kernel.org/r/20180925201814.3576.15105.stgit@localhost.localdomain
    Link: http://lkml.kernel.org/r/1536927045-23536-3-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Alexander Duyck
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Because get_signal_to_deliver() was renamed to get_signal() the
    comment should be fixed.

    Link: http://lkml.kernel.org/r/1539179128-45709-1-git-send-email-swkhack@gmail.com
    Signed-off-by: Weikang Shi
    Reported-by: Christian Brauner
    Cc: Eric W. Biederman
    Cc: Oleg Nesterov
    Cc: Anna-Maria Gleixner
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Weikang Shi
     
  • Prefer _THIS_IP_ defined in linux/kernel.h.

    Most definitions of current_text_addr were the same as _THIS_IP_, but
    a few archs had inline assembly instead.

    This patch removes the final call site of current_text_addr, making all
    of the definitions dead code.

    [akpm@linux-foundation.org: fix arch/csky/include/asm/processor.h]
    Link: http://lkml.kernel.org/r/20180911182413.180715-1-ndesaulniers@google.com
    Signed-off-by: Nick Desaulniers
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Desaulniers
     

27 Oct, 2018

11 commits

  • memmap_init is sometimes a macro sometimes a function based on
    __HAVE_ARCH_MEMMAP_INIT. It is only a function on ia64. Make memmap_init
    a weak function instead, and let ia64 redefine it.

    Link: http://lkml.kernel.org/r/20180724235520.10200-2-pasha.tatashin@oracle.com
    Signed-off-by: Pavel Tatashin
    Reviewed-by: Andrew Morton
    Reviewed-by: Oscar Salvador
    Cc: Steven Sistare
    Cc: Daniel Jordan
    Cc: Kirill A. Shutemov
    Cc: Michal Hocko
    Cc: Dan Williams
    Cc: Jan Kara
    Cc: Jérôme Glisse
    Cc: Souptick Joarder
    Cc: Baoquan He
    Cc: Greg Kroah-Hartman
    Cc: Vlastimil Babka
    Cc: Wei Yang
    Cc: Dave Hansen
    Cc: David Rientjes
    Cc: Ingo Molnar
    Cc: Pavel Tatashin
    Cc: Abdul Haleem
    Cc: Michael Ellerman
    Cc: Pasha Tatashin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Tatashin
     
  • ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the same
    version of huge_ptep_get, so move this generic implementation into
    asm-generic/hugetlb.h.

    [arnd@arndb.de: fix ARM 3level page tables]
    Link: http://lkml.kernel.org/r/20181005161722.904274-1-arnd@arndb.de
    Link: http://lkml.kernel.org/r/20180920060358.16606-12-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, ia64, sh, x86 architectures use the same version
    of huge_ptep_set_access_flags, so move this generic implementation
    into asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-11-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, ia64, mips, powerpc, sh, x86 architectures use the same version of
    huge_ptep_set_wrprotect, so move this generic implementation into
    asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-10-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, arm64, powerpc, sparc, x86 architectures use the same version of
    prepare_hugepage_range, so move this generic implementation into
    asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-9-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use
    the same version of huge_pte_wrprotect, so move this generic
    implementation into asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-8-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use
    the same version of huge_pte_none, so move this generic implementation
    into asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-7-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, x86 architectures use the same version of huge_ptep_clear_flush, so
    move this generic implementation into asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-6-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, ia64, sh, x86 architectures use the same version of
    huge_ptep_get_and_clear, so move this generic implementation into
    asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-5-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, ia64, mips, powerpc, sh, x86 architectures use the same version of
    set_huge_pte_at, so move this generic implementation into
    asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-4-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • arm, arm64, mips, parisc, sh, x86 architectures use the same version of
    hugetlb_free_pgd_range, so move this generic implementation into
    asm-generic/hugetlb.h.

    Link: http://lkml.kernel.org/r/20180920060358.16606-3-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Luiz Capitulino
    Reviewed-by: Mike Kravetz
    Tested-by: Helge Deller [parisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Ingo Molnar [x86]
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     

26 Oct, 2018

1 commit

  • Pull timekeeping updates from Thomas Gleixner:
    "The timers and timekeeping departement provides:

    - Another large y2038 update with further preparations for providing
    the y2038 safe timespecs closer to the syscalls.

    - An overhaul of the SHCMT clocksource driver

    - SPDX license identifier updates

    - Small cleanups and fixes all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
    tick/sched : Remove redundant cpu_online() check
    clocksource/drivers/dw_apb: Add reset control
    clocksource: Remove obsolete CLOCKSOURCE_OF_DECLARE
    clocksource/drivers: Unify the names to timer-* format
    clocksource/drivers/sh_cmt: Add R-Car gen3 support
    dt-bindings: timer: renesas: cmt: document R-Car gen3 support
    clocksource/drivers/sh_cmt: Properly line-wrap sh_cmt_of_table[] initializer
    clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines
    clocksource/drivers/sh_cmt: Fixup for 64-bit machines
    clocksource/drivers/sh_tmu: Convert to SPDX identifiers
    clocksource/drivers/sh_mtu2: Convert to SPDX identifiers
    clocksource/drivers/sh_cmt: Convert to SPDX identifiers
    clocksource/drivers/renesas-ostm: Convert to SPDX identifiers
    clocksource: Convert to using %pOFn instead of device_node.name
    tick/broadcast: Remove redundant check
    RISC-V: Request newstat syscalls
    y2038: signal: Change rt_sigtimedwait to use __kernel_timespec
    y2038: socket: Change recvmmsg to use __kernel_timespec
    y2038: sched: Change sched_rr_get_interval to use __kernel_timespec
    y2038: utimes: Rework #ifdef guards for compat syscalls
    ...

    Linus Torvalds
     

24 Oct, 2018

2 commits

  • Pull tty ioctl updates from Al Viro:
    "This is the compat_ioctl work related to tty ioctls.

    Quite a bit of dead code taken out, all tty-related stuff gone from
    fs/compat_ioctl.c. A bunch of compat bugs fixed - some still remain,
    but all more or less generic tty-related ioctls should be covered
    (remaining issues are in things like driver-private ioctls in a pcmcia
    serial card driver not getting properly handled in 32bit processes on
    64bit host, etc)"

    * 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (53 commits)
    kill TIOCSERGSTRUCT
    change semantics of ldisc ->compat_ioctl()
    kill TIOCSER[SG]WILD
    synclink_gt(): fix compat_ioctl()
    pty: fix compat ioctls
    compat_ioctl - kill keyboard ioctl handling
    gigaset: add ->compat_ioctl()
    vt_compat_ioctl(): clean up, use compat_ptr() properly
    gigaset: don't try to printk userland buffer contents
    dgnc: don't bother with (empty) stub for TCXONC
    dgnc: leave TIOC[GS]SOFTCAR to ldisc
    remove fallback to drivers for TIOCGICOUNT
    dgnc: break-related ioctls won't reach ->ioctl()
    kill the rest of tty COMPAT_IOCTL() entries
    dgnc: TIOCM... won't reach ->ioctl()
    isdn_tty: TCSBRK{,P} won't reach ->ioctl()
    kill capinc_tty_ioctl()
    take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()
    synclink: reduce pointless checks in ->ioctl()
    complete ->[sg]et_serial() switchover
    ...

    Linus Torvalds
     
  • …iederm/user-namespace

    Pull siginfo updates from Eric Biederman:
    "I have been slowly sorting out siginfo and this is the culmination of
    that work.

    The primary result is in several ways the signal infrastructure has
    been made less error prone. The code has been updated so that manually
    specifying SEND_SIG_FORCED is never necessary. The conversion to the
    new siginfo sending functions is now complete, which makes it
    difficult to send a signal without filling in the proper siginfo
    fields.

    At the tail end of the patchset comes the optimization of decreasing
    the size of struct siginfo in the kernel from 128 bytes to about 48
    bytes on 64bit. The fundamental observation that enables this is by
    definition none of the known ways to use struct siginfo uses the extra
    bytes.

    This comes at the cost of a small user space observable difference.
    For the rare case of siginfo being injected into the kernel only what
    can be copied into kernel_siginfo is delivered to the destination, the
    rest of the bytes are set to 0. For cases where the signal and the
    si_code are known this is safe, because we know those bytes are not
    used. For cases where the signal and si_code combination is unknown
    the bits that won't fit into struct kernel_siginfo are tested to
    verify they are zero, and the send fails if they are not.

    I made an extensive search through userspace code and I could not find
    anything that would break because of the above change. If it turns out
    I did break something it will take just the revert of a single change
    to restore kernel_siginfo to the same size as userspace siginfo.

    Testing did reveal dependencies on preferring the signo passed to
    sigqueueinfo over si->signo, so bit the bullet and added the
    complexity necessary to handle that case.

    Testing also revealed bad things can happen if a negative signal
    number is passed into the system calls. Something no sane application
    will do but something a malicious program or a fuzzer might do. So I
    have fixed the code that performs the bounds checks to ensure negative
    signal numbers are handled"

    * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (80 commits)
    signal: Guard against negative signal numbers in copy_siginfo_from_user32
    signal: Guard against negative signal numbers in copy_siginfo_from_user
    signal: In sigqueueinfo prefer sig not si_signo
    signal: Use a smaller struct siginfo in the kernel
    signal: Distinguish between kernel_siginfo and siginfo
    signal: Introduce copy_siginfo_from_user and use it's return value
    signal: Remove the need for __ARCH_SI_PREABLE_SIZE and SI_PAD_SIZE
    signal: Fail sigqueueinfo if si_signo != sig
    signal/sparc: Move EMT_TAGOVF into the generic siginfo.h
    signal/unicore32: Use force_sig_fault where appropriate
    signal/unicore32: Generate siginfo in ucs32_notify_die
    signal/unicore32: Use send_sig_fault where appropriate
    signal/arc: Use force_sig_fault where appropriate
    signal/arc: Push siginfo generation into unhandled_exception
    signal/ia64: Use force_sig_fault where appropriate
    signal/ia64: Use the force_sig(SIGSEGV,...) in ia64_rt_sigreturn
    signal/ia64: Use the generic force_sigsegv in setup_frame
    signal/arm/kvm: Use send_sig_mceerr
    signal/arm: Use send_sig_fault where appropriate
    signal/arm: Use force_sig_fault where appropriate
    ...

    Linus Torvalds
     

23 Oct, 2018

1 commit

  • Pull ia64 updates from Tony Luck:
    "Miscellaneous ia64 fixes from Christoph"

    * tag 'please-pull-next' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
    intel-iommu: mark intel_dma_ops static
    ia64: remove machvec_dma_sync_{single,sg}
    ia64/sn2: remove no-ops dma sync methods
    ia64: remove the unused iommu_dma_init function
    ia64: remove the unused pci_iommu_shutdown function
    ia64: remove the unused bad_dma_address symbol
    ia64: remove iommu_dma_supported
    ia64: remove the dead iommu_sac_force variable
    ia64: remove the kern_mem_attribute export

    Linus Torvalds
     

13 Oct, 2018

2 commits

  • Once upon a time a bunch of serial drivers used to provide that;
    today it's only amiserial and it's FUBAR - the structure being
    copied to userland includes kernel pointers, fields with
    config-dependent size, etc. No userland code using it could
    possibly survive - e.g. enabling lockdep definitely changes the
    layout. Besides, it's a massive infoleak.

    Kill it. If somebody needs that data for debugging purposes, they
    can bloody well expose it saner ways. Assuming anyone does debugging
    of amiserial in the first place, that is.

    Signed-off-by: Al Viro

    Al Viro
     
  • the only user is very old setserial rc script and even that
    (as far back as MCC Interim, AFAICS) doesn't actually fail -
    just gives one message during the boot ("Cannot scan for wild
    interrupts") and proceeds past that just fine.

    Signed-off-by: Al Viro

    Al Viro
     

03 Oct, 2018

1 commit


01 Oct, 2018

1 commit


28 Sep, 2018

3 commits

  • Acked-by: Tony Luck
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • The ia64 handling of failure to return from a signal frame has been trying
    to set overlapping fields in struct siginfo since 2.3.43. The si_code
    corresponds to the fields that were stomped (not the field that is
    actually written), so I can not imagine a piece of userspace code
    making sense of the signal frame if it looks closely.

    In practice failure to return from a signal frame is a rare event that
    almost never happens. Someone using an alternate signal stack to
    recover and looking in detail is even more rare. So I presume no one
    has ever noticed and reported this ia64 nonsense.

    Sort this out by causing ia64 to use force_sig(SIGSEGV) like other architectures.

    Fixes: 2.3.43
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: linux-ia64@vger.kernel.org
    Acked-by: Tony Luck
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • The ia64 handling of failure to setup a signal frame has been trying
    to set overlapping fields in struct siginfo since 2.3.43. The si_pid
    and si_uid fields are stomped when the si_addr field is set. The
    si_code of SI_KERNEL indicates that si_pid and si_uid should be valid,
    and that si_addr does not exist.

    Being at odds with the definition of SI_KERNEL and with nothing to
    indicate that this was a signal frame setup failure there is no way
    for userspace to know that si_addr was filled out instead.

    In practice failure to setup a signal frame is rare, and si_pid and
    si_uid are always set to 0 when si_code is SI_KERNEL so I expect no
    one has looked closely enough before to see this weirdness. Further
    the only difference between force_sigsegv_info and the generic
    force_sigsegv other than the return code is that force_sigsegv_info
    stomps the si_uid and si_pid fields.

    Remove the bug and simplify the code by using force_sigsegv in this
    case just like other architectures.

    Fixes: 2.3.43
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: linux-ia64@vger.kernel.org
    Acked-by: Tony Luck
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

18 Sep, 2018

5 commits