Commit 7943f06c authored by Linus Torvalds's avatar Linus Torvalds

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
parents 622a3ed1 cfb10de1
...@@ -777,8 +777,7 @@ config IRQ_STACKS ...@@ -777,8 +777,7 @@ config IRQ_STACKS
config THREAD_SIZE_ORDER config THREAD_SIZE_ORDER
int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT
range 0 4 range 0 4
default 1 if 32BIT && !KASAN default 1 if 32BIT
default 3 if 64BIT && KASAN
default 2 default 2
help help
Specify the Pages of thread stack size (from 4KB to 64KB), which also Specify the Pages of thread stack size (from 4KB to 64KB), which also
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
#include <linux/sizes.h> #include <linux/sizes.h>
/* thread information allocation */ /* thread information allocation */
#define THREAD_SIZE_ORDER CONFIG_THREAD_SIZE_ORDER #ifdef CONFIG_KASAN
#define KASAN_STACK_ORDER 1
#else
#define KASAN_STACK_ORDER 0
#endif
#define THREAD_SIZE_ORDER (CONFIG_THREAD_SIZE_ORDER + KASAN_STACK_ORDER)
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
/* /*
......
...@@ -22,13 +22,13 @@ static int pmu_legacy_ctr_get_idx(struct perf_event *event) ...@@ -22,13 +22,13 @@ static int pmu_legacy_ctr_get_idx(struct perf_event *event)
struct perf_event_attr *attr = &event->attr; struct perf_event_attr *attr = &event->attr;
if (event->attr.type != PERF_TYPE_HARDWARE) if (event->attr.type != PERF_TYPE_HARDWARE)
return -EOPNOTSUPP; return -ENOENT;
if (attr->config == PERF_COUNT_HW_CPU_CYCLES) if (attr->config == PERF_COUNT_HW_CPU_CYCLES)
return RISCV_PMU_LEGACY_CYCLE; return RISCV_PMU_LEGACY_CYCLE;
else if (attr->config == PERF_COUNT_HW_INSTRUCTIONS) else if (attr->config == PERF_COUNT_HW_INSTRUCTIONS)
return RISCV_PMU_LEGACY_INSTRET; return RISCV_PMU_LEGACY_INSTRET;
else else
return -EOPNOTSUPP; return -ENOENT;
} }
/* For legacy config & counter index are same */ /* For legacy config & counter index are same */
......
...@@ -309,7 +309,7 @@ static void pmu_sbi_check_event(struct sbi_pmu_event_data *edata) ...@@ -309,7 +309,7 @@ static void pmu_sbi_check_event(struct sbi_pmu_event_data *edata)
ret.value, 0x1, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0); ret.value, 0x1, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0);
} else if (ret.error == SBI_ERR_NOT_SUPPORTED) { } else if (ret.error == SBI_ERR_NOT_SUPPORTED) {
/* This event cannot be monitored by any counter */ /* This event cannot be monitored by any counter */
edata->event_idx = -EINVAL; edata->event_idx = -ENOENT;
} }
} }
...@@ -556,7 +556,7 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig) ...@@ -556,7 +556,7 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
} }
break; break;
default: default:
ret = -EINVAL; ret = -ENOENT;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment