11 Feb, 2020

1 commit

  • commit f1003b787c00fbaa4b11619c6b23a885bfce8f07 upstream.

    The BPF JIT incorrectly clobbered the a0 register, and did not flag
    usage of s5 register when BPF stack was being used.

    Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G")
    Signed-off-by: Björn Töpel
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20191216091343.23260-2-bjorn.topel@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Björn Töpel
     

06 Feb, 2020

1 commit

  • [ Upstream commit 95f4d9cced96afa9c69b3da8e79e96102c84fc60 ]

    Temporary files used in the VDSO build process linger on even after make
    mrproper: vdso-dummy.o.tmp, vdso.so.dbg.tmp.

    Delete them once they're no longer needed.

    Signed-off-by: Ilie Halip
    Signed-off-by: Paul Walmsley
    Signed-off-by: Sasha Levin

    Ilie Halip
     

18 Jan, 2020

1 commit

  • [ Upstream commit 1833e327a5ea1d1f356fbf6ded0760c9ff4b0594 ]

    This is needed by LKDTM (crash dump test module), it calls
    flush_icache_range(), which on RISC-V turns into flush_icache_all(). On
    other architectures, the actual implementation is exported, so follow
    that precedence and export it here too.

    Fixes build of CONFIG_LKDTM that fails with:
    ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

    Signed-off-by: Olof Johansson
    Signed-off-by: Paul Walmsley
    Signed-off-by: Sasha Levin

    Olof Johansson
     

15 Jan, 2020

1 commit

  • commit 20bda4ed62f507ed72e30e817b43c65fdba60be7 upstream.

    This is required for clone3 which passes the TLS value through a
    struct rather than a register.

    Signed-off-by: Amanieu d'Antras
    Cc: linux-riscv@lists.infradead.org
    Cc: # 5.3.x
    Link: https://lore.kernel.org/r/20200102172413.654385-6-amanieu@gmail.com
    Signed-off-by: Christian Brauner
    Signed-off-by: Greg Kroah-Hartman

    Amanieu d'Antras
     

12 Jan, 2020

1 commit

  • [ Upstream commit 96bc4432f5ade1045521f3b247f516b1478166bd ]

    All BPF JIT compilers except RISC-V's and MIPS' enforce a 33-tail calls
    limit at runtime. In addition, a test was recently added, in tailcalls2,
    to check this limit.

    This patch updates the tail call limit in RISC-V's JIT compiler to allow
    33 tail calls. I tested it using the above selftest on an emulated
    RISCV64.

    Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G")
    Reported-by: Mahshid Khezri
    Signed-off-by: Paul Chaignon
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Acked-by: Martin KaFai Lau
    Link: https://lore.kernel.org/bpf/966fe384383bf23a0ee1efe8d7291c78a3fb832b.1575916815.git.paul.chaignon@gmail.com
    Signed-off-by: Sasha Levin

    Paul Chaignon
     

09 Jan, 2020

1 commit

  • commit 1d8f65798240b6577d8c44d20c8ea8f1d429e495 upstream.

    The condition should be logical NOT to assign the hook address to parent
    address. Because the return value 0 of function_graph_enter upon
    success.

    Fixes: e949b6db51dc (riscv/function_graph: Simplify with function_graph_enter())
    Signed-off-by: Zong Li
    Reviewed-by: Steven Rostedt (VMware)
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Walmsley
    Signed-off-by: Greg Kroah-Hartman

    Zong Li
     

29 Oct, 2019

1 commit

  • For legacy I/O BARs (non-MMIO BARs) to work correctly on RISC-V Linux,
    we need to establish a reserved memory region for them, so that drivers
    that wish to use the legacy I/O BARs can issue reads and writes against
    a memory region that is mapped to the host PCIe controller's I/O BAR
    mapping.

    Signed-off-by: Yash Shah
    Signed-off-by: Paul Walmsley

    Yash Shah
     

28 Oct, 2019

6 commits

  • Rather than adding prototypes for C functions called only by assembly
    code, mark them as __visible. This avoids adding prototypes that will
    never be used by the callers. Resolves the following sparse warnings:

    arch/riscv/kernel/irq.c:27:29: warning: symbol 'do_IRQ' was not declared. Should it be static?
    arch/riscv/kernel/ptrace.c:151:6: warning: symbol 'do_syscall_trace_enter' was not declared. Should it be static?
    arch/riscv/kernel/ptrace.c:165:6: warning: symbol 'do_syscall_trace_exit' was not declared. Should it be static?
    arch/riscv/kernel/signal.c:295:17: warning: symbol 'do_notify_resume' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:92:1: warning: symbol 'do_trap_unknown' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:94:1: warning: symbol 'do_trap_insn_misaligned' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:96:1: warning: symbol 'do_trap_insn_fault' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:98:1: warning: symbol 'do_trap_insn_illegal' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:100:1: warning: symbol 'do_trap_load_misaligned' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:102:1: warning: symbol 'do_trap_load_fault' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:104:1: warning: symbol 'do_trap_store_misaligned' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:106:1: warning: symbol 'do_trap_store_fault' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:108:1: warning: symbol 'do_trap_ecall_u' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:110:1: warning: symbol 'do_trap_ecall_s' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:112:1: warning: symbol 'do_trap_ecall_m' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:124:17: warning: symbol 'do_trap_break' was not declared. Should it be static?
    arch/riscv/kernel/smpboot.c:136:24: warning: symbol 'smp_callin' was not declared. Should it be static?

    Based on a suggestion from Luc Van Oostenryck.

    This version includes changes based on feedback from Christoph Hellwig
    .

    Signed-off-by: Paul Walmsley
    Cc: Luc Van Oostenryck
    Reviewed-by: Christoph Hellwig # for do_syscall_trace_*

    Paul Walmsley
     
  • The __user annotations were removed from the {save,restore}_fp_state()
    function signatures by commit 007f5c358957 ("Refactor FPU code in
    signal setup/return procedures"), but should be present, and sparse
    warns when they are not applied. Add them back in.

    This change should have no functional impact.

    Signed-off-by: Paul Walmsley
    Fixes: 007f5c358957 ("Refactor FPU code in signal setup/return procedures")
    Cc: Alan Kao
    Reviewed-by: Christoph Hellwig

    Paul Walmsley
     
  • sparse identifies several missing prototypes caused by missing
    preprocessor include directives:

    arch/riscv/kernel/cpufeature.c:16:6: warning: symbol 'has_fpu' was not declared. Should it be static?
    arch/riscv/kernel/process.c:26:6: warning: symbol 'arch_cpu_idle' was not declared. Should it be static?
    arch/riscv/kernel/reset.c:15:6: warning: symbol 'pm_power_off' was not declared. Should it be static?
    arch/riscv/kernel/syscall_table.c:15:6: warning: symbol 'sys_call_table' was not declared. Should it be static?
    arch/riscv/kernel/traps.c:149:13: warning: symbol 'trap_init' was not declared. Should it be static?
    arch/riscv/kernel/vdso.c:54:5: warning: symbol 'arch_setup_additional_pages' was not declared. Should it be static?
    arch/riscv/kernel/smp.c:64:6: warning: symbol 'arch_match_cpu_phys_id' was not declared. Should it be static?
    arch/riscv/kernel/module-sections.c:89:5: warning: symbol 'module_frob_arch_sections' was not declared. Should it be static?
    arch/riscv/mm/context.c:42:6: warning: symbol 'switch_mm' was not declared. Should it be static?

    Fix by including the appropriate header files in the appropriate
    source files.

    This patch should have no functional impact.

    Signed-off-by: Paul Walmsley
    Reviewed-by: Christoph Hellwig

    Paul Walmsley
     
  • Several functions and arrays which are only used in the files in which
    they are declared are missing "static" qualifiers. Warnings for these
    symbols are reported by sparse:

    arch/riscv/kernel/vdso.c:28:18: warning: symbol 'vdso_data' was not declared. Should it be static?
    arch/riscv/mm/sifive_l2_cache.c:145:12: warning: symbol 'sifive_l2_init' was not declared. Should it be static?

    Resolve these warnings by marking them as static.

    This version incorporates feedback from Greentime Hu
    .

    Signed-off-by: Paul Walmsley
    Reviewed-by: Christoph Hellwig
    Cc: Greentime Hu

    Paul Walmsley
     
  • sparse complains loudly when string literals associated with
    preprocessor directives are split into multiple, separately quoted
    strings across different lines:

    arch/riscv/mm/init.c:341:9: error: Expected ; at the end of type declaration
    arch/riscv/mm/init.c:341:9: error: got "not use absolute addressing."
    arch/riscv/mm/init.c:358:9: error: Trying to use reserved word 'do' as identifier
    arch/riscv/mm/init.c:358:9: error: Expected ; at end of declaration
    [ ... ]

    It turns out this doesn't compile. The existing Linux practice for
    this situation is simply to use a single long line. So, fix by
    concatenating the strings.

    This patch should have no functional impact.

    This version incorporates changes based on feedback from Luc Van
    Oostenryck .

    Signed-off-by: Paul Walmsley
    Reviewed-by: Luc Van Oostenryck
    Reviewed-by: Christoph Hellwig
    Link: https://lore.kernel.org/linux-riscv/CAAhSdy2nX2LwEEAZuMtW_ByGTkHO6KaUEvVxRnba_ENEjmFayQ@mail.gmail.com/T/#mc1a58bc864f71278123d19a7abc083a9c8e37033
    Fixes: 387181dcdb6c1 ("RISC-V: Always compile mm/init.c with cmodel=medany and notrace")
    Cc: Anup Patel

    Paul Walmsley
     
  • Add prototypes for assembly language functions defined in head.S,
    and include these prototypes into C source files that call those
    functions.

    This patch resolves the following warnings from sparse:

    arch/riscv/kernel/setup.c:39:10: warning: symbol 'hart_lottery' was not declared. Should it be static?
    arch/riscv/kernel/setup.c:42:13: warning: symbol 'parse_dtb' was not declared. Should it be static?
    arch/riscv/kernel/smpboot.c:33:6: warning: symbol '__cpu_up_stack_pointer' was not declared. Should it be static?
    arch/riscv/kernel/smpboot.c:34:6: warning: symbol '__cpu_up_task_pointer' was not declared. Should it be static?
    arch/riscv/mm/fault.c:25:17: warning: symbol 'do_page_fault' was not declared. Should it be static?

    This change should have no functional impact.

    Signed-off-by: Paul Walmsley

    Paul Walmsley
     

26 Oct, 2019

1 commit

  • If we always compile the get_break_insn_length inline function we can
    remove the ifdefs and let dead code elimination take care of the warn
    branch that is now unreadable because the report_bug stub always
    returns BUG_TRAP_TYPE_BUG.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Anup Patel
    Signed-off-by: Paul Walmsley

    Christoph Hellwig
     

24 Oct, 2019

4 commits

  • Remove various not required ifdefs and externs.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Anup Patel
    Signed-off-by: Paul Walmsley

    Christoph Hellwig
     
  • Using CONFIG_SPARSEMEM_VMEMMAP instead of CONFIG_SPARSEMEM to fix
    following build issue.

    riscv64-linux-ld: arch/riscv/mm/init.o: in function 'vmemmap_populate':
    init.c:(.meminit.text+0x8): undefined reference to 'vmemmap_populate_basepages'

    Cc: Logan Gunthorpe
    Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
    Signed-off-by: Kefeng Wang
    Reviewed-by: Logan Gunthorpe
    Signed-off-by: Paul Walmsley

    Kefeng Wang
     
  • With CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP,

    arch/riscv/include/asm/pgtable.h: In function ‘mk_pte’:
    include/asm-generic/memory_model.h:64:14: error: implicit declaration of function ‘page_to_section’; did you mean ‘present_section’? [-Werror=implicit-function-declaration]
    int __sec = page_to_section(__pg); \
    ^~~~~~~~~~~~~~~

    Fixed by changing mk_pte() from inline function to macro.

    Cc: Logan Gunthorpe
    Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
    Signed-off-by: Kefeng Wang
    [paul.walmsley@sifive.com: fixed checkpatch errors]
    Signed-off-by: Paul Walmsley

    Kefeng Wang
     
  • Failed to compile Fedora/RISCV kernel (5.4-rc3+) with sparsemem enabled:

    fs/proc/kcore.c: In function 'read_kcore':
    fs/proc/kcore.c:510:8: error: implicit declaration of function 'kern_addr_valid'; did you mean 'virt_addr_valid'? [-Werror=implicit-function-declaration]
    510 | if (kern_addr_valid(start)) {
    | ^~~~~~~~~~~~~~~
    | virt_addr_valid

    Looking at other architectures I don't see kern_addr_valid being guarded by
    CONFIG_FLATMEM.

    Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
    Signed-off-by: David Abdurachmanov
    Tested-by: David Abdurachmanov
    Reviewed-by: Logan Gunthorpe
    Signed-off-by: Paul Walmsley

    David Abdurachmanov
     

16 Oct, 2019

1 commit


15 Oct, 2019

3 commits

  • Remove a confusing comment on our local_flush_tlb_all()
    implementation. Per an internal discussion with Andrew, while it's
    true that the fence.i is not necessary, it's not the case that an
    sfence.vma implies a fence.i. We also drop the section about
    "flush[ing] the entire local TLB" to better align with the language in
    section 4.2.1 "Supervisor Memory-Management Fence Instruction" of the
    RISC-V Privileged Specification v20190608.

    Fixes: c901e45a999a1 ("RISC-V: `sfence.vma` orderes the instruction cache")
    Reported-by: Alan Kao
    Cc: Palmer Dabbelt
    Cc: Andrew Waterman
    Signed-off-by: Paul Walmsley

    Paul Walmsley
     
  • Add a default "stdout-path" to the kernel DTS file, as is present in many
    of the board DTS files elsewhere in the kernel tree. With this line
    present, earlyconsole can be enabled by simply passing "earlycon" on the
    kernel command line. No specific device details are necessary, since the
    kernel will use the stdout-path as the default.

    Signed-off-by: Paul Walmsley
    Reviewed-by: Atish Patra

    Paul Walmsley
     
  • To make the code more straightforward, replace the switch statement
    with an if statement.

    Suggested-by: Paul Walmsley
    Signed-off-by: Vincent Chen
    [paul.walmsley@sifive.com: cleaned up patch description; updated to
    apply]
    Link: https://lore.kernel.org/linux-riscv/20190927224711.GI4700@infradead.org/
    Link: https://lore.kernel.org/linux-riscv/CABvJ_xiHJSB7P5QekuLRP=LBPzXXghAfuUpPUYb=a_HbnOQ6BA@mail.gmail.com/
    Link: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/VDCU2WOB6KQISREO4V5DTXEI2M7VOV55/
    Cc: Christoph Hellwig
    Signed-off-by: Paul Walmsley

    Vincent Chen
     

10 Oct, 2019

1 commit


08 Oct, 2019

3 commits

  • For the kernel space, all ebreak instructions are determined at compile
    time because the kernel space debugging module is currently unsupported.
    Hence, it should be treated as a bug if an ebreak instruction which does
    not belong to BUG_TRAP_TYPE_WARN or BUG_TRAP_TYPE_BUG is executed in
    kernel space. For the userspace, debugging module or user problem may
    intentionally insert an ebreak instruction to trigger a SIGTRAP signal.
    To approach the above two situations, the do_trap_break() will direct
    the BUG_TRAP_TYPE_NONE ebreak exception issued in kernel space to die()
    and will send a SIGTRAP to the trapped process only when the ebreak is
    in userspace.

    Signed-off-by: Vincent Chen
    Reviewed-by: Christoph Hellwig
    [paul.walmsley@sifive.com: fixed checkpatch issue]
    Signed-off-by: Paul Walmsley

    Vincent Chen
     
  • On RISC-V, when the kernel runs code on behalf of a user thread, and the
    kernel executes a WARN() or WARN_ON(), the user thread will be sent
    a bogus SIGTRAP. Fix the RISC-V kernel code to not send a SIGTRAP when
    a WARN()/WARN_ON() is executed.

    Signed-off-by: Vincent Chen
    Reviewed-by: Christoph Hellwig
    [paul.walmsley@sifive.com: fixed subject]
    Signed-off-by: Paul Walmsley

    Vincent Chen
     
  • When the CONFIG_GENERIC_BUG is disabled by disabling CONFIG_BUG, if a
    kernel thread is trapped by BUG(), the whole system will be in the
    loop that infinitely handles the ebreak exception instead of entering the
    die function. To fix this problem, the do_trap_break() will always call
    the die() to deal with the break exception as the type of break is
    BUG_TRAP_TYPE_BUG.

    Signed-off-by: Vincent Chen
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Paul Walmsley

    Vincent Chen
     

02 Oct, 2019

2 commits

  • This fixes an error with how the FDT blob is reserved in memblock.
    An incorrect physical address calculation exposed the FDT header to
    unintended corruption, which typically manifested with of_fdt_raw_init()
    faulting during late boot after fdt_totalsize() returned a wrong value.
    Systems with smaller physical memory sizes more frequently trigger this
    issue, as the kernel is more likely to allocate from the DMA32 zone
    where bbl places the DTB after the kernel image.

    Commit 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages")
    changed the mapping of the DTB to reside in the fixmap area.
    Consequently, early_init_fdt_reserve_self() cannot be used anymore in
    setup_bootmem() since it relies on __pa() to derive a physical address,
    which does not work with dtb_early_va that is no longer a valid kernel
    logical address.

    The reserved[0x1] region shows the effect of the pointer underflow
    resulting from the __pa(initial_boot_params) offset subtraction:

    [ 0.000000] MEMBLOCK configuration:
    [ 0.000000] memory size = 0x000000001fe00000 reserved size = 0x0000000000a2e514
    [ 0.000000] memory.cnt = 0x1
    [ 0.000000] memory[0x0] [0x0000000080200000-0x000000009fffffff], 0x000000001fe00000 bytes flags: 0x0
    [ 0.000000] reserved.cnt = 0x2
    [ 0.000000] reserved[0x0] [0x0000000080200000-0x0000000080c2dfeb], 0x0000000000a2dfec bytes flags: 0x0
    [ 0.000000] reserved[0x1] [0xfffffff080100000-0xfffffff080100527], 0x0000000000000528 bytes flags: 0x0

    With the fix applied:

    [ 0.000000] MEMBLOCK configuration:
    [ 0.000000] memory size = 0x000000001fe00000 reserved size = 0x0000000000a2e514
    [ 0.000000] memory.cnt = 0x1
    [ 0.000000] memory[0x0] [0x0000000080200000-0x000000009fffffff], 0x000000001fe00000 bytes flags: 0x0
    [ 0.000000] reserved.cnt = 0x2
    [ 0.000000] reserved[0x0] [0x0000000080200000-0x0000000080c2dfeb], 0x0000000000a2dfec bytes flags: 0x0
    [ 0.000000] reserved[0x1] [0x0000000080e00000-0x0000000080e00527], 0x0000000000000528 bytes flags: 0x0

    Fixes: 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages")
    Signed-off-by: Albert Ou
    Tested-by: Bin Meng
    Reviewed-by: Anup Patel
    Signed-off-by: Paul Walmsley

    Albert Ou
     
  • This is almost entirely a comment. The bug is unlikely to manifest on
    existing hardware because there is a timeout on load reservations, but
    manifests on QEMU because there is no timeout.

    Signed-off-by: Palmer Dabbelt
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Paul Walmsley

    Palmer Dabbelt
     

28 Sep, 2019

1 commit

  • Pull more RISC-V updates from Paul Walmsley:
    "Some additional RISC-V updates.

    This includes one significant fix:

    - Prevent interrupts from being unconditionally re-enabled during
    exception handling if they were disabled in the context in which
    the exception occurred

    Also a few other fixes:

    - Fix a build error when sparse memory support is manually enabled

    - Prevent CPUs beyond CONFIG_NR_CPUS from being enabled in early boot

    And a few minor improvements:

    - DT improvements: in the FU540 SoC DT files, improve U-Boot
    compatibility by adding an "ethernet0" alias, drop an unnecessary
    property from the DT files, and add support for the PWM device

    - KVM preparation: add a KVM-related macro for future RISC-V KVM
    support, and export some symbols required to build KVM support as
    modules

    - defconfig additions: build more drivers by default for QEMU
    configurations"

    * tag 'riscv/for-v5.4-rc1-b' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
    riscv: Avoid interrupts being erroneously enabled in handle_exception()
    riscv: dts: sifive: Drop "clock-frequency" property of cpu nodes
    riscv: dts: sifive: Add ethernet0 to the aliases node
    RISC-V: Export kernel symbols for kvm
    KVM: RISC-V: Add KVM_REG_RISCV for ONE_REG interface
    arch/riscv: disable excess harts before picking main boot hart
    RISC-V: Enable VIRTIO drivers in RV64 and RV32 defconfig
    RISC-V: Fix building error when CONFIG_SPARSEMEM_MANUAL=y
    riscv: dts: Add DT support for SiFive FU540 PWM driver

    Linus Torvalds
     

27 Sep, 2019

1 commit

  • The naming of pgtable_page_{ctor,dtor}() seems to have confused a few
    people, and until recently arm64 used these erroneously/pointlessly for
    other levels of page table.

    To make it incredibly clear that these only apply to the PTE level, and to
    align with the naming of pgtable_pmd_page_{ctor,dtor}(), let's rename them
    to pgtable_pte_page_{ctor,dtor}().

    These changes were generated with the following shell script:

    ----
    git grep -lw 'pgtable_page_.tor' | while read FILE; do
    sed -i '{s/pgtable_page_ctor/pgtable_pte_page_ctor/}' $FILE;
    sed -i '{s/pgtable_page_dtor/pgtable_pte_page_dtor/}' $FILE;
    done
    ----

    ... with the documentation re-flowed to remain under 80 columns, and
    whitespace fixed up in macros to keep backslashes aligned.

    There should be no functional change as a result of this patch.

    Link: http://lkml.kernel.org/r/20190722141133.3116-1-mark.rutland@arm.com
    Signed-off-by: Mark Rutland
    Reviewed-by: Mike Rapoport
    Acked-by: Geert Uytterhoeven [m68k]
    Cc: Anshuman Khandual
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Yu Zhao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rutland
     

25 Sep, 2019

3 commits

  • In order to avoid wasting user address space by using bottom-up mmap
    allocation scheme, prefer top-down scheme when possible.

    Before:
    root@qemuriscv64:~# cat /proc/self/maps
    00010000-00016000 r-xp 00000000 fe:00 6389 /bin/cat.coreutils
    00016000-00017000 r--p 00005000 fe:00 6389 /bin/cat.coreutils
    00017000-00018000 rw-p 00006000 fe:00 6389 /bin/cat.coreutils
    00018000-00039000 rw-p 00000000 00:00 0 [heap]
    1555556000-155556d000 r-xp 00000000 fe:00 7193 /lib/ld-2.28.so
    155556d000-155556e000 r--p 00016000 fe:00 7193 /lib/ld-2.28.so
    155556e000-155556f000 rw-p 00017000 fe:00 7193 /lib/ld-2.28.so
    155556f000-1555570000 rw-p 00000000 00:00 0
    1555570000-1555572000 r-xp 00000000 00:00 0 [vdso]
    1555574000-1555576000 rw-p 00000000 00:00 0
    1555576000-1555674000 r-xp 00000000 fe:00 7187 /lib/libc-2.28.so
    1555674000-1555678000 r--p 000fd000 fe:00 7187 /lib/libc-2.28.so
    1555678000-155567a000 rw-p 00101000 fe:00 7187 /lib/libc-2.28.so
    155567a000-15556a0000 rw-p 00000000 00:00 0
    3fffb90000-3fffbb1000 rw-p 00000000 00:00 0 [stack]

    After:
    root@qemuriscv64:~# cat /proc/self/maps
    00010000-00016000 r-xp 00000000 fe:00 6389 /bin/cat.coreutils
    00016000-00017000 r--p 00005000 fe:00 6389 /bin/cat.coreutils
    00017000-00018000 rw-p 00006000 fe:00 6389 /bin/cat.coreutils
    2de81000-2dea2000 rw-p 00000000 00:00 0 [heap]
    3ff7eb6000-3ff7ed8000 rw-p 00000000 00:00 0
    3ff7ed8000-3ff7fd6000 r-xp 00000000 fe:00 7187 /lib/libc-2.28.so
    3ff7fd6000-3ff7fda000 r--p 000fd000 fe:00 7187 /lib/libc-2.28.so
    3ff7fda000-3ff7fdc000 rw-p 00101000 fe:00 7187 /lib/libc-2.28.so
    3ff7fdc000-3ff7fe2000 rw-p 00000000 00:00 0
    3ff7fe4000-3ff7fe6000 r-xp 00000000 00:00 0 [vdso]
    3ff7fe6000-3ff7ffd000 r-xp 00000000 fe:00 7193 /lib/ld-2.28.so
    3ff7ffd000-3ff7ffe000 r--p 00016000 fe:00 7193 /lib/ld-2.28.so
    3ff7ffe000-3ff7fff000 rw-p 00017000 fe:00 7193 /lib/ld-2.28.so
    3ff7fff000-3ff8000000 rw-p 00000000 00:00 0
    3fff888000-3fff8a9000 rw-p 00000000 00:00 0 [stack]

    [alex@ghiti.fr: v6]
    Link: http://lkml.kernel.org/r/20190808061756.19712-15-alex@ghiti.fr
    Link: http://lkml.kernel.org/r/20190730055113.23635-15-alex@ghiti.fr
    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Kees Cook
    Reviewed-by: Luis Chamberlain
    Acked-by: Paul Walmsley [arch/riscv]
    Cc: Albert Ou
    Cc: Alexander Viro
    Cc: Catalin Marinas
    Cc: Christoph Hellwig
    Cc: James Hogan
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Ralf Baechle
    Cc: Russell King
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Ghiti
     
  • Both pgtable_cache_init() and pgd_cache_init() are used to initialize kmem
    cache for page table allocations on several architectures that do not use
    PAGE_SIZE tables for one or more levels of the page table hierarchy.

    Most architectures do not implement these functions and use __weak default
    NOP implementation of pgd_cache_init(). Since there is no such default
    for pgtable_cache_init(), its empty stub is duplicated among most
    architectures.

    Rename the definitions of pgd_cache_init() to pgtable_cache_init() and
    drop empty stubs of pgtable_cache_init().

    Link: http://lkml.kernel.org/r/1566457046-22637-1-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Will Deacon [arm64]
    Acked-by: Thomas Gleixner [x86]
    Cc: Catalin Marinas
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Patch series "mm: remove quicklist page table caches".

    A while ago Nicholas proposed to remove quicklist page table caches [1].

    I've rebased his patch on the curren upstream and switched ia64 and sh to
    use generic versions of PTE allocation.

    [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com

    This patch (of 3):

    Remove page table allocator "quicklists". These have been around for a
    long time, but have not got much traction in the last decade and are only
    used on ia64 and sh architectures.

    The numbers in the initial commit look interesting but probably don't
    apply anymore. If anybody wants to resurrect this it's in the git
    history, but it's unhelpful to have this code and divergent allocator
    behaviour for minor archs.

    Also it might be better to instead make more general improvements to page
    allocator if this is still so slow.

    Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Mike Rapoport
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     

20 Sep, 2019

6 commits

  • When the handle_exception function addresses an exception, the interrupts
    will be unconditionally enabled after finishing the context save. However,
    It may erroneously enable the interrupts if the interrupts are disabled
    before entering the handle_exception.

    For example, one of the WARN_ON() condition is satisfied in the scheduling
    where the interrupt is disabled and rq.lock is locked. The WARN_ON will
    trigger a break exception and the handle_exception function will enable the
    interrupts before entering do_trap_break function. During the procedure, if
    a timer interrupt is pending, it will be taken when interrupts are enabled.
    In this case, it may cause a deadlock problem if the rq.lock is locked
    again in the timer ISR.

    Hence, the handle_exception() can only enable interrupts when the state of
    sstatus.SPIE is 1.

    This patch is tested on HiFive Unleashed board.

    Signed-off-by: Vincent Chen
    Reviewed-by: Palmer Dabbelt
    [paul.walmsley@sifive.com: updated to apply]
    Fixes: bcae803a21317 ("RISC-V: Enable IRQ during exception handling")
    Cc: David Abdurachmanov
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Walmsley

    Vincent Chen
     
  • The "clock-frequency" property of cpu nodes isn't required. Drop it.

    Signed-off-by: Bin Meng
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Paul Walmsley

    Bin Meng
     
  • U-Boot expects this alias to be in place in order to fix up the mac
    address of the ethernet node.

    Signed-off-by: Bin Meng
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Paul Walmsley

    Bin Meng
     
  • Pull Kbuild updates from Masahiro Yamada:

    - add modpost warn exported symbols marked as 'static' because 'static'
    and EXPORT_SYMBOL is an odd combination

    - break the build early if gold linker is used

    - optimize the Bison rule to produce .c and .h files by a single
    pattern rule

    - handle PREEMPT_RT in the module vermagic and UTS_VERSION

    - warn CONFIG options leaked to the user-space except existing ones

    - make single targets work properly

    - rebuild modules when module linker scripts are updated

    - split the module final link stage into scripts/Makefile.modfinal

    - fix the missed error code in merge_config.sh

    - improve the error message displayed on the attempt of the O= build in
    unclean source tree

    - remove 'clean-dirs' syntax

    - disable -Wimplicit-fallthrough warning for Clang

    - add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC

    - remove ARCH_{CPP,A,C}FLAGS variables

    - add $(BASH) to run bash scripts

    - change *CFLAGS_.o to take the relative path to $(obj)
    instead of the basename

    - stop suppressing Clang's -Wunused-function warnings when W=1

    - fix linux/export.h to avoid genksyms calculating CRC of trimmed
    exported symbols

    - misc cleanups

    * tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits)
    genksyms: convert to SPDX License Identifier for lex.l and parse.y
    modpost: use __section in the output to *.mod.c
    modpost: use MODULE_INFO() for __module_depends
    export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
    export.h: remove defined(__KERNEL__), which is no longer needed
    kbuild: allow Clang to find unused static inline functions for W=1 build
    kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
    kbuild: refactor scripts/Makefile.extrawarn
    merge_config.sh: ignore unwanted grep errors
    kbuild: change *FLAGS_.o to take the path relative to $(obj)
    modpost: add NOFAIL to strndup
    modpost: add guid_t type definition
    kbuild: add $(BASH) to run scripts with bash-extension
    kbuild: remove ARCH_{CPP,A,C}FLAGS
    kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC
    kbuild: Do not enable -Wimplicit-fallthrough for clang for now
    kbuild: clean up subdir-ymn calculation in Makefile.clean
    kbuild: remove unneeded '+' marker from cmd_clean
    kbuild: remove clean-dirs syntax
    kbuild: check clean srctree even earlier
    ...

    Linus Torvalds
     
  • Export a few symbols used by kvm module. Without this, kvm cannot
    be compiled as a module.

    Signed-off-by: Atish Patra
    Signed-off-by: Anup Patel
    Acked-by: Paolo Bonzini
    Reviewed-by: Paolo Bonzini
    Reviewed-by: Alexander Graf
    [paul.walmsley@sifive.com: updated to apply; clarified short patch
    description]
    Signed-off-by: Paul Walmsley

    Atish Patra
     
  • Harts with id greater than or equal to CONFIG_NR_CPUS need to be
    disabled. But the kernel can pick any hart as the main hart. So,
    before picking the main hart, the kernel must disable harts with ids
    greater than or equal to CONFIG_NR_CPUS.

    Signed-off-by: Xiang Wang
    Reviewed-by: Palmer Dabbelt
    Reviewed-by: Anup Patel
    [paul.walmsley@sifive.com: updated to apply; cleaned up patch
    description]
    Signed-off-by: Paul Walmsley

    Xiang Wang
     

19 Sep, 2019

1 commit