14 Apr, 2020

1 commit

  • The cleanup in commit 630f289b7114c0e6 ("asm-generic: make more
    kernel-space headers mandatory") did not take into account the recently
    added line for hardirq.h in commit acc45648b9aefa90 ("m68k: Switch to
    asm-generic/hardirq.h"), leading to the following message during the
    build:

    scripts/Makefile.asm-generic:25: redundant generic-y found in arch/m68k/include/asm/Kbuild: hardirq.h

    Fix this by dropping the now redundant line.

    Fixes: 630f289b7114c0e6 ("asm-generic: make more kernel-space headers mandatory")
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Masahiro Yamada
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

11 Apr, 2020

2 commits

  • Currently there are many platforms that dont enable ARCH_HAS_PTE_SPECIAL
    but required to define quite similar fallback stubs for special page
    table entry helpers such as pte_special() and pte_mkspecial(), as they
    get build in generic MM without a config check. This creates two
    generic fallback stub definitions for these helpers, eliminating much
    code duplication.

    mips platform has a special case where pte_special() and pte_mkspecial()
    visibility is wider than what ARCH_HAS_PTE_SPECIAL enablement requires.
    This restricts those symbol visibility in order to avoid redefinitions
    which is now exposed through this new generic stubs and subsequent build
    failure. arm platform set_pte_at() definition needs to be moved into a
    C file just to prevent a build failure.

    [anshuman.khandual@arm.com: use defined(CONFIG_ARCH_HAS_PTE_SPECIAL) in mips per Thomas]
    Link: http://lkml.kernel.org/r/1583851924-21603-1-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Anshuman Khandual
    Signed-off-by: Andrew Morton
    Acked-by: Guo Ren [csky]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Stafford Horne [openrisc]
    Acked-by: Helge Deller [parisc]
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Russell King
    Cc: Brian Cain
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Sam Creasey
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: Nick Hu
    Cc: Greentime Hu
    Cc: Vincent Chen
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: "James E.J. Bottomley"
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Cc: Guan Xuetao
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: Thomas Bogendoerfer
    Link: http://lkml.kernel.org/r/1583802551-15406-1-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Linus Torvalds

    Anshuman Khandual
     
  • There are many platforms with exact same value for VM_DATA_DEFAULT_FLAGS
    This creates a default value for VM_DATA_DEFAULT_FLAGS in line with the
    existing VM_STACK_DEFAULT_FLAGS. While here, also define some more
    macros with standard VMA access flag combinations that are used
    frequently across many platforms. Apart from simplification, this
    reduces code duplication as well.

    Signed-off-by: Anshuman Khandual
    Signed-off-by: Andrew Morton
    Reviewed-by: Vlastimil Babka
    Acked-by: Geert Uytterhoeven
    Cc: Richard Henderson
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Mark Salter
    Cc: Guo Ren
    Cc: Yoshinori Sato
    Cc: Brian Cain
    Cc: Tony Luck
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: Nick Hu
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: "James E.J. Bottomley"
    Cc: Michael Ellerman
    Cc: Paul Walmsley
    Cc: Heiko Carstens
    Cc: Rich Felker
    Cc: "David S. Miller"
    Cc: Guan Xuetao
    Cc: Thomas Gleixner
    Cc: Jeff Dike
    Cc: Chris Zankel
    Link: http://lkml.kernel.org/r/1583391014-8170-2-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Linus Torvalds

    Anshuman Khandual
     

03 Apr, 2020

1 commit

  • Change a header to mandatory-y if both of the following are met:

    [1] At least one architecture (except um) specifies it as generic-y in
    arch/*/include/asm/Kbuild

    [2] Every architecture (except um) either has its own implementation
    (arch/*/include/asm/*.h) or specifies it as generic-y in
    arch/*/include/asm/Kbuild

    This commit was generated by the following shell script.

    ----------------------------------->8-----------------------------------

    arches=$(cd arch; ls -1 | sed -e '/Kconfig/d' -e '/um/d')

    tmpfile=$(mktemp)

    grep "^mandatory-y +=" include/asm-generic/Kbuild > $tmpfile

    find arch -path 'arch/*/include/asm/Kbuild' |
    xargs sed -n 's/^generic-y += \(.*\)/\1/p' | sort -u |
    while read header
    do
    mandatory=yes

    for arch in $arches
    do
    if ! grep -q "generic-y += $header" arch/$arch/include/asm/Kbuild &&
    ! [ -f arch/$arch/include/asm/$header ]; then
    mandatory=no
    break
    fi
    done

    if [ "$mandatory" = yes ]; then
    echo "mandatory-y += $header" >> $tmpfile

    for arch in $arches
    do
    sed -i "/generic-y += $header/d" arch/$arch/include/asm/Kbuild
    done
    fi

    done

    sed -i '/^mandatory-y +=/d' include/asm-generic/Kbuild

    LANG=C sort $tmpfile >> include/asm-generic/Kbuild

    ----------------------------------->8-----------------------------------

    One obvious benefit is the diff stat:

    25 files changed, 52 insertions(+), 557 deletions(-)

    It is tedious to list generic-y for each arch that needs it.

    So, mandatory-y works like a fallback default (by just wrapping
    asm-generic one) when arch does not have a specific header
    implementation.

    See the following commits:

    def3f7cefe4e81c296090e1722a76551142c227c
    a1b39bae16a62ce4aae02d958224f19316d98b24

    It is tedious to convert headers one by one, so I processed by a shell
    script.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Cc: Michal Simek
    Cc: Christoph Hellwig
    Cc: Arnd Bergmann
    Link: http://lkml.kernel.org/r/20200210175452.5030-1-masahiroy@kernel.org
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

31 Mar, 2020

1 commit

  • Pull m68k updates from Geert Uytterhoeven:

    - pagetable layout rewrite, to facilitate global READ_ONCE() rework

    - Zorro (Amiga) and DIO (HP 9000/300) bus cleanups

    - defconfig updates

    - minor cleanups and fixes

    * tag 'm68k-for-v5.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (23 commits)
    m68k: defconfig: Update defconfigs for v5.6-rc4
    zorro: Replace zero-length array with flexible-array member
    m68k: Switch to asm-generic/hardirq.h
    fbdev: c2p: Use BUILD_BUG() instead of custom solution
    dio: Remove unused dio_dev_driver()
    dio: Fix dio_bus_match() kerneldoc
    dio: Make dio_match_device() static
    zorro: Move zorro_bus_type to bus-private header file
    zorro: Remove unused zorro_dev_driver()
    zorro: Use zorro_match_device() helper in zorro_bus_match()
    zorro: Fix zorro_bus_match() kerneldoc
    zorro: Make zorro_match_device() static
    m68k: Fix Kconfig indentation
    m68k: mm: Change ColdFire pgtable_t
    m68k: mm: Fully initialize the page-table allocator
    m68k: mm: Extend table allocator for multiple sizes
    m68k: mm: Use table allocator for pgtables
    m68k: mm: Improve kernel_page_table()
    m68k: mm: Restructure Motorola MMU page-table layout
    m68k: mm: Move the pointer table allocator to motorola.c
    ...

    Linus Torvalds
     

28 Mar, 2020

1 commit

  • In file included
    from include/linux/huge_mm.h:8,
    from include/linux/mm.h:567,
    from arch/m68k/include/asm/uaccess_no.h:8,
    from arch/m68k/include/asm/uaccess.h:3,
    from include/linux/uaccess.h:11,
    from include/linux/sched/task.h:11,
    from include/linux/sched/signal.h:9,
    from include/linux/rcuwait.h:6,
    from include/linux/percpu-rwsem.h:7,
    from kernel/locking/percpu-rwsem.c:6:
    include/linux/fs.h:1422:29: error: array type has incomplete element type 'struct percpu_rw_semaphore'
    1422 | struct percpu_rw_semaphore rw_sem[SB_FREEZE_LEVELS];

    Removing the include of linux/mm.h from the uaccess header solves the problem
    and various build tests of nommu configurations still work.

    Fixes: 80fbaf1c3f29 ("rcuwait: Add @state argument to rcuwait_wait_event()")
    Reported-by: kbuild test robot
    Signed-off-by: Thomas Gleixner
    Acked-by: Geert Uytterhoeven
    Link: https://lkml.kernel.org/r/87fte1qzh0.fsf@nanos.tec.linutronix.de

    Thomas Gleixner
     

09 Mar, 2020

1 commit

  • Classic m68k with MMU was converted to generic hardirqs a long time ago,
    and there are no longer include dependency issues preventing the direct
    use of asm-generic/hardirq.h.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200112174854.2726-1-geert@linux-m68k.org

    Geert Uytterhoeven
     

10 Feb, 2020

8 commits

  • To match what we did to the Motorola MMU routines, change the ColdFire
    pgalloc.

    The result is that ColdFire and Sun3 pgalloc are actually very similar
    and could conceivably be unified.

    Signed-off-by: Will Deacon
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.995781825@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Will Deacon
     
  • In addition to the PGD/PMD table size (128*4) add a PTE table size
    (64*4) to the table allocator. This completely removes the pte-table
    overhead compared to the old code, even for dense tables.

    Notes:

    - the allocator gained a list_empty() check to deal with there not
    being any pages at all.

    - the free mask is extended to cover more than the 8 bits required
    for the (512 byte) PGD/PMD tables.

    - NR_PAGETABLE accounting is restored.

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.882175409@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     
  • With the new page-table layout, using full (4k) pages for (256 byte)
    pte-tables is immensely wastefull. Move the pte-tables over to the
    same allocator already used for the (512 byte) higher level tables
    (pgd/pmd).

    This reduces the pte-table waste from 15x to 2x.

    Due to no longer being bound to 16 consecutive tables, this might
    actually already be more efficient than the old code for sparse
    tables.

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.825295149@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     
  • With the PTE-tables now only being 256 bytes, allocating a full page
    for them is a giant waste. Start by improving the boot time allocator
    such that init_mm initialization will at least have optimal memory
    density.

    Much thanks to Will Deacon in help with debugging and ferreting out
    lost information on these dusty MMUs.

    Notes:

    - _TABLE_MASK is reduced to account for the shorter (256 byte)
    alignment of pte-tables, per the manual, table entries should only
    ever have state in the low 4 bits (Used,WrProt,Desc1,Desc0) so it is
    still longer than strictly required. (Thanks Will!!!)

    - Also use kernel_page_table() for the 020/030 zero_pgtable case and
    consequently remove the zero_pgtable init hack (will fix up later).

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.768263973@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     
  • The Motorola 68xxx MMUs, 040 (and later) have a fixed 7,7,{5,6}
    page-table setup, where the last depends on the page-size selected (8k
    vs 4k resp.), and head.S selects 4K pages. For 030 (and earlier) we
    explicitly program 7,7,6 and 4K pages in %tc.

    However, the current code implements this mightily weird. What it does
    is group 16 of those (6 bit) pte tables into one 4k page to not waste
    space. The down-side is that that forces pmd_t to be a 16-tuple
    pointing to consecutive pte tables.

    This breaks the generic code which assumes READ_ONCE(*pmd) will be
    word sized.

    Therefore implement a straight forward 7,7,6 3 level page-table setup,
    with the addition (for 020/030) of (partial) large-page support. For
    now this increases the memory footprint for pte-tables 15 fold.

    Tested with ARAnyM/68040 emulation.

    Suggested-by: Will Deacon
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.711478295@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     
  • Seeing how there are 5 copies of this magic code, one of which is
    unexplainably different, unify and document things.

    Suggested-by: Will Deacon
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.597688427@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     
  • I also notice that building for m5475evb_defconfig with vanilla v5.5
    triggers this scary looking warning due to a mismatch between the pgd
    size and the (8k!) page size:

    | In function 'pgd_alloc.isra.111',
    | inlined from 'mm_alloc_pgd' at kernel/fork.c:634:12,
    | inlined from 'mm_init.isra.112' at kernel/fork.c:1043:6:
    | ./arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' forming offset [4097, 8192] is out of the bounds [0, 4096] of object 'kernel_pg_dir' with type 'pgd_t[1024]' {aka 'struct [1024]'} [-Warray-bounds]
    | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    | ./arch/m68k/include/asm/mcf_pgalloc.h:93:2: note: in expansion of macro 'memcpy'
    | memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE);
    | ^~~~~~

    Signed-off-by: Will Deacon
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.540057688@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Will Deacon
     
  • Since ColdFire V4e is a software TLB-miss architecture, there is no
    need for page-tables to be mapped uncached. Remove this stray
    nocache_page() dance, which isn't paired with a cache_page() and looks
    like a copy/paste/edit fail.

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Acked-by: Greg Ungerer
    Tested-by: Michael Schmitz
    Tested-by: Greg Ungerer
    Link: https://lore.kernel.org/r/20200131125403.481739981@infradead.org
    Signed-off-by: Geert Uytterhoeven

    Peter Zijlstra
     

06 Feb, 2020

1 commit


03 Feb, 2020

1 commit

  • Newer versions of gcc are giving warnings in the non-MMU m68k version
    of the get_user() macro:

    ./arch/m68k/include/asm/string.h:72:25: warning: ‘__builtin_memcpy’ forming offset [3, 4] is out of the bounds [0, 2] of object ‘__gu_val’ with type ‘short unsigned int’ [-Warray-bounds]

    The warnings are generated when smaller sized variables are used as the
    result of user space pointers to larger values. For example a
    short/2-byte variable stores the result of a user space int (4-byte)
    pointer. The warning is in the 8-byte branch of get_user() - even
    though that branch is not the taken branch in the warning cases.

    Refactor the 8-byte branch of get_user() so that it uses a correctly
    formed union type to read and write the source and destination objects.
    Keep using the memcpy() just in case the user space pointer is not
    naturaly aligned (not required for ColdFire, but needed for early
    68000).

    Signed-off-by: Greg Ungerer

    Greg Ungerer
     

29 Jan, 2020

1 commit

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

    - Cleanup of the GOP [graphics output] handling code in the EFI stub

    - Complete refactoring of the mixed mode handling in the x86 EFI stub

    - Overhaul of the x86 EFI boot/runtime code

    - Increase robustness for mixed mode code

    - Add the ability to disable DMA at the root port level in the EFI
    stub

    - Get rid of RWX mappings in the EFI memory map and page tables,
    where possible

    - Move the support code for the old EFI memory mapping style into its
    only user, the SGI UV1+ support code.

    - plus misc fixes, updates, smaller cleanups.

    ... and due to interactions with the RWX changes, another round of PAT
    cleanups make a guest appearance via the EFI tree - with no side
    effects intended"

    * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (75 commits)
    efi/x86: Disable instrumentation in the EFI runtime handling code
    efi/libstub/x86: Fix EFI server boot failure
    efi/x86: Disallow efi=old_map in mixed mode
    x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld
    efi/x86: avoid KASAN false positives when accessing the 1: 1 mapping
    efi: Fix handling of multiple efi_fake_mem= entries
    efi: Fix efi_memmap_alloc() leaks
    efi: Add tracking for dynamically allocated memmaps
    efi: Add a flags parameter to efi_memory_map
    efi: Fix comment for efi_mem_type() wrt absent physical addresses
    efi/arm: Defer probe of PCIe backed efifb on DT systems
    efi/x86: Limit EFI old memory map to SGI UV machines
    efi/x86: Avoid RWX mappings for all of DRAM
    efi/x86: Don't map the entire kernel text RW for mixed mode
    x86/mm: Fix NX bit clearing issue in kernel_map_pages_in_pgd
    efi/libstub/x86: Fix unused-variable warning
    efi/libstub/x86: Use mandatory 16-byte stack alignment in mixed mode
    efi/libstub/x86: Use const attribute for efi_is_64bit()
    efi: Allow disabling PCI busmastering on bridges during boot
    efi/x86: Allow translating 64-bit arguments for mixed mode calls
    ...

    Linus Torvalds
     

28 Jan, 2020

1 commit


12 Jan, 2020

1 commit

  • Wire up the clone3() syscall for m68k. The special entry point is done in
    assembler as was done for clone() as well. This is needed because all
    registers need to be saved. The C wrapper then calls the generic
    sys_clone3() with the correct arguments.

    Tested on A1200 using the simple test program from:

    https://lore.kernel.org/lkml/20190716130631.tohj4ub54md25dys@brauner.io/

    Signed-off-by: Kars de Jong
    Link: https://lore.kernel.org/r/20191124195225.31230-1-jongk@linux-m68k.org
    Signed-off-by: Geert Uytterhoeven

    Kars de Jong
     

06 Jan, 2020

1 commit


10 Dec, 2019

1 commit


05 Dec, 2019

2 commits

  • m68k has two or three levels of page tables and can use appropriate
    pgtable-nopXd and folding of the upper layers.

    Replace usage of include/asm-generic/4level-fixup.h and explicit
    definitions of __PAGETABLE_PxD_FOLDED in m68k with
    include/asm-generic/pgtable-nopmd.h for two-level configurations and
    with include/asm-generic/pgtable-nopud.h for three-lelve configurations
    and adjust page table manipulation macros and functions accordingly.

    [akpm@linux-foundation.org: fix merge glitch]
    [geert@linux-m68k.org: more merge glitch fixes]
    [akpm@linux-foundation.org: s/bad_pgd/bad_pud/, per Mike]
    Link: http://lkml.kernel.org/r/1572938135-31886-6-git-send-email-rppt@kernel.org
    Signed-off-by: Mike Rapoport
    Acked-by: Greg Ungerer
    Cc: Anatoly Pugachev
    Cc: Anton Ivanov
    Cc: Arnd Bergmann
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Cc: Jeff Dike
    Cc: "Kirill A. Shutemov"
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Peter Rosin
    Cc: Richard Weinberger
    Cc: Rolf Eike Beer
    Cc: Russell King
    Cc: Russell King
    Cc: Sam Creasey
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The generic nommu implementation of page table manipulation takes care
    of folding of the upper levels and does not require fixups.

    Simply replace of include/asm-generic/4level-fixup.h with
    include/asm-generic/pgtable-nopud.h.

    Link: http://lkml.kernel.org/r/1572938135-31886-5-git-send-email-rppt@kernel.org
    Signed-off-by: Mike Rapoport
    Acked-by: Greg Ungerer
    Cc: Anatoly Pugachev
    Cc: Anton Ivanov
    Cc: Arnd Bergmann
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Cc: Jeff Dike
    Cc: "Kirill A. Shutemov"
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Peter Rosin
    Cc: Richard Weinberger
    Cc: Rolf Eike Beer
    Cc: Russell King
    Cc: Russell King
    Cc: Sam Creasey
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

12 Nov, 2019

1 commit

  • m68k uses __iounmap as the name for an internal helper that is only
    used for some CPU types. Mark it static, give it a better name
    and move it around a bit to avoid a forward declaration.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Geert Uytterhoeven

    Christoph Hellwig
     

27 Sep, 2019

1 commit

  • The naming of pgtable_page_{ctor,dtor}() seems to have confused a few
    people, and until recently arm64 used these erroneously/pointlessly for
    other levels of page table.

    To make it incredibly clear that these only apply to the PTE level, and to
    align with the naming of pgtable_pmd_page_{ctor,dtor}(), let's rename them
    to pgtable_pte_page_{ctor,dtor}().

    These changes were generated with the following shell script:

    ----
    git grep -lw 'pgtable_page_.tor' | while read FILE; do
    sed -i '{s/pgtable_page_ctor/pgtable_pte_page_ctor/}' $FILE;
    sed -i '{s/pgtable_page_dtor/pgtable_pte_page_dtor/}' $FILE;
    done
    ----

    ... with the documentation re-flowed to remain under 80 columns, and
    whitespace fixed up in macros to keep backslashes aligned.

    There should be no functional change as a result of this patch.

    Link: http://lkml.kernel.org/r/20190722141133.3116-1-mark.rutland@arm.com
    Signed-off-by: Mark Rutland
    Reviewed-by: Mike Rapoport
    Acked-by: Geert Uytterhoeven [m68k]
    Cc: Anshuman Khandual
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Yu Zhao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rutland
     

25 Sep, 2019

2 commits

  • Both pgtable_cache_init() and pgd_cache_init() are used to initialize kmem
    cache for page table allocations on several architectures that do not use
    PAGE_SIZE tables for one or more levels of the page table hierarchy.

    Most architectures do not implement these functions and use __weak default
    NOP implementation of pgd_cache_init(). Since there is no such default
    for pgtable_cache_init(), its empty stub is duplicated among most
    architectures.

    Rename the definitions of pgd_cache_init() to pgtable_cache_init() and
    drop empty stubs of pgtable_cache_init().

    Link: http://lkml.kernel.org/r/1566457046-22637-1-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Will Deacon [arm64]
    Acked-by: Thomas Gleixner [x86]
    Cc: Catalin Marinas
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Patch series "mm: remove quicklist page table caches".

    A while ago Nicholas proposed to remove quicklist page table caches [1].

    I've rebased his patch on the curren upstream and switched ia64 and sh to
    use generic versions of PTE allocation.

    [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com

    This patch (of 3):

    Remove page table allocator "quicklists". These have been around for a
    long time, but have not got much traction in the last decade and are only
    used on ia64 and sh architectures.

    The numbers in the initial commit look interesting but probably don't
    apply anymore. If anybody wants to resurrect this it's in the git
    history, but it's unhelpful to have this code and divergent allocator
    behaviour for minor archs.

    Also it might be better to instead make more general improvements to page
    allocator if this is still so slow.

    Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Mike Rapoport
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     

23 Sep, 2019

1 commit

  • Pull modules updates from Jessica Yu:
    "The main bulk of this pull request introduces a new exported symbol
    namespaces feature. The number of exported symbols is increasingly
    growing with each release (we're at about 31k exports as of 5.3-rc7)
    and we currently have no way of visualizing how these symbols are
    "clustered" or making sense of this huge export surface.

    Namespacing exported symbols allows kernel developers to more
    explicitly partition and categorize exported symbols, as well as more
    easily limiting the availability of namespaced symbols to other parts
    of the kernel. For starters, we have introduced the USB_STORAGE
    namespace to demonstrate the API's usage. I have briefly summarized
    the feature and its main motivations in the tag below.

    Summary:

    - Introduce exported symbol namespaces.

    This new feature allows subsystem maintainers to partition and
    categorize their exported symbols into explicit namespaces. Module
    authors are now required to import the namespaces they need.

    Some of the main motivations of this feature include: allowing
    kernel developers to better manage the export surface, allow
    subsystem maintainers to explicitly state that usage of some
    exported symbols should only be limited to certain users (think:
    inter-module or inter-driver symbols, debugging symbols, etc), as
    well as more easily limiting the availability of namespaced symbols
    to other parts of the kernel.

    With the module import requirement, it is also easier to spot the
    misuse of exported symbols during patch review.

    Two new macros are introduced: EXPORT_SYMBOL_NS() and
    EXPORT_SYMBOL_NS_GPL(). The API is thoroughly documented in
    Documentation/kbuild/namespaces.rst.

    - Some small code and kbuild cleanups here and there"

    * tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: Remove leftover '#undef' from export header
    module: remove unneeded casts in cmp_name()
    module: move CONFIG_UNUSED_SYMBOLS to the sub-menu of MODULES
    module: remove redundant 'depends on MODULES'
    module: Fix link failure due to invalid relocation on namespace offset
    usb-storage: export symbols in USB_STORAGE namespace
    usb-storage: remove single-use define for debugging
    docs: Add documentation for Symbol Namespaces
    scripts: Coccinelle script for namespace dependencies.
    modpost: add support for generating namespace dependencies
    export: allow definition default namespaces in Makefiles or sources
    module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
    modpost: add support for symbol namespaces
    module: add support for symbol namespaces.
    export: explicitly align struct kernel_symbol
    module: support reading multiple values per modinfo tag

    Linus Torvalds
     

20 Sep, 2019

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - add dma-mapping and block layer helpers to take care of IOMMU merging
    for mmc plus subsequent fixups (Yoshihiro Shimoda)

    - rework handling of the pgprot bits for remapping (me)

    - take care of the dma direct infrastructure for swiotlb-xen (me)

    - improve the dma noncoherent remapping infrastructure (me)

    - better defaults for ->mmap, ->get_sgtable and ->get_required_mask
    (me)

    - cleanup mmaping of coherent DMA allocations (me)

    - various misc cleanups (Andy Shevchenko, me)

    * tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping: (41 commits)
    mmc: renesas_sdhi_internal_dmac: Add MMC_CAP2_MERGE_CAPABLE
    mmc: queue: Fix bigger segments usage
    arm64: use asm-generic/dma-mapping.h
    swiotlb-xen: merge xen_unmap_single into xen_swiotlb_unmap_page
    swiotlb-xen: simplify cache maintainance
    swiotlb-xen: use the same foreign page check everywhere
    swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable
    xen: remove the exports for xen_{create,destroy}_contiguous_region
    xen/arm: remove xen_dma_ops
    xen/arm: simplify dma_cache_maint
    xen/arm: use dev_is_dma_coherent
    xen/arm: consolidate page-coherent.h
    xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance
    arm: remove wrappers for the generic dma remap helpers
    dma-mapping: introduce a dma_common_find_pages helper
    dma-mapping: always use VM_DMA_COHERENT for generic DMA remap
    vmalloc: lift the arm flag for coherent mappings to common code
    dma-mapping: provide a better default ->get_required_mask
    dma-mapping: remove the dma_declare_coherent_memory export
    remoteproc: don't allow modular build
    ...

    Linus Torvalds
     

10 Sep, 2019

1 commit

  • This change allows growing struct kernel_symbol without wasting bytes to
    alignment. It also concretized the alignment of ksymtab entries if
    relative references are used for ksymtab entries.

    struct kernel_symbol was already implicitly being aligned to the word
    size, except on x86_64 and m68k, where it is aligned to 16 and 2 bytes,
    respectively.

    As far as I can tell there is no requirement for aligning struct
    kernel_symbol to 16 bytes on x86_64, but gcc aligns structs to their
    size, and the linker aligns the custom __ksymtab sections to the largest
    data type contained within, so setting KSYM_ALIGN to 16 was necessary to
    stay consistent with the code generated for non-ASM EXPORT_SYMBOL(). Now
    that non-ASM EXPORT_SYMBOL() explicitly aligns to word size (8),
    KSYM_ALIGN is no longer necessary.

    In case of relative references, the alignment has been changed
    accordingly to not waste space when adding new struct members.

    As for m68k, struct kernel_symbol is aligned to 2 bytes even though the
    structure itself is 8 bytes; using a 4-byte alignment shouldn't hurt.

    I manually verified the output of the __ksymtab sections didn't change
    on x86, x86_64, arm, arm64 and m68k. As expected, the section contents
    didn't change, and the ELF section alignment only changed on x86_64 and
    m68k. Feedback from other archs more than welcome.

    Co-developed-by: Martijn Coenen
    Signed-off-by: Martijn Coenen
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Matthias Maennich
    Signed-off-by: Jessica Yu

    Matthias Maennich
     

02 Sep, 2019

2 commits


29 Aug, 2019

1 commit

  • arch_dma_mmap_pgprot is used for two things:

    1) to override the "normal" uncached page attributes for mapping
    memory coherent to devices that can't snoop the CPU caches
    2) to provide the special DMA_ATTR_WRITE_COMBINE semantics on older
    arm systems and some mips platforms

    Replace one with the pgprot_dmacoherent macro that is already provided
    by arm and much simpler to use, and lift the DMA_ATTR_WRITE_COMBINE
    handling to common code with an explicit arch opt-in.

    Signed-off-by: Christoph Hellwig
    Acked-by: Geert Uytterhoeven # m68k
    Acked-by: Paul Burton # mips

    Christoph Hellwig
     

19 Aug, 2019

3 commits

  • When test-compiling the BCM2835 pin control driver on m68k:

    In file included from arch/m68k/include/asm/io_mm.h:32:0,
    from arch/m68k/include/asm/io.h:8,
    from include/linux/io.h:13,
    from include/linux/irq.h:20,
    from include/linux/gpio/driver.h:7,
    from drivers/pinctrl/bcm/pinctrl-bcm2835.c:17:
    drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function 'bcm2711_pull_config_set':
    arch/m68k/include/asm/atarihw.h:190:22: error: expected identifier or '(' before 'volatile'
    # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))

    "shifter" is a too generic name for a global definition.

    As the corresponding definition for Atari TT is already called
    "shifter_tt", fix this by renaming the definition for Atari ST to
    "shifter_st".

    Reported-by: kbuild test robot
    Suggested-by: Michael Schmitz
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Linus Walleij

    Geert Uytterhoeven
     
  • Since commit d3b41b6bb49e ("m68k: Dispatch nvram_ops calls to Atari or
    Mac functions"), Coldfire builds generate compiler warnings due to the
    unconditional inclusion of asm/atarihw.h and asm/macintosh.h.

    The inclusion of asm/atarihw.h causes warnings like this:

    In file included from ./arch/m68k/include/asm/atarihw.h:25:0,
    from arch/m68k/kernel/setup_mm.c:41,
    from arch/m68k/kernel/setup.c:3:
    ./arch/m68k/include/asm/raw_io.h:39:0: warning: "__raw_readb" redefined
    #define __raw_readb in_8

    In file included from ./arch/m68k/include/asm/io.h:6:0,
    from arch/m68k/kernel/setup_mm.c:36,
    from arch/m68k/kernel/setup.c:3:
    ./arch/m68k/include/asm/io_no.h:16:0: note: this is the location of the previous definition
    #define __raw_readb(addr) \
    ...

    This issue is resolved by dropping the asm/raw_io.h include. It turns out
    that asm/io_mm.h already includes that header file.

    Moving the relevant macro definitions helps to clarify this dependency
    and make it safe to include asm/atarihw.h.

    The other warnings look like this:

    In file included from arch/m68k/kernel/setup_mm.c:48:0,
    from arch/m68k/kernel/setup.c:3:
    ./arch/m68k/include/asm/macintosh.h:19:35: warning: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration
    extern void mac_irq_enable(struct irq_data *data);
    ^~~~~~~~
    ...

    This issue is resolved by adding the missing linux/irq.h include.

    Signed-off-by: Finn Thain
    Acked-by: Greg Ungerer
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • Rename floppy_type macros to make them more consistent with the scsi_type
    macros, which are named after classes of models with similar memory maps.

    The MAC_FLOPPY_OLD symbol is introduced to change the relevant base
    address from 0x50F00000 to 0x50000000 (consistent with MAC_SCSI_OLD).

    The documentation for LC-class machines has the IO devices at offsets
    from $50F00000. Use these addresses for MAC_FLOPPY_LC (consistent with
    MAC_SCSI_LC) because they may not be aliased elsewhere in the memory map.

    Add comments with controller type information from 'Designing Cards and
    Drivers for the Macintosh Family', relevant Developer Notes and
    http://mess.redump.net/mess/driver_info/mac_technical_notes

    Adopt phys_addr_t to avoid type casts.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Acked-by: Laurent Vivier
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

13 Jul, 2019

1 commit

  • The sun3 MMU variant of m68k uses GFP_KERNEL to allocate a PTE page and
    then memset(0) or clear_highpage() to clear it.

    This is equivalent to allocating the page with GFP_KERNEL | __GFP_ZERO,
    which allows replacing sun3 implementation of pte_alloc_one() and
    pte_alloc_one_kernel() with the generic ones.

    The pte_free() and pte_free_kernel() versions are identical to the generic
    ones and can be simply dropped.

    Link: http://lkml.kernel.org/r/1557296232-15361-8-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Albert Ou
    Cc: Anshuman Khandual
    Cc: Anton Ivanov
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Guo Ren
    Cc: Helge Deller
    Cc: Ley Foon Tan
    Cc: Matthew Wilcox
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Ralf Baechle
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Sam Creasey
    Cc: Vincent Chen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

24 Jun, 2019

2 commits