Skip to content

Commit

Permalink
rpmi: performance: Add memory region service
Browse files Browse the repository at this point in the history
Add 'PERF_GET_FAST_CHANNEL_REGION' service to
get a continuous block of physical memory region
for fast channel access.

Signed-off-by: Joshua Yeong <[email protected]>
  • Loading branch information
Joshua Yeong committed Dec 12, 2024
1 parent 2674515 commit 0d2c4c5
Showing 1 changed file with 85 additions and 5 deletions.
90 changes: 85 additions & 5 deletions src/srvgrp-performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The following table lists the services in the PERFORMANCE service group:
| 0x07 | PERF_GET_LIMIT | NORMAL_REQUEST
| 0x08 | PERF_SET_LIMIT | NORMAL_REQUEST
| 0x09 | PERF_GET_FAST_CHANNEL_ATTRIBUTES | NORMAL_REQUEST
| 0x0A | PERF_GET_FAST_CHANNEL_REGION | NORMAL_REQUEST
|===

[#section-perf-level]
Expand Down Expand Up @@ -95,13 +96,29 @@ The fast-channel currently supports only the following PERFORMANCE services:
* Support for fast-channel depends on the platform implementation.


*Performance Fast-channel Shared Memory Region*::
* In the memory region designated by the platform for fast-channel, it is
essential that the Performance Request fast-channels are organized in a
continuous memory block.
* The shared memory region designated for fast-channel across performance
service group m must be a `power-of-two` in size. The base address and
size (in bytes) of this shared memory region can be obtained through the
service `PERF_GET_FAST_CHANNEL_REGION`. The base address of the
shared memory region must be aligned to 8 bytes.


*Discovering Fast-channel*::
* Fast-channels support are discoverable through PERFORMANCE service calls.
* To determine if a platform supports fast-channel for a specific performance
domain, use the `PERF_GET_ATTRIBUTES` service call.
* If fast-channel support is available, retrieve fast-channel attributes for
specific PERFORMANCE service call using the `PERF_GET_FAST_CHANNEL_ATTRIBUTES`
service call.
* The `PERF_GET_FAST_CHANNEL_REGION` provides physical memory for Performance
Service Group. The offset of the physical address retrieve in
`PERF_GET_FAST_CHANNEL_ATTRIBUTES` of the 'Performance Domain /
Service ID' paired is based on the starting address in
`PERF_GET_FAST_CHANNEL_REGION` service.


*Doorbell Support*::
Expand Down Expand Up @@ -661,7 +678,7 @@ performance domain in the system.
! RPMI_ERR_INVALID_PARAM
! `DOMAIN_ID` or `LEVEL` is invalid.

! RPMI_ERR_DENIED
! RPMI_ERR_DENIED
! Denied due to no permission.

! RPMI_ERR_HW_FAULT
Expand Down Expand Up @@ -881,14 +898,14 @@ specific performance domain and performance service.
!===

| 2
|PHYS_ADDR_LOW
| PHYS_ADDR_OFFSET_LOW
| uint32
| Lower 32-bit of physical address.
| Lower 32-bit offset of fast-channel physical address region.

| 3
| PHYS_ADDR_HIGH
| PHYS_ADDR_OFFSET_HIGH
| uint32
| Upper 32-bit of physical address.
| Upper 32-bit offset of fast-channel physical address region.

| 4
| DB_ADDR_LOW
Expand Down Expand Up @@ -922,4 +939,67 @@ ringing the doorbell. This field is unused if the doorbell is not supported.
| An upper 32-bit doorbell preserved mask to apply for this service before
ringing the doorbell. This field is only valid if the doorbell register width
is 64-bit. This field is unused if the doorbell is not supported.

|===

==== Service: PERF_GET_FAST_CHANNEL_REGION (SERVICE_ID: 0x0A)
This service retrieves the physical address of the fast-channel region used in
the performance service group. The fast-channel region is grouped in a continuous
block of memory to ease the configuration of memory region protection.

[#table_perf_getfastchanregion_request_data]
.Request Data
[cols="1", width=100%, align="center", options="header"]
|===
| NA
|===

[#table_perf_getfastchanregion_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="6,5", options="header"]
!===
! Error Code
! Description

! RPMI_SUCCESS
! Service completed successfully.

! RPMI_ERR_NOT_SUPPORTED
! Fast-channel is not implemented.

!===
- Other errors <<table_error_codes>>

| 1
| PHYS_ADDR_LOW
| uint32
| Lower 32-bit of the fast-channels shared memory region physical address.

| 2
| PHYS_ADDR_HIGH
| uint32
| Upper 32-bit of the fast-channels shared memory region physical address.

| 3
| REGION_SIZE_LOW
| uint32
| Lower 32-bit of the fast-channels shared memory region size.

| 4
| REGION_SIZE_HIGH
| uint32
| Upper 32-bit of the fast-channels shared memory region size.

|===

0 comments on commit 0d2c4c5

Please sign in to comment.