Skip to content

Conversation

@cuiyunhui
Copy link

Take ID value 0xffff8001 from the "Global events reserved for future use" range as the SBI_SSE_EVENT_GLOBAL_UNKNOWN_NMI event ID.

@cuiyunhui
Copy link
Author

cuiyunhui commented Sep 25, 2025

  1. When the Kernel system becomes unresponsive, we need to initiate an unknown NMI via BIOS to make the Kernel panic() and thereby generate a vmcore.

  2. Need to add an SSE event ID, and add SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI to the existing supported_events[]:
    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,
    };

  3. The SSE eventid is a logical software ID, unrelated to hardware properties, so it is better to add it in the SBI spec rather than ACPI.

  4. We will add a standard ID, which is UNKNOWN_NMI, and take the ID value 0xffff8001 from the "Global events reserved for future use" range as the SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI event ID.

  5. Kernel RFC patch: https://lore.kernel.org/all/CAAhSdy2e90AhkWaaCWsyEjRpovQbS9eBNpC60bLsLTLqUEWSkw@mail.gmail.com/

@atishp04 @avpatel Could you help review this PR? Thanks.

@cuiyunhui cuiyunhui changed the title ext-sse: add global unknown ni event id ext-sse: add global unknown nmi event id Sep 25, 2025
@cuiyunhui cuiyunhui marked this pull request as draft September 30, 2025 06:24
@cuiyunhui cuiyunhui marked this pull request as ready for review September 30, 2025 06:26
Ziang95

This comment was marked as resolved.

@atishp04
Copy link
Collaborator

atishp04 commented Oct 9, 2025

lgtm

@atishp04
Copy link
Collaborator

atishp04 commented Oct 9, 2025

How does the BIOS/firmware gets invoked to inject the unknown NMI SSE event ?

@weidongwd
Copy link

How does the BIOS/firmware gets invoked to inject the unknown NMI SSE event ?

Generally, an external interrupt is used as an Unknown NMI pin, and an Unknown NMI event is sent to the SBI firmware by triggering this pin. Then the SBI firmware will send SBI_SSE_EVENT_GLOBAL_UNKNOWN_NMI to the kernel.

@cuiyunhui cuiyunhui changed the title ext-sse: add global unknown nmi event id ext-sse: add local unknown nmi event id Oct 10, 2025
Take ID value 0xffff0001 from the "Local events reserved for future use"
range as the SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI event ID.

Signed-off-by: Yunhui Cui <[email protected]>
@cuiyunhui
Copy link
Author

As discussed during yesterday's [RISC-V][tech-prs] meeting, the global event has been adjusted to a local event based on feedback, and the corresponding patch has been updated accordingly.

@atishp04 @avpatel Could you help review this PR again? Thanks.

@avpatel
Copy link
Contributor

avpatel commented Oct 10, 2025

@atishp04 @cuiyunhui Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants