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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -777,8 +777,7 @@ config IRQ_STACKS
config THREAD_SIZE_ORDER
	int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT
	range 0 4
	default 1 if 32BIT && !KASAN
	default 3 if 64BIT && KASAN
	default 1 if 32BIT
	default 2
	help
	  Specify the Pages of thread stack size (from 4KB to 64KB), which also
+6 −1
Original line number Diff line number Diff line
@@ -13,7 +13,12 @@
#include <linux/sizes.h>

/* 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)

/*
+2 −2
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@ static int pmu_legacy_ctr_get_idx(struct perf_event *event)
	struct perf_event_attr *attr = &event->attr;

	if (event->attr.type != PERF_TYPE_HARDWARE)
		return -EOPNOTSUPP;
		return -ENOENT;
	if (attr->config == PERF_COUNT_HW_CPU_CYCLES)
		return RISCV_PMU_LEGACY_CYCLE;
	else if (attr->config == PERF_COUNT_HW_INSTRUCTIONS)
		return RISCV_PMU_LEGACY_INSTRET;
	else
		return -EOPNOTSUPP;
		return -ENOENT;
}

/* For legacy config & counter index are same */
+2 −2
Original line number Diff line number Diff line
@@ -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);
	} else if (ret.error == SBI_ERR_NOT_SUPPORTED) {
		/* 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)
		}
		break;
	default:
		ret = -EINVAL;
		ret = -ENOENT;
		break;
	}