OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: sbi: sse: add local unknown nmi event
@ 2025-10-14  5:53 weidongwd
  2025-10-15 14:18 ` dong wei
  0 siblings, 1 reply; 5+ messages in thread
From: weidongwd @ 2025-10-14  5:53 UTC (permalink / raw)
  To: opensbi; +Cc: cuiyunhui, heshuan, weidongwd

Add the id of local unknown nmi event and add this event to the
list of supported events.

Signed-off-by: weidongwd <weidong.wd@bytedance.com>
---
 include/sbi/sbi_ecall_interface.h | 3 ++-
 lib/sbi/sbi_sse.c                 | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
index af7a05a..8bb0d39 100644
--- a/include/sbi/sbi_ecall_interface.h
+++ b/include/sbi/sbi_ecall_interface.h
@@ -436,7 +436,8 @@ enum sbi_sse_state {
 
 /* Range 0xffff0000 - 0xffffffff */
 #define SBI_SSE_EVENT_LOCAL_SOFTWARE		0xffff0000
-#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START	0xffff0001
+#define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI		0xffff0001
+#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START	0xffff0002
 #define SBI_SSE_EVENT_LOCAL_RESERVED_3_END	0xffff3fff
 #define SBI_SSE_EVENT_LOCAL_PLAT_3_START	0xffff4000
 #define SBI_SSE_EVENT_LOCAL_PLAT_3_END		0xffff7fff
diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
index 986b770..e771efe 100644
--- a/lib/sbi/sbi_sse.c
+++ b/lib/sbi/sbi_sse.c
@@ -182,9 +182,14 @@ struct sse_event_info global_software_event = {
 	SBI_SLIST_NODE_INIT(NULL),
 };
 
+struct sse_event_info local_unknown_nmi_event = {
+	.event_id = SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
+	SBI_SLIST_NODE_INIT(&global_software_event),
+};
+
 struct sse_event_info local_software_event = {
 	.event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE,
-	SBI_SLIST_NODE_INIT(&global_software_event),
+	SBI_SLIST_NODE_INIT(&local_unknown_nmi_event),
 };
 
 static SBI_SLIST_HEAD(supported_events, sse_event_info) =
@@ -202,6 +207,7 @@ static const uint32_t standard_events[] = {
 	SBI_SSE_EVENT_LOCAL_LOW_PRIO_RAS,
 	SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS,
 	SBI_SSE_EVENT_LOCAL_SOFTWARE,
+	SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
 	SBI_SSE_EVENT_GLOBAL_SOFTWARE,
 };
 
-- 
2.20.1


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] lib: sbi: sse: add local unknown nmi event
  2025-10-14  5:53 [PATCH] lib: sbi: sse: add local unknown nmi event weidongwd
@ 2025-10-15 14:18 ` dong wei
  2025-10-30  8:20   ` dong wei
  0 siblings, 1 reply; 5+ messages in thread
From: dong wei @ 2025-10-15 14:18 UTC (permalink / raw)
  To: opensbi; +Cc: cuiyunhui, heshuan, wangziang.ok, atishp, anup

Add more reviewers.

On Tue, Oct 14, 2025 at 1:54 PM weidongwd <weidong.wd@bytedance.com> wrote:
>
> Add the id of local unknown nmi event and add this event to the
> list of supported events.
>
> Signed-off-by: weidongwd <weidong.wd@bytedance.com>
> ---
>  include/sbi/sbi_ecall_interface.h | 3 ++-
>  lib/sbi/sbi_sse.c                 | 8 +++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
> index af7a05a..8bb0d39 100644
> --- a/include/sbi/sbi_ecall_interface.h
> +++ b/include/sbi/sbi_ecall_interface.h
> @@ -436,7 +436,8 @@ enum sbi_sse_state {
>
>  /* Range 0xffff0000 - 0xffffffff */
>  #define SBI_SSE_EVENT_LOCAL_SOFTWARE           0xffff0000
> -#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0001
> +#define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI                0xffff0001
> +#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0002
>  #define SBI_SSE_EVENT_LOCAL_RESERVED_3_END     0xffff3fff
>  #define SBI_SSE_EVENT_LOCAL_PLAT_3_START       0xffff4000
>  #define SBI_SSE_EVENT_LOCAL_PLAT_3_END         0xffff7fff
> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> index 986b770..e771efe 100644
> --- a/lib/sbi/sbi_sse.c
> +++ b/lib/sbi/sbi_sse.c
> @@ -182,9 +182,14 @@ struct sse_event_info global_software_event = {
>         SBI_SLIST_NODE_INIT(NULL),
>  };
>
> +struct sse_event_info local_unknown_nmi_event = {
> +       .event_id = SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
> +       SBI_SLIST_NODE_INIT(&global_software_event),
> +};
> +
>  struct sse_event_info local_software_event = {
>         .event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE,
> -       SBI_SLIST_NODE_INIT(&global_software_event),
> +       SBI_SLIST_NODE_INIT(&local_unknown_nmi_event),
>  };
>
>  static SBI_SLIST_HEAD(supported_events, sse_event_info) =
> @@ -202,6 +207,7 @@ static const uint32_t standard_events[] = {
>         SBI_SSE_EVENT_LOCAL_LOW_PRIO_RAS,
>         SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS,
>         SBI_SSE_EVENT_LOCAL_SOFTWARE,
> +       SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
>         SBI_SSE_EVENT_GLOBAL_SOFTWARE,
>  };
>
> --
> 2.20.1
>

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lib: sbi: sse: add local unknown nmi event
  2025-10-15 14:18 ` dong wei
@ 2025-10-30  8:20   ` dong wei
  2025-10-30  8:51     ` Atish Patra
  0 siblings, 1 reply; 5+ messages in thread
From: dong wei @ 2025-10-30  8:20 UTC (permalink / raw)
  To: opensbi; +Cc: cuiyunhui, heshuan, wangziang.ok, atishp, anup

May I ask if there are any updates to the comments on this patch? The
unknown nmi event has practical application scenarios for RISC-V
servers.

On Wed, Oct 15, 2025 at 10:18 PM dong wei <weidong.wd@bytedance.com> wrote:
>
> Add more reviewers.
>
> On Tue, Oct 14, 2025 at 1:54 PM weidongwd <weidong.wd@bytedance.com> wrote:
> >
> > Add the id of local unknown nmi event and add this event to the
> > list of supported events.
> >
> > Signed-off-by: weidongwd <weidong.wd@bytedance.com>
> > ---
> >  include/sbi/sbi_ecall_interface.h | 3 ++-
> >  lib/sbi/sbi_sse.c                 | 8 +++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
> > index af7a05a..8bb0d39 100644
> > --- a/include/sbi/sbi_ecall_interface.h
> > +++ b/include/sbi/sbi_ecall_interface.h
> > @@ -436,7 +436,8 @@ enum sbi_sse_state {
> >
> >  /* Range 0xffff0000 - 0xffffffff */
> >  #define SBI_SSE_EVENT_LOCAL_SOFTWARE           0xffff0000
> > -#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0001
> > +#define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI                0xffff0001
> > +#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0002
> >  #define SBI_SSE_EVENT_LOCAL_RESERVED_3_END     0xffff3fff
> >  #define SBI_SSE_EVENT_LOCAL_PLAT_3_START       0xffff4000
> >  #define SBI_SSE_EVENT_LOCAL_PLAT_3_END         0xffff7fff
> > diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> > index 986b770..e771efe 100644
> > --- a/lib/sbi/sbi_sse.c
> > +++ b/lib/sbi/sbi_sse.c
> > @@ -182,9 +182,14 @@ struct sse_event_info global_software_event = {
> >         SBI_SLIST_NODE_INIT(NULL),
> >  };
> >
> > +struct sse_event_info local_unknown_nmi_event = {
> > +       .event_id = SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
> > +       SBI_SLIST_NODE_INIT(&global_software_event),
> > +};
> > +
> >  struct sse_event_info local_software_event = {
> >         .event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE,
> > -       SBI_SLIST_NODE_INIT(&global_software_event),
> > +       SBI_SLIST_NODE_INIT(&local_unknown_nmi_event),
> >  };
> >
> >  static SBI_SLIST_HEAD(supported_events, sse_event_info) =
> > @@ -202,6 +207,7 @@ static const uint32_t standard_events[] = {
> >         SBI_SSE_EVENT_LOCAL_LOW_PRIO_RAS,
> >         SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS,
> >         SBI_SSE_EVENT_LOCAL_SOFTWARE,
> > +       SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
> >         SBI_SSE_EVENT_GLOBAL_SOFTWARE,
> >  };
> >
> > --
> > 2.20.1
> >

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lib: sbi: sse: add local unknown nmi event
  2025-10-30  8:20   ` dong wei
@ 2025-10-30  8:51     ` Atish Patra
  2025-11-03  8:15       ` [External] " dong wei
  0 siblings, 1 reply; 5+ messages in thread
From: Atish Patra @ 2025-10-30  8:51 UTC (permalink / raw)
  To: dong wei, opensbi; +Cc: cuiyunhui, heshuan, wangziang.ok, anup

On 10/30/25 1:20 AM, dong wei wrote:
> May I ask if there are any updates to the comments on this patch? The
> unknown nmi event has practical application scenarios for RISC-V
> servers.
> 

The corresponding Linux kernel patches doesn't match this. We need to 
hash out the event IDs and then decide the process to merge this to SBI 
spec.

It should be okay to merge this in OpenSBI as an experimental feature 
after that.


Do you have a PoC on how this is hooked up to a platform NMI event ?

> On Wed, Oct 15, 2025 at 10:18 PM dong wei <weidong.wd@bytedance.com> wrote:
>>
>> Add more reviewers.
>>
>> On Tue, Oct 14, 2025 at 1:54 PM weidongwd <weidong.wd@bytedance.com> wrote:
>>>
>>> Add the id of local unknown nmi event and add this event to the
>>> list of supported events.
>>>
>>> Signed-off-by: weidongwd <weidong.wd@bytedance.com>
>>> ---
>>>   include/sbi/sbi_ecall_interface.h | 3 ++-
>>>   lib/sbi/sbi_sse.c                 | 8 +++++++-
>>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
>>> index af7a05a..8bb0d39 100644
>>> --- a/include/sbi/sbi_ecall_interface.h
>>> +++ b/include/sbi/sbi_ecall_interface.h
>>> @@ -436,7 +436,8 @@ enum sbi_sse_state {
>>>
>>>   /* Range 0xffff0000 - 0xffffffff */
>>>   #define SBI_SSE_EVENT_LOCAL_SOFTWARE           0xffff0000
>>> -#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0001
>>> +#define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI                0xffff0001
>>> +#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0002
>>>   #define SBI_SSE_EVENT_LOCAL_RESERVED_3_END     0xffff3fff
>>>   #define SBI_SSE_EVENT_LOCAL_PLAT_3_START       0xffff4000
>>>   #define SBI_SSE_EVENT_LOCAL_PLAT_3_END         0xffff7fff
>>> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
>>> index 986b770..e771efe 100644
>>> --- a/lib/sbi/sbi_sse.c
>>> +++ b/lib/sbi/sbi_sse.c
>>> @@ -182,9 +182,14 @@ struct sse_event_info global_software_event = {
>>>          SBI_SLIST_NODE_INIT(NULL),
>>>   };
>>>
>>> +struct sse_event_info local_unknown_nmi_event = {
>>> +       .event_id = SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
>>> +       SBI_SLIST_NODE_INIT(&global_software_event),
>>> +};
>>> +
>>>   struct sse_event_info local_software_event = {
>>>          .event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE,
>>> -       SBI_SLIST_NODE_INIT(&global_software_event),
>>> +       SBI_SLIST_NODE_INIT(&local_unknown_nmi_event),
>>>   };
>>>
>>>   static SBI_SLIST_HEAD(supported_events, sse_event_info) =
>>> @@ -202,6 +207,7 @@ static const uint32_t standard_events[] = {
>>>          SBI_SSE_EVENT_LOCAL_LOW_PRIO_RAS,
>>>          SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS,
>>>          SBI_SSE_EVENT_LOCAL_SOFTWARE,
>>> +       SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
>>>          SBI_SSE_EVENT_GLOBAL_SOFTWARE,
>>>   };
>>>
>>> --
>>> 2.20.1
>>>
> 


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [External] Re: [PATCH] lib: sbi: sse: add local unknown nmi event
  2025-10-30  8:51     ` Atish Patra
@ 2025-11-03  8:15       ` dong wei
  0 siblings, 0 replies; 5+ messages in thread
From: dong wei @ 2025-11-03  8:15 UTC (permalink / raw)
  To: Atish Patra; +Cc: opensbi, cuiyunhui, heshuan, wangziang.ok, anup

The relevant kernel patch is
https://lore.kernel.org/all/20251027133431.15321-1-cuiyunhui@bytedance.com/
, both use SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI(0xffff0001). And we have
completed the POC verification of unknown nmi.


On Thu, Oct 30, 2025 at 4:51 PM Atish Patra <atish.patra@linux.dev> wrote:
>
> On 10/30/25 1:20 AM, dong wei wrote:
> > May I ask if there are any updates to the comments on this patch? The
> > unknown nmi event has practical application scenarios for RISC-V
> > servers.
> >
>
> The corresponding Linux kernel patches doesn't match this. We need to
> hash out the event IDs and then decide the process to merge this to SBI
> spec.
>
> It should be okay to merge this in OpenSBI as an experimental feature
> after that.
>
>
> Do you have a PoC on how this is hooked up to a platform NMI event ?
>
> > On Wed, Oct 15, 2025 at 10:18 PM dong wei <weidong.wd@bytedance.com> wrote:
> >>
> >> Add more reviewers.
> >>
> >> On Tue, Oct 14, 2025 at 1:54 PM weidongwd <weidong.wd@bytedance.com> wrote:
> >>>
> >>> Add the id of local unknown nmi event and add this event to the
> >>> list of supported events.
> >>>
> >>> Signed-off-by: weidongwd <weidong.wd@bytedance.com>
> >>> ---
> >>>   include/sbi/sbi_ecall_interface.h | 3 ++-
> >>>   lib/sbi/sbi_sse.c                 | 8 +++++++-
> >>>   2 files changed, 9 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
> >>> index af7a05a..8bb0d39 100644
> >>> --- a/include/sbi/sbi_ecall_interface.h
> >>> +++ b/include/sbi/sbi_ecall_interface.h
> >>> @@ -436,7 +436,8 @@ enum sbi_sse_state {
> >>>
> >>>   /* Range 0xffff0000 - 0xffffffff */
> >>>   #define SBI_SSE_EVENT_LOCAL_SOFTWARE           0xffff0000
> >>> -#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0001
> >>> +#define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI                0xffff0001
> >>> +#define SBI_SSE_EVENT_LOCAL_RESERVED_3_START   0xffff0002
> >>>   #define SBI_SSE_EVENT_LOCAL_RESERVED_3_END     0xffff3fff
> >>>   #define SBI_SSE_EVENT_LOCAL_PLAT_3_START       0xffff4000
> >>>   #define SBI_SSE_EVENT_LOCAL_PLAT_3_END         0xffff7fff
> >>> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> >>> index 986b770..e771efe 100644
> >>> --- a/lib/sbi/sbi_sse.c
> >>> +++ b/lib/sbi/sbi_sse.c
> >>> @@ -182,9 +182,14 @@ struct sse_event_info global_software_event = {
> >>>          SBI_SLIST_NODE_INIT(NULL),
> >>>   };
> >>>
> >>> +struct sse_event_info local_unknown_nmi_event = {
> >>> +       .event_id = SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
> >>> +       SBI_SLIST_NODE_INIT(&global_software_event),
> >>> +};
> >>> +
> >>>   struct sse_event_info local_software_event = {
> >>>          .event_id = SBI_SSE_EVENT_LOCAL_SOFTWARE,
> >>> -       SBI_SLIST_NODE_INIT(&global_software_event),
> >>> +       SBI_SLIST_NODE_INIT(&local_unknown_nmi_event),
> >>>   };
> >>>
> >>>   static SBI_SLIST_HEAD(supported_events, sse_event_info) =
> >>> @@ -202,6 +207,7 @@ static const uint32_t standard_events[] = {
> >>>          SBI_SSE_EVENT_LOCAL_LOW_PRIO_RAS,
> >>>          SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS,
> >>>          SBI_SSE_EVENT_LOCAL_SOFTWARE,
> >>> +       SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI,
> >>>          SBI_SSE_EVENT_GLOBAL_SOFTWARE,
> >>>   };
> >>>
> >>> --
> >>> 2.20.1
> >>>
> >
>

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-03  8:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14  5:53 [PATCH] lib: sbi: sse: add local unknown nmi event weidongwd
2025-10-15 14:18 ` dong wei
2025-10-30  8:20   ` dong wei
2025-10-30  8:51     ` Atish Patra
2025-11-03  8:15       ` [External] " dong wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox