Skip to content
Permalink
Mike-Leach/Cor…
Switch branches/tags

Commits on Apr 9, 2021

  1. Documentation: coresight: Add documentation for CoreSight config

    Adds documentation for the CoreSight System configuration manager.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: linux-doc@vger.kernel.org
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  2. coresight: syscfg: Add initial configfs support

    Adds configfs subsystem and attributes to the configuration manager
    to enable the listing of loaded configurations and features.
    
    The default values of feature parameters can be accessed and altered
    from these attributes to affect all installed devices using the feature.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  3. coresight: config: Add preloaded configurations

    Preload set of configurations.
    
    This patch creates a small set of preloaded configurations and features
    that are available immediately after coresight has been initialised.
    
    The current set provides a strobing feature for ETMv4, that creates a
    periodic sampling of trace by switching trace generation on and off
    using counters in the ETM.
    
    A configuration called "autofdo" is also provided that uses the 'strobing'
    feature and provides a couple of preset values, selectable on the perf
    command line.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  4. coresight: etm4x: Add complex configuration handlers to etmv4

    Adds in handlers to allow the ETMv4 to use the complex configuration
    support. Features and configurations can be loaded and selected in the
    device.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  5. coresight: etm-perf: Update to activate selected configuration

    Add calls to activate the selected configuration as perf starts
    and stops the tracing session.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  6. coresight: syscfg: Add API to activate and enable configurations

    Configurations are first activated, then when any coresight device is
    enabled, the active configurations are checked and any matching
    one is enabled.
    
    This patch provides the activation / enable API.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  7. coresight: etm-perf: update to handle configuration selection

    Loaded coresight configurations are registered in the cs_etm\events sub
    directory. This extends the etm-perf code to handle these registrations,
    and the cs_syscfg driver to perform the registration on load.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  8. coresight: config: Add configuration and feature generic functions

    Adds a set of generic support functions that allow devices to set and save
    features values on the device, and enable and disable configurations.
    
    Additional functions for other common operations including feature
    reset.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  9. coresight: syscfg: Add registration and feature loading for cs devices

    API for individual devices to register with the syscfg management
    system is added.
    
    Devices register with matching information, and any features or
    configurations that match will be loaded into the device.
    
    The feature and configuration loading is extended so that on load these
    are loaded into any currently registered devices. This allows
    configuration loading after devices have been registered.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021
  10. coresight: syscfg: Initial coresight system configuration

    Creates an system management API to allow complex configurations and
    features to be programmed into a CoreSight infrastructure.
    
    A feature is defined as a programming set for a device or class of
    devices.
    
    A configuration is a set of features across the system that are enabled
    for a trace session.
    
    The API will manage system wide configuration, and allow complex
    programmed features to be added to individual device instances, and
    provide for system wide configuration selection on trace capture
    operations.
    
    This patch creates the initial data object and the initial API for
    loading configurations and features.
    
    Signed-off-by: Mike Leach <mike.leach@linaro.org>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
    mikel-armbb authored and intel-lab-lkp committed Apr 9, 2021

Commits on Apr 8, 2021

  1. Add linux-next specific files for 20210408

    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    sfrothwell committed Apr 8, 2021
  2. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  3. secretmem: test: add basic selftest for memfd_secret(2)

    The test verifies that file descriptor created with memfd_secret does not
    allow read/write operations, that secret memory mappings respect
    RLIMIT_MEMLOCK and that remote accesses with process_vm_read() and
    ptrace() to the secret memory fail.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-10-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  4. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  5. arch, mm: wire up memfd_secret system call where relevant

    Wire up memfd_secret system call on architectures that define
    ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-9-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  6. PM: hibernate: disable when there are active secretmem users

    It is unsafe to allow saving of secretmem areas to the hibernation
    snapshot as they would be visible after the resume and this essentially
    will defeat the purpose of secret memory mappings.
    
    Prevent hibernation whenever there are active secret memory users.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-8-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  7. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  8. mm: introduce memfd_secret system call to create "secret" memory areas

    Introduce "memfd_secret" system call with the ability to create memory
    areas visible only in the context of the owning process and not mapped not
    only to other processes but in the kernel page tables as well.
    
    The secretmem feature is off by default and the user must explicitly
    enable it at the boot time.
    
    Once secretmem is enabled, the user will be able to create a file
    descriptor using the memfd_secret() system call.  The memory areas created
    by mmap() calls from this file descriptor will be unmapped from the kernel
    direct map and they will be only mapped in the page table of the processes
    that have access to the file descriptor.
    
    The file descriptor based memory has several advantages over the
    "traditional" mm interfaces, such as mlock(), mprotect(), madvise().  File
    descriptor approach allows explict and controlled sharing of the memory
    areas, it allows to seal the operations.  Besides, file descriptor based
    memory paves the way for VMMs to remove the secret memory range from the
    userpace hipervisor process, for instance QEMU.  Andy Lutomirski says:
    
      "Getting fd-backed memory into a guest will take some possibly major
      work in the kernel, but getting vma-backed memory into a guest without
      mapping it in the host user address space seems much, much worse."
    
    memfd_secret() is made a dedicated system call rather than an extention to
    memfd_create() because it's purpose is to allow the user to create more
    secure memory mappings rather than to simply allow file based access to
    the memory.  Nowadays a new system call cost is negligible while it is way
    simpler for userspace to deal with a clear-cut system calls than with a
    multiplexer or an overloaded syscall.  Moreover, the initial
    implementation of memfd_secret() is completely distinct from
    memfd_create() so there is no much sense in overloading memfd_create()
    to begin with.  If there will be a need for code sharing between these
    implementation it can be easily achieved without a need to adjust user
    visible APIs.
    
    The secret memory remains accessible in the process context using uaccess
    primitives, but it is not exposed to the kernel otherwise; secret memory
    areas are removed from the direct map and functions in the
    follow_page()/get_user_page() family will refuse to return a page that
    belongs to the secret memory area.
    
    Once there will be a use case that will require exposing secretmem to the
    kernel it will be an opt-in request in the system call flags so that user
    would have to decide what data can be exposed to the kernel.
    
    Removing of the pages from the direct map may cause its fragmentation on
    architectures that use large pages to map the physical memory which
    affects the system performance.  However, the original Kconfig text for
    CONFIG_DIRECT_GBPAGES said that gigabyte pages in the direct map "...  can
    improve the kernel's performance a tiny bit ..." (commit 00d1c5e
    ("x86: add gbpages switches")) and the recent report [1] showed that "...
    although 1G mappings are a good default choice, there is no compelling
    evidence that it must be the only choice".  Hence, it is sufficient to
    have secretmem disabled by default with the ability of a system
    administrator to enable it at boot time.
    
    Pages in the secretmem regions are unevictable and unmovable to avoid
    accidental exposure of the sensitive data via swap or during page
    migration.
    
    Since the secretmem mappings are locked in memory they cannot exceed
    RLIMIT_MEMLOCK.  Since these mappings are already locked independently
    from mlock(), an attempt to mlock()/munlock() secretmem range would fail
    and mlockall()/munlockall() will ignore secretmem mappings.
    
    However, unlike mlock()ed memory, secretmem currently behaves more like
    long-term GUP: secretmem mappings are unmovable mappings directly consumed
    by user space.  With default limits, there is no excessive use of
    secretmem and it poses no real problem in combination with
    ZONE_MOVABLE/CMA, but in the future this should be addressed to allow
    balanced use of large amounts of secretmem along with ZONE_MOVABLE/CMA.
    
    A page that was a part of the secret memory area is cleared when it is
    freed to ensure the data is not exposed to the next user of that page.
    
    The following example demonstrates creation of a secret mapping (error
    handling is omitted):
    
    	fd = memfd_secret(0);
    	ftruncate(fd, MAP_SIZE);
    	ptr = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE,
    		   MAP_SHARED, fd, 0);
    
    [1] https://lore.kernel.org/linux-mm/213b4567-46ce-f116-9cdf-bbd0c884eb3c@linux.intel.com/
    Link: https://lkml.kernel.org/r/20210303162209.8609-7-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  9. set_memory: allow querying whether set_direct_map_*() is actually ena…

    …bled
    
    On arm64, set_direct_map_*() functions may return 0 without actually
    changing the linear map.  This behaviour can be controlled using kernel
    parameters, so we need a way to determine at runtime whether calls to
    set_direct_map_invalid_noflush() and set_direct_map_default_noflush() have
    any effect.
    
    Extend set_memory API with can_set_direct_map() function that allows
    checking if calling set_direct_map_*() will actually change the page
    table, replace several occurrences of open coded checks in arm64 with the
    new function and provide a generic stub for architectures that always
    modify page tables upon calls to set_direct_map APIs.
    
    [arnd@arndb.de: arm64: kfence: fix header inclusion ]
    Link: https://lkml.kernel.org/r/20210303162209.8609-6-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  10. set_memory: allow set_direct_map_*_noflush() for multiple pages

    The underlying implementations of set_direct_map_invalid_noflush() and
    set_direct_map_default_noflush() allow updating multiple contiguous pages
    at once.
    
    Add numpages parameter to set_direct_map_*_noflush() to expose this
    ability with these APIs.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-5-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  11. riscv/Kconfig: make direct map manipulation options depend on MMU

    ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have
    no meaning when CONFIG_MMU is disabled and there is no point to enable
    them for the nommu case.
    
    Add an explicit dependency on MMU for these options.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-4-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  12. mmap: make mlock_future_check() global

    Patch series "mm: introduce memfd_secret system call to create "secret" memory areas", v18.
    
    This is an implementation of "secret" mappings backed by a file
    descriptor.
    
    The file descriptor backing secret memory mappings is created using a
    dedicated memfd_secret system call The desired protection mode for the
    memory is configured using flags parameter of the system call.  The mmap()
    of the file descriptor created with memfd_secret() will create a "secret"
    memory mapping.  The pages in that mapping will be marked as not present
    in the direct map and will be present only in the page table of the owning
    mm.
    
    Although normally Linux userspace mappings are protected from other users,
    such secret mappings are useful for environments where a hostile tenant is
    trying to trick the kernel into giving them access to other tenants
    mappings.
    
    Additionally, in the future the secret mappings may be used as a mean to
    protect guest memory in a virtual machine host.
    
    For demonstration of secret memory usage we've created a userspace library
    
    https://git.kernel.org/pub/scm/linux/kernel/git/jejb/secret-memory-preloader.git
    
    that does two things: the first is act as a preloader for openssl to
    redirect all the OPENSSL_malloc calls to secret memory meaning any secret
    keys get automatically protected this way and the other thing it does is
    expose the API to the user who needs it.  We anticipate that a lot of the
    use cases would be like the openssl one: many toolkits that deal with
    secret keys already have special handling for the memory to try to give
    them greater protection, so this would simply be pluggable into the
    toolkits without any need for user application modification.
    
    Hiding secret memory mappings behind an anonymous file allows usage of the
    page cache for tracking pages allocated for the "secret" mappings as well
    as using address_space_operations for e.g.  page migration callbacks.
    
    The anonymous file may be also used implicitly, like hugetlb files, to
    implement mmap(MAP_SECRET) and use the secret memory areas with "native"
    mm ABIs in the future.
    
    Removing of the pages from the direct map may cause its fragmentation on
    architectures that use large pages to map the physical memory which
    affects the system performance.  However, the original Kconfig text for
    CONFIG_DIRECT_GBPAGES said that gigabyte pages in the direct map "...  can
    improve the kernel's performance a tiny bit ..." (commit 00d1c5e
    ("x86: add gbpages switches")) and the recent report [1] showed that "...
    although 1G mappings are a good default choice, there is no compelling
    evidence that it must be the only choice".  Hence, it is sufficient to
    have secretmem disabled by default with the ability of a system
    administrator to enable it at boot time.
    
    In addition, there is also a long term goal to improve management of the
    direct map.
    
    [1] https://lore.kernel.org/linux-mm/213b4567-46ce-f116-9cdf-bbd0c884eb3c@linux.intel.com/
    
    This patch (of 8):
    
    It will be used by the upcoming secret memory implementation.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-1-rppt@kernel.org
    Link: https://lkml.kernel.org/r/20210303162209.8609-3-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 8, 2021
  13. mm: fix typos in comments

    Fix ~94 single-word typos in locking code comments, plus a few
    very obvious grammar mistakes.
    
    Link: https://lkml.kernel.org/r/20210322212624.GA1963421@gmail.com
    Link: https://lore.kernel.org/r/20210322205203.GB1959563@gmail.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Bhaskar Chowdhury <unixbhaskar@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Ingo Molnar authored and sfrothwell committed Apr 8, 2021
  14. treewide: remove editor modelines and cruft

    The section "19) Editor modelines and other cruft" in
    Documentation/process/coding-style.rst clearly says, "Do not include any
    of these in source files."
    
    I recently receive a patch to explicitly add a new one.
    
    Let's do treewide cleanups, otherwise some people follow the existing code
    and attempt to upstream their favoriate editor setups.
    
    It is even nicer if scripts/checkpatch.pl can check it.
    
    If we like to impose coding style in an editor-independent manner, I think
    editorconfig (patch [1]) is a saner solution.
    
    [1] https://lore.kernel.org/lkml/20200703073143.423557-1-danny@kdrag0n.dev/
    
    Link: https://lkml.kernel.org/r/20210324054457.1477489-1-masahiroy@kernel.org
    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Reviewed-by: Miguel Ojeda <ojeda@kernel.org>	[auxdisplay]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    masahir0y authored and sfrothwell committed Apr 8, 2021
  15. ipc/sem.c: spelling fix

    s/purpuse/purpose/
    
    Link: https://lkml.kernel.org/r/20210319221432.26631-1-unixbhaskar@gmail.com
    Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
    Acked-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    unixbhaskar authored and sfrothwell committed Apr 8, 2021
  16. fs: fat: fix spelling typo of values

    vaules -> values
    
    Link: https://lkml.kernel.org/r/20210302034817.30384-1-dingsenjie@163.com
    Signed-off-by: dingsenjie <dingsenjie@yulong.com>
    Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    dingsenjie authored and sfrothwell committed Apr 8, 2021
  17. kernel/sys.c: fix typo

    change 'infite'     to 'infinite'
    change 'concurent'  to 'concurrent'
    change 'memvers'    to 'members'
    change 'decendants' to 'descendants'
    change 'argumets'   to 'arguments'
    
    Link: https://lkml.kernel.org/r/20210316112904.10661-1-cxfcosmos@gmail.com
    Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
    Acked-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    CaoXiaofengGH authored and sfrothwell committed Apr 8, 2021
  18. kernel/up.c: fix typo

    s/condtions/conditions/
    
    Link: https://lkml.kernel.org/r/20210317032732.3260835-1-unixbhaskar@gmail.com
    Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    unixbhaskar authored and sfrothwell committed Apr 8, 2021
  19. kernel/user_namespace.c: fix typos

    change 'verifing' to 'verifying'
    change 'certaint' to 'certain'
    change 'approprpiate' to 'appropriate'
    
    Link: https://lkml.kernel.org/r/20210317100129.12440-1-caoxiaofeng@yulong.com
    Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    CaoXiaofengGH authored and sfrothwell committed Apr 8, 2021
  20. kernel/umh.c: fix some spelling mistakes

    Fix some spelling mistakes, and modify the order of the parameter comments
    to be consistent with the order of the parameters passed to the function.
    
    Link: https://lkml.kernel.org/r/1615636139-4076-1-git-send-email-zhouchuangao@vivo.com
    Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
    Acked-by: Luis Chamberlain <mcgrof@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    zhouchuangao authored and sfrothwell committed Apr 8, 2021
  21. include/linux/pgtable.h: few spelling fixes

    Few spelling fixes throughout the file.
    
    Link: https://lkml.kernel.org/r/20210318201404.6380-1-unixbhaskar@gmail.com
    Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
    Acked-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    unixbhaskar authored and sfrothwell committed Apr 8, 2021
  22. mm/slab.c: fix spelling mistake "disired" -> "desired"

    There is a spelling mistake in a comment. Fix it.
    
    Link: https://lkml.kernel.org/r/20210317094158.5762-1-colin.king@canonical.com
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Colin Ian King authored and sfrothwell committed Apr 8, 2021
  23. scripts/spelling.txt: add "overflw"

    Add typo "overflw" for "overflow".  This typo was found and fixed in
    drivers/clocksource/timer-pistachio.c.
    
    Link: https://lore.kernel.org/lkml/20210305090315.384547-1-drew@beagleboard.org/
    Link: https://lkml.kernel.org/r/20210305095151.388182-1-drew@beagleboard.org
    Signed-off-by: Drew Fustini <drew@beagleboard.org>
    Suggested-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    pdp7 authored and sfrothwell committed Apr 8, 2021
  24. scripts/spelling.txt: Add "diabled" typo

    Increase "diabled" spelling error check.
    
    Link: https://lkml.kernel.org/r/20210304070106.2313-1-zuoqilin1@163.com
    Signed-off-by: zuoqilin <zuoqilin@yulong.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    zuoqilin authored and sfrothwell committed Apr 8, 2021
Older