Skip to content
Snippets Groups Projects
  1. Jul 10, 2022
  2. Jul 07, 2022
    • Tiezhu Yang's avatar
      LoongArch: Fix section mismatch warning · f0fbe652
      Tiezhu Yang authored
      
      init_numa_memory() is annotated __init and not used by any module,
      thus don't export it.
      
      Remove not needed EXPORT_SYMBOL for init_numa_memory() to fix the
      following section mismatch warning:
      
        MODPOST vmlinux.symvers
      WARNING: modpost: vmlinux.o(___ksymtab+init_numa_memory+0x0): Section mismatch in reference
      from the variable __ksymtab_init_numa_memory to the function .init.text:init_numa_memory()
      The symbol init_numa_memory is exported and annotated __init
      Fix this by removing the __init annotation of init_numa_memory or drop the export.
      
      This is build on Linux 5.19-rc4.
      
      Fixes: d4b6f156 ("LoongArch: Add Non-Uniform Memory Access (NUMA) support")
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      f0fbe652
    • Huacai Chen's avatar
      LoongArch: Fix build errors for tinyconfig · e6ee9023
      Huacai Chen authored
      
      Building loongarch:tinyconfig fails with the following error.
      
      ./arch/loongarch/include/asm/page.h: In function 'pfn_valid':
      ./arch/loongarch/include/asm/page.h:42:32: error: 'PHYS_OFFSET' undeclared
      
      Add the missing include file and fix succeeding vdso errors.
      
      Fixes: 09cfefb7 ("LoongArch: Add memory management")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      e6ee9023
    • Qi Hu's avatar
      LoongArch: Remove obsolete mentions of vcsr · 11238099
      Qi Hu authored
      
      The `vcsr` only exists in the old hardware design, it isn't used in any
      shipped hardware from Loongson-3A5000 on. Both scalar FP and LSX/LASX
      instructions use the `fcsr` as their control and status registers now.
      For example, the RM control bit in fcsr0 is shared by FP, LSX and LASX
      instructions.
      
      Particularly, fcsr16 to fcsr31 are reserved for LSX/LASX now, access to
      these registers has no visible effect if LSX/LASX is enabled, and will
      cause SXD/ASXD exceptions if LSX/LASX is not enabled.
      
      So, mentions of vcsr are obsolete in the first place (it was just used
      for debugging), let's remove them.
      
      Reviewed-by: default avatarWANG Xuerui <git@xen0n.name>
      Signed-off-by: default avatarQi Hu <huqi@loongson.cn>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      11238099
    • Lukas Bulwahn's avatar
      LoongArch: Drop these obsolete selects in Kconfig · 7fd6ef61
      Lukas Bulwahn authored
      
      Commit fa96b57c ("LoongArch: Add build infrastructure") adds the new
      file arch/loongarch/Kconfig.
      
      As the work on LoongArch was probably quite some time under development,
      various config symbols have changed and disappeared from the time of
      initial writing of the Kconfig file and its inclusion in the repository.
      
      The following four commits:
      
        commit c126a53c ("arch: remove GENERIC_FIND_FIRST_BIT entirely")
        commit 140c8180 ("arch: remove HAVE_COPY_THREAD_TLS")
        commit aca52c39 ("mm: remove CONFIG_HAVE_MEMBLOCK")
        commit 3f08a302 ("mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option")
      
      remove the mentioned config symbol, and enable the intended setup by
      default without configuration.
      
      Drop these obsolete selects in loongarch's Kconfig.
      
      Reviewed-by: default avatarWANG Xuerui <git@xen0n.name>
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      7fd6ef61
  3. Jul 06, 2022
  4. Jul 05, 2022
  5. Jul 04, 2022
  6. Jul 02, 2022
  7. Jul 01, 2022
  8. Jun 30, 2022
  9. Jun 29, 2022
    • Aneesh Kumar K.V's avatar
      powerpc/memhotplug: Add add_pages override for PPC · ac790d09
      Aneesh Kumar K.V authored
      
      With commit ffa0b64e ("powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit")
      the kernel now validate the addr against high_memory value. This results
      in the below BUG_ON with dax pfns.
      
      [  635.798741][T26531] kernel BUG at mm/page_alloc.c:5521!
      1:mon> e
      cpu 0x1: Vector: 700 (Program Check) at [c000000007287630]
          pc: c00000000055ed48: free_pages.part.0+0x48/0x110
          lr: c00000000053ca70: tlb_finish_mmu+0x80/0xd0
          sp: c0000000072878d0
         msr: 800000000282b033
        current = 0xc00000000afabe00
        paca    = 0xc00000037ffff300   irqmask: 0x03   irq_happened: 0x05
          pid   = 26531, comm = 50-landscape-sy
      kernel BUG at :5521!
      Linux version 5.19.0-rc3-14659-g4ec05be7c2e1 (kvaneesh@ltc-boston8) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #625 SMP Thu Jun 23 00:35:43 CDT 2022
      1:mon> t
      [link register   ] c00000000053ca70 tlb_finish_mmu+0x80/0xd0
      [c0000000072878d0] c00000000053ca54 tlb_finish_mmu+0x64/0xd0 (unreliable)
      [c000000007287900] c000000000539424 exit_mmap+0xe4/0x2a0
      [c0000000072879e0] c00000000019fc1c mmput+0xcc/0x210
      [c000000007287a20] c000000000629230 begin_new_exec+0x5e0/0xf40
      [c000000007287ae0] c00000000070b3cc load_elf_binary+0x3ac/0x1e00
      [c000000007287c10] c000000000627af0 bprm_execve+0x3b0/0xaf0
      [c000000007287cd0] c000000000628414 do_execveat_common.isra.0+0x1e4/0x310
      [c000000007287d80] c00000000062858c sys_execve+0x4c/0x60
      [c000000007287db0] c00000000002c1b0 system_call_exception+0x160/0x2c0
      [c000000007287e10] c00000000000c53c system_call_common+0xec/0x250
      
      The fix is to make sure we update high_memory on memory hotplug.
      This is similar to what x86 does in commit 3072e413 ("mm/memory_hotplug: introduce add_pages")
      
      Fixes: ffa0b64e ("powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit")
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220629050925.31447-1-aneesh.kumar@linux.ibm.com
      ac790d09
    • Naveen N Rao's avatar
      powerpc/bpf: Fix use of user_pt_regs in uapi · b21bd5a4
      Naveen N Rao authored
      
      Trying to build a .c file that includes <linux/bpf_perf_event.h>:
        $ cat test_bpf_headers.c
        #include <linux/bpf_perf_event.h>
      
      throws the below error:
        /usr/include/linux/bpf_perf_event.h:14:28: error: field ‘regs’ has incomplete type
           14 |         bpf_user_pt_regs_t regs;
      	|                            ^~~~
      
      This is because we typedef bpf_user_pt_regs_t to 'struct user_pt_regs'
      in arch/powerpc/include/uaps/asm/bpf_perf_event.h, but 'struct
      user_pt_regs' is not exposed to userspace.
      
      Powerpc has both pt_regs and user_pt_regs structures. However, unlike
      arm64 and s390, we expose user_pt_regs to userspace as just 'pt_regs'.
      As such, we should typedef bpf_user_pt_regs_t to 'struct pt_regs' for
      userspace.
      
      Within the kernel though, we want to typedef bpf_user_pt_regs_t to
      'struct user_pt_regs'.
      
      Remove arch/powerpc/include/uapi/asm/bpf_perf_event.h so that the
      uapi/asm-generic version of the header is exposed to userspace.
      Introduce arch/powerpc/include/asm/bpf_perf_event.h so that we can
      typedef bpf_user_pt_regs_t to 'struct user_pt_regs' for use within the
      kernel.
      
      Note that this was not showing up with the bpf selftest build since
      tools/include/uapi/asm/bpf_perf_event.h didn't include the powerpc
      variant.
      
      Fixes: a6460b03 ("powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT")
      Cc: stable@vger.kernel.org # v4.20+
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      [mpe: Use typical naming for header include guard]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220627191119.142867-1-naveen.n.rao@linux.vnet.ibm.com
      b21bd5a4
  10. Jun 28, 2022
  11. Jun 27, 2022
Loading