Skip to content

Commit eb67d23

Browse files
committed
Merge tag 'riscv-for-linus-6.2-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V updates from Palmer Dabbelt: - Support for the T-Head PMU via the perf subsystem - ftrace support for rv32 - Support for non-volatile memory devices - Various fixes and cleanups * tag 'riscv-for-linus-6.2-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (52 commits) Documentation: RISC-V: patch-acceptance: s/implementor/implementer Documentation: RISC-V: Mention the UEFI Standards Documentation: RISC-V: Allow patches for non-standard behavior Documentation: RISC-V: Fix a typo in patch-acceptance riscv: Fixup compile error with !MMU riscv: Fix P4D_SHIFT definition for 3-level page table mode riscv: Apply a static assert to riscv_isa_ext_id RISC-V: Add some comments about the shadow and overflow stacks RISC-V: Align the shadow stack RISC-V: Ensure Zicbom has a valid block size RISC-V: Introduce riscv_isa_extension_check RISC-V: Improve use of isa2hwcap[] riscv: Don't duplicate _ALTERNATIVE_CFG* macros riscv: alternatives: Drop the underscores from the assembly macro names riscv: alternatives: Don't name unused macro parameters riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2 riscv: mm: call best_map_size many times during linear-mapping riscv: Move cast inside kernel_mapping_[pv]a_to_[vp]a riscv: Fix crash during early errata patching riscv: boot: add zstd support ...
2 parents 94a8551 + 6e66e96 commit eb67d23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+619
-256
lines changed

Documentation/admin-guide/kdump/vmcoreinfo.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,3 +595,32 @@ X2TLB
595595
-----
596596

597597
Indicates whether the crashed kernel enabled SH extended mode.
598+
599+
RISCV64
600+
=======
601+
602+
VA_BITS
603+
-------
604+
605+
The maximum number of bits for virtual addresses. Used to compute the
606+
virtual memory ranges.
607+
608+
PAGE_OFFSET
609+
-----------
610+
611+
Indicates the virtual kernel start address of the direct-mapped RAM region.
612+
613+
phys_ram_base
614+
-------------
615+
616+
Indicates the start physical RAM address.
617+
618+
MODULES_VADDR|MODULES_END|VMALLOC_START|VMALLOC_END|VMEMMAP_START|VMEMMAP_END|KERNEL_LINK_ADDR
619+
----------------------------------------------------------------------------------------------
620+
621+
Used to get the correct ranges:
622+
623+
* MODULES_VADDR ~ MODULES_END : Kernel module space.
624+
* VMALLOC_START ~ VMALLOC_END : vmalloc() / ioremap() space.
625+
* VMEMMAP_START ~ VMEMMAP_END : vmemmap space, used for struct page array.
626+
* KERNEL_LINK_ADDR : start address of Kernel link and BPF

Documentation/features/vm/huge-vmap/arch-support.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| openrisc: | TODO |
2222
| parisc: | TODO |
2323
| powerpc: | ok |
24-
| riscv: | TODO |
24+
| riscv: | ok |
2525
| s390: | TODO |
2626
| sh: | TODO |
2727
| sparc: | TODO |

Documentation/riscv/patch-acceptance.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,22 @@ Submit Checklist Addendum
2020
-------------------------
2121
We'll only accept patches for new modules or extensions if the
2222
specifications for those modules or extensions are listed as being
23-
"Frozen" or "Ratified" by the RISC-V Foundation. (Developers may, of
24-
course, maintain their own Linux kernel trees that contain code for
25-
any draft extensions that they wish.)
23+
unlikely to be incompatibly changed in the future. For
24+
specifications from the RISC-V foundation this means "Frozen" or
25+
"Ratified", for the UEFI forum specifications this means a published
26+
ECR. (Developers may, of course, maintain their own Linux kernel trees
27+
that contain code for any draft extensions that they wish.)
2628

27-
Additionally, the RISC-V specification allows implementors to create
29+
Additionally, the RISC-V specification allows implementers to create
2830
their own custom extensions. These custom extensions aren't required
2931
to go through any review or ratification process by the RISC-V
3032
Foundation. To avoid the maintenance complexity and potential
3133
performance impact of adding kernel code for implementor-specific
32-
RISC-V extensions, we'll only to accept patches for extensions that
33-
have been officially frozen or ratified by the RISC-V Foundation.
34-
(Implementors, may, of course, maintain their own Linux kernel trees
35-
containing code for any custom extensions that they wish.)
34+
RISC-V extensions, we'll only consider patches for extensions that either:
35+
36+
- Have been officially frozen or ratified by the RISC-V Foundation, or
37+
- Have been implemented in hardware that is widely available, per standard
38+
Linux practice.
39+
40+
(Implementers, may, of course, maintain their own Linux kernel trees containing
41+
code for any custom extensions that they wish.)

arch/riscv/Kconfig

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config RISCV
2525
select ARCH_HAS_GIGANTIC_PAGE
2626
select ARCH_HAS_KCOV
2727
select ARCH_HAS_MMIOWB
28+
select ARCH_HAS_PMEM_API
2829
select ARCH_HAS_PTE_SPECIAL
2930
select ARCH_HAS_SET_DIRECT_MAP if MMU
3031
select ARCH_HAS_SET_MEMORY if MMU
@@ -72,6 +73,8 @@ config RISCV
7273
select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO
7374
select HARDIRQS_SW_RESEND
7475
select HAVE_ARCH_AUDITSYSCALL
76+
select HAVE_ARCH_HUGE_VMALLOC if HAVE_ARCH_HUGE_VMAP
77+
select HAVE_ARCH_HUGE_VMAP if MMU && 64BIT && !XIP_KERNEL
7578
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
7679
select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
7780
select HAVE_ARCH_KASAN if MMU && 64BIT
@@ -99,6 +102,7 @@ config RISCV
99102
select HAVE_KPROBES if !XIP_KERNEL
100103
select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
101104
select HAVE_KRETPROBES if !XIP_KERNEL
105+
select HAVE_RETHOOK if !XIP_KERNEL
102106
select HAVE_MOVE_PMD
103107
select HAVE_MOVE_PUD
104108
select HAVE_PCI
@@ -123,12 +127,18 @@ config RISCV
123127
select PCI_MSI if PCI
124128
select RISCV_INTC
125129
select RISCV_TIMER if RISCV_SBI
130+
select SIFIVE_PLIC
126131
select SPARSE_IRQ
127132
select SYSCTL_EXCEPTION_TRACE
128133
select THREAD_INFO_IN_TASK
129134
select TRACE_IRQFLAGS_SUPPORT
130135
select UACCESS_MEMCPY if !MMU
131136
select ZONE_DMA32 if 64BIT
137+
select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
138+
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
139+
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
140+
select HAVE_FUNCTION_GRAPH_TRACER
141+
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
132142

133143
config ARCH_MMAP_RND_BITS_MIN
134144
default 18 if 64BIT
@@ -274,11 +284,6 @@ config ARCH_RV64I
274284
bool "RV64I"
275285
select 64BIT
276286
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
277-
select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
278-
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
279-
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
280-
select HAVE_FUNCTION_GRAPH_TRACER
281-
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
282287
select SWIOTLB if MMU
283288

284289
endchoice
@@ -502,7 +507,7 @@ config KEXEC_FILE
502507
select KEXEC_CORE
503508
select KEXEC_ELF
504509
select HAVE_IMA_KEXEC if IMA
505-
depends on 64BIT
510+
depends on 64BIT && MMU
506511
help
507512
This is new version of kexec system call. This system call is
508513
file based and takes file descriptors as system call argument
@@ -691,6 +696,8 @@ menu "CPU Power Management"
691696

692697
source "drivers/cpuidle/Kconfig"
693698

699+
source "drivers/cpufreq/Kconfig"
700+
694701
endmenu # "CPU Power Management"
695702

696703
source "arch/riscv/kvm/Kconfig"

arch/riscv/Kconfig.erratas

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,17 @@ config ERRATA_THEAD_CMO
6666

6767
If you don't know what to do here, say "Y".
6868

69+
config ERRATA_THEAD_PMU
70+
bool "Apply T-Head PMU errata"
71+
depends on ERRATA_THEAD && RISCV_PMU_SBI
72+
default y
73+
help
74+
The T-Head C9xx cores implement a PMU overflow extension very
75+
similar to the core SSCOFPMF extension.
76+
77+
This will apply the overflow errata to handle the non-standard
78+
behaviour via the regular SBI PMU driver and interface.
79+
80+
If you don't know what to do here, say "Y".
81+
6982
endmenu # "CPU errata selection"

arch/riscv/Kconfig.socs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ menu "SoC selection"
33
config SOC_MICROCHIP_POLARFIRE
44
bool "Microchip PolarFire SoCs"
55
select MCHP_CLK_MPFS
6-
select SIFIVE_PLIC
76
help
87
This enables support for Microchip PolarFire SoC platforms.
98

@@ -18,7 +17,6 @@ config SOC_SIFIVE
1817
select SERIAL_SIFIVE_CONSOLE if TTY
1918
select CLK_SIFIVE
2019
select CLK_SIFIVE_PRCI
21-
select SIFIVE_PLIC
2220
select ERRATA_SIFIVE if !XIP_KERNEL
2321
help
2422
This enables support for SiFive SoC platform hardware.
@@ -27,7 +25,6 @@ config SOC_STARFIVE
2725
bool "StarFive SoCs"
2826
select PINCTRL
2927
select RESET_CONTROLLER
30-
select SIFIVE_PLIC
3128
help
3229
This enables support for StarFive SoC platform hardware.
3330

@@ -39,7 +36,6 @@ config SOC_VIRT
3936
select POWER_RESET_SYSCON_POWEROFF
4037
select GOLDFISH
4138
select RTC_DRV_GOLDFISH if RTC_CLASS
42-
select SIFIVE_PLIC
4339
select PM_GENERIC_DOMAINS if PM
4440
select PM_GENERIC_DOMAINS_OF if PM && OF
4541
select RISCV_SBI_CPUIDLE if CPU_IDLE && RISCV_SBI
@@ -52,7 +48,6 @@ config SOC_CANAAN
5248
select CLINT_TIMER if RISCV_M_MODE
5349
select SERIAL_SIFIVE if TTY
5450
select SERIAL_SIFIVE_CONSOLE if TTY
55-
select SIFIVE_PLIC
5651
select ARCH_HAS_RESET_CONTROLLER
5752
select PINCTRL
5853
select COMMON_CLK

arch/riscv/boot/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ $(obj)/Image.lzma: $(obj)/Image FORCE
5656
$(obj)/Image.lzo: $(obj)/Image FORCE
5757
$(call if_changed,lzo)
5858

59+
$(obj)/Image.zst: $(obj)/Image FORCE
60+
$(call if_changed,zstd)
61+
5962
$(obj)/loader.bin: $(obj)/loader FORCE
6063
$(call if_changed,objcopy)
6164

arch/riscv/configs/defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ CONFIG_KVM=m
3939
CONFIG_JUMP_LABEL=y
4040
CONFIG_MODULES=y
4141
CONFIG_MODULE_UNLOAD=y
42+
CONFIG_SPARSEMEM_MANUAL=y
4243
CONFIG_BLK_DEV_THROTTLING=y
4344
CONFIG_NET=y
4445
CONFIG_PACKET=y
@@ -123,6 +124,7 @@ CONFIG_MICROSEMI_PHY=y
123124
CONFIG_INPUT_MOUSEDEV=y
124125
CONFIG_SERIAL_8250=y
125126
CONFIG_SERIAL_8250_CONSOLE=y
127+
CONFIG_SERIAL_8250_DW=y
126128
CONFIG_SERIAL_OF_PLATFORM=y
127129
CONFIG_SERIAL_SH_SCI=y
128130
CONFIG_VIRTIO_CONSOLE=y
@@ -162,6 +164,7 @@ CONFIG_RPMSG_CHAR=y
162164
CONFIG_RPMSG_CTRL=y
163165
CONFIG_RPMSG_VIRTIO=y
164166
CONFIG_ARCH_R9A07G043=y
167+
CONFIG_LIBNVDIMM=y
165168
CONFIG_EXT4_FS=y
166169
CONFIG_EXT4_FS_POSIX_ACL=y
167170
CONFIG_EXT4_FS_SECURITY=y

arch/riscv/errata/thead/errata.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ static bool errata_probe_cmo(unsigned int stage,
4747
return true;
4848
}
4949

50+
static bool errata_probe_pmu(unsigned int stage,
51+
unsigned long arch_id, unsigned long impid)
52+
{
53+
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PMU))
54+
return false;
55+
56+
/* target-c9xx cores report arch_id and impid as 0 */
57+
if (arch_id != 0 || impid != 0)
58+
return false;
59+
60+
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
61+
return false;
62+
63+
return true;
64+
}
65+
5066
static u32 thead_errata_probe(unsigned int stage,
5167
unsigned long archid, unsigned long impid)
5268
{
@@ -58,6 +74,9 @@ static u32 thead_errata_probe(unsigned int stage,
5874
if (errata_probe_cmo(stage, archid, impid))
5975
cpu_req_errata |= BIT(ERRATA_THEAD_CMO);
6076

77+
if (errata_probe_pmu(stage, archid, impid))
78+
cpu_req_errata |= BIT(ERRATA_THEAD_PMU);
79+
6180
return cpu_req_errata;
6281
}
6382

0 commit comments

Comments
 (0)