1. 20 12月, 2022 1 次提交
  2. 30 9月, 2022 1 次提交
    • M
      powerpc: Add hardware description string · 41dc0563
      Michael Ellerman 提交于
      Create a hardware description string, which we will use to record
      various details of the hardware platform we are running on.
      
      Print the accumulated description at boot, and use it to set the generic
      description which is printed in oopses.
      
      To begin with add ppc_md.name, aka the "machine description".
      
      Example output at boot with the full series applied:
      
        Linux version 6.0.0-rc2-gcc-11.1.0-00199-g893f9007a5ce-dirty (michael@alpine1-p1) (powerpc64-linux-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #844 SMP Thu Sep 29 22:29:53 AEST 2022
        Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1200 0xf000005 of:SLOF,git-5b4c5a pSeries
        printk: bootconsole [udbg0] enabled
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220930082709.55830-1-mpe@ellerman.id.au
      41dc0563
  3. 01 8月, 2022 1 次提交
    • Y
      powerpc: drop dependency on <asm/machdep.h> in archrandom.h · 3e731203
      Yury Norov 提交于
      archrandom.h includes <asm/machdep.h> to refer ppc_md. This causes
      circular header dependency, if generic nodemask.h  includes random.h:
      
      In file included from include/linux/cred.h:16,
                       from include/linux/seq_file.h:13,
                       from arch/powerpc/include/asm/machdep.h:6,
                       from arch/powerpc/include/asm/archrandom.h:5,
                       from include/linux/random.h:109,
                       from include/linux/nodemask.h:97,
                       from include/linux/list_lru.h:12,
                       from include/linux/fs.h:13,
                       from include/linux/compat.h:17,
                       from arch/powerpc/kernel/asm-offsets.c:12:
      include/linux/sched.h:1203:9: error: unknown type name 'nodemask_t'
       1203 |         nodemask_t                      mems_allowed;
            |         ^~~~~~~~~~
      
      Fix it by removing <asm/machdep.h> dependency from archrandom.h
      
      Now as arch_get_random_seed_long() moved to c-file, and not exported,
      it's not available for modules. As Michael Ellerman says:
      
        I think we actually don't need it exported to modules, I think it's
        a private detail of the RNG <-> architecture interface, not something
        that modules should be calling.
      
      CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michael Ellerman <mpe@ellerman.id.au>
      CC: Paul Mackerras <paulus@samba.org>
      CC: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: linuxppc-dev@lists.ozlabs.org
      Suggested-by: Michael Ellerman <mpe@ellerman.id.au> (for non-exporting)
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NYury Norov <yury.norov@gmail.com>
      3e731203
  4. 18 6月, 2022 1 次提交
    • M
      powerpc/mm: Move CMA reservations after initmem_init() · 6cf06c17
      Michael Ellerman 提交于
      After commit 11ac3e87 ("mm: cma: use pageblock_order as the single
      alignment") there is an error at boot about the KVM CMA reservation
      failing, eg:
      
        kvm_cma_reserve: reserving 6553 MiB for global area
        cma: Failed to reserve 6553 MiB
      
      That makes it impossible to start KVM guests using the hash MMU with
      more than 2G of memory, because the VM is unable to allocate a large
      enough region for the hash page table, eg:
      
        $ qemu-system-ppc64 -enable-kvm -M pseries -m 4G ...
        qemu-system-ppc64: Failed to allocate KVM HPT of order 25: Cannot allocate memory
      
      Aneesh pointed out that this happens because when kvm_cma_reserve() is
      called, pageblock_order has not been initialised yet, and is still zero,
      causing the checks in cma_init_reserved_mem() against
      CMA_MIN_ALIGNMENT_PAGES to fail.
      
      Fix it by moving the call to kvm_cma_reserve() after initmem_init(). The
      pageblock_order is initialised in sparse_init() which is called from
      initmem_init().
      
      Also move the hugetlb CMA reservation.
      
      Fixes: 11ac3e87 ("mm: cma: use pageblock_order as the single alignment")
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Reviewed-by: NZi Yan <ziy@nvidia.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220616120033.1976732-1-mpe@ellerman.id.au
      6cf06c17
  5. 20 5月, 2022 1 次提交
  6. 19 5月, 2022 1 次提交
    • G
      powerpc/setup: Refactor/untangle panic notifiers · e2aa34ce
      Guilherme G. Piccoli 提交于
      The panic notifiers infrastructure is a bit limited in the scope of
      the callbacks - basically every kind of functionality is dropped
      in a list that runs in the same point during the kernel panic path.
      This is not really on par with the complexities and particularities
      of architecture / hypervisors' needs, and a refactor is ongoing.
      
      As part of this refactor, it was observed that powerpc has 2 notifiers,
      with mixed goals: one is just a KASLR offset dumper, whereas the other
      aims to hard-disable IRQs (necessary on panic path), warn firmware of
      the panic event (fadump) and run low-level platform-specific machinery
      that might stop kernel execution and never come back.
      
      Clearly, the 2nd notifier has opposed goals: disable IRQs / fadump
      should run earlier while low-level platform actions should
      run late since it might not even return. Hence, this patch decouples
      the notifiers splitting them in three:
      
      - First one is responsible for hard-disable IRQs and fadump,
      should run early;
      
      - The kernel KASLR offset dumper is really an informative notifier,
      harmless and may run at any moment in the panic path;
      
      - The last notifier should run last, since it aims to perform
      low-level actions for specific platforms, and might never return.
      It is also only registered for 2 platforms, pseries and ps3.
      
      The patch better documents the notifiers and clears the code too,
      also removing a useless header.
      
      Currently no functionality change should be observed, but after
      the planned panic refactor we should expect more panic reliability
      with this patch.
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@igalia.com>
      Reviewed-by: NHari Bathini <hbathini@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220427224924.592546-9-gpiccoli@igalia.com
      e2aa34ce
  7. 08 5月, 2022 1 次提交
  8. 05 5月, 2022 1 次提交
  9. 03 2月, 2022 1 次提交
    • F
      powerpc: Fix debug print in smp_setup_cpu_maps · b53c8610
      Fabiano Rosas 提交于
      When figuring out the number of threads, the debug message prints "1
      thread" for the first iteration of the loop, instead of the actual
      number of threads calculated from the length of the
      "ibm,ppc-interrupt-server#s" property.
      
        * /cpus/PowerPC,POWER8@20...
          ibm,ppc-interrupt-server#s -> 1 threads <--- WRONG
          thread 0 -> cpu 0 (hard id 32)
          thread 1 -> cpu 1 (hard id 33)
          thread 2 -> cpu 2 (hard id 34)
          thread 3 -> cpu 3 (hard id 35)
          thread 4 -> cpu 4 (hard id 36)
          thread 5 -> cpu 5 (hard id 37)
          thread 6 -> cpu 6 (hard id 38)
          thread 7 -> cpu 7 (hard id 39)
        * /cpus/PowerPC,POWER8@28...
          ibm,ppc-interrupt-server#s -> 8 threads
          thread 0 -> cpu 8 (hard id 40)
          thread 1 -> cpu 9 (hard id 41)
          thread 2 -> cpu 10 (hard id 42)
          thread 3 -> cpu 11 (hard id 43)
          thread 4 -> cpu 12 (hard id 44)
          thread 5 -> cpu 13 (hard id 45)
          thread 6 -> cpu 14 (hard id 46)
          thread 7 -> cpu 15 (hard id 47)
      (...)
      Signed-off-by: NFabiano Rosas <farosas@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210120181847.952106-1-farosas@linux.ibm.com
      b53c8610
  10. 29 11月, 2021 1 次提交
  11. 07 11月, 2021 2 次提交
  12. 22 10月, 2021 1 次提交
  13. 13 8月, 2021 1 次提交
  14. 09 7月, 2021 1 次提交
  15. 02 7月, 2021 1 次提交
  16. 24 6月, 2021 1 次提交
  17. 29 3月, 2021 1 次提交
  18. 24 3月, 2021 1 次提交
    • Z
      powerpc: Remove duplicate includes · 1a0e4550
      Zhang Yunkai 提交于
      asm/tm.h included in traps.c is duplicated. It is also included on
      the 62nd line.
      
      asm/udbg.h included in setup-common.c is duplicated. It is also
      included on the 61st line.
      
      asm/bug.h included in arch/powerpc/include/asm/book3s/64/mmu-hash.h
      is duplicated. It is also included on the 12th line.
      
      asm/tlbflush.h included in arch/powerpc/include/asm/pgtable.h is
      duplicated. It is also included on the 11th line.
      
      asm/page.h included in arch/powerpc/include/asm/thread_info.h is
      duplicated. It is also included on the 13th line.
      Signed-off-by: NZhang Yunkai <zhang.yunkai@zte.com.cn>
      [mpe: Squash together from multiple commits]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1a0e4550
  19. 31 1月, 2021 2 次提交
  20. 05 12月, 2020 1 次提交
  21. 02 11月, 2020 1 次提交
    • J
      powerpc/64: Set up a kernel stack for secondaries before cpu_restore() · 3c0b976b
      Jordan Niethe 提交于
      Currently in generic_secondary_smp_init(), cur_cpu_spec->cpu_restore()
      is called before a stack has been set up in r1. This was previously fine
      as the cpu_restore() functions were implemented in assembly and did not
      use a stack. However commit 5a61ef74 ("powerpc/64s: Support new
      device tree binding for discovering CPU features") used
      __restore_cpu_cpufeatures() as the cpu_restore() function for a
      device-tree features based cputable entry. This is a C function and
      hence uses a stack in r1.
      
      generic_secondary_smp_init() is entered on the secondary cpus via the
      primary cpu using the OPAL call opal_start_cpu(). In OPAL, each hardware
      thread has its own stack. The OPAL call is ran in the primary's hardware
      thread. During the call, a job is scheduled on a secondary cpu that will
      start executing at the address of generic_secondary_smp_init().  Hence
      the value that will be left in r1 when the secondary cpu enters the
      kernel is part of that secondary cpu's individual OPAL stack. This means
      that __restore_cpu_cpufeatures() will write to that OPAL stack. This is
      not horribly bad as each hardware thread has its own stack and the call
      that enters the kernel from OPAL never returns, but it is still wrong
      and should be corrected.
      
      Create the temp kernel stack before calling cpu_restore().
      
      As noted by mpe, for a kexec boot, the secondary CPUs are released from
      the spin loop at address 0x60 by smp_release_cpus() and then jump to
      generic_secondary_smp_init(). The call to smp_release_cpus() is in
      setup_arch(), and it comes before the call to emergency_stack_init().
      emergency_stack_init() allocates an emergency stack in the PACA for each
      CPU.  This address in the PACA is what is used to set up the temp kernel
      stack in generic_secondary_smp_init(). Move releasing the secondary CPUs
      to after the PACAs have been allocated an emergency stack, otherwise the
      PACA stack pointer will contain garbage and hence the temp kernel stack
      created from it will be broken.
      
      Fixes: 5a61ef74 ("powerpc/64s: Support new device tree binding for discovering CPU features")
      Signed-off-by: NJordan Niethe <jniethe5@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201014072837.24539-1-jniethe5@gmail.com
      3c0b976b
  22. 17 8月, 2020 1 次提交
  23. 29 7月, 2020 1 次提交
  24. 10 6月, 2020 2 次提交
    • M
      mm: reorder includes after introduction of linux/pgtable.h · 65fddcfc
      Mike Rapoport 提交于
      The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
      of the latter in the middle of asm includes.  Fix this up with the aid of
      the below script and manual adjustments here and there.
      
      	import sys
      	import re
      
      	if len(sys.argv) is not 3:
      	    print "USAGE: %s <file> <header>" % (sys.argv[0])
      	    sys.exit(1)
      
      	hdr_to_move="#include <linux/%s>" % sys.argv[2]
      	moved = False
      	in_hdrs = False
      
      	with open(sys.argv[1], "r") as f:
      	    lines = f.readlines()
      	    for _line in lines:
      		line = _line.rstrip('
      ')
      		if line == hdr_to_move:
      		    continue
      		if line.startswith("#include <linux/"):
      		    in_hdrs = True
      		elif not moved and in_hdrs:
      		    moved = True
      		    print hdr_to_move
      		print line
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      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: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65fddcfc
    • M
      mm: introduce include/linux/pgtable.h · ca5999fd
      Mike Rapoport 提交于
      The include/linux/pgtable.h is going to be the home of generic page table
      manipulation functions.
      
      Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
      make the latter include asm/pgtable.h.
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      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: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ca5999fd
  25. 28 5月, 2020 1 次提交
  26. 04 3月, 2020 1 次提交
  27. 14 1月, 2020 1 次提交
  28. 13 11月, 2019 1 次提交
  29. 23 8月, 2019 1 次提交
  30. 15 8月, 2019 1 次提交
    • N
      powerpc/64s: Make boot look nice(r) · 2b87a255
      Nicholas Piggin 提交于
      Radix boot looks like this:
      
       -----------------------------------------------------
       phys_mem_size     = 0x200000000
       dcache_bsize      = 0x80
       icache_bsize      = 0x80
       cpu_features      = 0x0000c06f8f5fb1a7
         possible        = 0x0000fbffcf5fb1a7
         always          = 0x00000003800081a1
       cpu_user_features = 0xdc0065c2 0xaee00000
       mmu_features      = 0xbc006041
       firmware_features = 0x0000000010000000
       hash-mmu: ppc64_pft_size    = 0x0
       hash-mmu: kernel vmalloc start   = 0xc008000000000000
       hash-mmu: kernel IO start        = 0xc00a000000000000
       hash-mmu: kernel vmemmap start   = 0xc00c000000000000
       -----------------------------------------------------
      
      Fix:
      
       -----------------------------------------------------
       phys_mem_size     = 0x200000000
       dcache_bsize      = 0x80
       icache_bsize      = 0x80
       cpu_features      = 0x0000c06f8f5fb1a7
         possible        = 0x0000fbffcf5fb1a7
         always          = 0x00000003800081a1
       cpu_user_features = 0xdc0065c2 0xaee00000
       mmu_features      = 0xbc006041
       firmware_features = 0x0000000010000000
       vmalloc start     = 0xc008000000000000
       IO start          = 0xc00a000000000000
       vmemmap start     = 0xc00c000000000000
       -----------------------------------------------------
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20190516020437.11783-1-npiggin@gmail.com
      2b87a255
  31. 31 5月, 2019 1 次提交
  32. 02 5月, 2019 6 次提交