1. 27 May, 2021 4 commits
  2. 20 May, 2021 2 commits
  3. 17 May, 2021 1 commit
    • Jan Kara's avatar
      quota: Disable quotactl_path syscall · 5b9fedb3
      Jan Kara authored
      In commit fa8b9007 ("quota: wire up quotactl_path") we have wired up
      new quotactl_path syscall. However some people in LWN discussion have
      objected that the path based syscall is missing dirfd and flags argument
      which is mostly standard for contemporary path based syscalls. Indeed
      they have a point and after a discussion with Christian Brauner and
      Sascha Hauer I've decided to disable the syscall for now and update its
      API. Since there is no userspace currently using that syscall and it
      hasn't been released in any major release, we should be fine.
      
      CC: Christian Brauner <christian.brauner@ubuntu.com>
      CC: Sascha Hauer <s.hauer@pengutronix.de>
      Link: https://lore.kernel.org/lkml/20210512153621.n5u43jsytbik4yze@wittgenstein
      
      
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      5b9fedb3
  4. 14 May, 2021 6 commits
    • Nicholas Piggin's avatar
      powerpc/64e/interrupt: Fix nvgprs being clobbered · c6ac667b
      Nicholas Piggin authored
      Some interrupt handlers have an "extra" that saves 1 or 2
      registers (r14, r15) in the paca save area and makes them available to
      use by the handler.
      
      The change to always save nvgprs in exception handlers lead to some
      interrupt handlers saving those scratch r14 / r15 registers into the
      interrupt frame's GPR saves, which get restored on interrupt exit.
      
      Fix this by always reloading those scratch registers from paca before
      the EXCEPTION_COMMON that saves nvgprs.
      
      Fixes: 4228b2c3
      
       ("powerpc/64e/interrupt: always save nvgprs on interrupt")
      Reported-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Tested-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210514044008.1955783-1-npiggin@gmail.com
      c6ac667b
    • Nicholas Piggin's avatar
      powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled · 4ec5feec
      Nicholas Piggin authored
      scv support introduced the notion of code that implicitly soft-masks
      irqs due to the instruction addresses. This is required because scv
      enters the kernel with MSR[EE]=1.
      
      If a NMI (including soft-NMI) interrupt hits when we are implicitly
      soft-masked then its regs->softe does not reflect this because it is
      derived from the explicit soft mask state (paca->irq_soft_mask). This
      makes arch_irq_disabled_regs(regs) return false.
      
      This can trigger a warning in the soft-NMI watchdog code (shown below).
      Fix it by having NMI interrupts set regs->softe to disabled in case of
      interrupting an implicit soft-masked region.
      
        ------------[ cut here ]------------
        WARNING: CPU: 41 PID: 1103 at arch/powerpc/kernel/watchdog.c:259 soft_nmi_interrupt+0x3e4/0x5f0
        CPU: 41 PID: 1103 Comm: (spawn) Not tainted
        NIP:  c000000000039534 LR: c000000000039234 CTR: c000000000009a00
        REGS: c000007fffbcf940 TRAP: 0700   Not tainted
        MSR:  9000000000021033 <SF,HV,ME,IR,DR,RI,LE>  CR: 22042482  XER: 200400ad
        CFAR: c000000000039260 IRQMASK: 3
        GPR00: c000000000039204 c000007fffbcfbe0 c000000001d6c300 0000000000000003
        GPR04: 00007ffffa45d078 0000000000000000 0000000000000008 0000000000000020
        GPR08: 0000007ffd4e0000 0000000000000000 c000007ffffceb00 7265677368657265
        GPR12: 9000000000009033 c000007ffffceb00 00000f7075bf4480 000000000000002a
        GPR16: 00000f705745a528 00007ffffa45ddd8 00000f70574d0008 0000000000000000
        GPR20: 00000f7075c58d70 00000f7057459c38 0000000000000001 0000000000000040
        GPR24: 0000000000000000 0000000000000029 c000000001dae058 0000000000000029
        GPR28: 0000000000000000 0000000000000800 0000000000000009 c000007fffbcfd60
        NIP [c000000000039534] soft_nmi_interrupt+0x3e4/0x5f0
        LR [c000000000039234] soft_nmi_interrupt+0xe4/0x5f0
        Call Trace:
        [c000007fffbcfbe0] [c000000000039204] soft_nmi_interrupt+0xb4/0x5f0 (unreliable)
        [c000007fffbcfcf0] [c00000000000c0e8] soft_nmi_common+0x138/0x1c4
        --- interrupt: 900 at end_real_trampolines+0x0/0x1000
        NIP:  c000000000003000 LR: 00007ca426adb03c CTR: 900000000280f033
        REGS: c000007fffbcfd60 TRAP: 0900
        MSR:  9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 44042482  XER: 200400ad
        CFAR: 00007ca426946020 IRQMASK: 0
        GPR00: 00000000000000ad 00007ffffa45d050 00007ca426b07f00 0000000000000035
        GPR04: 00007ffffa45d078 0000000000000000 0000000000000008 0000000000000020
        GPR08: 0000000000000000 0000000000100000 0000000010000000 00007ffffa45d110
        GPR12: 0000000000000001 00007ca426d4e680 00000f7075bf4480 000000000000002a
        GPR16: 00000f705745a528 00007ffffa45ddd8 00000f70574d0008 0000000000000000
        GPR20: 00000f7075c58d70 00000f7057459c38 0000000000000001 0000000000000040
        GPR24: 0000000000000000 00000f7057473f68 0000000000000003 000000000000041b
        GPR28: 00007ffffa45d4c4 0000000000000035 0000000000000000 00000f7057473f68
        NIP [c000000000003000] end_real_trampolines+0x0/0x1000
        LR [00007ca426adb03c] 0x7ca426adb03c
        --- interrupt: 900
        Instruction dump:
        60000000 60000000 60420000 38600001 482b3ae5 60000000 e93f0138 a36d0008
        7daa6b78 71290001 7f7907b4 4082fd34 <0fe00000> 4bfffd2c 60420000 ea6100a8
        ---[ end trace dc75f67d819779da ]---
      
      Fixes: 118178e6
      
       ("powerpc: move NMI entry/exit code into wrapper")
      Reported-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210503111708.758261-1-npiggin@gmail.com
      4ec5feec
    • Michael Ellerman's avatar
      powerpc/64s: Fix stf mitigation patching w/strict RWX & hash · 5b48ba2f
      Michael Ellerman authored
      The stf entry barrier fallback is unsafe to execute in a semi-patched
      state, which can happen when enabling/disabling the mitigation with
      strict kernel RWX enabled and using the hash MMU.
      
      See the previous commit for more details.
      
      Fix it by changing the order in which we patch the instructions.
      
      Note the stf barrier fallback is only used on Power6 or earlier.
      
      Fixes: bd573a81
      
       ("powerpc/mm/64s: Allow STRICT_KERNEL_RWX again")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210513140800.1391706-2-mpe@ellerman.id.au
      5b48ba2f
    • Michael Ellerman's avatar
      powerpc/64s: Fix entry flush patching w/strict RWX & hash · 49b39ec2
      Michael Ellerman authored
      The entry flush mitigation can be enabled/disabled at runtime. When this
      happens it results in the kernel patching its own instructions to
      enable/disable the mitigation sequence.
      
      With strict kernel RWX enabled instruction patching happens via a
      secondary mapping of the kernel text, so that we don't have to make the
      primary mapping writable. With the hash MMU this leads to a hash fault,
      which causes us to execute the exception entry which contains the entry
      flush mitigation.
      
      This means we end up executing the entry flush in a semi-patched state,
      ie. after we have patched the first instruction but before we patch the
      second or third instruction of the sequence.
      
      On machines with updated firmware the entry flush is a series of special
      nops, and it's safe to to execute in a semi-patched state.
      
      However when using the fallback flush the sequence is mflr/branch/mtlr,
      and so it's not safe to execute if we have patched out the mflr but not
      the other two instructions. Doing so leads to us corrputing LR, leading
      to an oops, for example:
      
        # echo 0 > /sys/kernel/debug/powerpc/entry_flush
        kernel tried to execute exec-protected page (c000000002971000) - exploit attempt? (uid: 0)
        BUG: Unable to handle kernel instruction fetch
        Faulting instruction address: 0xc000000002971000
        Oops: Kernel access of bad area, sig: 11 [#1]
        LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
        CPU: 0 PID: 2215 Comm: bash Not tainted 5.13.0-rc1-00010-gda3bb206 #1
        NIP:  c000000002971000 LR: c000000002971000 CTR: c000000000120c40
        REGS: c000000013243840 TRAP: 0400   Not tainted  (5.13.0-rc1-00010-gda3bb206)
        MSR:  8000000010009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 48428482  XER: 00000000
        ...
        NIP  0xc000000002971000
        LR   0xc000000002971000
        Call Trace:
          do_patch_instruction+0xc4/0x340 (unreliable)
          do_entry_flush_fixups+0x100/0x3b0
          entry_flush_set+0x50/0xe0
          simple_attr_write+0x160/0x1a0
          full_proxy_write+0x8c/0x110
          vfs_write+0xf0/0x340
          ksys_write+0x84/0x140
          system_call_exception+0x164/0x2d0
          system_call_common+0xec/0x278
      
      The simplest fix is to change the order in which we patch the
      instructions, so that the sequence is always safe to execute. For the
      non-fallback flushes it doesn't matter what order we patch in.
      
      Fixes: bd573a81
      
       ("powerpc/mm/64s: Allow STRICT_KERNEL_RWX again")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210513140800.1391706-1-mpe@ellerman.id.au
      49b39ec2
    • Michael Ellerman's avatar
      powerpc/64s: Fix crashes when toggling entry flush barrier · aec86b05
      Michael Ellerman authored
      The entry flush mitigation can be enabled/disabled at runtime via a
      debugfs file (entry_flush), which causes the kernel to patch itself to
      enable/disable the relevant mitigations.
      
      However depending on which mitigation we're using, it may not be safe to
      do that patching while other CPUs are active. For example the following
      crash:
      
        sleeper[15639]: segfault (11) at c000000000004c20 nip c000000000004c20 lr c000000000004c20
      
      Shows that we returned to userspace with a corrupted LR that points into
      the kernel, due to executing the partially patched call to the fallback
      entry flush (ie. we missed the LR restore).
      
      Fix it by doing the patching under stop machine. The CPUs that aren't
      doing the patching will be spinning in the core of the stop machine
      logic. That is currently sufficient for our purposes, because none of
      the patching we do is to that code or anywhere in the vicinity.
      
      Fixes: f7964378
      
       ("powerpc/64s: flush L1D on kernel entry")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210506044959.1298123-2-mpe@ellerman.id.au
      aec86b05
    • Michael Ellerman's avatar
      powerpc/64s: Fix crashes when toggling stf barrier · 8ec7791b
      Michael Ellerman authored
      The STF (store-to-load forwarding) barrier mitigation can be
      enabled/disabled at runtime via a debugfs file (stf_barrier), which
      causes the kernel to patch itself to enable/disable the relevant
      mitigations.
      
      However depending on which mitigation we're using, it may not be safe to
      do that patching while other CPUs are active. For example the following
      crash:
      
        User access of kernel address (c00000003fff5af0) - exploit attempt? (uid: 0)
        segfault (11) at c00000003fff5af0 nip 7fff8ad12198 lr 7fff8ad121f8 code 1
        code: 40820128 e93c00d0 e9290058 7c292840 40810058 38600000 4bfd9a81 e8410018
        code: 2c030006 41810154 3860ffb6 e9210098 <e94d8ff0> 7d295279 39400000 40820a3c
      
      Shows that we returned to userspace without restoring the user r13
      value, due to executing the partially patched STF exit code.
      
      Fix it by doing the patching under stop machine. The CPUs that aren't
      doing the patching will be spinning in the core of the stop machine
      logic. That is currently sufficient for our purposes, because none of
      the patching we do is to that code or anywhere in the vicinity.
      
      Fixes: a048a07d
      
       ("powerpc/64s: Add support for a store forwarding barrier at kernel entry/exit")
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210506044959.1298123-1-mpe@ellerman.id.au
      8ec7791b
  5. 12 May, 2021 10 commits
  6. 07 May, 2021 2 commits
    • Nicholas Piggin's avatar
      KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks · 34114136
      Nicholas Piggin authored
      Commit b1c5356e ("KVM: PPC: Convert to the gfn-based MMU notifier
      callbacks") causes unmap_gfn_range and age_gfn callbacks to only work
      on the first gfn in the range. It also makes the aging callbacks call
      into both radix and hash aging functions for radix guests. Fix this.
      
      Add warnings for the single-gfn calls that have been converted to range
      callbacks, in case they ever receieve ranges greater than 1.
      
      Fixes: b1c5356e
      
       ("KVM: PPC: Convert to the gfn-based MMU notifier callbacks")
      Reported-by: default avatarBharata B Rao <bharata@linux.ibm.com>
      Tested-by: default avatarBharata B Rao <bharata@linux.ibm.com>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Message-Id: <20210505121509.1470207-1-npiggin@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      34114136
    • David Hildenbrand's avatar
      mm: remove xlate_dev_kmem_ptr() · f2e762ba
      David Hildenbrand authored
      Since /dev/kmem has been removed, let's remove the xlate_dev_kmem_ptr()
      leftovers.
      
      Link: https://lkml.kernel.org/r/20210324102351.6932-3-david@redhat.com
      
      
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
      Cc: Niklas Schnelle <schnelle@linux.ibm.com>
      Cc: Pierre Morel <pmorel@linux.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f2e762ba
  7. 05 May, 2021 7 commits
    • Anshuman Khandual's avatar
      mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK · 66f24fa7
      Anshuman Khandual authored
      ARCH_ENABLE_SPLIT_PMD_PTLOCKS has duplicate definitions on platforms
      that subscribe it.  Drop these redundant definitions and instead just
      select it on applicable platforms.
      
      Link: https://lkml.kernel.org/r/1617259448-22529-6-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: Anshuman Khandual's avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Acked-by: Heiko Carstens <hca@linux.ibm.com>		[s390]
      Cc: Will Deacon <will@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      66f24fa7
    • Anshuman Khandual's avatar
      mm: drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION · 1e866974
      Anshuman Khandual authored
      ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION configs have duplicate definitions on
      platforms that subscribe them.  Drop these reduntant definitions and
      instead just select them appropriately.
      
      [akpm@linux-foundation.org: s/x86_64/X86_64/, per Oscar]
      
      Link: https://lkml.kernel.org/r/1617259448-22529-5-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: Anshuman Khandual's avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Cc: Will Deacon <will@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1e866974
    • Anshuman Khandual's avatar
      mm: generalize ARCH_ENABLE_MEMORY_[HOTPLUG|HOTREMOVE] · 91024b3c
      Anshuman Khandual authored
      ARCH_ENABLE_MEMORY_[HOTPLUG|HOTREMOVE] configs have duplicate
      definitions on platforms that subscribe them.  Instead, just make them
      generic options which can be selected on applicable platforms.
      
      Link: https://lkml.kernel.org/r/1617259448-22529-4-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: Anshuman Khandual's avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Acked-by: Heiko Carstens <hca@linux.ibm.com>		[s390]
      Cc: Will Deacon <will@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      91024b3c
    • Anshuman Khandual's avatar
      mm: generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS) · 855f9a8e
      Anshuman Khandual authored
      SYS_SUPPORTS_HUGETLBFS config has duplicate definitions on platforms
      that subscribe it.  Instead, just make it a generic option which can be
      selected on applicable platforms.
      
      Also rename it as ARCH_SUPPORTS_HUGETLBFS instead.  This reduces code
      duplication and makes it cleaner.
      
      Link: https://lkml.kernel.org/r/1617259448-22529-3-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: Anshuman Khandual's avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>	[riscv]
      Acked-by: Michael Ellerman <mpe@ellerman.id.au>		[powerpc]
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Will Deacon <will@kernel.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      855f9a8e
    • Anshuman Khandual's avatar
      mm: generalize HUGETLB_PAGE_SIZE_VARIABLE · 4bfb68a0
      Anshuman Khandual authored
      HUGETLB_PAGE_SIZE_VARIABLE need not be defined for each individual
      platform subscribing it.  Instead just make it generic.
      
      Link: https://lkml.kernel.org/r/1614914928-22039-1-git-send-email-anshuman.khandual@arm.com
      
      
      Signed-off-by: Anshuman Khandual's avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au>	[powerpc]
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4bfb68a0
    • Peter Xu's avatar
      hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share() · aec44e0f
      Peter Xu authored
      Patch series "hugetlb: Disable huge pmd unshare for uffd-wp", v4.
      
      This series tries to disable huge pmd unshare of hugetlbfs backed memory
      for uffd-wp.  Although uffd-wp of hugetlbfs is still during rfc stage,
      the idea of this series may be needed for multiple tasks (Axel's uffd
      minor fault series, and Mike's soft dirty series), so I picked it out
      from the larger series.
      
      This patch (of 4):
      
      It is a preparation work to be able to behave differently in the per
      architecture huge_pte_alloc() according to different VMA attributes.
      
      Pass it deeper into huge_pmd_share() so that we can avoid the find_vma() call.
      
      [peterx@redhat.com: build fix]
        Link: https://lkml.kernel.org/r/20210304164653.GB397383@xz-x1Link: https://lkml.kernel.org/r/20210218230633.15028-1-peterx@redhat.com
      
      Link: https://lkml.kernel.org/r/20210218230633.15028-2-peterx@redhat.com
      
      
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Suggested-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Cc: Adam Ruprecht <ruprecht@google.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Axel Rasmussen <axelrasmussen@google.com>
      Cc: Cannon Matthews <cannonmatthews@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chinwen Chang <chinwen.chang@mediatek.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Lokesh Gidra <lokeshgidra@google.com>
      Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: "Michal Koutn" <mkoutny@suse.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Mina Almasry <almasrymina@google.com>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Oliver Upton <oupton@google.com>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Shawn Anastasio <shawn@anastas.io>
      Cc: Steven Price <steven.price@arm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      aec44e0f
    • Nicholas Piggin's avatar
      KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks · 32b48bf8
      Nicholas Piggin authored
      Commit b1c5356e ("KVM: PPC: Convert to the gfn-based MMU notifier
      callbacks") causes unmap_gfn_range and age_gfn callbacks to only work
      on the first gfn in the range. It also makes the aging callbacks call
      into both radix and hash aging functions for radix guests. Fix this.
      
      Add warnings for the single-gfn calls that have been converted to range
      callbacks, in case they ever receieve ranges greater than 1.
      
      Fixes: b1c5356e
      
       ("KVM: PPC: Convert to the gfn-based MMU notifier callbacks")
      Reported-by: default avatarBharata B Rao <bharata@linux.ibm.com>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Tested-by: default avatarBharata B Rao <bharata@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210505121509.1470207-1-npiggin@gmail.com
      32b48bf8
  8. 04 May, 2021 5 commits
  9. 02 May, 2021 1 commit
  10. 01 May, 2021 1 commit
  11. 30 Apr, 2021 1 commit