17 Apr, 2019

1 commit

  • commit 10a16997db3d99fc02c026cf2c6e6c670acafab0 upstream.

    RISC-V syscall arguments are located in orig_a0,a1..a5 fields
    of struct pt_regs.

    Due to an off-by-one bug and a bug in pointer arithmetic
    syscall_get_arguments() was reading s3..s7 fields instead of a1..a5.
    Likewise, syscall_set_arguments() was writing s3..s7 fields
    instead of a1..a5.

    Link: http://lkml.kernel.org/r/20190329171221.GA32456@altlinux.org

    Fixes: e2c0cdfba7f69 ("RISC-V: User-facing API")
    Cc: Ingo Molnar
    Cc: Kees Cook
    Cc: Andy Lutomirski
    Cc: Will Drewry
    Cc: Albert Ou
    Cc: linux-riscv@lists.infradead.org
    Cc: stable@vger.kernel.org # v4.15+
    Acked-by: Palmer Dabbelt
    Signed-off-by: Dmitry V. Levin
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Dmitry V. Levin
     

14 Mar, 2019

2 commits

  • [ Upstream commit ae662eec8a515ab550524e04c793b5ddf1aae3a1 ]

    This ratio is the most used among all other architectures and make
    icache_hygiene libhugetlbfs test pass: this test mmap lots of
    hugepages whose addresses, without this patch, reach the end of
    the process user address space.

    Signed-off-by: Alexandre Ghiti
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Sasha Levin

    Alexandre Ghiti
     
  • [ Upstream commit 28198c4639b39899a728ac89aea29d2a7a72562f ]

    max_low_pfn should be pfn_size not byte_size.

    Signed-off-by: Guo Ren
    Signed-off-by: Mao Han
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Sasha Levin

    Guo Ren
     

20 Feb, 2019

2 commits

  • commit e3613bb8afc2a9474c9214d65c8326c5ac02135e upstream.

    Previously, invalid PTEs and swap PTEs had the same binary
    representation, causing errors when attempting to unmap PROT_NONE
    mappings, including implicit unmap on exit.

    Typical error:

    swap_info_get: Bad swap file entry 40000000007a9879
    BUG: Bad page map in process a.out pte:3d4c3cc0 pmd:3e521401

    Cc: stable@vger.kernel.org
    Signed-off-by: Stefan O'Rear
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Greg Kroah-Hartman

    Stefan O'Rear
     
  • [ Upstream commit 775800b0f1d7303d4fd8ce0e0d9eca4ff2f338f2 ]

    Fix compilation error.

    Signed-off-by: David Abdurachmanov
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Sasha Levin

    David Abdurachmanov
     

13 Dec, 2018

1 commit


06 Dec, 2018

1 commit

  • commit e949b6db51dc172a35c962bc4414ca148315fe21 upstream.

    The function_graph_enter() function does the work of calling the function
    graph hook function and the management of the shadow stack, simplifying the
    work done in the architecture dependent prepare_ftrace_return().

    Have riscv use the new code, and remove the shadow stack management as well as
    having to set up the trace structure.

    This is needed to prepare for a fix of a design bug on how the curr_ret_stack
    is used.

    Cc: Greentime Hu
    Cc: Alan Kao
    Cc: stable@kernel.org
    Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback")
    Reviewed-by: Palmer Dabbelt
    Reviewed-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (VMware)
     

01 Dec, 2018

2 commits

  • [ Upstream commit ef3a61406618291c46da168ff91acaa28d85944c ]

    Fixes:

    arch/riscv/kernel/module.c: In function 'apply_r_riscv_32_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:23:27: note: format string is defined here
    arch/riscv/kernel/module.c: In function 'apply_r_riscv_pcrel_hi20_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:104:23: note: format string is defined here
    arch/riscv/kernel/module.c: In function 'apply_r_riscv_hi20_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:146:23: note: format string is defined here
    arch/riscv/kernel/module.c: In function 'apply_r_riscv_got_hi20_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:190:60: note: format string is defined here
    arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_plt_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:214:24: note: format string is defined here
    arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_rela':
    ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
    arch/riscv/kernel/module.c:236:23: note: format string is defined here

    Signed-off-by: Olof Johansson
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Sasha Levin

    Olof Johansson
     
  • [ Upstream commit f157d411a9eb170d2ee6b766da7a381962017cc9 ]

    Building kernel 4.20 for Fedora as RPM fails, because riscv is missing
    vdso_install target in arch/riscv/Makefile.

    Signed-off-by: David Abdurachmanov
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Sasha Levin

    David Abdurachmanov
     

27 Nov, 2018

1 commit

  • commit 21f70d4abf9e17c2e3d7e64b7bfa3424e017f176 upstream.

    Sparse highlighted it, and appears to be a pure bug (from vs to).

    ./arch/riscv/include/asm/uaccess.h:403:35: warning: incorrect type in argument 1 (different address spaces)
    ./arch/riscv/include/asm/uaccess.h:403:39: warning: incorrect type in argument 2 (different address spaces)
    ./arch/riscv/include/asm/uaccess.h:409:37: warning: incorrect type in argument 1 (different address spaces)
    ./arch/riscv/include/asm/uaccess.h:409:41: warning: incorrect type in argument 2 (different address spaces)

    Signed-off-by: Olof Johansson
    Cc: stable@vger.kernel.org
    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Greg Kroah-Hartman

    Olof Johansson
     

03 Oct, 2018

1 commit

  • Use memblock_end_of_DRAM which provides correct last low memory
    PFN. Without that, DMA32 region becomes empty resulting in zero
    pages being allocated for DMA32.

    This patch is based on earlier patch from palmer which never
    merged into 4.19. I just edited the commit text to make more
    sense.

    Signed-off-by: Atish Patra
    Signed-off-by: Palmer Dabbelt

    Atish Patra
     

25 Sep, 2018

1 commit

  • Building a riscv kernel with CONFIG_FUNCTION_TRACER and
    CONFIG_MODVERSIONS enabled results in these two warnings:

    MODPOST vmlinux.o
    WARNING: EXPORT symbol "return_to_handler" [vmlinux] version generation failed, symbol will not be versioned.
    WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned.

    When exporting symbols from an assembly file, the MODVERSIONS code
    requires their prototypes to be defined in asm-prototypes.h (see
    scripts/Makefile.build). Since both of these symbols have prototypes
    defined in linux/ftrace.h, include this header from RISC-V's
    asm-prototypes.h.

    Reported-by: Karsten Merker
    Signed-off-by: James Cowgill
    Signed-off-by: Palmer Dabbelt

    James Cowgill
     

05 Sep, 2018

1 commit

  • setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size
    is larger than 0, which is always true even if there is no embedded
    initramfs. This prevents booting qemu with "-initrd" parameter.
    Overwriting initrd_start and initrd_end is not necessary since
    __initramfs_start and __initramfs_size are used directly in
    populate_rootfs() to load the built-in initramfs, so just drop
    that code.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Palmer Dabbelt

    Guenter Roeck
     

29 Aug, 2018

2 commits


26 Aug, 2018

1 commit

  • Pull more Kbuild updates from Masahiro Yamada:

    - add build_{menu,n,g,x}config targets for compile-testing Kconfig

    - fix and improve recursive dependency detection in Kconfig

    - fix parallel building of menuconfig/nconfig

    - fix syntax error in clang-version.sh

    - suppress distracting log from syncconfig

    - remove obsolete "rpm" target

    - remove VMLINUX_SYMBOL(_STR) macro entirely

    - fix microblaze build with CONFIG_DYNAMIC_FTRACE

    - move compiler test for dead code/data elimination to Kconfig

    - rename well-known LDFLAGS variable to KBUILD_LDFLAGS

    - misc fixes and cleanups

    * tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kbuild: rename LDFLAGS to KBUILD_LDFLAGS
    kbuild: pass LDFLAGS to recordmcount.pl
    kbuild: test dead code/data elimination support in Kconfig
    initramfs: move gen_initramfs_list.sh from scripts/ to usr/
    vmlinux.lds.h: remove stale include
    export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
    Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci
    kbuild: make sorting initramfs contents independent of locale
    kbuild: remove "rpm" target, which is alias of "rpm-pkg"
    kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt
    kconfig: suppress "configuration written to .config" for syncconfig
    kconfig: fix "Can't open ..." in parallel build
    kbuild: Add a space after `!` to prevent parsing as file pattern
    scripts: modpost: check memory allocation results
    kconfig: improve the recursive dependency report
    kconfig: report recursive dependency involving 'imply'
    kconfig: error out when seeing recursive dependency
    kconfig: add build-only configurator targets
    scripts/dtc: consolidate include path options in Makefile

    Linus Torvalds
     

24 Aug, 2018

1 commit

  • Commit a0f97e06a43c ("kbuild: enable 'make CFLAGS=...' to add
    additional options to CC") renamed CFLAGS to KBUILD_CFLAGS.

    Commit 222d394d30e7 ("kbuild: enable 'make AFLAGS=...' to add
    additional options to AS") renamed AFLAGS to KBUILD_AFLAGS.

    Commit 06c5040cdb13 ("kbuild: enable 'make CPPFLAGS=...' to add
    additional options to CPP") renamed CPPFLAGS to KBUILD_CPPFLAGS.

    For some reason, LDFLAGS was not renamed.

    Using a well-known variable like LDFLAGS may result in accidental
    override of the variable.

    Kbuild generally uses KBUILD_ prefixed variables for the internally
    appended options, so here is one more conversion to sanitize the
    naming convention.

    I did not touch Makefiles under tools/ since the tools build system
    is a different world.

    Signed-off-by: Masahiro Yamada
    Acked-by: Kirill A. Shutemov
    Reviewed-by: Palmer Dabbelt

    Masahiro Yamada
     

21 Aug, 2018

4 commits

  • This contains a pair of patches that together fix sys_riscv_flush_icache
    on all systems:

    * The first enables sys_riscv_flush_icache() for non-SMP systems.
    * The second fixes a bug in our syscall header that caused
    sys_riscv_flush_icache to never get generated.

    Palmer Dabbelt
     
  • riscv does not enable CONFIG_COMPAT in default configurations:
    defconfig, allmodconfig and allnoconfig.
    Remove the asm/compat.h as it does not seem to add any value to
    the architecture without CONFIG_COMPAT.

    Now that time compat syscalls are being reused in non CONFIG_COMPAT
    modes, asm-generic/compat.h provides definitions for riscv 32 bit
    mode.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Deepa Dinamani
    Cc: palmer@sifive.com
    Cc: linux-riscv@lists.infradead.org
    Signed-off-by: Palmer Dabbelt

    Deepa Dinamani
     
  • This file is expected to be included multiple times in the same file in
    order to allow the __SYSCALL macro to generate system call tables. With
    a global include guard we end up missing __NR_riscv_flush_icache in the
    syscall table, which results in icache flushes that escape the vDSO call
    to not actually do anything.

    The fix is to move to per-#define include guards, which allows the
    system call tables to actually be populated. Thanks to Macrus Comstedt
    for finding and fixing the bug!

    Cc: Marcus Comstedt
    Signed-off-by: Palmer Dabbelt

    Palmer Dabbelt
     
  • This would be necessary to make non-SMP builds work, but there is
    another error in the implementation of our syscall linkage that actually
    just causes sys_riscv_flush_icache to never build. I've build tested
    this on allnoconfig and allnoconfig+SMP=y, as well as defconfig like
    normal.

    CC: Christoph Hellwig
    CC: Guenter Roeck
    In-Reply-To:
    In-Reply-To:
    Signed-off-by: Palmer Dabbelt

    Palmer Dabbelt
     

20 Aug, 2018

1 commit

  • …l/git/palmer/riscv-linux

    Pull RISC-V updates from Palmer Dabbelt:
    "This contains some major improvements to the RISC-V port, including
    the necessary interrupt controller and timer support to actually make
    it to userspace. Support for three devices has been added:

    - the ISA-mandated timers on RISC-V systems.

    - the ISA-mandated first-level interrupt controller on RISC-V
    systems, which is handled as part of our core arch code because
    it's very small and tightly tied to the ISA.

    - SiFive's platform-level interrupt controller, which talks to the
    actual devices.

    In addition to these new devices, there are a handful of cleanups all
    over the RISC-V tree:

    - build fixes for various configurations:
    * A fix to the vDSO build's makefile so it respects CFLAGS.
    * The addition of __lshrti3, a libgcc derived function necessary
    for some 32-bit configurations.
    * !SMP && PERF_EVENTS

    - Cleanups to the arch code to remove the remnants of old versions of
    the drivers that were just properly submitted.
    * Some dead code from the timer driver, most of which wasn't ever
    even compiled.
    * Cleanups of some interrupt #defines, which are now local to the
    interrupt handling code.

    - Fixes to ptrace(), which while not being sufficient to fully make
    GDB work are at least sufficient to get simple GDB tasks to work.

    - Early printk support via RISC-V's architecturally mandated SBI
    console device.

    - A fix to our early debug trap handler to ensure it's always
    aligned.

    These patches have all been through a fairly extensive review process,
    but as this enables a whole pile of functionality (ie, userspace) I'm
    confident we'll need to submit a few more patches. The only concrete
    issues I know about are the sys_riscv_flush_icache patches, but as I
    managed to screw those up on Friday I figured it'd be best to let them
    bake another week.

    This tag boots a Fedora root filesystem on QEMU's master branch for
    me, and before this morning's rebase (from 4.18-rc8 to 4.18) it booted
    on the HiFive Unleashed.

    Thanks to Christoph Hellwig and the other guys at WD for getting the
    new drivers in shape!"

    * tag 'riscv-for-linus-4.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
    dt-bindings: interrupt-controller: SiFive Plaform Level Interrupt Controller
    dt-bindings: interrupt-controller: RISC-V local interrupt controller
    RISC-V: Fix !CONFIG_SMP compilation error
    irqchip: add a SiFive PLIC driver
    RISC-V: Add the directive for alignment of stvec's value
    clocksource: new RISC-V SBI timer driver
    RISC-V: implement low-level interrupt handling
    RISC-V: add a definition for the SIE SEIE bit
    RISC-V: remove INTERRUPT_CAUSE_* defines from asm/irq.h
    RISC-V: simplify software interrupt / IPI code
    RISC-V: remove timer leftovers
    RISC-V: Add early printk support via the SBI console
    RISC-V: Don't increment sepc after breakpoint.
    RISC-V: implement __lshrti3.
    RISC-V: Use KBUILD_CFLAGS instead of KCFLAGS when building the vDSO

    Linus Torvalds
     

18 Aug, 2018

1 commit

  • Use new return type vm_fault_t for fault handler. For now, this is just
    documenting that the function returns a VM_FAULT value rather than an
    errno. Once all instances are converted, vm_fault_t will become a
    distinct type.

    Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

    In this patch all the caller of handle_mm_fault() are changed to return
    vm_fault_t type.

    Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PC
    Signed-off-by: Souptick Joarder
    Cc: Matthew Wilcox
    Cc: Richard Henderson
    Cc: Tony Luck
    Cc: Matt Turner
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Richard Kuo
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: James Hogan
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: James E.J. Bottomley
    Cc: Benjamin Herrenschmidt
    Cc: Palmer Dabbelt
    Cc: Yoshinori Sato
    Cc: David S. Miller
    Cc: Richard Weinberger
    Cc: Guan Xuetao
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: "Levin, Alexander (Sasha Levin)"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Souptick Joarder
     

16 Aug, 2018

2 commits

  • Pull Kconfig consolidation from Masahiro Yamada:
    "Consolidation of Kconfig files by Christoph Hellwig.

    Move the source statements of arch-independent Kconfig files instead
    of duplicating the includes in every arch/$(SRCARCH)/Kconfig"

    * tag 'kconfig-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kconfig: add a Memory Management options" menu
    kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
    kconfig: use a menu in arch/Kconfig to reduce clutter
    kconfig: include kernel/Kconfig.preempt from init/Kconfig
    Kconfig: consolidate the "Kernel hacking" menu
    kconfig: include common Kconfig files from top-level Kconfig
    kconfig: remove duplicate SWAP symbol defintions
    um: create a proper drivers Kconfig
    um: cleanup Kconfig files
    um: stop abusing KBUILD_KCONFIG

    Linus Torvalds
     
  • Pull Kbuild updates from Masahiro Yamada:

    - verify depmod is installed before modules_install

    - support build salt in case build ids must be unique between builds

    - allow users to specify additional host compiler flags via HOST*FLAGS,
    and rename internal variables to KBUILD_HOST*FLAGS

    - update buildtar script to drop vax support, add arm64 support

    - update builddeb script for better debarch support

    - document the pit-fall of if_changed usage

    - fix parallel build of UML with O= option

    - make 'samples' target depend on headers_install to fix build errors

    - remove deprecated host-progs variable

    - add a new coccinelle script for refcount_t vs atomic_t check

    - improve double-test coccinelle script

    - misc cleanups and fixes

    * tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits)
    coccicheck: return proper error code on fail
    Coccinelle: doubletest: reduce side effect false positives
    kbuild: remove deprecated host-progs variable
    kbuild: make samples really depend on headers_install
    um: clean up archheaders recipe
    kbuild: add %asm-generic to no-dot-config-targets
    um: fix parallel building with O= option
    scripts: Add Python 3 support to tracing/draw_functrace.py
    builddeb: Add automatic support for sh{3,4}{,eb} architectures
    builddeb: Add automatic support for riscv* architectures
    builddeb: Add automatic support for m68k architecture
    builddeb: Add automatic support for or1k architecture
    builddeb: Add automatic support for sparc64 architecture
    builddeb: Add automatic support for mips{,64}r6{,el} architectures
    builddeb: Add automatic support for mips64el architecture
    builddeb: Add automatic support for ppc64 and powerpcspe architectures
    builddeb: Introduce functions to simplify kconfig tests in set_debarch
    builddeb: Drop check for 32-bit s390
    builddeb: Change architecture detection fallback to use dpkg-architecture
    builddeb: Skip architecture detection when KBUILD_DEBARCH is set
    ...

    Linus Torvalds
     

13 Aug, 2018

13 commits

  • Enabling both CONFIG_PERF_EVENTS without !CONFIG_SMP
    generates following compilation error.

    arch/riscv/include/asm/perf_event.h:80:2: error: expected
    specifier-qualifier-list before 'irqreturn_t'

    irqreturn_t (*handle_irq)(int irq_num, void *dev);
    ^~~~~~~~~~~

    Include interrupt.h in proper place to avoid compilation
    error.

    Signed-off-by: Atish Patra
    Signed-off-by: Palmer Dabbelt

    Atish Patra
     
  • Add a driver for the SiFive implementation of the RISC-V Platform Level
    Interrupt Controller (PLIC). The PLIC connects global interrupt sources
    to the local interrupt controller on each hart.

    This driver is based on the driver in the RISC-V tree from Palmer Dabbelt,
    but has been almost entirely rewritten since, and includes many fixes
    from Atish Patra.

    Signed-off-by: Christoph Hellwig
    Acked-by: Thomas Gleixner
    Reviewed-by: Atish Patra
    [Binding update by Palmer]
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • The stvec's value must be 4 byte alignment by specification definition.
    These directives avoid to stvec be set the non-alignment value.

    Signed-off-by: Zong Li
    Signed-off-by: Palmer Dabbelt

    Zong Li
     
  • The RISC-V ISA defines a per-hart real-time clock and timer, which is
    present on all systems. The clock is accessed via the 'rdtime'
    pseudo-instruction (which reads a CSR), and the timer is set via an SBI
    call.

    Contains various improvements from Atish Patra .

    Signed-off-by: Dmitriy Cherkasov
    Signed-off-by: Palmer Dabbelt
    [hch: remove dead code, add SPDX tags, used riscv_of_processor_hart(),
    minor cleanups, merged hotplug cpu support and other improvements
    from Atish]
    Signed-off-by: Christoph Hellwig
    Acked-by: Thomas Gleixner
    Reviewed-by: Atish Patra
    Signed-off-by: Palmer Dabbelt

    Palmer Dabbelt
     
  • Add support for a routine that dispatches exceptions with the interrupt
    flags set to either the IPI or irqdomain code (and the clock source in the
    future).

    Loosely based on the irq-riscv-int.c irqchip driver from the RISC-V tree.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • This mirrors the SIE_SSIE and SETE bits that are used in a similar
    fashion.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • These are only of use to the local irq controller driver, so add them in
    that driver implementation instead, which will be submitted soon.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • Rename handle_ipi to riscv_software_interrupt, drop the unused return
    value and move the prototype to irq.h together with riscv_timer_interupt.
    This allows simplifying the upcoming interrupt handling support.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • This code is currently unused and will be added back later in a different
    place with the real interrupt and clocksource support.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Palmer Dabbelt

    Christoph Hellwig
     
  • This code lives entirely within the RISC-V arch code. I've left it
    within an "#ifdef CONFIG_EARLY_PRINTK" despite always having
    EARLY_PRINTK support on RISC-V just in case someone wants to remove
    it.

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

    Palmer Dabbelt
     
  • Adding 4 to sepc is pointless, and is wrong if we executed a 2-byte
    compressed breakpoint. This plus a corresponding gdb patch allows
    compressed breakpoints to work in gdb. Gdb maintainers have already
    agreed that this is the right approach.

    Signed-off-by: Jim Wilson
    Signed-off-by: Palmer Dabbelt

    Jim Wilson
     
  • Signed-off-by: Alex Guo
    Signed-off-by: Palmer Dabbelt

    Alex Guo
     
  • If you use a 64-bit compiler to build a 32-bit kernel then you'll get an
    error when building the vDSO due to a library mismatch. The happens
    because the relevant "-march" argument isn't supplied to the GCC run
    that generates one of the vDSO intermediate files.

    I'm not actually sure what the right thing to do here is as I'm not
    particularly familiar with the kernel build system. I poked the
    documentation and it appears that KCFLAGS is the correct thing to do
    (it's suggested that should be used when building modules), but we set
    KBUILD_CFLAGS in arch/riscv/Makefile.

    This does at least fix the build error.

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

    Palmer Dabbelt
     

02 Aug, 2018

2 commits

  • Almost all architectures include it. Add a ARCH_NO_PREEMPT symbol to
    disable preempt support for alpha, hexagon, non-coldfire m68k and
    user mode Linux.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Masahiro Yamada

    Christoph Hellwig
     
  • Move the source of lib/Kconfig.debug and arch/$(ARCH)/Kconfig.debug to
    the top-level Kconfig. For two architectures that means moving their
    arch-specific symbols in that menu into a new arch Kconfig.debug file,
    and for a few more creating a dummy file so that we can include it
    unconditionally.

    Also move the actual 'Kernel hacking' menu to lib/Kconfig.debug, where
    it belongs.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Masahiro Yamada

    Christoph Hellwig