Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-for-linus-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

- PERF_TYPE_BREAKPOINT now returns -EOPNOTSUPP instead of -ENOENT,
which aligns to other ports and is a saner value

- The KASAN-related stack size increasing logic has been moved to a C
header, to avoid dependency issues

* tag 'riscv-for-linus-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: Fix kernel stack size when KASAN is enabled
drivers/perf: riscv: Align errno for unsupported perf event

+11 -7
+1 -2
arch/riscv/Kconfig
··· 777 777 config THREAD_SIZE_ORDER 778 778 int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT 779 779 range 0 4 780 - default 1 if 32BIT && !KASAN 781 - default 3 if 64BIT && KASAN 780 + default 1 if 32BIT 782 781 default 2 783 782 help 784 783 Specify the Pages of thread stack size (from 4KB to 64KB), which also
+6 -1
arch/riscv/include/asm/thread_info.h
··· 13 13 #include <linux/sizes.h> 14 14 15 15 /* thread information allocation */ 16 - #define THREAD_SIZE_ORDER CONFIG_THREAD_SIZE_ORDER 16 + #ifdef CONFIG_KASAN 17 + #define KASAN_STACK_ORDER 1 18 + #else 19 + #define KASAN_STACK_ORDER 0 20 + #endif 21 + #define THREAD_SIZE_ORDER (CONFIG_THREAD_SIZE_ORDER + KASAN_STACK_ORDER) 17 22 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 18 23 19 24 /*
+2 -2
drivers/perf/riscv_pmu_legacy.c
··· 22 22 struct perf_event_attr *attr = &event->attr; 23 23 24 24 if (event->attr.type != PERF_TYPE_HARDWARE) 25 - return -EOPNOTSUPP; 25 + return -ENOENT; 26 26 if (attr->config == PERF_COUNT_HW_CPU_CYCLES) 27 27 return RISCV_PMU_LEGACY_CYCLE; 28 28 else if (attr->config == PERF_COUNT_HW_INSTRUCTIONS) 29 29 return RISCV_PMU_LEGACY_INSTRET; 30 30 else 31 - return -EOPNOTSUPP; 31 + return -ENOENT; 32 32 } 33 33 34 34 /* For legacy config & counter index are same */
+2 -2
drivers/perf/riscv_pmu_sbi.c
··· 309 309 ret.value, 0x1, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0); 310 310 } else if (ret.error == SBI_ERR_NOT_SUPPORTED) { 311 311 /* This event cannot be monitored by any counter */ 312 - edata->event_idx = -EINVAL; 312 + edata->event_idx = -ENOENT; 313 313 } 314 314 } 315 315 ··· 556 556 } 557 557 break; 558 558 default: 559 - ret = -EINVAL; 559 + ret = -ENOENT; 560 560 break; 561 561 } 562 562