diff mbox series

[v2,3/5] lib: sbi_pmu: Reserve space for implementation specific firmware events

Message ID 20230217144413.3720307-4-mchitale@ventanamicro.com
State Changes Requested
Headers show
Series SBI PMU firmware counters and events improvement | expand

Commit Message

Mayuresh Chitale Feb. 17, 2023, 2:44 p.m. UTC
We reserve space for SBI implementation specific custom firmware
events which can be used by M-mode firmwares and HS-mode hypervisors
for their own use. This reserved space is intentionally large to
ensure that SBI implementation has enough space to accommodate
platform specific firmware events as well.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
---
 include/sbi/sbi_ecall_interface.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Atish Patra Feb. 22, 2023, 12:51 a.m. UTC | #1
On Fri, Feb 17, 2023 at 6:44 AM Mayuresh Chitale
<mchitale@ventanamicro.com> wrote:
>
> We reserve space for SBI implementation specific custom firmware
> events which can be used by M-mode firmwares and HS-mode hypervisors
> for their own use. This reserved space is intentionally large to
> ensure that SBI implementation has enough space to accommodate
> platform specific firmware events as well.
>
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> ---
>  include/sbi/sbi_ecall_interface.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
> index f5d6667..5732419 100644
> --- a/include/sbi/sbi_ecall_interface.h
> +++ b/include/sbi/sbi_ecall_interface.h
> @@ -183,6 +183,17 @@ enum sbi_pmu_fw_event_code_id {
>         SBI_PMU_FW_HFENCE_VVMA_ASID_SENT = 20,
>         SBI_PMU_FW_HFENCE_VVMA_ASID_RCVD = 21,
>         SBI_PMU_FW_MAX,
> +       /*
> +        * Event codes 22 to 255 are reserved for future use.
> +        * Event codes 256 to 65534 are reserved for SBI implementation
> +        * specific custom firmware events.
> +        */
> +       SBI_PMU_FW_RESERVED_MAX = 0xFFFE,
> +       /*
> +       * Event code 0xFFFF is used for platform specific firmware
> +       * events where the event data contains any event specific information.
> +       */
> +       SBI_PMU_FW_PLATFORM = 0xFFFF,
>  };
>
>  /** SBI PMU event idx type */
> --
> 2.34.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



Reviewed-by: Atish Patra <atishp@rivosinc.com>
diff mbox series

Patch

diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
index f5d6667..5732419 100644
--- a/include/sbi/sbi_ecall_interface.h
+++ b/include/sbi/sbi_ecall_interface.h
@@ -183,6 +183,17 @@  enum sbi_pmu_fw_event_code_id {
 	SBI_PMU_FW_HFENCE_VVMA_ASID_SENT = 20,
 	SBI_PMU_FW_HFENCE_VVMA_ASID_RCVD = 21,
 	SBI_PMU_FW_MAX,
+	/*
+	 * Event codes 22 to 255 are reserved for future use.
+	 * Event codes 256 to 65534 are reserved for SBI implementation
+	 * specific custom firmware events.
+	 */
+	SBI_PMU_FW_RESERVED_MAX = 0xFFFE,
+	/*
+	* Event code 0xFFFF is used for platform specific firmware
+	* events where the event data contains any event specific information.
+	*/
+	SBI_PMU_FW_PLATFORM = 0xFFFF,
 };
 
 /** SBI PMU event idx type */