1. 12 May, 2021 1 commit
  2. 17 Feb, 2021 1 commit
    • Ben Widawsky's avatar
      cxl/mem: Add basic IOCTL interface · 583fa5e7
      Ben Widawsky authored
      
      Add a straightforward IOCTL that provides a mechanism for userspace to
      query the supported memory device commands. CXL commands as they appear
      to userspace are described as part of the UAPI kerneldoc. The command
      list returned via this IOCTL will contain the full set of commands that
      the driver supports, however, some of those commands may not be
      available for use by userspace.
      
      Memory device commands first appear in the CXL 2.0 specification. They
      are submitted through a mailbox mechanism specified in the CXL 2.0
      specification.
      
      The send command allows userspace to issue mailbox commands directly to
      the hardware. The list of available commands to send are the output of
      the query command. The driver verifies basic properties of the command
      and possibly inspect the input (or output) payload to determine whether
      or not the command is allowed (or might taint the kernel).
      
      Reported-by: kernel test robot <lkp@intel.com> # bug in earlier revision
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarBen Widawsky <ben.widawsky@intel.com>
      Reviewed-by: Dan Williams <dan.j.williams@intel.com> (v2)
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Link: https://lore.kernel.org/r/20210217040958.1354670-5-ben.widawsky@intel.com
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      583fa5e7
  3. 29 Jan, 2021 1 commit
  4. 14 Oct, 2020 3 commits
    • Mike Rapoport's avatar
      memblock: use separate iterators for memory and reserved regions · cc6de168
      Mike Rapoport authored
      
      for_each_memblock() is used to iterate over memblock.memory in a few
      places that use data from memblock_region rather than the memory ranges.
      
      Introduce separate for_each_mem_region() and
      for_each_reserved_mem_region() to improve encapsulation of memblock
      internals from its users.
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarBaoquan He <bhe@redhat.com>
      Acked-by: Ingo Molnar <mingo@kernel.org>			[x86]
      Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>	[MIPS]
      Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>	[.clang-format]
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Emil Renner Berthing <kernel@esmil.dk>
      Cc: H...
      cc6de168
    • Mike Rapoport's avatar
      memblock: implement for_each_reserved_mem_region() using __next_mem_region() · 9f3d5eaa
      Mike Rapoport authored
      
      Iteration over memblock.reserved with for_each_reserved_mem_region() used
      __next_reserved_mem_region() that implemented a subset of
      __next_mem_region().
      
      Use __for_each_mem_range() and, essentially, __next_mem_region() with
      appropriate parameters to reduce code duplication.
      
      While on it, rename for_each_reserved_mem_region() to
      for_each_reserved_mem_range() for consistency.
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>	[.clang-format]
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Emil Renner Berthing <kernel@esmil.dk>
      Cc: Hari Bathini <hbathini@linux.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: https://lkml.kernel.org/r/20200818151634.14343-17-rppt@kernel.org
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9f3d5eaa
    • Mike Rapoport's avatar
      memblock: reduce number of parameters in for_each_mem_range() · 6e245ad4
      Mike Rapoport authored
      
      Currently for_each_mem_range() and for_each_mem_range_rev() iterators are
      the most generic way to traverse memblock regions.  As such, they have 8
      parameters and they are hardly convenient to users.  Most users choose to
      utilize one of their wrappers and the only user that actually needs most
      of the parameters is memblock itself.
      
      To avoid yet another naming for memblock iterators, rename the existing
      for_each_mem_range[_rev]() to __for_each_mem_range[_rev]() and add a new
      for_each_mem_range[_rev]() wrappers with only index, start and end
      parameters.
      
      The new wrapper nicely fits into init_unavailable_mem() and will be used
      in upcoming changes to simplify memblock traversals.
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>	[MIPS]
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Emil Renner Berthing <kernel@esmil.dk>
      Cc: Hari Bathini <hbathini@linux.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: https://lkml.kernel.org/r/20200818151634.14343-11-rppt@kernel.org
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6e245ad4
  5. 09 Sep, 2020 1 commit
  6. 01 Sep, 2020 1 commit
  7. 25 May, 2020 1 commit
  8. 18 Apr, 2020 2 commits
  9. 06 Mar, 2020 1 commit
  10. 31 Aug, 2019 1 commit
  11. 12 Apr, 2019 1 commit
  12. 21 Mar, 2019 1 commit
  13. 19 Feb, 2019 1 commit
  14. 11 Feb, 2019 1 commit
    • Jason Gunthorpe's avatar
      lib/scatterlist: Provide a DMA page iterator · d901b276
      Jason Gunthorpe authored
      Commit 2db76d7c
      
       ("lib/scatterlist: sg_page_iter: support sg lists w/o
      backing pages") introduced the sg_page_iter_dma_address() function without
      providing a way to use it in the general case. If the sg_dma_len() is not
      equal to the sg length callers cannot safely use the
      for_each_sg_page/sg_page_iter_dma_address combination.
      
      Resolve this API mistake by providing a DMA specific iterator,
      for_each_sg_dma_page(), that uses the right length so
      sg_page_iter_dma_address() works as expected with all sglists.
      
      A new iterator type is introduced to provide compile-time safety against
      wrongly mixing accessors and iterators.
      
      Acked-by: Christoph Hellwig <hch@lst.de> (for scatterlist)
      Acked-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> (ipu3-cio2)
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      d901b276
  15. 04 Feb, 2019 1 commit
  16. 19 Jan, 2019 1 commit
  17. 21 Oct, 2018 1 commit
  18. 01 Aug, 2018 1 commit
  19. 11 Apr, 2018 1 commit
    • Miguel Ojeda's avatar
      clang-format: add configuration file · d4ef8d3f
      Miguel Ojeda authored
      clang-format is a tool to format C/C++/...  code according to a set of
      rules and heuristics.  Like most tools, it is not perfect nor covers
      every single case, but it is good enough to be helpful.
      
      In particular, it is useful for quickly re-formatting blocks of code
      automatically, for reviewing full files in order to spot coding style
      mistakes, typos and possible improvements.  It is also handy for sorting
      ``#includes``, for aligning variables and macros, for reflowing text and
      other similar tasks.  It also serves as a teaching tool/guide for
      newcomers.
      
      The tool itself has been already included in the repositories of popular
      Linux distributions for a long time.  The rules in this file are
      intended for clang-format >= 4, which is easily available in most
      distributions.
      
      This commit adds the configuration file that contains the rules that the
      tool uses to know how to format the code according to the kernel coding
      style.  This gives us several advantages:
      
        * clang-format works out of the box with reasonable defaults;
          avoiding that everyone has to re-do the configuration.
      
        * Everyone agrees (eventually) on what is the most useful default
          configuration for most of the kernel.
      
        * If it becomes commonplace among kernel developers, clang-format
          may feel compelled to support us better. They already recognize
          the Linux kernel and its style in their documentation and in one
          of the style sub-options.
      
      Some of clang-format's features relevant for the kernel are:
      
        * Uses clang's tooling support behind the scenes to parse and rewrite
          the code. It is not based on ad-hoc regexps.
      
        * Supports reasonably well the Linux kernel coding style.
      
        * Fast enough to be used at the press of a key.
      
        * There are already integrations (either built-in or third-party)
          for many common editors used by kernel developers (e.g. vim,
          emacs, Sublime, Atom...) that allow you to format an entire file
          or, more usefully, just your selection.
      
        * Able to parse unified diffs -- you can, for instance, reformat
          only the lines changed by a git commit.
      
        * Able to reflow text comments as well.
      
        * Widely supported and used by hundreds of developers in highly
          complex projects and organizations (e.g. the LLVM project itself,
          Chromium, WebKit, Google, Mozilla...). Therefore, it will be
          supported for a long time.
      
      See more information about the tool at:
      
          https://clang.llvm.org/docs/ClangFormat.html
          https://clang.llvm.org/docs/ClangFormatStyleOptions.html
      
      Link: http://lkml.kernel.org/r/20180318171632.qfkemw3mwbcukth6@gmail.com
      
      Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Andy Whitcroft <apw@canonical.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4ef8d3f