1. 13 12月, 2019 1 次提交
  2. 11 12月, 2019 1 次提交
  3. 06 12月, 2019 10 次提交
  4. 05 12月, 2019 21 次提交
    • M
      powerpc/perf: Disable trace_imc pmu · 249fad73
      Madhavan Srinivasan 提交于
      When a root user or a user with CAP_SYS_ADMIN privilege uses any
      trace_imc performance monitoring unit events, to monitor application
      or KVM threads, it may result in a checkstop (System crash).
      
      The cause is frequent switching of the "trace/accumulation" mode of
      the In-Memory Collection hardware (LDBAR).
      
      This patch disables the trace_imc PMU unit entirely to avoid
      triggering the checkstop. A future patch will reenable it at a later
      stage once a workaround has been developed.
      
      Fixes: 012ae244 ("powerpc/perf: Trace imc PMU functions")
      Cc: stable@vger.kernel.org # v5.2+
      Signed-off-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Tested-by: NHariharan T.S. <hari@linux.ibm.com>
      [mpe: Add pr_info_once() so dmesg shows the PMU has been disabled]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191118034452.9939-1-maddy@linux.vnet.ibm.com
      249fad73
    • A
      powerpc/powernv: Avoid re-registration of imc debugfs directory · 48e626ac
      Anju T Sudhakar 提交于
      export_imc_mode_and_cmd() function which creates the debugfs interface
      for imc-mode and imc-command, is invoked when each nest pmu units is
      registered.
      
      When the first nest pmu unit is registered, export_imc_mode_and_cmd()
      creates 'imc' directory under `/debug/powerpc/`. In the subsequent
      invocations debugfs_create_dir() function returns, since the directory
      already exists.
      
      The recent commit <c33d4423> (debugfs: make error message a bit
      more verbose), throws a warning if we try to invoke
      `debugfs_create_dir()` with an already existing directory name.
      
      Address this warning by making the debugfs directory registration in
      the opal_imc_counters_probe() function, i.e invoke
      export_imc_mode_and_cmd() function from the probe function.
      Signed-off-by: NAnju T Sudhakar <anju@linux.vnet.ibm.com>
      Tested-by: NNageswara R Sastry <nasastry@in.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191127072035.4283-1-anju@linux.vnet.ibm.com
      48e626ac
    • M
      um: add support for folded p4d page tables · e19f97ed
      Mike Rapoport 提交于
      The UML port uses 4 and 5 level fixups to support higher level page
      table directories in the generic VM code.
      
      Implement primitives necessary for the 4th level folding, add walks of
      p4d level where appropriate and drop usage of __ARCH_USE_5LEVEL_HACK.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-13-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e19f97ed
    • M
      um: remove unused pxx_offset_proc() and addr_pte() functions · 4e65e76f
      Mike Rapoport 提交于
      The pxx_offset_proc() and addr_pte() functions are never used.  Remove
      them.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-12-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NRichard Weinberger <richard@nod.at>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e65e76f
    • M
      sparc32: use pgtable-nopud instead of 4level-fixup · 7235db26
      Mike Rapoport 提交于
      32-bit version of sparc has three-level page tables and can use
      pgtable-nopud and folding of the upper layers.
      
      Replace usage of include/asm-generic/4level-fixup.h with
      include/asm-generic/pgtable-nopud.h and adjust page table manipulation
      macros and functions accordingly.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-11-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Tested-by: NAnatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7235db26
    • H
      parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup · 2fa245c1
      Helge Deller 提交于
      Link: http://lkml.kernel.org/r/1572938135-31886-10-git-send-email-rppt@kernel.orgSigned-off-by: NHelge Deller <deller@gmx.de>
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2fa245c1
    • M
      parisc: use pgtable-nopXd instead of 4level-fixup · d96885e2
      Mike Rapoport 提交于
      parisc has two or three levels of page tables and can use appropriate
      pgtable-nopXd and folding of the upper layers.
      
      Replace usage of include/asm-generic/4level-fixup.h and explicit
      definitions of __PAGETABLE_PxD_FOLDED in parisc with
      include/asm-generic/pgtable-nopmd.h for two-level configurations and
      with include/asm-generic/pgtable-nopud.h for three-lelve configurations
      and adjust page table manipulation macros and functions accordingly.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-9-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NHelge Deller <deller@gmx.de>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d96885e2
    • M
      nds32: use pgtable-nopmd instead of 4level-fixup · 7c2763c4
      Mike Rapoport 提交于
      nds32 has only two-level page tables and can use pgtable-nopmd and
      folding of the upper layers.
      
      Replace usage of include/asm-generic/4level-fixup.h and explicit
      definition of __PAGETABLE_PMD_FOLDED in nds32 with
      include/asm-generic/pgtable-nopmd.h and adjust page table manipulation
      macros and functions accordingly.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-8-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7c2763c4
    • M
      microblaze: use pgtable-nopmd instead of 4level-fixup · ed48e1f8
      Mike Rapoport 提交于
      microblaze has only two-level page tables and can use pgtable-nopmd and
      folding of the upper layers.
      
      Replace usage of include/asm-generic/4level-fixup.h and explicit
      definition of __PAGETABLE_PMD_FOLDED in microblaze with
      include/asm-generic/pgtable-nopmd.h and adjust page table manipulation
      macros and functions accordingly.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-7-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ed48e1f8
    • M
      m68k: mm: use pgtable-nopXd instead of 4level-fixup · 60e50f34
      Mike Rapoport 提交于
      m68k has two or three levels of page tables and can use appropriate
      pgtable-nopXd and folding of the upper layers.
      
      Replace usage of include/asm-generic/4level-fixup.h and explicit
      definitions of __PAGETABLE_PxD_FOLDED in m68k with
      include/asm-generic/pgtable-nopmd.h for two-level configurations and
      with include/asm-generic/pgtable-nopud.h for three-lelve configurations
      and adjust page table manipulation macros and functions accordingly.
      
      [akpm@linux-foundation.org: fix merge glitch]
      [geert@linux-m68k.org: more merge glitch fixes]
      [akpm@linux-foundation.org: s/bad_pgd/bad_pud/, per Mike]
      Link: http://lkml.kernel.org/r/1572938135-31886-6-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NGreg Ungerer <gerg@linux-m68k.org>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60e50f34
    • M
      m68k: nommu: use pgtable-nopud instead of 4level-fixup · f6f7caeb
      Mike Rapoport 提交于
      The generic nommu implementation of page table manipulation takes care
      of folding of the upper levels and does not require fixups.
      
      Simply replace of include/asm-generic/4level-fixup.h with
      include/asm-generic/pgtable-nopud.h.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-5-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NGreg Ungerer <gerg@linux-m68k.org>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f6f7caeb
    • M
      c6x: use pgtable-nopud instead of 4level-fixup · d13252ea
      Mike Rapoport 提交于
      c6x is a nommu architecture and does not require fixup for upper layers
      of the page tables because it is already handled by the generic nommu
      implementation.
      
      Replace usage of include/asm-generic/4level-fixup.h with
      include/asm-generic/pgtable-nopud.h
      
      Link: http://lkml.kernel.org/r/1572938135-31886-4-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d13252ea
    • M
      arm: nommu: use pgtable-nopud instead of 4level-fixup · aa662823
      Mike Rapoport 提交于
      The generic nommu implementation of page table manipulation takes care
      of folding of the upper levels and does not require fixups.
      
      Simply replace of include/asm-generic/4level-fixup.h with
      include/asm-generic/pgtable-nopud.h.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-3-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aa662823
    • M
      alpha: use pgtable-nopud instead of 4level-fixup · a73c9489
      Mike Rapoport 提交于
      Patch series "mm: remove __ARCH_HAS_4LEVEL_HACK", v13.
      
      These patches convert several architectures to use page table folding
      and remove __ARCH_HAS_4LEVEL_HACK along with
      include/asm-generic/4level-fixup.h.
      
      For the nommu configurations the folding is already implemented by the
      generic code so the only change was to use the appropriate header file.
      
      As for the rest, the changes are mostly about mechanical replacement of
      pgd accessors with pud/pmd ones and the addition of higher levels to
      page table traversals.
      
      With Vineet's patches from "elide extraneous generated code for folded
      p4d/pud/pmd" series [1] there is a small shrink of the kernel size of
      about -0.01% for the defconfig builds.
      
      This patch (of 13):
      
      It is not likely alpha will have 5-level page tables.
      
      Replace usage of include/asm-generic/4level-fixup.h and implied
      __ARCH_HAS_4LEVEL_HACK with include/asm-generic/pgtable-nopud.h and
      adjust page table manipulation macros and functions accordingly.
      
      Link: http://lkml.kernel.org/r/1572938135-31886-2-git-send-email-rppt@kernel.orgSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sam Creasey <sammy@sammy.net>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Cc: Anatoly Pugachev <matorola@gmail.com>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a73c9489
    • M
      arch: sembuf.h: make uapi asm/sembuf.h self-contained · 0fb9dc28
      Masahiro Yamada 提交于
      Userspace cannot compile <asm/sembuf.h> due to some missing type
      definitions.  For example, building it for x86 fails as follows:
      
          CC      usr/include/asm/sembuf.h.s
        In file included from <command-line>:32:0:
        usr/include/asm/sembuf.h:17:20: error: field `sem_perm' has incomplete type
          struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
                            ^~~~~~~~
        usr/include/asm/sembuf.h:24:2: error: unknown type name `__kernel_time_t'
          __kernel_time_t sem_otime; /* last semop time */
          ^~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:25:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused1;
          ^~~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:26:2: error: unknown type name `__kernel_time_t'
          __kernel_time_t sem_ctime; /* last change time */
          ^~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:27:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused2;
          ^~~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:29:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t sem_nsems; /* no. of semaphores in array */
          ^~~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:30:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused3;
          ^~~~~~~~~~~~~~~~
        usr/include/asm/sembuf.h:31:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused4;
          ^~~~~~~~~~~~~~~~
      
      It is just a matter of missing include directive.
      
      Include <asm/ipcbuf.h> to make it self-contained, and add it to
      the compile-test coverage.
      
      Link: http://lkml.kernel.org/r/20191030063855.9989-3-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0fb9dc28
    • M
      arch: msgbuf.h: make uapi asm/msgbuf.h self-contained · 9ef0e004
      Masahiro Yamada 提交于
      Userspace cannot compile <asm/msgbuf.h> due to some missing type
      definitions.  For example, building it for x86 fails as follows:
      
          CC      usr/include/asm/msgbuf.h.s
        In file included from usr/include/asm/msgbuf.h:6:0,
                         from <command-line>:32:
        usr/include/asm-generic/msgbuf.h:25:20: error: field `msg_perm' has incomplete type
          struct ipc64_perm msg_perm;
                            ^~~~~~~~
        usr/include/asm-generic/msgbuf.h:27:2: error: unknown type name `__kernel_time_t'
          __kernel_time_t msg_stime; /* last msgsnd time */
          ^~~~~~~~~~~~~~~
        usr/include/asm-generic/msgbuf.h:28:2: error: unknown type name `__kernel_time_t'
          __kernel_time_t msg_rtime; /* last msgrcv time */
          ^~~~~~~~~~~~~~~
        usr/include/asm-generic/msgbuf.h:29:2: error: unknown type name `__kernel_time_t'
          __kernel_time_t msg_ctime; /* last change time */
          ^~~~~~~~~~~~~~~
        usr/include/asm-generic/msgbuf.h:41:2: error: unknown type name `__kernel_pid_t'
          __kernel_pid_t msg_lspid; /* pid of last msgsnd */
          ^~~~~~~~~~~~~~
        usr/include/asm-generic/msgbuf.h:42:2: error: unknown type name `__kernel_pid_t'
          __kernel_pid_t msg_lrpid; /* last receive pid */
          ^~~~~~~~~~~~~~
      
      It is just a matter of missing include directive.
      
      Include <asm/ipcbuf.h> to make it self-contained, and add it to
      the compile-test coverage.
      
      Link: http://lkml.kernel.org/r/20191030063855.9989-2-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ef0e004
    • M
      arch: ipcbuf.h: make uapi asm/ipcbuf.h self-contained · 5b009673
      Masahiro Yamada 提交于
      Userspace cannot compile <asm/ipcbuf.h> due to some missing type
      definitions.  For example, building it for x86 fails as follows:
      
          CC      usr/include/asm/ipcbuf.h.s
        In file included from usr/include/asm/ipcbuf.h:1:0,
                         from <command-line>:32:
        usr/include/asm-generic/ipcbuf.h:21:2: error: unknown type name `__kernel_key_t'
          __kernel_key_t  key;
          ^~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:22:2: error: unknown type name `__kernel_uid32_t'
          __kernel_uid32_t uid;
          ^~~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:23:2: error: unknown type name `__kernel_gid32_t'
          __kernel_gid32_t gid;
          ^~~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:24:2: error: unknown type name `__kernel_uid32_t'
          __kernel_uid32_t cuid;
          ^~~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:25:2: error: unknown type name `__kernel_gid32_t'
          __kernel_gid32_t cgid;
          ^~~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:26:2: error: unknown type name `__kernel_mode_t'
          __kernel_mode_t  mode;
          ^~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:28:35: error: `__kernel_mode_t' undeclared here (not in a function)
          unsigned char  __pad1[4 - sizeof(__kernel_mode_t)];
                                           ^~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:31:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused1;
          ^~~~~~~~~~~~~~~~
        usr/include/asm-generic/ipcbuf.h:32:2: error: unknown type name `__kernel_ulong_t'
          __kernel_ulong_t __unused2;
          ^~~~~~~~~~~~~~~~
      
      It is just a matter of missing include directive.
      
      Include <linux/posix_types.h> to make it self-contained, and add it to
      the compile-test coverage.
      
      Link: http://lkml.kernel.org/r/20191030063855.9989-1-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b009673
    • H
      lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr · 964975ac
      Huang Shijie 提交于
      Follow the kernel conventions, rename addr_in_gen_pool to
      gen_pool_has_addr.
      
      [sjhuang@iluvatar.ai: fix Documentation/ too]
       Link: http://lkml.kernel.org/r/20181229015914.5573-1-sjhuang@iluvatar.ai
      Link: http://lkml.kernel.org/r/20181228083950.20398-1-sjhuang@iluvatar.aiSigned-off-by: NHuang Shijie <sjhuang@iluvatar.ai>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      964975ac
    • K
      arch/Kconfig: fix indentation · 24b54fee
      Krzysztof Kozlowski 提交于
      Adjust indentation from spaces to tab (+optional two spaces) as in
      coding style with command like:
      	$ sed -e 's/^        /	/' -i */Kconfig
      
      Link: http://lkml.kernel.org/r/1574306573-10886-1-git-send-email-krzk@kernel.orgSigned-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Kosina <trivial@kernel.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      24b54fee
    • A
    • A
      powerpc/archrandom: fix arch_get_random_seed_int() · b6afd123
      Ard Biesheuvel 提交于
      Commit 01c9348c
      
        powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*
      
      updated arch_get_random_[int|long]() to be NOPs, and moved the hardware
      RNG backing to arch_get_random_seed_[int|long]() instead. However, it
      failed to take into account that arch_get_random_int() was implemented
      in terms of arch_get_random_long(), and so we ended up with a version
      of the former that is essentially a NOP as well.
      
      Fix this by calling arch_get_random_seed_long() from
      arch_get_random_seed_int() instead.
      
      Fixes: 01c9348c ("powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*")
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191204115015.18015-1-ardb@kernel.org
      b6afd123
  5. 04 12月, 2019 7 次提交
    • V
      powerpc: Fix vDSO clock_getres() · 55226345
      Vincenzo Frascino 提交于
      clock_getres in the vDSO library has to preserve the same behaviour
      of posix_get_hrtimer_res().
      
      In particular, posix_get_hrtimer_res() does:
          sec = 0;
          ns = hrtimer_resolution;
      and hrtimer_resolution depends on the enablement of the high
      resolution timers that can happen either at compile or at run time.
      
      Fix the powerpc vdso implementation of clock_getres keeping a copy of
      hrtimer_resolution in vdso data and using that directly.
      
      Fixes: a7f290da ("[PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel")
      Cc: stable@vger.kernel.org
      Signed-off-by: NVincenzo Frascino <vincenzo.frascino@arm.com>
      Reviewed-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Acked-by: NShuah Khan <skhan@linuxfoundation.org>
      [chleroy: changed CLOCK_REALTIME_RES to CLOCK_HRTIMER_RES]
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/a55eca3a5e85233838c2349783bcb5164dae1d09.1575273217.git.christophe.leroy@c-s.fr
      55226345
    • A
      powerpc/pmem: Fix kernel crash due to wrong range value usage in flush_dcache_range · 6f4679b9
      Aneesh Kumar K.V 提交于
      This patch fix the below kernel crash.
      
       BUG: Unable to handle kernel data access on read at 0xc000000380000000
       Faulting instruction address: 0xc00000000008b6f0
      cpu 0x5: Vector: 300 (Data Access) at [c0000000d8587790]
          pc: c00000000008b6f0: arch_remove_memory+0x150/0x210
          lr: c00000000008b720: arch_remove_memory+0x180/0x210
          sp: c0000000d8587a20
         msr: 800000000280b033
         dar: c000000380000000
       dsisr: 40000000
        current = 0xc0000000d8558600
        paca    = 0xc00000000fff8f00   irqmask: 0x03   irq_happened: 0x01
          pid   = 1220, comm = ndctl
      enter ? for help
       memunmap_pages+0x33c/0x410
       devm_action_release+0x30/0x50
       release_nodes+0x30c/0x3a0
       device_release_driver_internal+0x178/0x240
       unbind_store+0x74/0x190
       drv_attr_store+0x44/0x60
       sysfs_kf_write+0x74/0xa0
       kernfs_fop_write+0x1b0/0x260
       __vfs_write+0x3c/0x70
       vfs_write+0xe4/0x200
       ksys_write+0x7c/0x140
       system_call+0x5c/0x68
      
      Fixes: 07626590 ("powerpc: Chunk calls to flush_dcache_range in arch_*_memory")
      Reported-by: NSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191204052909.59145-1-aneesh.kumar@linux.ibm.com
      6f4679b9
    • C
      powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts · b67a95f2
      Cédric Le Goater 提交于
      The PCI INTx interrupts and other LSI interrupts are handled differently
      under a sPAPR platform. When the interrupt source characteristics are
      queried, the hypervisor returns an H_INT_ESB flag to inform the OS
      that it should be using the H_INT_ESB hcall for interrupt management
      and not loads and stores on the interrupt ESB pages.
      
      A default -1 value is returned for the addresses of the ESB pages. The
      driver ignores this condition today and performs a bogus IO mapping.
      Recent changes and the DEBUG_VM configuration option make the bug
      visible with :
      
        kernel BUG at arch/powerpc/include/asm/book3s/64/pgtable.h:612!
        Oops: Exception in kernel mode, sig: 5 [#1]
        LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=1024 NUMA pSeries
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-0.rc6.git0.1.fc32.ppc64le #1
        NIP:  c000000000f63294 LR: c000000000f62e44 CTR: 0000000000000000
        REGS: c0000000fa45f0d0 TRAP: 0700   Not tainted  (5.4.0-0.rc6.git0.1.fc32.ppc64le)
        ...
        NIP ioremap_page_range+0x4c4/0x6e0
        LR  ioremap_page_range+0x74/0x6e0
        Call Trace:
          ioremap_page_range+0x74/0x6e0 (unreliable)
          do_ioremap+0x8c/0x120
          __ioremap_caller+0x128/0x140
          ioremap+0x30/0x50
          xive_spapr_populate_irq_data+0x170/0x260
          xive_irq_domain_map+0x8c/0x170
          irq_domain_associate+0xb4/0x2d0
          irq_create_mapping+0x1e0/0x3b0
          irq_create_fwspec_mapping+0x27c/0x3e0
          irq_create_of_mapping+0x98/0xb0
          of_irq_parse_and_map_pci+0x168/0x230
          pcibios_setup_device+0x88/0x250
          pcibios_setup_bus_devices+0x54/0x100
          __of_scan_bus+0x160/0x310
          pcibios_scan_phb+0x330/0x390
          pcibios_init+0x8c/0x128
          do_one_initcall+0x60/0x2c0
          kernel_init_freeable+0x290/0x378
          kernel_init+0x2c/0x148
          ret_from_kernel_thread+0x5c/0x80
      
      Fixes: bed81ee1 ("powerpc/xive: introduce H_INT_ESB hcall")
      Cc: stable@vger.kernel.org # v4.14+
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Tested-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191203163642.2428-1-clg@kaod.org
      b67a95f2
    • C
      powerpc/kasan: Fix boot failure with RELOCATABLE && FSL_BOOKE · 71eb40fc
      Christophe Leroy 提交于
      When enabling CONFIG_RELOCATABLE and CONFIG_KASAN on FSL_BOOKE,
      the kernel doesn't boot.
      
      relocate_init() requires KASAN early shadow area to be set up because
      it needs access to the device tree through generic functions.
      
      Call kasan_early_init() before calling relocate_init()
      Reported-by: NLexi Shao <shaolexi@huawei.com>
      Fixes: 2edb16ef ("powerpc/32: Add KASAN support")
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/b58426f1664a4b344ff696d18cacf3b3e8962111.1575036985.git.christophe.leroy@c-s.fr
      71eb40fc
    • M
      arm64: mm: Fix column alignment for UXN in kernel_page_tables · cba779d8
      Mark Brown 提交于
      UXN is the only individual PTE bit other than the PTE_ATTRINDX_MASK ones
      which doesn't have both a set and a clear value provided, meaning that the
      columns in the table won't all be aligned. The PTE_ATTRINDX_MASK values
      are all both mutually exclusive and longer so are listed last to make a
      single final column for those values. Ensure everything is aligned by
      providing a clear value for UXN.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      cba779d8
    • M
      arm64: insn: consistently handle exit text · ca2ef4ff
      Mark Rutland 提交于
      A kernel built with KASAN && FTRACE_WITH_REGS && !MODULES, produces a
      boot-time splat in the bowels of ftrace:
      
      | [    0.000000] ftrace: allocating 32281 entries in 127 pages
      | [    0.000000] ------------[ cut here ]------------
      | [    0.000000] WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2019 ftrace_bug+0x27c/0x328
      | [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.0-rc3-00008-g7f08ae53 #13
      | [    0.000000] Hardware name: linux,dummy-virt (DT)
      | [    0.000000] pstate: 60000085 (nZCv daIf -PAN -UAO)
      | [    0.000000] pc : ftrace_bug+0x27c/0x328
      | [    0.000000] lr : ftrace_init+0x640/0x6cc
      | [    0.000000] sp : ffffa000120e7e00
      | [    0.000000] x29: ffffa000120e7e00 x28: ffff00006ac01b10
      | [    0.000000] x27: ffff00006ac898c0 x26: dfffa00000000000
      | [    0.000000] x25: ffffa000120ef290 x24: ffffa0001216df40
      | [    0.000000] x23: 000000000000018d x22: ffffa0001244c700
      | [    0.000000] x21: ffffa00011bf393c x20: ffff00006ac898c0
      | [    0.000000] x19: 00000000ffffffff x18: 0000000000001584
      | [    0.000000] x17: 0000000000001540 x16: 0000000000000007
      | [    0.000000] x15: 0000000000000000 x14: ffffa00010432770
      | [    0.000000] x13: ffff940002483519 x12: 1ffff40002483518
      | [    0.000000] x11: 1ffff40002483518 x10: ffff940002483518
      | [    0.000000] x9 : dfffa00000000000 x8 : 0000000000000001
      | [    0.000000] x7 : ffff940002483519 x6 : ffffa0001241a8c0
      | [    0.000000] x5 : ffff940002483519 x4 : ffff940002483519
      | [    0.000000] x3 : ffffa00011780870 x2 : 0000000000000001
      | [    0.000000] x1 : 1fffe0000d591318 x0 : 0000000000000000
      | [    0.000000] Call trace:
      | [    0.000000]  ftrace_bug+0x27c/0x328
      | [    0.000000]  ftrace_init+0x640/0x6cc
      | [    0.000000]  start_kernel+0x27c/0x654
      | [    0.000000] random: get_random_bytes called from print_oops_end_marker+0x30/0x60 with crng_init=0
      | [    0.000000] ---[ end trace 0000000000000000 ]---
      | [    0.000000] ftrace faulted on writing
      | [    0.000000] [<ffffa00011bf393c>] _GLOBAL__sub_D_65535_0___tracepoint_initcall_level+0x4/0x28
      | [    0.000000] Initializing ftrace call sites
      | [    0.000000] ftrace record flags: 0
      | [    0.000000]  (0)
      | [    0.000000]  expected tramp: ffffa000100b3344
      
      This is due to an unfortunate combination of several factors.
      
      Building with KASAN results in the compiler generating anonymous
      functions to register/unregister global variables against the shadow
      memory. These functions are placed in .text.startup/.text.exit, and
      given mangled names like _GLOBAL__sub_{I,D}_65535_0_$OTHER_SYMBOL. The
      kernel linker script places these in .init.text and .exit.text
      respectively, which are both discarded at runtime as part of initmem.
      
      Building with FTRACE_WITH_REGS uses -fpatchable-function-entry=2, which
      also instruments KASAN's anonymous functions. When these are discarded
      with the rest of initmem, ftrace removes dangling references to these
      call sites.
      
      Building without MODULES implicitly disables STRICT_MODULE_RWX, and
      causes arm64's patch_map() function to treat any !core_kernel_text()
      symbol as something that can be modified in-place. As core_kernel_text()
      is only true for .text and .init.text, with the latter depending on
      system_state < SYSTEM_RUNNING, we'll treat .exit.text as something that
      can be patched in-place. However, .exit.text is mapped read-only.
      
      Hence in this configuration the ftrace init code blows up while trying
      to patch one of the functions generated by KASAN.
      
      We could try to filter out the call sites in .exit.text rather than
      initializing them, but this would be inconsistent with how we handle
      .init.text, and requires hooking into core bits of ftrace. The behaviour
      of patch_map() is also inconsistent today, so instead let's clean that
      up and have it consistently handle .exit.text.
      
      This patch teaches patch_map() to handle .exit.text at init time,
      preventing the boot-time splat above. The flow of patch_map() is
      reworked to make the logic clearer and minimize redundant
      conditionality.
      
      Fixes: 3b23e499 ("arm64: implement ftrace with regs")
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Torsten Duwe <duwe@suse.de>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      ca2ef4ff
    • W
      arm64: mm: Fix initialisation of DMA zones on non-NUMA systems · 93b90414
      Will Deacon 提交于
      John reports that the recently merged commit 1a8e1cef ("arm64: use
      both ZONE_DMA and ZONE_DMA32") breaks the boot on his DB845C board:
      
        | Booting Linux on physical CPU 0x0000000000 [0x517f803c]
        | Linux version 5.4.0-mainline-10675-g957a03b9e38f
        | Machine model: Thundercomm Dragonboard 845c
        | [...]
        | Built 1 zonelists, mobility grouping on.  Total pages: -188245
        | Kernel command line: earlycon
        | firmware_class.path=/vendor/firmware/ androidboot.hardware=db845c
        | init=/init androidboot.boot_devices=soc/1d84000.ufshc
        | printk.devkmsg=on buildvariant=userdebug root=/dev/sda2
        | androidboot.bootdevice=1d84000.ufshc androidboot.serialno=c4e1189c
        | androidboot.baseband=sda
        | msm_drm.dsi_display0=dsi_lt9611_1080_video_display:
        | androidboot.slot_suffix=_a skip_initramfs rootwait ro init=/init
        |
        | <hangs indefinitely here>
      
      This is because, when CONFIG_NUMA=n, zone_sizes_init() fails to handle
      memblocks that fall entirely within the ZONE_DMA region and erroneously ends up
      trying to add a negatively-sized region into the following ZONE_DMA32, which is
      later interpreted as a large unsigned region by the core MM code.
      
      Rework the non-NUMA implementation of zone_sizes_init() so that the start
      address of the memblock being processed is adjusted according to the end of the
      previous zone, which is then range-checked before updating the hole information
      of subsequent zones.
      
      Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://lore.kernel.org/lkml/CALAqxLVVcsmFrDKLRGRq7GewcW405yTOxG=KR3csVzQ6bXutkA@mail.gmail.com
      Fixes: 1a8e1cef ("arm64: use both ZONE_DMA and ZONE_DMA32")
      Reported-by: NJohn Stultz <john.stultz@linaro.org>
      Tested-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      93b90414
新手
引导
客服 返回
顶部