11 Nov, 2020

1 commit


26 Oct, 2020

1 commit

  • Use a more generic form for __section that requires quotes to avoid
    complications with clang and gcc differences.

    Remove the quote operator # from compiler_attributes.h __section macro.

    Convert all unquoted __section(foo) uses to quoted __section("foo").
    Also convert __attribute__((section("foo"))) uses to __section("foo")
    even if the __attribute__ has multiple list entry forms.

    Conversion done using the script at:

    https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl

    Signed-off-by: Joe Perches
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Miguel Ojeda
    Signed-off-by: Linus Torvalds

    Joe Perches
     

24 Sep, 2020

1 commit

  • There was a request to preprocess the module linker script like we
    do for the vmlinux one. (https://lkml.org/lkml/2020/8/21/512)

    The difference between vmlinux.lds and module.lds is that the latter
    is needed for external module builds, thus must be cleaned up by
    'make mrproper' instead of 'make clean'. Also, it must be created
    by 'make modules_prepare'.

    You cannot put it in arch/$(SRCARCH)/kernel/, which is cleaned up by
    'make clean'. I moved arch/$(SRCARCH)/kernel/module.lds to
    arch/$(SRCARCH)/include/asm/module.lds.h, which is included from
    scripts/module.lds.S.

    scripts/module.lds is fine because 'make clean' keeps all the
    build artifacts under scripts/.

    You can add arch-specific sections in .

    Signed-off-by: Masahiro Yamada
    Tested-by: Jessica Yu
    Acked-by: Will Deacon
    Acked-by: Geert Uytterhoeven
    Acked-by: Palmer Dabbelt
    Reviewed-by: Kees Cook
    Acked-by: Jessica Yu

    Masahiro Yamada
     

08 Aug, 2020

2 commits

  • Most architectures define pgd_free() as a wrapper for free_page().

    Provide a generic version in asm-generic/pgalloc.h and enable its use for
    most architectures.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Reviewed-by: Pekka Enberg
    Acked-by: Geert Uytterhoeven [m68k]
    Cc: Abdul Haleem
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Christophe Leroy
    Cc: Joerg Roedel
    Cc: Joerg Roedel
    Cc: Max Filippov
    Cc: Peter Zijlstra (Intel)
    Cc: Satheesh Rajendran
    Cc: Stafford Horne
    Cc: Stephen Rothwell
    Cc: Steven Rostedt
    Cc: Matthew Wilcox
    Link: http://lkml.kernel.org/r/20200627143453.31835-7-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • For most architectures that support >2 levels of page tables,
    pmd_alloc_one() is a wrapper for __get_free_pages(), sometimes with
    __GFP_ZERO and sometimes followed by memset(0) instead.

    More elaborate versions on arm64 and x86 account memory for the user page
    tables and call to pgtable_pmd_page_ctor() as the part of PMD page
    initialization.

    Move the arm64 version to include/asm-generic/pgalloc.h and use the
    generic version on several architectures.

    The pgtable_pmd_page_ctor() is a NOP when ARCH_ENABLE_SPLIT_PMD_PTLOCK is
    not enabled, so there is no functional change for most architectures
    except of the addition of __GFP_ACCOUNT for allocation of user page
    tables.

    The pmd_free() is a wrapper for free_page() in all the cases, so no
    functional change here.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Reviewed-by: Pekka Enberg
    Cc: Matthew Wilcox
    Cc: Abdul Haleem
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Christophe Leroy
    Cc: Joerg Roedel
    Cc: Joerg Roedel
    Cc: Max Filippov
    Cc: Peter Zijlstra (Intel)
    Cc: Satheesh Rajendran
    Cc: Stafford Horne
    Cc: Stephen Rothwell
    Cc: Steven Rostedt
    Cc: Geert Uytterhoeven
    Link: http://lkml.kernel.org/r/20200627143453.31835-5-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

10 Jun, 2020

4 commits

  • Add API for nested write locks and convert the few call sites doing that.

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Reviewed-by: Daniel Jordan
    Reviewed-by: Laurent Dufour
    Reviewed-by: Vlastimil Babka
    Cc: Davidlohr Bueso
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Jason Gunthorpe
    Cc: Jerome Glisse
    Cc: John Hubbard
    Cc: Liam Howlett
    Cc: Matthew Wilcox
    Cc: Peter Zijlstra
    Cc: Ying Han
    Link: http://lkml.kernel.org/r/20200520052908.204642-7-walken@google.com
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • This change converts the existing mmap_sem rwsem calls to use the new mmap
    locking API instead.

    The change is generated using coccinelle with the following rule:

    // spatch --sp-file mmap_lock_api.cocci --in-place --include-headers --dir .

    @@
    expression mm;
    @@
    (
    -init_rwsem
    +mmap_init_lock
    |
    -down_write
    +mmap_write_lock
    |
    -down_write_killable
    +mmap_write_lock_killable
    |
    -down_write_trylock
    +mmap_write_trylock
    |
    -up_write
    +mmap_write_unlock
    |
    -downgrade_write
    +mmap_write_downgrade
    |
    -down_read
    +mmap_read_lock
    |
    -down_read_killable
    +mmap_read_lock_killable
    |
    -down_read_trylock
    +mmap_read_trylock
    |
    -up_read
    +mmap_read_unlock
    )
    -(&mm->mmap_sem)
    +(mm)

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Reviewed-by: Daniel Jordan
    Reviewed-by: Laurent Dufour
    Reviewed-by: Vlastimil Babka
    Cc: Davidlohr Bueso
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Jason Gunthorpe
    Cc: Jerome Glisse
    Cc: John Hubbard
    Cc: Liam Howlett
    Cc: Matthew Wilcox
    Cc: Peter Zijlstra
    Cc: Ying Han
    Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • All architectures define pte_index() as

    (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)

    and all architectures define pte_offset_kernel() as an entry in the array
    of PTEs indexed by the pte_index().

    For the most architectures the pte_offset_kernel() implementation relies
    on the availability of pmd_page_vaddr() that converts a PMD entry value to
    the virtual address of the page containing PTEs array.

    Let's move x86 definitions of the PTE accessors to the generic place in
    and then simply drop the respective definitions from the
    other architectures.

    The architectures that didn't provide pmd_page_vaddr() are updated to have
    that defined.

    The generic implementation of pte_offset_kernel() can be overridden by an
    architecture and alpha makes use of this because it has special ordering
    requirements for its version of pte_offset_kernel().

    [rppt@linux.ibm.com: v2]
    Link: http://lkml.kernel.org/r/20200514170327.31389-11-rppt@kernel.org
    [rppt@linux.ibm.com: update]
    Link: http://lkml.kernel.org/r/20200514170327.31389-12-rppt@kernel.org
    [rppt@linux.ibm.com: update]
    Link: http://lkml.kernel.org/r/20200514170327.31389-13-rppt@kernel.org
    [akpm@linux-foundation.org: fix x86 warning]
    [sfr@canb.auug.org.au: fix powerpc build]
    Link: http://lkml.kernel.org/r/20200607153443.GB738695@linux.ibm.com

    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brian Cain
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Ungerer
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Matthew Wilcox
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Nick Hu
    Cc: Paul Walmsley
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Bogendoerfer
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200514170327.31389-10-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The include/linux/pgtable.h is going to be the home of generic page table
    manipulation functions.

    Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
    make the latter include asm/pgtable.h.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brian Cain
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Ungerer
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Matthew Wilcox
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Nick Hu
    Cc: Paul Walmsley
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Bogendoerfer
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

09 Jun, 2020

1 commit

  • This seems to lead to some crazy include loops when using
    asm-generic/cacheflush.h on more architectures, so leave it to the arch
    header for now.

    [hch@lst.de: fix warning]
    Link: http://lkml.kernel.org/r/20200520173520.GA11199@lst.de

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Cc: Will Deacon
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Dan Williams
    Cc: Vishal Verma
    Cc: Dave Jiang
    Cc: Keith Busch
    Cc: Ira Weiny
    Cc: Arnd Bergmann
    Link: http://lkml.kernel.org/r/20200515143646.3857579-7-hch@lst.de
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

30 Apr, 2020

1 commit

  • Two independent changes here ended up going into the tree
    one after another, without a necessary rename, fix that.

    Reported-by: Thomas Meyer
    Fixes: f185063bff91 ("um: Move timer-internal.h to non-shared")
    Signed-off-by: Johannes Berg
    Reviewed-by: Brendan Higgins
    Signed-off-by: Richard Weinberger

    Johannes Berg
     

11 Apr, 2020

1 commit

  • 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
     

30 Mar, 2020

4 commits

  • In external or inf-cpu time-travel mode, ndelay/udelay currently
    just waste CPU time since the simulation time doesn't advance.
    Implement them properly in this case.

    Note that the "if (time_travel_mode == ...)" parts compile out
    if CONFIG_UML_TIME_TRAVEL_SUPPORT isn't set, time_travel_mode is
    defined to TT_MODE_OFF in that case.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • This implements synchronized time-travel mode which - using a special
    application on a unix socket - lets multiple machines take part in a
    time-travelling simulation together.

    The protocol for the unix domain socket is defined in the new file
    include/uapi/linux/um_timetravel.h.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • Instead of tracking all the various timer configurations,
    modify the time-travel mode to have an event scheduler and
    use a timer event on the scheduler to handle the different
    timer configurations.

    This doesn't change the function right now, but it prepares
    the code for having different kinds of events in the future
    (i.e. interrupts coming from other devices that are part of
    co-simulation.)

    While at it, also move time_travel_sleep() to time.c to
    reduce the externally visible API surface.

    Also, we really should mark time-travel as incompatible with
    SMP, even if UML doesn't support SMP yet.

    Finally, I noticed a bug while developing this - if we move
    time forward due to consuming time while reading the clock,
    we might move across the next event and that would cause us
    to go backward in time when we then handle that event. Fix
    that by invoking the whole event machine in this case, but
    in order to simplify this, make reading the clock only cost
    something when interrupts are not disabled. Otherwise, we'd
    have to hook into the interrupt delivery machinery etc. and
    that's somewhat intrusive.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • This file isn't really shared, it's only used on the kernel side,
    not on the user side. Remove the include from the user-side and
    move the file to a better place.

    While at it, rename it to time-internal.h, it's not really just
    timers but all kinds of things related to timekeeping.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     

31 Jan, 2020

1 commit

  • Pull x86 MPX removal from Dave Hansen:
    "MPX requires recompiling applications, which requires compiler
    support. Unfortunately, GCC 9.1 is expected to be be released without
    support for MPX. This means that there was only a relatively small
    window where folks could have ever used MPX. It failed to gain wide
    adoption in the industry, and Linux was the only mainstream OS to ever
    support it widely.

    Support for the feature may also disappear on future processors.

    This set completes the process that we started during the 5.4 merge
    window when the MPX prctl()s were removed. XSAVE support is left in
    place, which allows MPX-using KVM guests to continue to function"

    * tag 'mpx-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-mpx:
    x86/mpx: remove MPX from arch/x86
    mm: remove arch_bprm_mm_init() hook
    x86/mpx: remove bounds exception code
    x86/mpx: remove build infrastructure
    x86/alternatives: add missing insn.h include

    Linus Torvalds
     

30 Jan, 2020

1 commit

  • …/kernel/git/arnd/playground

    Pull y2038 updates from Arnd Bergmann:
    "Core, driver and file system changes

    These are updates to device drivers and file systems that for some
    reason or another were not included in the kernel in the previous
    y2038 series.

    I've gone through all users of time_t again to make sure the kernel is
    in a long-term maintainable state, replacing all remaining references
    to time_t with safe alternatives.

    Some related parts of the series were picked up into the nfsd, xfs,
    alsa and v4l2 trees. A final set of patches in linux-mm removes the
    now unused time_t/timeval/timespec types and helper functions after
    all five branches are merged for linux-5.6, ensuring that no new users
    get merged.

    As a result, linux-5.6, or my backport of the patches to 5.4 [1],
    should be the first release that can serve as a base for a 32-bit
    system designed to run beyond year 2038, with a few remaining caveats:

    - All user space must be compiled with a 64-bit time_t, which will be
    supported in the coming musl-1.2 and glibc-2.32 releases, along
    with installed kernel headers from linux-5.6 or higher.

    - Applications that use the system call interfaces directly need to
    be ported to use the time64 syscalls added in linux-5.1 in place of
    the existing system calls. This impacts most users of futex() and
    seccomp() as well as programming languages that have their own
    runtime environment not based on libc.

    - Applications that use a private copy of kernel uapi header files or
    their contents may need to update to the linux-5.6 version, in
    particular for sound/asound.h, xfs/xfs_fs.h, linux/input.h,
    linux/elfcore.h, linux/sockios.h, linux/timex.h and
    linux/can/bcm.h.

    - A few remaining interfaces cannot be changed to pass a 64-bit
    time_t in a compatible way, so they must be configured to use
    CLOCK_MONOTONIC times or (with a y2106 problem) unsigned 32-bit
    timestamps. Most importantly this impacts all users of 'struct
    input_event'.

    - All y2038 problems that are present on 64-bit machines also apply
    to 32-bit machines. In particular this affects file systems with
    on-disk timestamps using signed 32-bit seconds: ext4 with
    ext3-style small inodes, ext2, xfs (to be fixed soon) and ufs"

    [1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-endgame

    * tag 'y2038-drivers-for-v5.6-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: (21 commits)
    Revert "drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC"
    y2038: sh: remove timeval/timespec usage from headers
    y2038: sparc: remove use of struct timex
    y2038: rename itimerval to __kernel_old_itimerval
    y2038: remove obsolete jiffies conversion functions
    nfs: fscache: use timespec64 in inode auxdata
    nfs: fix timstamp debug prints
    nfs: use time64_t internally
    sunrpc: convert to time64_t for expiry
    drm/etnaviv: avoid deprecated timespec
    drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC
    drm/msm: avoid using 'timespec'
    hfs/hfsplus: use 64-bit inode timestamps
    hostfs: pass 64-bit timestamps to/from user space
    packet: clarify timestamp overflow
    tsacct: add 64-bit btime field
    acct: stop using get_seconds()
    um: ubd: use 64-bit time_t where possible
    xtensa: ISS: avoid struct timeval
    dlm: use SO_SNDTIMEO_NEW instead of SO_SNDTIMEO_OLD
    ...

    Linus Torvalds
     

29 Jan, 2020

1 commit

  • Pull UML updates from Anton Ivanov:
    "I am sending this on behalf of Richard who is traveling.

    This contains the following changes for UML:

    - Fix for time travel mode

    - Disable CONFIG_CONSTRUCTORS again

    - A new command line option to have an non-raw serial line

    - Preparations to remove obsolete UML network drivers"

    * tag 'for-linus-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
    um: Fix time-travel=inf-cpu with xor/raid6
    Revert "um: Enable CONFIG_CONSTRUCTORS"
    um: Mark non-vector net transports as obsolete
    um: Add an option to make serial driver non-raw

    Linus Torvalds
     

24 Jan, 2020

1 commit

  • From: Dave Hansen

    MPX is being removed from the kernel due to a lack of support
    in the toolchain going forward (gcc).

    arch_bprm_mm_init() is used at execve() time. The only non-stub
    implementation is on x86 for MPX. Remove the hook entirely from
    all architectures and generic code.

    Cc: Peter Zijlstra (Intel)
    Cc: Andy Lutomirski
    Cc: x86@kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Cc: Guan Xuetao
    Cc: Andrew Morton
    Signed-off-by: Dave Hansen

    Dave Hansen
     

20 Jan, 2020

3 commits

  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Today, I erroneously built a time-travel configuration with btrfs
    enabled, and noticed it cannot boot in time-travel=inf-cpu mode,
    both xor and raid6 speed measurement gets stuck.

    For xor, work around it by picking the first algorithm if inf-cpu
    mode is enabled.

    For raid6, I didn't find such a workaround, so disallow enabling
    time-travel mode if RAID6_PQ_BENCHMARK is enabled.

    With this, and RAID6_PQ_BENCHMARK disabled, I can boot a kernel
    that has btrfs enabled in time-travel=inf-cpu mode.

    Signed-off-by: Johannes Berg
    Acked-by: Anton Ivanov
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • This reverts commit 786b2384bf1c ("um: Enable CONFIG_CONSTRUCTORS").

    There are two issues with this commit, uncovered by Anton in tests
    on some (Debian) systems:

    1) I completely forgot to call any constructors if CONFIG_CONSTRUCTORS
    isn't set. Don't recall now if it just wasn't needed on my system, or
    if I never tested this case.

    2) With that fixed, it works - with CONFIG_CONSTRUCTORS *unset*. If I
    set CONFIG_CONSTRUCTORS, it fails again, which isn't totally
    unexpected since whatever wanted to run is likely to have to run
    before the kernel init etc. that calls the constructors in this case.

    Basically, some constructors that gcc emits (libc has?) need to run
    very early during init; the failure mode otherwise was that the ptrace
    fork test already failed:

    ----------------------
    $ ./linux mem=512M
    Core dump limits :
    soft - 0
    hard - NONE
    Checking that ptrace can change system call numbers...check_ptrace : child exited with exitcode 6, while expecting 0; status 0x67f
    Aborted
    ----------------------

    Thinking more about this, it's clear that we simply cannot support
    CONFIG_CONSTRUCTORS in UML. All the cases we need now (gcov, kasan)
    involve not use of the __attribute__((constructor)), but instead
    some constructor code/entry generated by gcc. Therefore, we cannot
    distinguish between kernel constructors and system constructors.

    Thus, revert this commit.

    Cc: stable@vger.kernel.org [5.4+]
    Fixes: 786b2384bf1c ("um: Enable CONFIG_CONSTRUCTORS")
    Reported-by: Anton Ivanov
    Signed-off-by: Johannes Berg
    Acked-by: Anton Ivanov

    Signed-off-by: Richard Weinberger

    Johannes Berg
     

07 Jan, 2020

1 commit

  • This is required for clone3 which passes the TLS value through a
    struct rather than a register.

    Signed-off-by: Amanieu d'Antras
    Cc: linux-um@lists.infradead.org
    Cc: # 5.3.x
    Link: https://lore.kernel.org/r/20200104123928.1048822-1-amanieu@gmail.com
    Signed-off-by: Christian Brauner

    Amanieu d'Antras
     

19 Dec, 2019

1 commit

  • The ubd code suffers from a possible y2038 overflow on 32-bit
    architectures, both for the cow header and the os_file_modtime()
    function.

    Replace time_t with time64_t to extend the ubd_kern side as much
    as possible.

    Whether this makes a difference for the user side depends on
    the host libc implementation that may use either 32-bit or 64-bit
    time_t.

    For the cow file format, the header contains an unsigned 32-bit
    timestamp, which is good until y2106, passing this through a
    'long long' gives us a consistent interpretation between 32-bit
    and 64-bit um kernels.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

10 Dec, 2019

1 commit


05 Dec, 2019

1 commit

  • The UML port uses 4 and 5 level fixups to support higher level page
    table directories in the generic VM code.

    Implement primitives necessary for the 4th level folding, add walks of
    p4d level where appropriate and drop usage of __ARCH_USE_5LEVEL_HACK.

    Link: http://lkml.kernel.org/r/1572938135-31886-13-git-send-email-rppt@kernel.org
    Signed-off-by: Mike Rapoport
    Cc: Anatoly Pugachev
    Cc: Anton Ivanov
    Cc: Arnd Bergmann
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Ungerer
    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
     

04 Nov, 2019

2 commits

  • There's no reason to keep the RODATA macro: replace the callers with
    the expected RO_DATA macro.

    Signed-off-by: Kees Cook
    Signed-off-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Dave Hansen
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Rick Edgecombe
    Cc: Segher Boessenkool
    Cc: Will Deacon
    Cc: x86-ml
    Cc: Yoshinori Sato
    Link: https://lkml.kernel.org/r/20191029211351.13243-12-keescook@chromium.org

    Kees Cook
     
  • The .notes section should be non-executable read-only data. As such,
    move it to the RO_DATA macro instead of being per-architecture defined.

    Signed-off-by: Kees Cook
    Signed-off-by: Borislav Petkov
    Acked-by: Heiko Carstens # s390
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Dave Hansen
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Rick Edgecombe
    Cc: Segher Boessenkool
    Cc: Will Deacon
    Cc: x86-ml
    Cc: Yoshinori Sato
    Link: https://lkml.kernel.org/r/20191029211351.13243-11-keescook@chromium.org

    Kees Cook
     

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
     

16 Sep, 2019

8 commits

  • Convert files to use SPDX header. All files are licensed under the GPLv2.

    Signed-off-by: Alex Dewar
    Signed-off-by: Richard Weinberger

    Alex Dewar
     
  • This module allows virtio devices to be used over a vhost-user socket.

    Signed-off-by: Erel Geron
    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Erel Geron
     
  • UML has its own platform-specific barrier.h under arch/x86/um/,
    which should get used. Fix the build system to use it, and then
    fix the barrier.h to actually compile.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • Periodic timers are broken, because the also only fire once.
    As it happens, Linux doesn't care because it only sets the
    timer to periodic very briefly during boot, and then switches
    it only between one-shot and off later.

    Nevertheless, fix the logic (we shouldn't even be looking at
    time_travel_timer_expiry unless the timer is enabled) and
    change the code to fire the timer periodically in periodic
    mode, in case it ever gets used in the future.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • We do need to call the constructors for *modules*, and
    at least for KASAN in the future, we must call even the
    kernel constructors only later when the kernel has been
    initialized.

    Instead of relying on libc to call them, emit an empty
    section for libc and let the kernel's CONSTRUCTORS code
    do the rest of the job.

    Tested that it indeed doesn't work in modules, and does
    work after the fixes in both, with a few functions with
    __attribute__((constructor)) in both dynamic and static
    builds.

    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • UML enables TRACE_IRQFLAGS_SUPPORT but doesn't actually implement
    it. It seems to have been added for lockdep support, but that can't
    actually really work well without IRQ flags tracing, as is also
    very noisily reported when enabling CONFIG_DEBUG_LOCKDEP.

    Implement it now.

    Fixes: 711553efa5b8 ("[PATCH] uml: declare in Kconfig our partial LOCKDEP support")
    Signed-off-by: Johannes Berg
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • Due to the typo in the name, this can never be used, but
    it's also misleading because our value for enabled/disabled
    is always just 0/1, not an actual signal mask.

    Signed-off-by: Johannes Berg
    Acked-by: Anton Ivanov
    Signed-off-by: Richard Weinberger

    Johannes Berg
     
  • Fix an off-by-one in IRQ enumeration

    Fixes: 49da7e64f33e ("High Performance UML Vector Network Driver")
    Reported by: Dana Johnson
    Signed-off-by: Anton Ivanov
    Signed-off-by: Richard Weinberger

    Anton Ivanov