14 Oct, 2020

35 commits

  • i915 does not want to see value entries. Switch it to use
    find_lock_page() instead, and remove the export of find_lock_entry().
    Move find_lock_entry() and find_get_entry() to mm/internal.h to discourage
    any future use.

    Signed-off-by: Matthew Wilcox (Oracle)
    Signed-off-by: Andrew Morton
    Acked-by: Johannes Weiner
    Cc: Alexey Dobriyan
    Cc: Chris Wilson
    Cc: Huang Ying
    Cc: Hugh Dickins
    Cc: Jani Nikula
    Cc: Matthew Auld
    Cc: William Kucharski
    Link: https://lkml.kernel.org/r/20200910183318.20139-6-willy@infradead.org
    Signed-off-by: Linus Torvalds

    Matthew Wilcox (Oracle)
     
  • Add a sysfs attribute which denotes a range from the dax region to be
    allocated. It's an write only @mapping sysfs attribute in the format of
    '-' to allocate a range. @start and @end use hexadecimal
    values and the @pgoff is implicitly ordered wrt to previous writes to
    @mapping sysfs e.g. a write of a range of length 1G the pgoff is
    0..1G(-4K), a second write will use @pgoff for 1G+4K...

    This range mapping interface is useful for:

    1) Application which want to implement its own allocation logic, and
    thus pick the desired ranges from dax_region.

    2) For use cases like VMM fast restart[0] where after kexec we want
    to the same gpaphys mappings (as originally created before kexec).

    [0] https://static.sched.com/hosted_files/kvmforum2019/66/VMM-fast-restart_kvmforum2019.pdf

    Signed-off-by: Joao Martins
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643106970.4062302.10402616567780784722.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lore.kernel.org/r/20200716172913.19658-5-joao.m.martins@oracle.com
    Link: https://lkml.kernel.org/r/160106119570.30709.4548889722645210610.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Joao Martins
     
  • Introduce a new module parameter for dax_hmem which initializes all region
    devices as free, rather than allocating a pagemap for the region by
    default.

    All hmem devices created with dax_hmem.region_idle=1 will have full
    available size for creating dynamic dax devices.

    Signed-off-by: Joao Martins
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643106460.4062302.5868522341307530091.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lore.kernel.org/r/20200716172913.19658-4-joao.m.martins@oracle.com
    Link: https://lkml.kernel.org/r/160106119033.30709.11249962152222193448.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Joao Martins
     
  • Introduce a device align attribute. While doing so, rename the region
    align attribute to be more explicitly named as so, but keep it named as
    @align to retain the API for tools like daxctl.

    Changes on align may not always be valid, when say certain mappings were
    created with 2M and then we switch to 1G. So, we validate all ranges
    against the new value being attempted, post resizing.

    Signed-off-by: Joao Martins
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643105944.4062302.3131761052969132784.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lore.kernel.org/r/20200716172913.19658-3-joao.m.martins@oracle.com
    Link: https://lkml.kernel.org/r/160106118486.30709.13012322227204800596.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Introduce @align to struct dev_dax.

    When creating a new device, we still initialize to the default dax_region
    @align. Child devices belonging to a region may wish to keep a different
    alignment property instead of a global region-defined one.

    Signed-off-by: Joao Martins
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643105377.4062302.4159447829955683131.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lore.kernel.org/r/20200716172913.19658-2-joao.m.martins@oracle.com
    Link: https://lkml.kernel.org/r/160106117957.30709.1142303024324655705.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Joao Martins
     
  • In support of interrogating the physical address layout of a device with
    dis-contiguous ranges, introduce a sysfs directory with 'start', 'end',
    and 'page_offset' attributes. The alternative is trying to parse
    /proc/iomem, and that file will not reflect the extent layout until the
    device is enabled.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Joao Martins
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643104819.4062302.13691281391423291589.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106117446.30709.2751020815463722537.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Break the requirement that device-dax instances are physically contiguous.
    With this constraint removed it allows fragmented available capacity to
    be fully allocated.

    This capability is useful to mitigate the "noisy neighbor" problem with
    memory-side-cache management for virtual machines, or any other scenario
    where a platform address boundary also designates a performance boundary.
    For example a direct mapped memory side cache might rotate cache colors at
    1GB boundaries. With dis-contiguous allocations a device-dax instance
    could be configured to contain only 1 cache color.

    It also satisfies Joao's use case (see link) for partitioning memory for
    exclusive guest access. It allows for a future potential mode where the
    host kernel need not allocate 'struct page' capacity up-front.

    Reported-by: Joao Martins
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lore.kernel.org/lkml/20200110190313.17144-1-joao.m.martins@oracle.com/
    Link: https://lkml.kernel.org/r/159643104304.4062302.16561669534797528660.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106116875.30709.11456649969327399771.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In support of device-dax growing the ability to front physically
    dis-contiguous ranges of memory, update devm_memremap_pages() to track
    multiple ranges with a single reference counter and devm instance.

    Convert all [devm_]memremap_pages() users to specify the number of ranges
    they are mapping in their 'struct dev_pagemap' instance.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Dave Jiang
    Cc: Ben Skeggs
    Cc: David Airlie
    Cc: Daniel Vetter
    Cc: Ira Weiny
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Juergen Gross
    Cc: Stefano Stabellini
    Cc: "Jérôme Glisse"
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Dave Hansen
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: kernel test robot
    Cc: Mike Rapoport
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643103789.4062302.18426128170217903785.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106116293.30709.13350662794915396198.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • The 'struct resource' in 'struct dev_pagemap' is only used for holding
    resource span information. The other fields, 'name', 'flags', 'desc',
    'parent', 'sibling', and 'child' are all unused wasted space.

    This is in preparation for introducing a multi-range extension of
    devm_memremap_pages().

    The bulk of this change is unwinding all the places internal to libnvdimm
    that used 'struct resource' unnecessarily, and replacing instances of
    'struct dev_pagemap'.res with 'struct dev_pagemap'.range.

    P2PDMA had a minor usage of the resource flags field, but only to report
    failures with "%pR". That is replaced with an open coded print of the
    range.

    [dan.carpenter@oracle.com: mm/hmm/test: use after free in dmirror_allocate_chunk()]
    Link: https://lkml.kernel.org/r/20200926121402.GA7467@kadam

    Signed-off-by: Dan Williams
    Signed-off-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Reviewed-by: Boris Ostrovsky [xen]
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Dave Jiang
    Cc: Ben Skeggs
    Cc: David Airlie
    Cc: Daniel Vetter
    Cc: Ira Weiny
    Cc: Bjorn Helgaas
    Cc: Juergen Gross
    Cc: Stefano Stabellini
    Cc: "Jérôme Glisse"
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Dave Hansen
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: kernel test robot
    Cc: Mike Rapoport
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643103173.4062302.768998885691711532.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106115761.30709.13539840236873663620.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Make the device-dax 'size' attribute writable to allow capacity to be
    split between multiple instances in a region. The intended consumers of
    this capability are users that want to split a scarce memory resource
    between device-dax and System-RAM access, or users that want to have
    multiple security domains for a large region.

    By default the hmem instance provider allocates an entire region to the
    first instance. The process of creating a new instance (assuming a
    region-id of 0) is find the region and trigger the 'create' attribute
    which yields an empty instance to configure. For example:

    cd /sys/bus/dax/devices
    echo dax0.0 > dax0.0/driver/unbind
    echo $new_size > dax0.0/size
    echo 1 > $(readlink -f dax0.0)../dax_region/create
    seed=$(cat $(readlink -f dax0.0)../dax_region/seed)
    echo $new_size > $seed/size
    echo dax0.0 > ../drivers/{device_dax,kmem}/bind
    echo dax0.1 > ../drivers/{device_dax,kmem}/bind

    Instances can be destroyed by:

    echo $device > $(readlink -f $device)../dax_region/delete

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Vishal Verma
    Cc: Brice Goglin
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Hildenbrand
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643102625.4062302.7431838945566033852.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106115239.30709.9850106928133493138.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Use sysfs_streq() in device_find_child_by_name() to allow it to use a
    sysfs input string that might contain a trailing newline.

    The other "device by name" interfaces,
    {bus,driver,class}_find_device_by_name(), already account for sysfs
    strings.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Reviewed-by: Greg Kroah-Hartman
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643102106.4062302.12229802117645312104.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106114576.30709.2960091665444712180.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Add a seed device concept for dynamic dax regions to be able to split the
    region amongst multiple sub-instances. The seed device, similar to
    libnvdimm seed devices, is a device that starts with zero capacity
    allocated and unbound to a driver. In contrast to libnvdimm seed devices
    explicit 'create' and 'delete' interfaces are added to the region to
    trigger seeds to be created and unused devices to be reclaimed. The
    explicit create and delete replaces implicit create as a side effect of
    probe and implicit delete when writing 0 to the size that libnvdimm
    implements.

    Delete can be performed on any 0-sized and idle device. This avoids the
    gymnastics of needing to move device_unregister() to its own async
    context. Specifically, it avoids the deadlock of deleting a device via
    one of its own attributes. It is also less surprising to userspace which
    never sees an extra device it did not request.

    For now just add the device creation, teardown, and ->probe() prevention.
    A later patch will arrange for the 'dax/size' attribute to be writable to
    allocate capacity from the region.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Vishal Verma
    Cc: Brice Goglin
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Hildenbrand
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643101583.4062302.12255093902950754962.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106113873.30709.15168756050631539431.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In preparation for introducing seed devices the dax-bus core needs to be
    able to intercept ->probe() and ->remove() operations. Towards that end
    arrange for the bus and drivers to switch from raw 'struct device' driver
    operations to 'struct dev_dax' typed operations.

    Reported-by: Hulk Robot
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Jason Yan
    Cc: Vishal Verma
    Cc: Brice Goglin
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Hildenbrand
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/160106113357.30709.4541750544799737855.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In preparation for a facility that enables dax regions to be sub-divided,
    introduce infrastructure to track and allocate region capacity.

    The new dax_region/available_size attribute is only enabled for volatile
    hmem devices, not pmem devices that are defined by nvdimm namespace
    boundaries. This is per Jeff's feedback the last time dynamic device-dax
    capacity allocation support was discussed.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Vishal Verma
    Cc: Brice Goglin
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Hildenbrand
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lore.kernel.org/linux-nvdimm/x49shpp3zn8.fsf@segfault.boston.devel.redhat.com
    Link: https://lkml.kernel.org/r/159643101035.4062302.6785857915652647857.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106112801.30709.14601438735305335071.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Towards removing the mode specific @dax_kmem_res attribute from the
    generic 'struct dev_dax', and preparing for multi-range support, change
    the kmem driver to use the idiomatic release_mem_region() to pair with the
    initial request_mem_region(). This also eliminates the need to open code
    the release of the resource allocated by request_mem_region().

    As there are no more dax_kmem_res users, delete this struct member.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: David Hildenbrand
    Cc: Vishal Verma
    Cc: Dave Hansen
    Cc: Pavel Tatashin
    Cc: Brice Goglin
    Cc: Dave Jiang
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/160106112239.30709.15909567572288425294.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Towards removing the mode specific @dax_kmem_res attribute from the
    generic 'struct dev_dax', and preparing for multi-range support, move
    resource name tracking to driver data. The memory for the resource name
    needs to have its own lifetime separate from the device bind lifetime for
    cases where the driver is unbound, but the kmem range could not be
    unplugged from the page allocator.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: David Hildenbrand
    Cc: Vishal Verma
    Cc: Dave Hansen
    Cc: Pavel Tatashin
    Cc: Brice Goglin
    Cc: Dave Jiang
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/160106111639.30709.17624822766862009183.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Towards removing the mode specific @dax_kmem_res attribute from the
    generic 'struct dev_dax', and preparing for multi-range support, teach the
    driver to calculate the hotplug range from the device range. The hotplug
    range is the trivially calculated memory-block-size aligned version of the
    device range.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: David Hildenbrand
    Cc: Vishal Verma
    Cc: Dave Hansen
    Cc: Pavel Tatashin
    Cc: Brice Goglin
    Cc: Dave Jiang
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/160106111109.30709.3173462396758431559.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • The passed in dev_pagemap is only required in the pmem case as the
    libnvdimm core may have reserved a vmem_altmap for dev_memremap_pages() to
    place the memmap in pmem directly. In the hmem case there is no agent
    reserving an altmap so it can all be handled by a core internal default.

    Pass the resource range via a new @range property of 'struct
    dev_dax_data'.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: David Hildenbrand
    Cc: Vishal Verma
    Cc: Dave Hansen
    Cc: Pavel Tatashin
    Cc: Brice Goglin
    Cc: Dave Jiang
    Cc: Ira Weiny
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Hulk Robot
    Cc: Ingo Molnar
    Cc: Jason Gunthorpe
    Cc: Jason Yan
    Cc: Jeff Moyer
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vivek Goyal
    Cc: Wei Yang
    Cc: Will Deacon
    Link: https://lkml.kernel.org/r/159643099958.4062302.10379230791041872886.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/160106110513.30709.4303239334850606031.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In preparation for adding more parameters to instance creation, move
    existing parameters to a new struct.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Vishal Verma
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643099411.4062302.1337305960720423895.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • All callers specify the same flags to alloc_dax_region(), so there is no
    need to allow for anything other than PFN_DEV|PFN_MAP, or carry a
    ->pfn_flags around on the region. Device-dax instances are always page
    backed.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Vishal Verma
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643098829.4062302.13611520567669439046.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • The hmem enabling in commit cf8741ac57ed ("ACPI: NUMA: HMAT: Register
    "soft reserved" memory as an "hmem" device") only registered ranges to the
    hmem driver for each soft-reservation that also appeared in the HMAT.
    While this is meant to encourage platform firmware to "do the right thing"
    and publish an HMAT, the corollary is that platforms that fail to publish
    an accurate HMAT will strand memory from Linux usage. Additionally, the
    "efi_fake_mem" kernel command line option enabling will strand memory by
    default without an HMAT.

    Arrange for "soft reserved" memory that goes unclaimed by HMAT entries to
    be published as raw resource ranges for the hmem driver to consume.

    Include a module parameter to disable either this fallback behavior, or
    the hmat enabling from creating hmem devices. The module parameter
    requires the hmem device enabling to have unique name in the module
    namespace: "device_hmem".

    The driver depends on the architecture providing phys_to_target_node()
    which is only x86 via numa_meminfo() and arm64 via a generic memblock
    implementation.

    [joao.m.martins@oracle.com: require NUMA_KEEP_MEMINFO for phys_to_target_node()]
    Link: https://lkml.kernel.org/r/aaae71a7-4846-f5cc-5acf-cf05fdb1f2dc@oracle.com

    Signed-off-by: Dan Williams
    Signed-off-by: Joao Martins
    Signed-off-by: Andrew Morton
    Reviewed-by: Joao Martins
    Cc: Jonathan Cameron
    Cc: Brice Goglin
    Cc: Jeff Moyer
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Borislav Petkov
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jia He
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Wei Yang
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643098298.4062302.17587338161136144730.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In preparation for exposing "Soft Reserved" memory ranges without an HMAT,
    move the hmem device registration to its own compilation unit and make the
    implementation generic.

    The generic implementation drops usage acpi_map_pxm_to_online_node() that
    was translating ACPI proximity domain values and instead relies on
    numa_map_to_online_node() to determine the numa node for the device.

    [joao.m.martins@oracle.com: CONFIG_DEV_DAX_HMEM_DEVICES should depend on CONFIG_DAX=y]
    Link: https://lkml.kernel.org/r/8f34727f-ec2d-9395-cb18-969ec8a5d0d4@oracle.com

    Signed-off-by: Dan Williams
    Signed-off-by: Joao Martins
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643096584.4062302.5035370788475153738.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lore.kernel.org/r/158318761484.2216124.2049322072599482736.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In preparation for attaching a platform device per iomem resource teach
    the efi_fake_mem code to create an e820 entry per instance. Similar to
    E820_TYPE_PRAM, bypass merging resource when the e820 map is sanitized.

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Acked-by: Ard Biesheuvel
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Andy Lutomirski
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643096068.4062302.11590041070221681669.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Disable parsing of the HMAT for debug, to workaround broken platform
    instances, or cases where it is otherwise not wanted.

    [rdunlap@infradead.org: fix build when CONFIG_ACPI is not set]
    Link: https://lkml.kernel.org/r/70e5ee34-9809-a997-7b49-499e4be61307@infradead.org

    Signed-off-by: Dan Williams
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Cc: Dave Hansen
    Cc: Andy Lutomirski
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Ard Biesheuvel
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: "Rafael J. Wysocki"
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/159643095540.4062302.732962081968036212.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Patch series "device-dax: Support sub-dividing soft-reserved ranges", v5.

    The device-dax facility allows an address range to be directly mapped
    through a chardev, or optionally hotplugged to the core kernel page
    allocator as System-RAM. It is the mechanism for converting persistent
    memory (pmem) to be used as another volatile memory pool i.e. the current
    Memory Tiering hot topic on linux-mm.

    In the case of pmem the nvdimm-namespace-label mechanism can sub-divide
    it, but that labeling mechanism is not available / applicable to
    soft-reserved ("EFI specific purpose") memory [3]. This series provides a
    sysfs-mechanism for the daxctl utility to enable provisioning of
    volatile-soft-reserved memory ranges.

    The motivations for this facility are:

    1/ Allow performance differentiated memory ranges to be split between
    kernel-managed and directly-accessed use cases.

    2/ Allow physical memory to be provisioned along performance relevant
    address boundaries. For example, divide a memory-side cache [4] along
    cache-color boundaries.

    3/ Parcel out soft-reserved memory to VMs using device-dax as a security
    / permissions boundary [5]. Specifically I have seen people (ab)using
    memmap=nn!ss (mark System-RAM as Persistent Memory) just to get the
    device-dax interface on custom address ranges. A follow-on for the VM
    use case is to teach device-dax to dynamically allocate 'struct page' at
    runtime to reduce the duplication of 'struct page' space in both the
    guest and the host kernel for the same physical pages.

    [2]: http://lore.kernel.org/r/20200713160837.13774-11-joao.m.martins@oracle.com
    [3]: http://lore.kernel.org/r/157309097008.1579826.12818463304589384434.stgit@dwillia2-desk3.amr.corp.intel.com
    [4]: http://lore.kernel.org/r/154899811738.3165233.12325692939590944259.stgit@dwillia2-desk3.amr.corp.intel.com
    [5]: http://lore.kernel.org/r/20200110190313.17144-1-joao.m.martins@oracle.com

    This patch (of 23):

    In preparation for adding a new numa= option clean up the existing ones to
    avoid ifdefs in numa_setup(), and provide feedback when the option is
    numa=fake= option is invalid due to kernel config. The same does not need
    to be done for numa=noacpi, since the capability is already hard disabled
    at compile-time.

    Suggested-by: Rafael J. Wysocki
    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Ben Skeggs
    Cc: Borislav Petkov
    Cc: Brice Goglin
    Cc: Catalin Marinas
    Cc: Daniel Vetter
    Cc: Dave Hansen
    Cc: Dave Jiang
    Cc: David Airlie
    Cc: David Hildenbrand
    Cc: Greg Kroah-Hartman
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Ira Weiny
    Cc: Jason Gunthorpe
    Cc: Jeff Moyer
    Cc: Jia He
    Cc: Joao Martins
    Cc: Jonathan Cameron
    Cc: Michael Ellerman
    Cc: Mike Rapoport
    Cc: Paul Mackerras
    Cc: Pavel Tatashin
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: Tom Lendacky
    Cc: Vishal Verma
    Cc: Wei Yang
    Cc: Will Deacon
    Cc: Ard Biesheuvel
    Cc: Bjorn Helgaas
    Cc: Boris Ostrovsky
    Cc: Hulk Robot
    Cc: Jason Yan
    Cc: "Jérôme Glisse"
    Cc: Juergen Gross
    Cc: kernel test robot
    Cc: Randy Dunlap
    Cc: Stefano Stabellini
    Cc: Vivek Goyal
    Link: https://lkml.kernel.org/r/160106109960.30709.7379926726669669398.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com
    Link: https://lkml.kernel.org/r/159643094925.4062302.14979872973043772305.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • Pull block driver updates from Jens Axboe:
    "Here are the driver updates for 5.10.

    A few SCSI updates in here too, in coordination with Martin as they
    depend on core block changes for the shared tag bitmap.

    This contains:

    - NVMe pull requests via Christoph:
    - fix keep alive timer modification (Amit Engel)
    - order the PCI ID list more sensibly (Andy Shevchenko)
    - cleanup the open by controller helper (Chaitanya Kulkarni)
    - use an xarray for the CSE log lookup (Chaitanya Kulkarni)
    - support ZNS in nvmet passthrough mode (Chaitanya Kulkarni)
    - fix nvme_ns_report_zones (Christoph Hellwig)
    - add a sanity check to nvmet-fc (James Smart)
    - fix interrupt allocation when too many polled queues are
    specified (Jeffle Xu)
    - small nvmet-tcp optimization (Mark Wunderlich)
    - fix a controller refcount leak on init failure (Chaitanya
    Kulkarni)
    - misc cleanups (Chaitanya Kulkarni)
    - major refactoring of the scanning code (Christoph Hellwig)

    - MD updates via Song:
    - Bug fixes in bitmap code, from Zhao Heming
    - Fix a work queue check, from Guoqing Jiang
    - Fix raid5 oops with reshape, from Song Liu
    - Clean up unused code, from Jason Yan
    - Discard improvements, from Xiao Ni
    - raid5/6 page offset support, from Yufen Yu

    - Shared tag bitmap for SCSI/hisi_sas/null_blk (John, Kashyap,
    Hannes)

    - null_blk open/active zone limit support (Niklas)

    - Set of bcache updates (Coly, Dongsheng, Qinglang)"

    * tag 'drivers-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (78 commits)
    md/raid5: fix oops during stripe resizing
    md/bitmap: fix memory leak of temporary bitmap
    md: fix the checking of wrong work queue
    md/bitmap: md_bitmap_get_counter returns wrong blocks
    md/bitmap: md_bitmap_read_sb uses wrong bitmap blocks
    md/raid0: remove unused function is_io_in_chunk_boundary()
    nvme-core: remove extra condition for vwc
    nvme-core: remove extra variable
    nvme: remove nvme_identify_ns_list
    nvme: refactor nvme_validate_ns
    nvme: move nvme_validate_ns
    nvme: query namespace identifiers before adding the namespace
    nvme: revalidate zone bitmaps in nvme_update_ns_info
    nvme: remove nvme_update_formats
    nvme: update the known admin effects
    nvme: set the queue limits in nvme_update_ns_info
    nvme: remove the 0 lba_shift check in nvme_update_ns_info
    nvme: clean up the check for too large logic block sizes
    nvme: freeze the queue over ->lba_shift updates
    nvme: factor out a nvme_configure_metadata helper
    ...

    Linus Torvalds
     
  • Pull libata updates from Jens Axboe:
    "Nothing major in here, just fixes or improvements collected over the
    last few months"

    * tag 'libata-5.10-2020-10-12' of git://git.kernel.dk/linux-block:
    ata: ahci: mvebu: Make SATA PHY optional for Armada 3720
    MAINTAINERS: remove LIBATA PATA DRIVERS entry
    pata_cmd64x: Use fallthrough pseudo-keyword
    ahci: qoriq: enable acpi support in qoriq ahci driver
    sata, highbank: simplify the return expression of ahci_highbank_suspend
    ahci: Add Intel Rocket Lake PCH-H RAID PCI IDs

    Linus Torvalds
     
  • Pull block updates from Jens Axboe:

    - Series of merge handling cleanups (Baolin, Christoph)

    - Series of blk-throttle fixes and cleanups (Baolin)

    - Series cleaning up BDI, seperating the block device from the
    backing_dev_info (Christoph)

    - Removal of bdget() as a generic API (Christoph)

    - Removal of blkdev_get() as a generic API (Christoph)

    - Cleanup of is-partition checks (Christoph)

    - Series reworking disk revalidation (Christoph)

    - Series cleaning up bio flags (Christoph)

    - bio crypt fixes (Eric)

    - IO stats inflight tweak (Gabriel)

    - blk-mq tags fixes (Hannes)

    - Buffer invalidation fixes (Jan)

    - Allow soft limits for zone append (Johannes)

    - Shared tag set improvements (John, Kashyap)

    - Allow IOPRIO_CLASS_RT for CAP_SYS_NICE (Khazhismel)

    - DM no-wait support (Mike, Konstantin)

    - Request allocation improvements (Ming)

    - Allow md/dm/bcache to use IO stat helpers (Song)

    - Series improving blk-iocost (Tejun)

    - Various cleanups (Geert, Damien, Danny, Julia, Tetsuo, Tian, Wang,
    Xianting, Yang, Yufen, yangerkun)

    * tag 'block-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (191 commits)
    block: fix uapi blkzoned.h comments
    blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue
    blk-mq: get rid of the dead flush handle code path
    block: get rid of unnecessary local variable
    block: fix comment and add lockdep assert
    blk-mq: use helper function to test hw stopped
    block: use helper function to test queue register
    block: remove redundant mq check
    block: invoke blk_mq_exit_sched no matter whether have .exit_sched
    percpu_ref: don't refer to ref->data if it isn't allocated
    block: ratelimit handle_bad_sector() message
    blk-throttle: Re-use the throtl_set_slice_end()
    blk-throttle: Open code __throtl_de/enqueue_tg()
    blk-throttle: Move service tree validation out of the throtl_rb_first()
    blk-throttle: Move the list operation after list validation
    blk-throttle: Fix IO hang for a corner case
    blk-throttle: Avoid tracking latency if low limit is invalid
    blk-throttle: Avoid getting the current time if tg->last_finish_time is 0
    blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()
    block: Remove redundant 'return' statement
    ...

    Linus Torvalds
     
  • Pull hwmon updates from Guenter Roeck:
    "New driver and chip support:
    - Moortec MR75203 PVT controller
    - MPS Multi-phase mp2975 controller
    - ADM1266
    - Zen3 CPUs
    - Intel MAX 10 BMC

    Enhancements:
    - Support for rated attributes in hwmon core
    - MAX20730:
    - Device monitoring via debugfs
    - VOUT readin adjustment vie devicetree bindings
    - LM75:
    - Devicetree support
    - Regulator support
    - Improved accumulationm logic in amd_energy driver
    - Added fan sensor to gsc-hwmon driver
    - Support for simplified I2C probing

    Various other minor fixes and improvements"

    * tag 'hwmon-for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (64 commits)
    hwmon: (pmbus/max20730) adjust the vout reading given voltage divider
    dt-bindings: hwmon: max20730: adding device tree doc for max20730
    hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller
    hwmon: Add DT bindings schema for PVT controller
    dt-bindings: hwmon: Add the +vs supply to the lm75 bindings
    dt-bindings: hwmon: Convert lm75 bindings to yaml
    docs: hwmon: (ltc2945) update datasheet link
    hwmon: (mlxreg-fan) Fix double "Mellanox"
    hwmon: (pmbus/max20730) add device monitoring via debugfs
    hwmon: (pmbus/max34440) Fix OC fault limits
    hwmon: (bt1-pvt) Wait for the completion with timeout
    hwmon: (bt1-pvt) Cache current update timeout
    hwmon: (bt1-pvt) Test sensor power supply on probe
    hwmon: (lm75) Add regulator support
    hwmon: Add hwmon driver for Intel MAX 10 BMC
    dt-bindings: Add MP2975 voltage regulator device
    hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller
    hwmon: (tmp513) fix spelling typo in comments
    hwmon: (amd_energy) Update driver documentation
    hwmon: (amd_energy) Improve the accumulation logic
    ...

    Linus Torvalds
     
  • Pull GPIO updates from Linus Walleij:
    "This time very little driver changes but lots of core changes.

    We have some interesting cooperative work for ARM and Intel alike,
    making the GPIO subsystem more and more suitable for industrial
    systems and the like, in addition to the in-kernel users.

    We touch driver core (device properties) and lib/* by adding one
    simple string array free function, these are authored by Andy
    Shevchenko who is a well known and recognized core helpers maintainers
    so this should be fine.

    We also see some Android GKI-related modularization in the MXC
    drivers.

    Core changes:

    - The big core change is the updated (v2) userspace character device
    API.

    This corrects badly designed 64-bit alignment around the line
    events. We also add the debounce request feature. This echoes the
    often quotes passage from Frederick Brooks "The mythical man-month"
    to always throw one away, which we have seen before in things such
    as V4L2. So we put in a new one and deprecate and obsolete the old
    one.

    - All example tools in tools/gpio/* are migrated to the new API to
    set a good example. The libgpiod userspace library has been
    augmented to use this new API pretty much from day 1.

    - Some misc API hardening by using strn* function calls has been
    added as well.

    - Use the simpler IDA interface for GPIO chip instance enumeration.

    - Add device core function for counting string arrays in device
    properties.

    - Provide a generic library function kfree_strarray() that can be
    used throughout the kernel.

    Driver enhancements:

    - The DesignWare dwapb-gpio driver has been enhanced and now uses the
    IRQ handling in the gpiolib core.

    - The mockup and aggregator drivers have seen some substantial code
    clean-up and now use more of the core kernel inftrastructure.

    - Misc cleanups using dev_err_probe().

    - The MXC drivers (Freescale/NXP) can now be built modularized, which
    makes modularized GKI Android kernels happy"

    * tag 'gpio-v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (73 commits)
    gpiolib: Update header block in gpiolib-cdev.h
    gpiolib: cdev: switch from kstrdup() to kstrndup()
    docs: gpio: add a new document to its index.rst
    gpio: pca953x: Add support for the NXP PCAL9554B/C
    tools: gpio: add debounce support to gpio-event-mon
    tools: gpio: add multi-line monitoring to gpio-event-mon
    tools: gpio: port gpio-event-mon to v2 uAPI
    tools: gpio: port gpio-hammer to v2 uAPI
    tools: gpio: rename nlines to num_lines
    tools: gpio: port gpio-watch to v2 uAPI
    tools: gpio: port lsgpio to v2 uAPI
    gpio: uapi: document uAPI v1 as deprecated
    gpiolib: cdev: support setting debounce
    gpiolib: cdev: support GPIO_V2_LINE_SET_VALUES_IOCTL
    gpiolib: cdev: support GPIO_V2_LINE_SET_CONFIG_IOCTL
    gpiolib: cdev: support edge detection for uAPI v2
    gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL
    gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL
    gpiolib: add build option for CDEV v1 ABI
    gpiolib: make cdev a build option
    ...

    Linus Torvalds
     
  • Pull spi updates from Mark Brown:
    "There's quite a lot of changes for SPI in this release but none in the
    core, they're all mostly small driver updates and additions. Some of
    the more notable changes include:

    - A huge set of cleanups, optimizations and improvements for the
    DesignWare driver from Serge Semin finishing up the work started
    last release.

    - Conversion of the Zynq gqspi driver to spi-mem.

    - Support for Baikal T1, Broadcom BCMSTB 7445, and Renesas R8A7742"

    * tag 'spi-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (137 commits)
    spi: cadence: Add SPI transfer delays
    spi: dw: Add Baikal-T1 SPI Controller bindings
    spi: dw: Add Baikal-T1 SPI Controller glue driver
    spi: dw: Add poll-based SPI transfers support
    spi: dw: Introduce max mem-ops SPI bus frequency setting
    spi: dw: Add memory operations support
    spi: dw: Add generic DW SSI status-check method
    spi: dw: Move num-of retries parameter to the header file
    spi: dw: Explicitly de-assert CS on SPI transfer completion
    spi: dw: De-assert chip-select on reset
    spi: dw: Discard chip enabling on DMA setup error
    spi: dw: Unmask IRQs after enabling the chip
    spi: dw: Perform IRQ setup in a dedicated function
    spi: dw: Refactor IRQ-based SPI transfer procedure
    spi: dw: Refactor data IO procedure
    spi: dw: Add DW SPI controller config structure
    spi: dw: Update Rx sample delay in the config function
    spi: dw: Simplify the SPI bus speed config procedure
    spi: dw: Update SPI bus speed in a config function
    spi: dw: Detach SPI device specific CR0 config method
    ...

    Linus Torvalds
     
  • Pull regulator updates from Mark Brown:
    "This is a fairly small release for the regulator API, there's quite a
    few new devices supported and some important improvements around
    coupled regulators in the core but mostly just small fixes and
    improvements otherwise.

    Summary:

    - Fixes and cleanups around the handling of coupled regulators.

    - A special driver for some Raspberry Pi panels with some unusually
    custom stuff around them.

    - Support for Qualcomm PM660/PM660L, PM8950 and PM8953, Richtek
    RT4801 and RTMV20, Rohm BD9576MUF and BD9573MUF"

    * tag 'regulator-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (89 commits)
    regulator: bd9576: Fix print
    regulator: bd9576: fix regulator binfdings dt node names
    dt-bindings: regulator: document pm8950 and pm8953 smd regulators
    regulator: qcom_smd: add pm8953 regulators
    regulator: Make constraint debug processing conditional on DEBUG
    regulator: qcom: labibb: Constify static structs
    regulator: dt-bindings: Document the PM660/PM660L PMICs entries
    regulator: qcom_smd: Add PM660/PM660L regulator support
    regulator: dt-bindings: Document the PM660/660L SPMI PMIC entries
    regulator: qcom_spmi: Add PM660/PM660L regulators
    regulator: qcom_spmi: Add support for new regulator types
    regulator: core: Enlarge max OF property name length to 64 chars
    regulator: tps65910: use regmap accessors
    regulator: rtmv20: Add missing regcache cache only before marked as dirty
    regulator: rtmv20: Update DT binding document and property name parsing
    regulator: rtmv20: Add DT-binding document for Richtek RTMV20
    regulator: rtmv20: Adds support for Richtek RTMV20 load switch regulator
    regulator: resolve supply after creating regulator
    regulator: print symbolic errors in kernel messages
    regulator: print state at boot
    ...

    Linus Torvalds
     
  • Pull regmap updates from Mark Brown:
    "Quite a busy release for regmap, mostly support for new features
    useful on fairly small subsets of devices. The user visible features
    are:

    - A new API for registering large numbers of regmap fields at once.

    - Support for Intel AVMM buses connected via SPI.

    - Support for 12/20 address/value layouts.

    - Support for yet another scheme for acknowledging interrupts used on
    some Qualcomm devices"

    * tag 'regmap-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: irq: Add support to clear ack registers
    regmap: add support to regmap_field_bulk_alloc/free apis
    regmap: destroy mutex (if used) in regmap_exit()
    regmap: debugfs: use semicolons rather than commas to separate statements
    regmap: debugfs: Fix more error path regressions
    regmap: Add support for 12/20 register formatting
    regmap: Add can_sleep configuration option
    regmap: soundwire: remove unused header mod_devicetable.h
    regmap: Use flexible sleep
    regmap: add Intel SPI Slave to AVMM Bus Bridge support

    Linus Torvalds
     
  • Pull media updates from Mauro Carvalho Chehab:

    - the usbvision driver was dropped from staging

    - the Zoran driver were re-added at staging. It gained lots of
    improvements, and was converted to use videobuf2 API

    - a new virtual driver (vidtv) was added in order to allow testing the
    digital TV framework and APIs

    - the media uAPI documentation gained a glossary with commonly used
    terms, helping to simplify some parts of the docs

    - more cleanups at the atomisp driver

    - Mediatek VPU gained support for MT8183

    - added support for codecs with supports doing colorspace conversion
    (CSC)

    - support for CSC API was added at vivid and rksip1 drivers

    - added a helper core support and uAPI for better supporting H.264
    codecs

    - added support for Renesas R8A774E1

    - use the new SPDX GFDL-1.1-no-invariants-or-later license on media
    uAPI docs, instead of a license text

    - Venus driver has gained VP9 codec support

    - lots of other cleanups and driver improvements

    * tag 'media/v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (555 commits)
    media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning
    media: tvp7002: fix uninitialized variable warning
    media: s5k5baf: drop 'data' field in struct s5k5baf_fw
    media: dt-bindings: media: venus: Add an optional power domain for perf voting
    media: rcar-vin: rcar-dma: Fix setting VNIS_REG for RAW8 formats
    media: staging: rkisp1: uapi: Do not use BIT() macro
    media: v4l2-mem2mem: Fix spurious v4l2_m2m_buf_done
    media: usbtv: Fix refcounting mixup
    media: zoran.rst: place it at the right place this time
    media: add Zoran cardlist
    media: admin-guide: update cardlists
    media: siano: rename a duplicated card string
    media: zoran: move documentation file to the right place
    media: atomisp: fixes build breakage for ISP2400 due to a cleanup
    media: zoran: fix mixed case on vars
    media: zoran: get rid of an unused var
    media: zoran: use upper case for card types
    media: zoran: fix sparse warnings
    media: zoran: fix smatch warning
    media: zoran: update TODO
    ...

    Linus Torvalds
     
  • Pull MMC updates from Ulf Hansson:
    "MMC core:
    - Export SDIO revision and info strings to userspace
    - Add support for specifying mmc/mmcblk index via mmc aliases in DT

    MMC host:
    - Enable support for async probe for all mmc host drivers
    - Enable compile testing of multiple host drivers
    - dw_mmc: Enable the Synopsys DesignWare driver for RISCV and CSKY
    - mtk-sd: Fixup support for CQHCI
    - owl-mmc: Add support for the actions,s700-mmc variant
    - renesas_sdhi: Fix regression (temporary) for re-insertion of SD cards
    - renesas_sdhi: Add support for the r8a774e1 variant
    - renesas_sdhi/tmio: Improvements for tunings
    - renesas_sdhi/tmio: Rework support for reset of controller
    - sdhci-acpi: Fix HS400 tuning for devices with invalid presets on AMDI0040
    - sdhci_am654: Improve support for tunings
    - sdhci_am654: Add support for input tap delays
    - sdhci_am654: Add workaround for card detect debounce timer
    - sdhci-am654: Add support for the TI's J7200 variants
    - sdhci-esdhc-imx: Fix support for manual tuning
    - sdhci-iproc: Enable support for eMMC DDR 3.3V for bcm2711
    - sdhci-msm: Fix stability issues with HS400 for sc7180
    - sdhci-of-sparx5: Add Sparx5 SoC eMMC driver
    - sdhci-of-esdhc: Fixup reference clock source selection
    - sdhci-pci: Add LTR support for some Intel BYT controllers
    - sdhci-pci-gli: Add CQHCI Support for GL9763E"

    * tag 'mmc-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (91 commits)
    mmc: sdhci_am654: Fix module autoload
    mmc: renesas_sdhi: workaround a regression when reinserting SD cards
    mmc: sdhci-pci-gli: Add CQHCI Support for GL9763E
    mmc: sdhci-acpi: AMDI0040: Set SDHCI_QUIRK2_PRESET_VALUE_BROKEN
    mmc: sdhci_am654: Enable tuning for SDR50
    mmc: sdhci_am654: Add support for software tuning
    mmc: sdhci_am654: Add support for input tap delay
    mmc: sdhci_am654: Fix hard coded otap delay array size
    dt-bindings: mmc: sdhci-am654: Add documentation for input tap delay
    dt-bindings: mmc: sdhci-am654: Convert sdhci-am654 controller documentation to json schema
    mmc: sdhci-of-esdhc: fix reference clock source selection
    mmc: host: fix depends for MMC_MESON_GX w/ COMPILE_TEST
    mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF
    mmc: sdhci: fix indentation mistakes
    mmc: moxart: remove unneeded check for drvdata
    mmc: renesas_sdhi: drop local flag for tuning
    mmc: rtsx_usb_sdmmc: simplify the return expression of sd_change_phase()
    mmc: core: document mmc_hw_reset()
    mmc: mediatek: Drop pointer to mmc_host from msdc_host
    dt-bindings: mmc: owl: add compatible string actions,s700-mmc
    ...

    Linus Torvalds
     

13 Oct, 2020

5 commits

  • Pull crypto updates from Herbert Xu:
    "API:
    - Allow DRBG testing through user-space af_alg
    - Add tcrypt speed testing support for keyed hashes
    - Add type-safe init/exit hooks for ahash

    Algorithms:
    - Mark arc4 as obsolete and pending for future removal
    - Mark anubis, khazad, sead and tea as obsolete
    - Improve boot-time xor benchmark
    - Add OSCCA SM2 asymmetric cipher algorithm and use it for integrity

    Drivers:
    - Fixes and enhancement for XTS in caam
    - Add support for XIP8001B hwrng in xiphera-trng
    - Add RNG and hash support in sun8i-ce/sun8i-ss
    - Allow imx-rngc to be used by kernel entropy pool
    - Use crypto engine in omap-sham
    - Add support for Ingenic X1830 with ingenic"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (205 commits)
    X.509: Fix modular build of public_key_sm2
    crypto: xor - Remove unused variable count in do_xor_speed
    X.509: fix error return value on the failed path
    crypto: bcm - Verify GCM/CCM key length in setkey
    crypto: qat - drop input parameter from adf_enable_aer()
    crypto: qat - fix function parameters descriptions
    crypto: atmel-tdes - use semicolons rather than commas to separate statements
    crypto: drivers - use semicolons rather than commas to separate statements
    hwrng: mxc-rnga - use semicolons rather than commas to separate statements
    hwrng: iproc-rng200 - use semicolons rather than commas to separate statements
    hwrng: stm32 - use semicolons rather than commas to separate statements
    crypto: xor - use ktime for template benchmarking
    crypto: xor - defer load time benchmark to a later time
    crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'
    crypto: hisilicon/zip - fix the return value when device is busy
    crypto: hisilicon/zip - fix zero length input in GZIP decompress
    crypto: hisilicon/zip - fix the uncleared debug registers
    lib/mpi: Fix unused variable warnings
    crypto: x86/poly1305 - Remove assignments with no effect
    hwrng: npcm - modify readl to readb
    ...

    Linus Torvalds
     
  • Pull compat iovec cleanups from Al Viro:
    "Christoph's series around import_iovec() and compat variant thereof"

    * 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    security/keys: remove compat_keyctl_instantiate_key_iov
    mm: remove compat_process_vm_{readv,writev}
    fs: remove compat_sys_vmsplice
    fs: remove the compat readv/writev syscalls
    fs: remove various compat readv/writev helpers
    iov_iter: transparently handle compat iovecs in import_iovec
    iov_iter: refactor rw_copy_check_uvector and import_iovec
    iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c
    compat.h: fix a spelling error in

    Linus Torvalds
     
  • Pull copy_and_csum cleanups from Al Viro:
    "Saner calling conventions for csum_and_copy_..._user() and friends"

    [ Removing 800+ lines of code and cleaning stuff up is good - Linus ]

    * 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    ppc: propagate the calling conventions change down to csum_partial_copy_generic()
    amd64: switch csum_partial_copy_generic() to new calling conventions
    sparc64: propagate the calling convention changes down to __csum_partial_copy_...()
    xtensa: propagate the calling conventions change down into csum_partial_copy_generic()
    mips: propagate the calling convention change down into __csum_partial_copy_..._user()
    mips: __csum_partial_copy_kernel() has no users left
    mips: csum_and_copy_{to,from}_user() are never called under KERNEL_DS
    sparc32: propagate the calling conventions change down to __csum_partial_copy_sparc_generic()
    i386: propagate the calling conventions change down to csum_partial_copy_generic()
    sh: propage the calling conventions change down to csum_partial_copy_generic()
    m68k: get rid of zeroing destination on error in csum_and_copy_from_user()
    arm: propagate the calling convention changes down to csum_partial_copy_from_user()
    alpha: propagate the calling convention changes down to csum_partial_copy.c helpers
    saner calling conventions for csum_and_copy_..._user()
    csum_and_copy_..._user(): pass 0xffffffff instead of 0 as initial sum
    csum_partial_copy_nocheck(): drop the last argument
    unify generic instances of csum_partial_copy_nocheck()
    icmp_push_reply(): reorder adding the checksum up
    skb_copy_and_csum_bits(): don't bother with the last argument

    Linus Torvalds
     
  • Pull static call support from Ingo Molnar:
    "This introduces static_call(), which is the idea of static_branch()
    applied to indirect function calls. Remove a data load (indirection)
    by modifying the text.

    They give the flexibility of function pointers, but with better
    performance. (This is especially important for cases where retpolines
    would otherwise be used, as retpolines can be pretty slow.)

    API overview:

    DECLARE_STATIC_CALL(name, func);
    DEFINE_STATIC_CALL(name, func);
    DEFINE_STATIC_CALL_NULL(name, typename);

    static_call(name)(args...);
    static_call_cond(name)(args...);
    static_call_update(name, func);

    x86 is supported via text patching, otherwise basic indirect calls are
    used, with function pointers.

    There's a second variant using inline code patching, inspired by
    jump-labels, implemented on x86 as well.

    The new APIs are utilized in the x86 perf code, a heavy user of
    function pointers, where static calls speed up the PMU handler by
    4.2% (!).

    The generic implementation is not really excercised on other
    architectures, outside of the trivial test_static_call_init()
    self-test"

    * tag 'core-static_call-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
    static_call: Fix return type of static_call_init
    tracepoint: Fix out of sync data passing by static caller
    tracepoint: Fix overly long tracepoint names
    x86/perf, static_call: Optimize x86_pmu methods
    tracepoint: Optimize using static_call()
    static_call: Allow early init
    static_call: Add some validation
    static_call: Handle tail-calls
    static_call: Add static_call_cond()
    x86/alternatives: Teach text_poke_bp() to emulate RET
    static_call: Add simple self-test for static calls
    x86/static_call: Add inline static call implementation for x86-64
    x86/static_call: Add out-of-line static call implementation
    static_call: Avoid kprobes on inline static_call()s
    static_call: Add inline static call infrastructure
    static_call: Add basic static call infrastructure
    compiler.h: Make __ADDRESSABLE() symbol truly unique
    jump_label,module: Fix module lifetime for __jump_label_mod_text_reserved()
    module: Properly propagate MODULE_STATE_COMING failure
    module: Fix up module_notifier return values
    ...

    Linus Torvalds
     
  • Pull orphan section checking from Ingo Molnar:
    "Orphan link sections were a long-standing source of obscure bugs,
    because the heuristics that various linkers & compilers use to handle
    them (include these bits into the output image vs discarding them
    silently) are both highly idiosyncratic and also version dependent.

    Instead of this historically problematic mess, this tree by Kees Cook
    (et al) adds build time asserts and build time warnings if there's any
    orphan section in the kernel or if a section is not sized as expected.

    And because we relied on so many silent assumptions in this area, fix
    a metric ton of dependencies and some outright bugs related to this,
    before we can finally enable the checks on the x86, ARM and ARM64
    platforms"

    * tag 'core-build-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    x86/boot/compressed: Warn on orphan section placement
    x86/build: Warn on orphan section placement
    arm/boot: Warn on orphan section placement
    arm/build: Warn on orphan section placement
    arm64/build: Warn on orphan section placement
    x86/boot/compressed: Add missing debugging sections to output
    x86/boot/compressed: Remove, discard, or assert for unwanted sections
    x86/boot/compressed: Reorganize zero-size section asserts
    x86/build: Add asserts for unwanted sections
    x86/build: Enforce an empty .got.plt section
    x86/asm: Avoid generating unused kprobe sections
    arm/boot: Handle all sections explicitly
    arm/build: Assert for unwanted sections
    arm/build: Add missing sections
    arm/build: Explicitly keep .ARM.attributes sections
    arm/build: Refactor linker script headers
    arm64/build: Assert for unwanted sections
    arm64/build: Add missing DWARF sections
    arm64/build: Use common DISCARDS in linker script
    arm64/build: Remove .eh_frame* sections due to unwind tables
    ...

    Linus Torvalds