Skip to content
Snippets Groups Projects
  1. Dec 21, 2021
  2. Nov 22, 2021
  3. Nov 18, 2021
  4. Nov 17, 2021
    • Matthew Wilcox (Oracle)'s avatar
      Add linux/cacheflush.h · 522a0032
      Matthew Wilcox (Oracle) authored
      
      Many architectures do not include asm-generic/cacheflush.h, so turn
      the includes on their head and add linux/cacheflush.h which includes
      asm/cacheflush.h.
      
      Move the flush_dcache_folio() declaration from asm-generic/cacheflush.h
      to linux/cacheflush.h and change linux/highmem.h to include
      linux/cacheflush.h instead of asm/cacheflush.h so that all necessary
      places will see flush_dcache_folio().
      
      More functions should have their default implementations moved in the
      future, but those are for follow-on patches.  This fixes csky, sparc and
      sparc64 which were missed in the commit which added flush_dcache_folio().
      
      Fixes: 08b0b005 ("mm: Add flush_dcache_folio()")
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      522a0032
  5. Nov 13, 2021
    • John David Anglin's avatar
      parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page · 38860b2c
      John David Anglin authored
      
      For years, there have been random segmentation faults in userspace on
      SMP PA-RISC machines.  It occurred to me that this might be a problem in
      set_pte_at().  MIPS and some other architectures do cache flushes when
      installing PTEs with the present bit set.
      
      Here I have adapted the code in update_mmu_cache() to flush the kernel
      mapping when the kernel flush is deferred, or when the kernel mapping
      may alias with the user mapping.  This simplifies calls to
      update_mmu_cache().
      
      I also changed the barrier in set_pte() from a compiler barrier to a
      full memory barrier.  I know this change is not sufficient to fix the
      problem.  It might not be needed.
      
      I have had a few days of operation with 5.14.16 to 5.15.1 and haven't
      seen any random segmentation faults on rp3440 or c8000 so far.
      
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: stable@kernel.org # 5.12+
      38860b2c
  6. Nov 04, 2021
    • Ard Biesheuvel's avatar
      parisc: move CPU field back into thread_info · 2a2e8202
      Ard Biesheuvel authored
      
      In commit 2214c0e7 ("parisc: Move thread_info into task struct")
      PA-RISC gained support for THREAD_INFO_IN_TASK while changes were
      already underway to keep the CPU field in thread_info rather than move
      it into task_struct when THREAD_INFO_IN_TASK is enabled. The result is a
      broken build for all PA-RISC configs that enable SMP.
      
      So let's partially revert that commit, and get rid of the ugly hack to
      get at the offset of task_struct::cpu without having to include
      linux/sched.h, and put the CPU field back where it was before.
      
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: bcf9033e ("sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y")
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      2a2e8202
    • Dave Anglin's avatar
      parisc: Don't disable interrupts in cmpxchg and futex operations · 7e992711
      Dave Anglin authored
      
      I no longer think interrupts can be disabled in the futex and cmpxchg
      operations because of COW breaks.  This not ideal but I suspect it's the
      best we can do.
      
      For the cmpxchg operations in syscall.S, we rely on the code to not
      schedule off the gateway page.  For the futex, I added code to disable
      preemption.
      
      So far, I haven't seen the warnings with the attached change but the
      change is only lightly tested.
      
      Signed-off-by: default avatarDave Anglin <dave.anglin@bell.net>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      7e992711
  7. Nov 01, 2021
  8. Oct 30, 2021
  9. Oct 18, 2021
  10. Oct 15, 2021
  11. Oct 01, 2021
  12. Sep 16, 2021
  13. Sep 09, 2021
  14. Sep 08, 2021
    • Arnd Bergmann's avatar
      arch: remove compat_alloc_user_space · a7a08b27
      Arnd Bergmann authored
      All users of compat_alloc_user_space() and copy_in_user() have been
      removed from the kernel, only a few functions in sparc remain that can be
      changed to calling arch_copy_in_user() instead.
      
      Link: https://lkml.kernel.org/r/20210727144859.4150043-7-arnd@kernel.org
      
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a7a08b27
  15. Sep 03, 2021
    • Christoph Hellwig's avatar
      mm: remove flush_kernel_dcache_page · f358afc5
      Christoph Hellwig authored
      flush_kernel_dcache_page is a rather confusing interface that implements a
      subset of flush_dcache_page by not being able to properly handle page
      cache mapped pages.
      
      The only callers left are in the exec code as all other previous callers
      were incorrect as they could have dealt with page cache pages.  Replace
      the calls to flush_kernel_dcache_page with calls to flush_dcache_page,
      which for all architectures does either exactly the same thing, can
      contains one or more of the following:
      
       1) an optimization to defer the cache flush for page cache pages not
          mapped into userspace
       2) additional flushing for mapped page cache pages if cache aliases
          are possible
      
      Link: https://lkml.kernel.org/r/20210712060928.4161649-7-hch@lst.de
      
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
      Cc: Alex Shi <alexs@kernel.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Cercueil <paul@crapouillou.net>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Yoshinori Sato <ysato@users.osdn.me>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f358afc5
  16. Sep 02, 2021
  17. Aug 30, 2021
  18. Aug 29, 2021
  19. Aug 04, 2021
    • Pavel Tikhomirov's avatar
      sock: allow reading and changing sk_userlocks with setsockopt · 04190bf8
      Pavel Tikhomirov authored
      
      SOCK_SNDBUF_LOCK and SOCK_RCVBUF_LOCK flags disable automatic socket
      buffers adjustment done by kernel (see tcp_fixup_rcvbuf() and
      tcp_sndbuf_expand()). If we've just created a new socket this adjustment
      is enabled on it, but if one changes the socket buffer size by
      setsockopt(SO_{SND,RCV}BUF*) it becomes disabled.
      
      CRIU needs to call setsockopt(SO_{SND,RCV}BUF*) on each socket on
      restore as it first needs to increase buffer sizes for packet queues
      restore and second it needs to restore back original buffer sizes. So
      after CRIU restore all sockets become non-auto-adjustable, which can
      decrease network performance of restored applications significantly.
      
      CRIU need to be able to restore sockets with enabled/disabled adjustment
      to the same state it was before dump, so let's add special setsockopt
      for it.
      
      Let's also export SOCK_SNDBUF_LOCK and SOCK_RCVBUF_LOCK flags to uAPI so
      that using these interface one can reenable automatic socket buffer
      adjustment on their sockets.
      
      Signed-off-by: default avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      04190bf8
  20. Jul 23, 2021
    • Arnd Bergmann's avatar
      compat: make linux/compat.h available everywhere · 1a33b18b
      Arnd Bergmann authored
      
      Parts of linux/compat.h are under an #ifdef, but we end up
      using more of those over time, moving things around bit by
      bit.
      
      To get it over with once and for all, make all of this file
      uncondititonal now so it can be accessed everywhere. There
      are only a few types left that are in asm/compat.h but not
      yet in the asm-generic version, so add those in the process.
      
      This requires providing a few more types in asm-generic/compat.h
      that were not already there. The only tricky one is
      compat_sigset_t, which needs a little help on 32-bit architectures
      and for x86.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a33b18b
  21. Jul 08, 2021
  22. Jul 01, 2021
    • Anshuman Khandual's avatar
      mm/thp: define default pmd_pgtable() · 1c2f7d14
      Anshuman Khandual authored
      Currently most platforms define pmd_pgtable() as pmd_page() duplicating
      the same code all over.  Instead just define a default value i.e
      pmd_page() for pmd_pgtable() and let platforms override when required via
      <asm/pgtable.h>.  All the existing platform that override pmd_pgtable()
      have been moved into their respective <asm/pgtable.h> header in order to
      precede before the new generic definition.  This makes it much cleaner
      with reduced code.
      
      Link: https://lkml.kernel.org/r/1623646133-20306-1-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c2f7d14
    • Anshuman Khandual's avatar
      mm: define default value for FIRST_USER_ADDRESS · fac7757e
      Anshuman Khandual authored
      Currently most platforms define FIRST_USER_ADDRESS as 0UL duplication the
      same code all over.  Instead just define a generic default value (i.e 0UL)
      for FIRST_USER_ADDRESS and let the platforms override when required.  This
      makes it much cleaner with reduced code.
      
      The default FIRST_USER_ADDRESS here would be skipped in <linux/pgtable.h>
      when the given platform overrides its value via <asm/pgtable.h>.
      
      Link: https://lkml.kernel.org/r/1620615725-24623-1-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
      Acked-by: Guo Ren <guoren@kernel.org>			[csky]
      Acked-by: Stafford Horne <shorne@gmail.com>		[openrisc]
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>	[RISC-V]
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fac7757e
Loading