From 1959d278c6d1622ffa0868f4ae5f4d07d2c420d8 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Tue, 1 Oct 2024 11:27:51 +0530 Subject: [PATCH] Define request forward service group Certain use-cases require forwarding RPMI messages from one RPMI client to another so let's define request forward service group for this purpose. Signed-off-by: Anup Patel --- riscv-rpmi.adoc | 2 + src/message-protocol.adoc | 6 +- src/service-groups.adoc | 7 +- src/srvgrp-request-forward.adoc | 244 ++++++++++++++++++++++++++++++++ 4 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 src/srvgrp-request-forward.adoc diff --git a/riscv-rpmi.adoc b/riscv-rpmi.adoc index 4cdfe7a..018e542 100644 --- a/riscv-rpmi.adoc +++ b/riscv-rpmi.adoc @@ -94,6 +94,8 @@ include::src/srvgrp-management.adoc[] include::src/srvgrp-ras-agent.adoc[] +include::src/srvgrp-request-forward.adoc[] + include::src/rpmi-mpxy.adoc[] // The index must precede the bibliography diff --git a/src/message-protocol.adoc b/src/message-protocol.adoc index a00ef3a..09e693c 100644 --- a/src/message-protocol.adoc +++ b/src/message-protocol.adoc @@ -340,8 +340,12 @@ specification or the extension version mismatch. | -13 | Input/Output error. +| RPMI_ERR_NO_DATA +| -14 +| Data not available. + | -| -14 to -127 +| -15 to -127 | _Reserved_ | diff --git a/src/service-groups.adoc b/src/service-groups.adoc index ccd436d..36c620b 100644 --- a/src/service-groups.adoc +++ b/src/service-groups.adoc @@ -110,7 +110,12 @@ defined by this specification. | RAS_AGENT | M-mode, S-mode -| 0x000C - 0x7FFF +| 0x000C +| +| REQUEST_FORWARD +| M-mode, S-mode + +| 0x000D - 0x7FFF | | _Reserved for Future Use_ | diff --git a/src/srvgrp-request-forward.adoc b/src/srvgrp-request-forward.adoc new file mode 100644 index 0000000..eec75f7 --- /dev/null +++ b/src/srvgrp-request-forward.adoc @@ -0,0 +1,244 @@ +:path: src/ +:imagesdir: ../images + +ifdef::rootpath[] +:imagesdir: {rootpath}{path}{imagesdir} +endif::rootpath[] + +ifndef::rootpath[] +:rootpath: ./../ +endif::rootpath[] + +=== Service Group - REQUEST_FORWARD (SERVICEGROUP_ID: 0x000C) +The REQUEST_FORWARD service group allows application processors to retrieve and +process RPMI request messages which are forwarded by platform microcontroller from +some other RPMI client. This service group also allows an SBI implementation to +forward RPMI request messages from one system-level partition (or domain) to another +using the SBI MPXY extension cite:[SBI]. + +The platform microcontroller (or SBI implementation) should maintain a queue of +forwarded RPMI request messages and the services defined by the REQUEST_FORWARD +service group allow application processors to retrieve and process one forwarded +RPMI request message at a time. + +The <> below lists the services defined by the REQUEST_FORWARD +service group: + +[#table_reqfwd_services] +.Request Forward Services +[cols="1, 4, 2", width=100%, align="center", options="header"] +|=== +| Service ID +| Service Name +| Request Type + +| 0x01 +| REQFWD_ENABLE_NOTIFICATION +| NORMAL_REQUEST + +| 0x02 +| REQFWD_RETRIEVE_CURRENT_MESSAGE +| NORMAL_REQUEST + +| 0x03 +| REQFWD_COMPLETE_CURRENT_MESSAGE +| NORMAL_REQUEST +|=== + +[#reqfwd-notifications] +==== Notifications +The <> below list the notification events +defined by the REQUEST_FORWARD service group. + +[#table_reqfwd_notification_events] +.Request Forward Notification Events +[cols="1, 3, 2, 5", width=100%, align="center", options="header"] +|=== +| Event ID +| Name +| Event Data +| Description + +| 0x01 +| REQFWD_NEW_MESSAGE +| NA +| New RPMI request message forwarded to the RPMI client. +|=== + +==== Service: REQFWD_ENABLE_NOTIFICATION (SERVICE_ID: 0x01) +This service allows the application processor to subscribe to REQUEST_FORWARD +service group notifications. The supported events are described in the +<>. + +[#table_reqfwd_enable_notif_request_data] +.Request Data +[cols="1, 2, 1, 7", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| EVENT_ID +| uint32 +| Event to be subscribed for notification. +|=== + +[#table_reqfwd_enable_notif_response_data] +.Response Data +[cols="1, 2, 1, 7a", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| STATUS +| int32 +| Return error code + +[cols="5,5", options="header"] +!=== +! Error Code +! Description + +! RPMI_SUCCESS +! Event is subscribed successfully. + +! RPMI_ERR_INVALID_PARAM +! `EVENT_ID` is invalid. + +! RPMI_ERR_NOT_SUPPORTED +! Notification is not supported. + +!=== +- Other errors <> +|=== + +==== Service: REQFWD_RETRIEVE_CURRENT_MESSAGE (SERVICE_ID: 0x02) +This service allows application processors to retrieve the current forwarded RPMI +request message. The current message may be the oldest forwarded RPMI request +message in the platform microcontroller (or SBI implementation) queue. + +[#table_reqfwd_retireve_current_message_request_data] +.Request Data +[cols="1, 3, 1, 7", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| START_INDEX +| uint32 +| Starting index of first byte of the current forwarded RPMI request message. Use +`0` for the first call, subsequent calls will use the next index of the remaining +bytes. +|=== + +[#table_reqfwd_retireve_current_message_response_data] +.Response Data +[cols="1, 3, 1, 7a", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| STATUS +| int32 +| Return error code + +[cols="7,5", options="header"] +!=== +! Error Code +! Description + +! RPMI_SUCCESS +! Service completed successfully. + +! RPMI_ERR_INVALID_PARAM +! `START_INDEX` is invalid. + +! RPMI_ERR_NO_DATA +! No forwarded RPMI request message available. + +!=== +- Other errors <> + +| 1 +| REMAINING +| uint32 +| Remaining number of bytes in the current forwarded RPMI request message. + +| 2 +| RETURNED +| uint32 +| Number of bytes `N` of the current forwarded RPMI request message returned in this request. + +| 3 +| REQUEST_MESSAGE[N] +| uint8 +| An array of bytes representing the part of the current forwarded RPMI request message +at byte offset specified by `START_INDEX`. +|=== + +==== Service: REQFWD_COMPLETE_CURRENT_MESSAGE (SERVICE_ID: 0x03) +This service allows the application processors to inform the platform microcontroller +(or SBI implementation) that: + +* The processing of the current forwarded RPMI request message has completed and +RPMI response message must be sent to the original source of RPMI request message. +* The current forwarded RPMI request message must now point to the next forwarded +RPMI request message if available. + +[#table_reqfwd_complete_current_message_request_data] +.Request Data +[cols="1, 3, 1, 7", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| RESPONSE_DATA[N] +| uint8 +| An array of bytes representing the RPMI message data to be send as response for +the current RPMI request message. The `N` represents the total number of bytes in +the response data. +|=== + +[#table_reqfwd_complete_current_message_response_data] +.Response Data +[cols="1, 3, 1, 7a", width=100%, align="center", options="header"] +|=== +| Word +| Name +| Type +| Description + +| 0 +| STATUS +| int32 +| Return error code + +[cols="7,5", options="header"] +!=== +! Error Code +! Description + +! RPMI_SUCCESS +! Service completed successfully. + +! RPMI_ERR_NO_DATA +! No forwarded RPMI request message available. + +!=== +- Other errors <> + +|===