Commit 6a0e20cd authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull RISC-V updates from Paul Walmsley:
 "New features:
   - SECCOMP support
   - nommu support
   - SBI-less system support
   - M-Mode support
   - TLB flush optimizations

  Other improvements:
   - Pass the complete RISC-V ISA string supported by the CPU cores to
     userspace, rather than redacting parts of it in the kernel
   - Add platform DMA IP block data to the HiFive Unleashed board DT
     file
   - Add Makefile support for BZ2, LZ4, LZMA, LZO kernel image
     compression formats, in line with other architectures

  Cleanups:
   - Remove unnecessary PTE_PARENT_SIZE macro
   - Standardize include guard naming across arch/riscv"

* tag 'riscv/for-v5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (22 commits)
  riscv: provide a flat image loader
  riscv: add nommu support
  riscv: clear the instruction cache and all registers when booting
  riscv: read the hart ID from mhartid on boot
  riscv: provide native clint access for M-mode
  riscv: dts: add support for PDMA device of HiFive Unleashed Rev A00
  riscv: add support for MMIO access to the timer registers
  riscv: implement remote sfence.i using IPIs
  riscv: cleanup the default power off implementation
  riscv: poison SBI calls for M-mode
  riscv: don't allow selecting SBI based drivers for M-mode
  RISC-V: Add multiple compression image format.
  riscv: clean up the macro format in each header file
  riscv: Use PMD_SIZE to replace PTE_PARENT_SIZE
  riscv: abstract out CSR names for supervisor vs machine mode
  riscv: separate MMIO functions into their own header file
  riscv: enter WFI in default_power_off() if SBI does not shutdown
  RISC-V: Issue a tlb page flush if possible
  RISC-V: Issue a local tlbflush if possible.
  RISC-V: Do not invoke SBI call if cpumask is empty
  ...
parents 80eb5fea 5ba9aa56
Loading
Loading
Loading
Loading
+41 −9
Original line number Diff line number Diff line
@@ -26,14 +26,15 @@ config RISCV
	select GENERIC_IRQ_SHOW
	select GENERIC_PCI_IOMAP
	select GENERIC_SCHED_CLOCK
	select GENERIC_STRNCPY_FROM_USER
	select GENERIC_STRNLEN_USER
	select GENERIC_STRNCPY_FROM_USER if MMU
	select GENERIC_STRNLEN_USER if MMU
	select GENERIC_SMP_IDLE_THREAD
	select GENERIC_ATOMIC64 if !64BIT
	select HAVE_ARCH_AUDITSYSCALL
	select HAVE_ARCH_SECCOMP_FILTER
	select HAVE_ASM_MODVERSIONS
	select HAVE_MEMBLOCK_NODE_MAP
	select HAVE_DMA_CONTIGUOUS
	select HAVE_DMA_CONTIGUOUS if MMU
	select HAVE_FUTEX_CMPXCHG if FUTEX
	select HAVE_PERF_EVENTS
	select HAVE_PERF_REGS
@@ -50,6 +51,7 @@ config RISCV
	select PCI_DOMAINS_GENERIC if PCI
	select PCI_MSI if PCI
	select RISCV_TIMER
	select UACCESS_MEMCPY if !MMU
	select GENERIC_IRQ_MULTI_HANDLER
	select GENERIC_ARCH_TOPOLOGY if SMP
	select ARCH_HAS_PTE_SPECIAL
@@ -60,7 +62,7 @@ config RISCV
	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
	select SPARSEMEM_STATIC if 32BIT
	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
	select HAVE_ARCH_MMAP_RND_BITS
	select HAVE_ARCH_MMAP_RND_BITS if MMU

config ARCH_MMAP_RND_BITS_MIN
	default 18 if 64BIT
@@ -72,8 +74,23 @@ config ARCH_MMAP_RND_BITS_MAX
	default 24 if 64BIT # SV39 based
	default 17

# set if we run in machine mode, cleared if we run in supervisor mode
config RISCV_M_MODE
	bool
	default !MMU

# set if we are running in S-mode and can use SBI calls
config RISCV_SBI
	bool
	depends on !RISCV_M_MODE
	default y

config MMU
	def_bool y
	bool "MMU-based Paged Memory Management Support"
	default y
	help
	  Select if you want MMU-based virtualised addressing space
	  support by paged memory management. If unsure, say 'Y'.

config ZONE_DMA32
	bool
@@ -92,6 +109,7 @@ config PA_BITS
config PAGE_OFFSET
	hex
	default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
	default 0x80000000 if 64BIT && !MMU
	default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
	default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB

@@ -135,7 +153,7 @@ config GENERIC_HWEIGHT
	def_bool y

config FIX_EARLYCON_MEM
	def_bool y
	def_bool CONFIG_MMU

config PGTABLE_LEVELS
	int
@@ -160,6 +178,7 @@ config ARCH_RV32I
	select GENERIC_LIB_ASHRDI3
	select GENERIC_LIB_LSHRDI3
	select GENERIC_LIB_UCMPDI2
	select MMU

config ARCH_RV64I
	bool "RV64I"
@@ -168,9 +187,9 @@ config ARCH_RV64I
	select HAVE_FUNCTION_TRACER
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_DYNAMIC_FTRACE
	select HAVE_DYNAMIC_FTRACE_WITH_REGS
	select SWIOTLB
	select HAVE_DYNAMIC_FTRACE if MMU
	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
	select SWIOTLB if MMU

endchoice

@@ -272,6 +291,19 @@ menu "Kernel features"

source "kernel/Kconfig.hz"

config SECCOMP
	bool "Enable seccomp to safely compute untrusted bytecode"
	help
	  This kernel feature is useful for number crunching applications
	  that may need to compute untrusted bytecode during their
	  execution. By using pipes or other transports made available to
	  the process as file descriptors supporting the read/write
	  syscalls, it's possible to isolate those applications in
	  their own address space using seccomp. Once seccomp is
	  enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
	  and the task is only allowed to execute a few safe syscalls
	  defined by each seccomp mode.

endmenu

menu "Boot options"
+9 −4
Original line number Diff line number Diff line
@@ -83,13 +83,18 @@ PHONY += vdso_install
vdso_install:
	$(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@

all: Image.gz
ifeq ($(CONFIG_RISCV_M_MODE),y)
KBUILD_IMAGE := $(boot)/loader
else
KBUILD_IMAGE := $(boot)/Image.gz
endif
BOOT_TARGETS := Image Image.gz loader

Image: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
all:	$(notdir $(KBUILD_IMAGE))

Image.%: Image
$(BOOT_TARGETS): vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
	@$(kecho) '  Kernel: $(boot)/$@ is ready'

zinstall install:
	$(Q)$(MAKE) $(build)=$(boot) $@
+18 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S

targets := Image
targets := Image loader

$(obj)/Image: vmlinux FORCE
	$(call if_changed,objcopy)
@@ -24,6 +24,23 @@ $(obj)/Image: vmlinux FORCE
$(obj)/Image.gz: $(obj)/Image FORCE
	$(call if_changed,gzip)

loader.o: $(src)/loader.S $(obj)/Image

$(obj)/loader: $(obj)/loader.o $(obj)/Image $(obj)/loader.lds FORCE
	$(Q)$(LD) -T $(obj)/loader.lds -o $@ $(obj)/loader.o

$(obj)/Image.bz2: $(obj)/Image FORCE
	$(call if_changed,bzip2)

$(obj)/Image.lz4: $(obj)/Image FORCE
	$(call if_changed,lz4)

$(obj)/Image.lzma: $(obj)/Image FORCE
	$(call if_changed,lzma)

$(obj)/Image.lzo: $(obj)/Image FORCE
	$(call if_changed,lzo)

install:
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/Image System.map "$(INSTALL_PATH)"
+7 −0
Original line number Diff line number Diff line
@@ -162,6 +162,13 @@
			clocks = <&prci PRCI_CLK_TLCLK>;
			status = "disabled";
		};
		dma: dma@3000000 {
			compatible = "sifive,fu540-c000-pdma";
			reg = <0x0 0x3000000 0x0 0x8000>;
			interrupt-parent = <&plic0>;
			interrupts = <23 24 25 26 27 28 29 30>;
			#dma-cells = <1>;
		};
		uart1: serial@10011000 {
			compatible = "sifive,fu540-c000-uart", "sifive,uart0";
			reg = <0x0 0x10011000 0x0 0x1000>;
+8 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */

	.align 4
	.section .payload, "ax", %progbits
	.globl _start
_start:
	.incbin "arch/riscv/boot/Image"
Loading