Skip to content

Commit 67e4562

Browse files
committed
Merge tag 'riscv-for-linus-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: "A handful of build fixes, all found by Huawei's autobuilder. None of these patches should have any functional impact on kernels that build, and they're mostly related to various features intermingling with !MMU. While some of these might be better hoisted to generic code, it seems better to have the simple fixes in the meanwhile. As far as I know these are the only outstanding patches for 5.7" * tag 'riscv-for-linus-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id' riscv: pgtable: Fix __kernel_map_pages build error if NOMMU riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU riscv: Disable ARCH_HAS_DEBUG_VIRTUAL if NOMMU riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU riscv: stacktrace: Fix undefined reference to `walk_stackframe' riscv: Fix unmet direct dependencies built based on SOC_VIRT riscv: perf: RISCV_BASE_PMU should be independent riscv: perf_event: Make some funciton static
2 parents 01d8a74 + ed1ed4c commit 67e4562

File tree

9 files changed

+25
-21
lines changed

9 files changed

+25
-21
lines changed

arch/riscv/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ config RISCV
5454
select GENERIC_ARCH_TOPOLOGY if SMP
5555
select ARCH_HAS_PTE_SPECIAL
5656
select ARCH_HAS_MMIOWB
57-
select ARCH_HAS_DEBUG_VIRTUAL
57+
select ARCH_HAS_DEBUG_VIRTUAL if MMU
5858
select HAVE_EBPF_JIT if MMU
5959
select EDAC_SUPPORT
6060
select ARCH_HAS_GIGANTIC_PAGE
@@ -136,6 +136,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
136136
def_bool y
137137

138138
config SYS_SUPPORTS_HUGETLBFS
139+
depends on MMU
139140
def_bool y
140141

141142
config STACKTRACE_SUPPORT

arch/riscv/Kconfig.socs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ config SOC_SIFIVE
1111
This enables support for SiFive SoC platform hardware.
1212

1313
config SOC_VIRT
14-
bool "QEMU Virt Machine"
15-
select POWER_RESET_SYSCON
16-
select POWER_RESET_SYSCON_POWEROFF
17-
select GOLDFISH
18-
select RTC_DRV_GOLDFISH
19-
select SIFIVE_PLIC
20-
help
21-
This enables support for QEMU Virt Machine.
14+
bool "QEMU Virt Machine"
15+
select POWER_RESET
16+
select POWER_RESET_SYSCON
17+
select POWER_RESET_SYSCON_POWEROFF
18+
select GOLDFISH
19+
select RTC_DRV_GOLDFISH if RTC_CLASS
20+
select SIFIVE_PLIC
21+
help
22+
This enables support for QEMU Virt Machine.
2223

2324
config SOC_KENDRYTE
2425
bool "Kendryte K210 SoC"

arch/riscv/include/asm/mmio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#ifndef CONFIG_MMU
1818
#define pgprot_noncached(x) (x)
19+
#define pgprot_writecombine(x) (x)
20+
#define pgprot_device(x) (x)
1921
#endif /* CONFIG_MMU */
2022

2123
/* Generic IO read/write. These perform native-endian accesses. */

arch/riscv/include/asm/mmiowb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
#define mmiowb() __asm__ __volatile__ ("fence o,w" : : : "memory");
1111

12+
#include <linux/smp.h>
1213
#include <asm-generic/mmiowb.h>
1314

1415
#endif /* _ASM_RISCV_MMIOWB_H */

arch/riscv/include/asm/perf_event.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@
1212
#include <linux/ptrace.h>
1313
#include <linux/interrupt.h>
1414

15+
#ifdef CONFIG_RISCV_BASE_PMU
1516
#define RISCV_BASE_COUNTERS 2
1617

1718
/*
1819
* The RISCV_MAX_COUNTERS parameter should be specified.
1920
*/
2021

21-
#ifdef CONFIG_RISCV_BASE_PMU
2222
#define RISCV_MAX_COUNTERS 2
23-
#endif
24-
25-
#ifndef RISCV_MAX_COUNTERS
26-
#error "Please provide a valid RISCV_MAX_COUNTERS for the PMU."
27-
#endif
2823

2924
/*
3025
* These are the indexes of bits in counteren register *minus* 1,
@@ -82,6 +77,7 @@ struct riscv_pmu {
8277
int irq;
8378
};
8479

80+
#endif
8581
#ifdef CONFIG_PERF_EVENTS
8682
#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs
8783
#endif

arch/riscv/include/asm/pgtable.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,12 +470,15 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
470470

471471
#else /* CONFIG_MMU */
472472

473+
#define PAGE_SHARED __pgprot(0)
473474
#define PAGE_KERNEL __pgprot(0)
474475
#define swapper_pg_dir NULL
475476
#define VMALLOC_START 0
476477

477478
#define TASK_SIZE 0xffffffffUL
478479

480+
static inline void __kernel_map_pages(struct page *page, int numpages, int enable) {}
481+
479482
#endif /* !CONFIG_MMU */
480483

481484
#define kern_addr_valid(addr) (1) /* FIXME */

arch/riscv/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o
4343
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
4444
obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o
4545

46-
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
46+
obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o
4747
obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
4848
obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
4949
obj-$(CONFIG_RISCV_SBI) += sbi.o

arch/riscv/kernel/perf_event.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int riscv_map_hw_event(u64 config)
147147
return riscv_pmu->hw_events[config];
148148
}
149149

150-
int riscv_map_cache_decode(u64 config, unsigned int *type,
150+
static int riscv_map_cache_decode(u64 config, unsigned int *type,
151151
unsigned int *op, unsigned int *result)
152152
{
153153
return -ENOENT;
@@ -342,7 +342,7 @@ static void riscv_pmu_del(struct perf_event *event, int flags)
342342

343343
static DEFINE_MUTEX(pmc_reserve_mutex);
344344

345-
irqreturn_t riscv_base_pmu_handle_irq(int irq_num, void *dev)
345+
static irqreturn_t riscv_base_pmu_handle_irq(int irq_num, void *dev)
346346
{
347347
return IRQ_NONE;
348348
}
@@ -361,7 +361,7 @@ static int reserve_pmc_hardware(void)
361361
return err;
362362
}
363363

364-
void release_pmc_hardware(void)
364+
static void release_pmc_hardware(void)
365365
{
366366
mutex_lock(&pmc_reserve_mutex);
367367
if (riscv_pmu->irq >= 0)
@@ -464,7 +464,7 @@ static const struct of_device_id riscv_pmu_of_ids[] = {
464464
{ /* sentinel value */ }
465465
};
466466

467-
int __init init_hw_perf_events(void)
467+
static int __init init_hw_perf_events(void)
468468
{
469469
struct device_node *node = of_find_node_by_type(NULL, "pmu");
470470
const struct of_device_id *of_id;

arch/riscv/kernel/stacktrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
6565

6666
#else /* !CONFIG_FRAME_POINTER */
6767

68-
static void notrace walk_stackframe(struct task_struct *task,
68+
void notrace walk_stackframe(struct task_struct *task,
6969
struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
7070
{
7171
unsigned long sp, pc;

0 commit comments

Comments
 (0)