Skip to contentSkip to conversation

lib: sbi: sse: rework event availability

PATCH Superseded Clément Léger 2 participants 11 messages Dec 10, 2024 – Dec 12, 2024

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover lib: sbi: sse: rework event availability

While reworking the Linux SSE support, it appears that the PMU event should not be available if the SSCOFPMF extension is not available since there would be no IRQ. A request to modify the specification has been send in order to add the possbility to return SBI_ENOTSUPP (see [1]). This small series modifies the SSE core to detect event support at boot time using a new callback and return SBI_ENOTSUPP if needed.

---

Changes in v2:
- Add an sse_event_info struct that stores 'cb_ops' as well as 'supported'
- Move SSE initialization after all other "drivers" init.
- Split changes in multiple commits
- Added an is_supported callback to check for event availability

Cl?ment L?ger (4):
lib: sbi: sse: return an error value from sse_event_get()
lib: sbi: sse: rework event availability
lib: sbi: sse: add a is_supported_cb() callback
lib: sbi: pmu: add an sse .is_supported_cb callback implementation

 include/sbi/sbi_sse.h |   5 ++
 lib/sbi/sbi_init.c    |  20 +++---
 lib/sbi/sbi_pmu.c     |  13 +++-
 lib/sbi/sbi_sse.c     | 162 +++++++++++++++++++++++++++---------------
 4 files changed, 131 insertions(+), 69 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/4 lib: sbi: sse: return an error value from sse_event_get()

Since event support will be checked in the next commits, return a value from sse_event_get() to allow propagating it. This will be used to report SBI_ERR_NOT_SUPPORTED when an event isn't supported.

---
 lib/sbi/sbi_sse.c | 69 ++++++++++++++++++++++++-----------------------
 1 file changed, 35 insertions(+), 34 deletions(-)
lib/sbi/sbi_sse.c +35 -34
index c9f9a9dd..ed07844a 100644
@@ -244,7 +244,7 @@ static void sse_event_set_state(struct sbi_sse_event *e,
 	e->attrs.status |= new_state;
 }
 
-static struct sbi_sse_event *sse_event_get(uint32_t event_id)
+static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret)
 {
 	unsigned int i;
 	struct sbi_sse_event *e;
@@ -255,19 +255,22 @@ static struct sbi_sse_event *sse_event_get(uint32_t event_id)
 			e = &global_events[i].event;
 			if (e->event_id == event_id) {
 				spin_lock(&global_events[i].lock);
-				return e;
+				*eret = e;
+				return SBI_SUCCESS;
 			}
 		}
 	} else {
 		shs = sse_thishart_state_ptr();
 		for (i = 0; i < local_event_count; i++) {
 			e = &shs->local_events[i];
-			if (e->event_id == event_id)
-				return e;
+			if (e->event_id == event_id) {
+				*eret = e;
+				return SBI_SUCCESS;
+			}
 		}
 	}
 
-	return NULL;
+	return SBI_EINVAL;
 }
 
 static void sse_event_put(struct sbi_sse_event *e)
@@ -653,8 +656,7 @@ static void sse_ipi_inject_process(struct sbi_scratch *scratch)
 
 	/* Mark all queued events as pending */
 	while (!sbi_fifo_dequeue(sse_inject_fifo_r, &evt)) {
-		e = sse_event_get(evt.event_id);
-		if (!e)
+		if (sse_event_get(evt.event_id, &e))
 			continue;
 
 		sse_event_set_pending(e);
@@ -696,10 +698,9 @@ static int sse_inject_event(uint32_t event_id, unsigned long hartid)
 	int ret;
 	struct sbi_sse_event *e;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
-
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	/* In case of global event, provided hart_id is ignored */
 	if (sse_event_is_global(e))
@@ -788,9 +789,9 @@ int sbi_sse_enable(uint32_t event_id)
 	int ret;
 	struct sbi_sse_event *e;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	sse_enabled_event_lock(e);
 	ret = sse_event_enable(e);
@@ -805,9 +806,9 @@ int sbi_sse_disable(uint32_t event_id)
 	int ret;
 	struct sbi_sse_event *e;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	sse_enabled_event_lock(e);
 	ret = sse_event_disable(e);
@@ -865,14 +866,15 @@ int sbi_sse_inject_event(uint32_t event_id)
 
 int sbi_sse_set_cb_ops(uint32_t event_id, const struct sbi_sse_cb_ops *cb_ops)
 {
+	int ret;
 	struct sbi_sse_event *e;
 
 	if (cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
 		return SBI_EINVAL;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	e->cb_ops = cb_ops;
 	sse_event_put(e);
@@ -943,9 +945,9 @@ int sbi_sse_read_attrs(uint32_t event_id, uint32_t base_attr_id,
 	if (ret)
 		return ret;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	sbi_hart_map_saddr(output_phys_lo, sizeof(unsigned long) * attr_count);
 
@@ -1008,9 +1010,9 @@ int sbi_sse_write_attrs(uint32_t event_id, uint32_t base_attr_id,
 	if (ret)
 		return ret;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	ret = sse_write_attrs(e, base_attr_id, attr_count, input_phys_lo);
 	sse_event_put(e);
@@ -1033,9 +1035,9 @@ int sbi_sse_register(uint32_t event_id, unsigned long handler_entry_pc,
 					 SBI_DOMAIN_EXECUTE))
 		return SBI_EINVALID_ADDR;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	ret = sse_event_register(e, handler_entry_pc, handler_entry_arg);
 	sse_event_put(e);
@@ -1048,9 +1050,9 @@ int sbi_sse_unregister(uint32_t event_id)
 	int ret;
 	struct sbi_sse_event *e;
 
-	e = sse_event_get(event_id);
-	if (!e)
-		return SBI_EINVAL;
+	ret = sse_event_get(event_id, &e);
+	if (ret)
+		return ret;
 
 	ret = sse_event_unregister(e);
 	sse_event_put(e);
@@ -1192,8 +1194,7 @@ void sbi_sse_exit(struct sbi_scratch *scratch)
 	struct sbi_sse_event *e;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		e = sse_event_get(supported_events[i]);
-		if (!e)
+		if (sse_event_get(supported_events[i], &e))
 			continue;
 
 		if (e->attrs.hartid != current_hartid())
Signature · 1 line
2.45.2
#2 lore raw

PATCH v2 1/4 lib: sbi: sse: return an error value from sse_event_get()

Quoted 8 lines · Cl?ment L?ger

Since event support will be checked in the next commits, return a value from sse_event_get() to allow propagating it. This will be used to report SBI_ERR_NOT_SUPPORTED when an event isn't supported.

---
 lib/sbi/sbi_sse.c | 69 ++++++++++++++++++++++++-----------------------
 1 file changed, 35 insertions(+), 34 deletions(-)
#3 lore raw

PATCH v2 2/4 lib: sbi: sse: rework event availability

In reply to Clément Léger

In order to detect events that are available and supported, add a per event 'supported' property.

To make full use of that property, add a new struct sse_event_info which contains the 'cb_ops' as well as a 'supported' boolean. The cb_ops are now global for a specific event_id and can be filled by drivers before calling sse init which will use the callback to determine which events are available. Thanks to that, we can also allocate only the supported events and defer sse probing. All events are declared as supported to keep the existing behavior. Since the callback operations can now be registered once for all harts, move the pmu sse_set_cb_ops() callback to the cold_boot 'if'.

Checking the new additional 'supported' property is only done when we fail from getting an event so that there is no performance cost.

---
 lib/sbi/sbi_init.c |  20 ++++-----
 lib/sbi/sbi_pmu.c  |   4 +-
 lib/sbi/sbi_sse.c  | 104 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 86 insertions(+), 42 deletions(-)
lib/sbi/sbi_init.c +10 -10
index 0736345d..dd8b990f 100644
@@ -262,12 +262,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, true);
-	if (rc) {
-		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
-		sbi_hart_hang();
-	}
-
 	rc = sbi_pmu_init(scratch, true);
 	if (rc) {
 		sbi_printf("%s: pmu init failed (error %d)\n",
@@ -317,6 +311,12 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 		sbi_printf("%s: mpxy init failed (error %d)\n", __func__, rc);
 		sbi_hart_hang();
 	}
+
+	rc = sbi_sse_init(scratch, true);
+	if (rc) {
+		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
+		sbi_hart_hang();
+	}
 	/*
 	 * Note: Finalize domains after HSM initialization so that we
 	 * can startup non-root domains.
@@ -404,10 +404,6 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, false);
-	if (rc)
-		sbi_hart_hang();
-
 	rc = sbi_pmu_init(scratch, false);
 	if (rc)
 		sbi_hart_hang();
@@ -440,6 +436,10 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
+	rc = sbi_sse_init(scratch, false);
+	if (rc)
+		sbi_hart_hang();
+
 	/*
 	 * Configure PMP at last because if SMEPMP is detected,
 	 * M-mode access to the S/U space will be rescinded.
lib/sbi/sbi_pmu.c +2 -2
index 0696ab5e..6f192440 100644
@@ -1153,9 +1153,9 @@ int sbi_pmu_init(struct sbi_scratch *scratch, bool cold_boot)
 			return SBI_EINVAL;
 
 		total_ctrs = num_hw_ctrs + SBI_PMU_FW_CTR_MAX;
-	}
 
-	sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+		sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+	}
 
 	phs = pmu_get_hart_state_ptr(scratch);
 	if (!phs) {
lib/sbi/sbi_sse.c +74 -30

203 lines not on this page · raw message

Signature · 1 line
2.45.2
#4 lore raw

PATCH v2 2/4 lib: sbi: sse: rework event availability

Hi Cl?ment,

Quoted 13 lines · Cl?ment L?ger

In order to detect events that are available and supported, add a per event 'supported' property.

To make full use of that property, add a new struct sse_event_info which contains the 'cb_ops' as well as a 'supported' boolean. The cb_ops are now global for a specific event_id and can be filled by drivers before calling sse init which will use the callback to determine which events are available. Thanks to that, we can also allocate only the supported events and defer sse probing. All events are declared as supported to keep the existing behavior. Since the callback operations can now be registered once for all harts, move the pmu sse_set_cb_ops() callback to the cold_boot 'if'.

Quoted 2 lines

Checking the new additional 'supported' property is only done when we fail from getting an event so that there is no performance cost.

Looks like a good design. It does prevent supporting a local event on some harts but not others, but that's probably not worth considering until there's an actual need for it.

Quoted 25 lines
---
 lib/sbi/sbi_init.c |  20 ++++-----
 lib/sbi/sbi_pmu.c  |   4 +-
 lib/sbi/sbi_sse.c  | 104 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 86 insertions(+), 42 deletions(-)
lib/sbi/sbi_init.c +0 -6
index 0736345d..dd8b990f 100644
@@ -262,12 +262,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, true);
-	if (rc) {
-		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
-		sbi_hart_hang();
-	}
-
 	rc = sbi_pmu_init(scratch, true);
 	if (rc) {
 		sbi_printf("%s: pmu init failed (error %d)\n",

lib/sbi/sbi_init.c static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) · line 319

Quoted 9 lines
lib/sbi/sbi_init.c +6 -0
@@ -317,6 +311,12 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 		sbi_printf("%s: mpxy init failed (error %d)\n", __func__, rc);
 		sbi_hart_hang();
 	}
+
+	rc = sbi_sse_init(scratch, true);
+	if (rc) {
+		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
+		sbi_hart_hang();
+	}

Should have a blank line here.

Quoted 125 lines
lib/sbi/sbi_init.c +4 -4
 	/*
 	 * Note: Finalize domains after HSM initialization so that we
 	 * can startup non-root domains.
@@ -404,10 +404,6 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, false);
-	if (rc)
-		sbi_hart_hang();
-
 	rc = sbi_pmu_init(scratch, false);
 	if (rc)
 		sbi_hart_hang();
@@ -440,6 +436,10 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
+	rc = sbi_sse_init(scratch, false);
+	if (rc)
+		sbi_hart_hang();
+
 	/*
 	 * Configure PMP at last because if SMEPMP is detected,
 	 * M-mode access to the S/U space will be rescinded.
lib/sbi/sbi_pmu.c +2 -2
index 0696ab5e..6f192440 100644
@@ -1153,9 +1153,9 @@ int sbi_pmu_init(struct sbi_scratch *scratch, bool cold_boot)
 			return SBI_EINVAL;
 
 		total_ctrs = num_hw_ctrs + SBI_PMU_FW_CTR_MAX;
-	}
 
-	sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+		sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+	}
 
 	phs = pmu_get_hart_state_ptr(scratch);
 	if (!phs) {
lib/sbi/sbi_sse.c +42 -11
index ed07844a..4c186a22 100644
@@ -39,21 +39,28 @@
 
 #define EVENT_IS_GLOBAL(__event_id) ((__event_id) & SBI_SSE_EVENT_GLOBAL_BIT)
 
-static const uint32_t supported_events[] = {
-	SBI_SSE_EVENT_LOCAL_RAS,
-	SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP,
-	SBI_SSE_EVENT_GLOBAL_RAS,
-	SBI_SSE_EVENT_LOCAL_PMU,
-	SBI_SSE_EVENT_LOCAL_SOFTWARE,
-	SBI_SSE_EVENT_GLOBAL_SOFTWARE,
+struct sse_event_info {
+	uint32_t event_id;
+	bool supported;
+	const struct sbi_sse_cb_ops *cb_ops;
+};
+
+static struct sse_event_info valid_events[] = {
+	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = true},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE, .supported = true},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_SOFTWARE, .supported = true},
 };
 
-#define EVENT_COUNT array_size(supported_events)
+#define EVENT_COUNT array_size(valid_events)
 
 #define sse_event_invoke_cb(_event, _cb, ...)                                 \
 	{                                                                     \
-		if (_event->cb_ops && _event->cb_ops->_cb)                    \
-			_event->cb_ops->_cb(_event->event_id, ##__VA_ARGS__); \
+		const struct sbi_sse_cb_ops *__ops = _event->info->cb_ops;    \
+		if (__ops && __ops->_cb)                                          \
+			__ops->_cb(_event->event_id, ##__VA_ARGS__);            \
 	}
 
 struct sse_entry_state {
@@ -110,7 +117,7 @@ struct sbi_sse_event {
 	struct sbi_sse_event_attrs attrs;
 	uint32_t event_id;
 	u32 hartindex;
-	const struct sbi_sse_cb_ops *cb_ops;
+	struct sse_event_info *info;
 	struct sbi_dlist node;
 };
 
@@ -244,6 +251,30 @@ static void sse_event_set_state(struct sbi_sse_event *e,
 	e->attrs.status |= new_state;
 }
 
+static struct sse_event_info *sse_event_info_get(uint32_t event_id)
+{
+	struct sse_event_info *info;
+	int i;
+
+	for (i = 0; i < EVENT_COUNT; i++) {
+		info = &valid_events[i];
+		if (info->event_id == event_id)
+			return info;
+	}
+
+	return NULL;
+}
+
+static int sse_event_is_supported(uint32_t event_id)
+{
+	struct sse_event_info *info = sse_event_info_get(event_id);
+
+	if (!info)
+		return SBI_EINVAL;
+
+	return info->supported ? SBI_SUCCESS : SBI_ENOTSUPP;
+}
+
 static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret)
 {
 	unsigned int i;

lib/sbi/sbi_sse.c static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret) · line 304

Quoted 5 lines
lib/sbi/sbi_sse.c +1 -1
@@ -270,7 +301,7 @@ static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret)
 		}
 	}
 
-	return SBI_EINVAL;
+	return sse_event_is_supported(event_id);

I don't like that sse_event_is_supported() can return SBI_SUCCESS while this function has not initialized eret. I don't think this can actually happen in practice -- all actually supported events will have a struct sbi_sse_event allocated -- but I think it at least deserves a comment.

Regards,
Samuel

Quoted 129 lines
lib/sbi/sbi_sse.c +31 -18
 }
 
 static void sse_event_put(struct sbi_sse_event *e)
@@ -866,18 +897,16 @@ int sbi_sse_inject_event(uint32_t event_id)
 
 int sbi_sse_set_cb_ops(uint32_t event_id, const struct sbi_sse_cb_ops *cb_ops)
 {
-	int ret;
-	struct sbi_sse_event *e;
+	struct sse_event_info *info;
 
-	if (cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
+	info = sse_event_info_get(event_id);
+	if (!info)
 		return SBI_EINVAL;
 
-	ret = sse_event_get(event_id, &e);
-	if (ret)
-		return ret;
+	if (cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
+		return SBI_EINVAL;
 
-	e->cb_ops = cb_ops;
-	sse_event_put(e);
+	info->cb_ops = cb_ops;
 
 	return SBI_OK;
 }
@@ -1060,21 +1089,27 @@ int sbi_sse_unregister(uint32_t event_id)
 	return ret;
 }
 
-static void sse_event_init(struct sbi_sse_event *e, uint32_t event_id)
+static void sse_event_init(struct sbi_sse_event *e, struct sse_event_info *info)
 {
-	e->event_id = event_id;
+	e->event_id = info->event_id;
+	e->info = info;
 	e->hartindex = current_hartindex();
 	e->attrs.hartid = current_hartid();
 	/* Declare all events as injectable */
 	e->attrs.status |= BIT(SBI_SSE_ATTR_STATUS_INJECT_OFFSET);
 }
 
-static void sse_event_count_init()
+static void sse_event_info_init(void)
 {
 	unsigned int i;
+	struct sse_event_info *info;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported)
+			continue;
+
+		if (EVENT_IS_GLOBAL(info->event_id))
 			global_event_count++;
 		else
 			local_event_count++;
@@ -1083,6 +1118,7 @@ static void sse_event_count_init()
 
 static int sse_global_init()
 {
+	struct sse_event_info *info;
 	struct sbi_sse_event *e;
 	unsigned int i, ev = 0;
 
@@ -1091,11 +1127,12 @@ static int sse_global_init()
 		return SBI_ENOMEM;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (!EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported || !EVENT_IS_GLOBAL(info->event_id))
 			continue;
 
 		e = &global_events[ev].event;
-		sse_event_init(e, supported_events[i]);
+		sse_event_init(e, info);
 		SPIN_LOCK_INIT(global_events[ev].lock);
 
 		ev++;
@@ -1106,16 +1143,18 @@ static int sse_global_init()
 
 static void sse_local_init(struct sse_hart_state *shs)
 {
+	struct sse_event_info *info;
 	unsigned int i, ev = 0;
 
 	SBI_INIT_LIST_HEAD(&shs->enabled_event_list);
 	SPIN_LOCK_INIT(shs->enabled_event_lock);
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported || EVENT_IS_GLOBAL(info->event_id))
 			continue;
 
-		sse_event_init(&shs->local_events[ev++], supported_events[i]);
+		sse_event_init(&shs->local_events[ev++], info);
 	}
 }
 
@@ -1127,7 +1166,7 @@ int sbi_sse_init(struct sbi_scratch *scratch, bool cold_boot)
 	struct sbi_fifo *sse_inject_q;
 
 	if (cold_boot) {
-		sse_event_count_init();
+		sse_event_info_init();
 
 		ret = sse_global_init();
 		if (ret)
@@ -1192,9 +1231,14 @@ void sbi_sse_exit(struct sbi_scratch *scratch)
 {
 	int i;
 	struct sbi_sse_event *e;
+	struct sse_event_info *info;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (sse_event_get(supported_events[i], &e))
+		info = &valid_events[i];
+		if (!info->supported)
+			continue;
+
+		if (sse_event_get(info->event_id, &e))
 			continue;
 
 		if (e->attrs.hartid != current_hartid())
#5 lore raw

PATCH v2 2/4 lib: sbi: sse: rework event availability

Quoted 16 lines · Samuel Holland

Hi Cl?ment,

Quoted 13 lines · Cl?ment L?ger

In order to detect events that are available and supported, add a per event 'supported' property.

To make full use of that property, add a new struct sse_event_info which contains the 'cb_ops' as well as a 'supported' boolean. The cb_ops are now global for a specific event_id and can be filled by drivers before calling sse init which will use the callback to determine which events are available. Thanks to that, we can also allocate only the supported events and defer sse probing. All events are declared as supported to keep the existing behavior. Since the callback operations can now be registered once for all harts, move the pmu sse_set_cb_ops() callback to the cold_boot 'if'.

Quoted 6 lines
Quoted 2 lines

Checking the new additional 'supported' property is only done when we fail from getting an event so that there is no performance cost.

Looks like a good design. It does prevent supporting a local event on some harts but not others, but that's probably not worth considering until there's an actual need for it.

That's a good comment and I can actually modify that pretty easily to have per hart local_event_count. I'll do that for the next version.

Quoted 166 lines
Quoted 26 lines
---
 lib/sbi/sbi_init.c |  20 ++++-----
 lib/sbi/sbi_pmu.c  |   4 +-
 lib/sbi/sbi_sse.c  | 104 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 86 insertions(+), 42 deletions(-)
lib/sbi/sbi_init.c +0 -6
index 0736345d..dd8b990f 100644
@@ -262,12 +262,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, true);
-	if (rc) {
-		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
-		sbi_hart_hang();
-	}
-
 	rc = sbi_pmu_init(scratch, true);
 	if (rc) {
 		sbi_printf("%s: pmu init failed (error %d)\n",

lib/sbi/sbi_init.c static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) · line 319

Quoted 9 lines
lib/sbi/sbi_init.c +6 -0
@@ -317,6 +311,12 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 		sbi_printf("%s: mpxy init failed (error %d)\n", __func__, rc);
 		sbi_hart_hang();
 	}
+
+	rc = sbi_sse_init(scratch, true);
+	if (rc) {
+		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
+		sbi_hart_hang();
+	}

Should have a blank line here.

Quoted 128 lines
lib/sbi/sbi_init.c +4 -4
 	/*
 	 * Note: Finalize domains after HSM initialization so that we
 	 * can startup non-root domains.
@@ -404,10 +404,6 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_sse_init(scratch, false);
-	if (rc)
-		sbi_hart_hang();
-
 	rc = sbi_pmu_init(scratch, false);
 	if (rc)
 		sbi_hart_hang();
@@ -440,6 +436,10 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
 	if (rc)
 		sbi_hart_hang();
 
+	rc = sbi_sse_init(scratch, false);
+	if (rc)
+		sbi_hart_hang();
+
 	/*
 	 * Configure PMP at last because if SMEPMP is detected,
 	 * M-mode access to the S/U space will be rescinded.
lib/sbi/sbi_pmu.c +2 -2
index 0696ab5e..6f192440 100644
@@ -1153,9 +1153,9 @@ int sbi_pmu_init(struct sbi_scratch *scratch, bool cold_boot)
 			return SBI_EINVAL;
 
 		total_ctrs = num_hw_ctrs + SBI_PMU_FW_CTR_MAX;
-	}
 
-	sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+		sbi_sse_set_cb_ops(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops);
+	}
 
 	phs = pmu_get_hart_state_ptr(scratch);
 	if (!phs) {
lib/sbi/sbi_sse.c +42 -11
index ed07844a..4c186a22 100644
@@ -39,21 +39,28 @@
 
 #define EVENT_IS_GLOBAL(__event_id) ((__event_id) & SBI_SSE_EVENT_GLOBAL_BIT)
 
-static const uint32_t supported_events[] = {
-	SBI_SSE_EVENT_LOCAL_RAS,
-	SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP,
-	SBI_SSE_EVENT_GLOBAL_RAS,
-	SBI_SSE_EVENT_LOCAL_PMU,
-	SBI_SSE_EVENT_LOCAL_SOFTWARE,
-	SBI_SSE_EVENT_GLOBAL_SOFTWARE,
+struct sse_event_info {
+	uint32_t event_id;
+	bool supported;
+	const struct sbi_sse_cb_ops *cb_ops;
+};
+
+static struct sse_event_info valid_events[] = {
+	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = true},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE, .supported = true},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_SOFTWARE, .supported = true},
 };
 
-#define EVENT_COUNT array_size(supported_events)
+#define EVENT_COUNT array_size(valid_events)
 
 #define sse_event_invoke_cb(_event, _cb, ...)                                 \
 	{                                                                     \
-		if (_event->cb_ops && _event->cb_ops->_cb)                    \
-			_event->cb_ops->_cb(_event->event_id, ##__VA_ARGS__); \
+		const struct sbi_sse_cb_ops *__ops = _event->info->cb_ops;    \
+		if (__ops && __ops->_cb)                                          \
+			__ops->_cb(_event->event_id, ##__VA_ARGS__);            \
 	}
 
 struct sse_entry_state {
@@ -110,7 +117,7 @@ struct sbi_sse_event {
 	struct sbi_sse_event_attrs attrs;
 	uint32_t event_id;
 	u32 hartindex;
-	const struct sbi_sse_cb_ops *cb_ops;
+	struct sse_event_info *info;
 	struct sbi_dlist node;
 };
 
@@ -244,6 +251,30 @@ static void sse_event_set_state(struct sbi_sse_event *e,
 	e->attrs.status |= new_state;
 }
 
+static struct sse_event_info *sse_event_info_get(uint32_t event_id)
+{
+	struct sse_event_info *info;
+	int i;
+
+	for (i = 0; i < EVENT_COUNT; i++) {
+		info = &valid_events[i];
+		if (info->event_id == event_id)
+			return info;
+	}
+
+	return NULL;
+}
+
+static int sse_event_is_supported(uint32_t event_id)
+{
+	struct sse_event_info *info = sse_event_info_get(event_id);
+
+	if (!info)
+		return SBI_EINVAL;
+
+	return info->supported ? SBI_SUCCESS : SBI_ENOTSUPP;
+}
+
 static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret)
 {
 	unsigned int i;
@@ -270,7 +301,7 @@ static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret)
 		}
 	}
 
Quoted 7 lines

lib/sbi/sbi_sse.c static int sse_event_get(uint32_t event_id, struct sbi_sse_event **eret) · line 304

Quoted 2 lines
lib/sbi/sbi_sse.c +1 -1
-	return SBI_EINVAL;
+	return sse_event_is_supported(event_id);

I don't like that sse_event_is_supported() can return SBI_SUCCESS while this function has not initialized eret. I don't think this can actually happen in practice -- all actually supported events will have a struct sbi_sse_event allocated -- but I think it at least deserves a comment.

Sure, let's be conservative and return an error if eret isn't set in all cases.

Thanks,

Cl?ment

Quoted 134 lines

Regards,
Samuel

Quoted 129 lines
lib/sbi/sbi_sse.c +31 -18
 }
 
 static void sse_event_put(struct sbi_sse_event *e)
@@ -866,18 +897,16 @@ int sbi_sse_inject_event(uint32_t event_id)
 
 int sbi_sse_set_cb_ops(uint32_t event_id, const struct sbi_sse_cb_ops *cb_ops)
 {
-	int ret;
-	struct sbi_sse_event *e;
+	struct sse_event_info *info;
 
-	if (cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
+	info = sse_event_info_get(event_id);
+	if (!info)
 		return SBI_EINVAL;
 
-	ret = sse_event_get(event_id, &e);
-	if (ret)
-		return ret;
+	if (cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
+		return SBI_EINVAL;
 
-	e->cb_ops = cb_ops;
-	sse_event_put(e);
+	info->cb_ops = cb_ops;
 
 	return SBI_OK;
 }
@@ -1060,21 +1089,27 @@ int sbi_sse_unregister(uint32_t event_id)
 	return ret;
 }
 
-static void sse_event_init(struct sbi_sse_event *e, uint32_t event_id)
+static void sse_event_init(struct sbi_sse_event *e, struct sse_event_info *info)
 {
-	e->event_id = event_id;
+	e->event_id = info->event_id;
+	e->info = info;
 	e->hartindex = current_hartindex();
 	e->attrs.hartid = current_hartid();
 	/* Declare all events as injectable */
 	e->attrs.status |= BIT(SBI_SSE_ATTR_STATUS_INJECT_OFFSET);
 }
 
-static void sse_event_count_init()
+static void sse_event_info_init(void)
 {
 	unsigned int i;
+	struct sse_event_info *info;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported)
+			continue;
+
+		if (EVENT_IS_GLOBAL(info->event_id))
 			global_event_count++;
 		else
 			local_event_count++;
@@ -1083,6 +1118,7 @@ static void sse_event_count_init()
 
 static int sse_global_init()
 {
+	struct sse_event_info *info;
 	struct sbi_sse_event *e;
 	unsigned int i, ev = 0;
 
@@ -1091,11 +1127,12 @@ static int sse_global_init()
 		return SBI_ENOMEM;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (!EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported || !EVENT_IS_GLOBAL(info->event_id))
 			continue;
 
 		e = &global_events[ev].event;
-		sse_event_init(e, supported_events[i]);
+		sse_event_init(e, info);
 		SPIN_LOCK_INIT(global_events[ev].lock);
 
 		ev++;
@@ -1106,16 +1143,18 @@ static int sse_global_init()
 
 static void sse_local_init(struct sse_hart_state *shs)
 {
+	struct sse_event_info *info;
 	unsigned int i, ev = 0;
 
 	SBI_INIT_LIST_HEAD(&shs->enabled_event_list);
 	SPIN_LOCK_INIT(shs->enabled_event_lock);
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (EVENT_IS_GLOBAL(supported_events[i]))
+		info = &valid_events[i];
+		if (!info->supported || EVENT_IS_GLOBAL(info->event_id))
 			continue;
 
-		sse_event_init(&shs->local_events[ev++], supported_events[i]);
+		sse_event_init(&shs->local_events[ev++], info);
 	}
 }
 
@@ -1127,7 +1166,7 @@ int sbi_sse_init(struct sbi_scratch *scratch, bool cold_boot)
 	struct sbi_fifo *sse_inject_q;
 
 	if (cold_boot) {
-		sse_event_count_init();
+		sse_event_info_init();
 
 		ret = sse_global_init();
 		if (ret)
@@ -1192,9 +1231,14 @@ void sbi_sse_exit(struct sbi_scratch *scratch)
 {
 	int i;
 	struct sbi_sse_event *e;
+	struct sse_event_info *info;
 
 	for (i = 0; i < EVENT_COUNT; i++) {
-		if (sse_event_get(supported_events[i], &e))
+		info = &valid_events[i];
+		if (!info->supported)
+			continue;
+
+		if (sse_event_get(info->event_id, &e))
 			continue;
 
 		if (e->attrs.hartid != current_hartid())
#6 lore raw

PATCH v2 3/4 lib: sbi: sse: add a is_supported_cb() callback

In reply to Clément Léger

This callback will be used to expose the availability of events based on the presence of the dependencies (PMU Overflow IRQ for the PMU Overflow SSE event for instance). Drivers that want to handle an SSE event will need to register callbacks for the SSE event with at least the is_supported_cb() callback implemented. Now that this callback is implemented, set all non software events as not supported by default.

---
 include/sbi/sbi_sse.h |  5 +++++
 lib/sbi/sbi_sse.c     | 11 +++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
include/sbi/sbi_sse.h +5 -0
index 7419698a..1eab4f8b 100644
@@ -52,6 +52,11 @@ struct sbi_sse_cb_ops {
 	 * Called when the SBI_EXT_SSE_DISABLE is invoked on the event.
 	 */
 	void (*disable_cb)(uint32_t event_id);
+
+	/**
+	 * Called at init to check if an event is supported.
+	 */
+	bool (*is_supported_cb)(uint32_t event_id);
 };
 
 /* Set the callback operations for an event
lib/sbi/sbi_sse.c +7 -4
index 4c186a22..31002a7d 100644
@@ -46,10 +46,10 @@ struct sse_event_info {
 };
 
 static struct sse_event_info valid_events[] = {
-	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = true},
-	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = false},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = false},
 	{.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE, .supported = true},
 	{.event_id = SBI_SSE_EVENT_GLOBAL_SOFTWARE, .supported = true},
 };
@@ -1106,6 +1106,9 @@ static void sse_event_info_init(void)
 
 	for (i = 0; i < EVENT_COUNT; i++) {
 		info = &valid_events[i];
+		if (info->cb_ops && info->cb_ops->is_supported_cb)
+			info->supported = info->cb_ops->is_supported_cb(info->event_id);
+
 		if (!info->supported)
 			continue;
 
Signature · 1 line
2.45.2
#7 lore raw

PATCH v2 3/4 lib: sbi: sse: add a is_supported_cb() callback

Hi Cl?ment,

Quoted 35 lines · Cl?ment L?ger

This callback will be used to expose the availability of events based on the presence of the dependencies (PMU Overflow IRQ for the PMU Overflow SSE event for instance). Drivers that want to handle an SSE event will need to register callbacks for the SSE event with at least the is_supported_cb() callback implemented. Now that this callback is implemented, set all non software events as not supported by default.

---
 include/sbi/sbi_sse.h |  5 +++++
 lib/sbi/sbi_sse.c     | 11 +++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
include/sbi/sbi_sse.h +5 -0
index 7419698a..1eab4f8b 100644
@@ -52,6 +52,11 @@ struct sbi_sse_cb_ops {
 	 * Called when the SBI_EXT_SSE_DISABLE is invoked on the event.
 	 */
 	void (*disable_cb)(uint32_t event_id);
+
+	/**
+	 * Called at init to check if an event is supported.
+	 */
+	bool (*is_supported_cb)(uint32_t event_id);
 };
 
 /* Set the callback operations for an event
lib/sbi/sbi_sse.c +0 -0
index 4c186a22..31002a7d 100644
@@ -46,10 +46,10 @@ struct sse_event_info {
 };

lib/sbi/sbi_sse.c struct sse_event_info { · line 52

Quoted 10 lines
lib/sbi/sbi_sse.c +4 -4
 
 static struct sse_event_info valid_events[] = {
-	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = true},
-	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = false},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = false},

This change breaks bisectability, because the PMU callback isn't added until the next commit. So I would suggest moving this hunk to a separate final commit. The commit looks good otherwise.

Regards,
Samuel

Quoted 13 lines
lib/sbi/sbi_sse.c +3 -0
 	{.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE, .supported = true},
 	{.event_id = SBI_SSE_EVENT_GLOBAL_SOFTWARE, .supported = true},
 };
@@ -1106,6 +1106,9 @@ static void sse_event_info_init(void)
 
 	for (i = 0; i < EVENT_COUNT; i++) {
 		info = &valid_events[i];
+		if (info->cb_ops && info->cb_ops->is_supported_cb)
+			info->supported = info->cb_ops->is_supported_cb(info->event_id);
+
 		if (!info->supported)
 			continue;
 
#8 lore raw

PATCH v2 3/4 lib: sbi: sse: add a is_supported_cb() callback

Quoted 39 lines · Samuel Holland

Hi Cl?ment,

Quoted 36 lines · Cl?ment L?ger

This callback will be used to expose the availability of events based on the presence of the dependencies (PMU Overflow IRQ for the PMU Overflow SSE event for instance). Drivers that want to handle an SSE event will need to register callbacks for the SSE event with at least the is_supported_cb() callback implemented. Now that this callback is implemented, set all non software events as not supported by default.

---
 include/sbi/sbi_sse.h |  5 +++++
 lib/sbi/sbi_sse.c     | 11 +++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
include/sbi/sbi_sse.h +5 -0
index 7419698a..1eab4f8b 100644
@@ -52,6 +52,11 @@ struct sbi_sse_cb_ops {
 	 * Called when the SBI_EXT_SSE_DISABLE is invoked on the event.
 	 */
 	void (*disable_cb)(uint32_t event_id);
+
+	/**
+	 * Called at init to check if an event is supported.
+	 */
+	bool (*is_supported_cb)(uint32_t event_id);
 };
 
 /* Set the callback operations for an event
lib/sbi/sbi_sse.c +0 -0
index 4c186a22..31002a7d 100644
@@ -46,10 +46,10 @@ struct sse_event_info {
 };
 
Quoted 13 lines

lib/sbi/sbi_sse.c struct sse_event_info { · line 52

Quoted 9 lines
lib/sbi/sbi_sse.c +4 -4
 static struct sse_event_info valid_events[] = {
-	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = true},
-	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = true},
-	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = true},
+	{.event_id = SBI_SSE_EVENT_LOCAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_DOUBLE_TRAP, .supported = false},
+	{.event_id = SBI_SSE_EVENT_GLOBAL_RAS, .supported = false},
+	{.event_id = SBI_SSE_EVENT_LOCAL_PMU, .supported = false},

This change breaks bisectability, because the PMU callback isn't added until the next commit. So I would suggest moving this hunk to a separate final commit. The commit looks good otherwise.

True, I'll move it to the end of the series.

Quoted 18 lines

Regards,
Samuel

Quoted 13 lines
lib/sbi/sbi_sse.c +3 -0
 	{.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE, .supported = true},
 	{.event_id = SBI_SSE_EVENT_GLOBAL_SOFTWARE, .supported = true},
 };
@@ -1106,6 +1106,9 @@ static void sse_event_info_init(void)
 
 	for (i = 0; i < EVENT_COUNT; i++) {
 		info = &valid_events[i];
+		if (info->cb_ops && info->cb_ops->is_supported_cb)
+			info->supported = info->cb_ops->is_supported_cb(info->event_id);
+
 		if (!info->supported)
 			continue;
 
#9 lore raw

PATCH v2 4/4 lib: sbi: pmu: add an sse .is_supported_cb callback implementation

In reply to Clément Léger

Since the PMU overflow event can only be generated if a PMU overflow irq is implemented, add a pmu_sse_is_supported() function to check for the PMU irq presence.

---
 lib/sbi/sbi_pmu.c | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/sbi/sbi_pmu.c +9 -0
index 6f192440..46dbcc9a 100644
@@ -1110,7 +1110,16 @@ static void pmu_sse_complete(uint32_t event_id)
 	csr_set(CSR_MIE, MIP_LCOFIP);
 }
 
+static bool pmu_sse_is_supported(uint32_t event_id)
+{
+	if (!sbi_pmu_irq_bit())
+		return false;
+
+	return true;
+}
+
 static const struct sbi_sse_cb_ops pmu_sse_cb_ops = {
+	.is_supported_cb = pmu_sse_is_supported,
 	.enable_cb = pmu_sse_enable,
 	.disable_cb = pmu_sse_disable,
 	.complete_cb = pmu_sse_complete,
Signature · 1 line
2.45.2
#10 lore raw

PATCH v2 4/4 lib: sbi: pmu: add an sse .is_supported_cb callback implementation

Hi Cl?ment,

Quoted 14 lines · Cl?ment L?ger

Since the PMU overflow event can only be generated if a PMU overflow irq is implemented, add a pmu_sse_is_supported() function to check for the PMU irq presence.

---
 lib/sbi/sbi_pmu.c | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/sbi/sbi_pmu.c +0 -0
index 6f192440..46dbcc9a 100644

lib/sbi/sbi_pmu.c static void pmu_sse_complete(uint32_t event_id) · line 1119

Quoted 10 lines
lib/sbi/sbi_pmu.c +7 -0
@@ -1110,7 +1110,16 @@ static void pmu_sse_complete(uint32_t event_id)
 	csr_set(CSR_MIE, MIP_LCOFIP);
 }
 
+static bool pmu_sse_is_supported(uint32_t event_id)
+{
+	if (!sbi_pmu_irq_bit())
+		return false;
+
+	return true;
+}

This isn't correct as-is because the PMU code hardcodes MIP_LCOFIP several places in the SSE handling code. Those would first need to be changed to use sbi_pmu_irq_bit() before we can use the PMU SSE event on non-Sscofpmf platforms.

Regards,
Samuel

Quoted 6 lines
lib/sbi/sbi_pmu.c +2 -0
+
 static const struct sbi_sse_cb_ops pmu_sse_cb_ops = {
+	.is_supported_cb = pmu_sse_is_supported,
 	.enable_cb = pmu_sse_enable,
 	.disable_cb = pmu_sse_disable,
 	.complete_cb = pmu_sse_complete,