test: arch timer in nwd is honored across world switch
This patch introduces a test to ensure that the functionality of arch
(EL1 physical) timer configured by NWd endpoint, such as an hypervisor,
is not corrupted by SPMC when an SP also configures the arch timer for
its own use.
Also, necessary helpers and utilities to create the test scenario have
been added.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I1cfd1e1117412b2b23a57af30064c41dc2e66e0b
diff --git a/include/runtime_services/cactus_test_cmds.h b/include/runtime_services/cactus_test_cmds.h
index 282cfbe..a5fb4b6 100644
--- a/include/runtime_services/cactus_test_cmds.h
+++ b/include/runtime_services/cactus_test_cmds.h
@@ -691,4 +691,23 @@
return (uint64_t)ret.arg4;
}
+#define CACTUS_SET_ARCH_TIMER_CMD U(0x54494d4552)
+
+static inline struct ffa_value cactus_send_arch_timer_cmd(
+ ffa_id_t source, ffa_id_t dest, uint64_t deadline, uint64_t wait)
+{
+ return cactus_send_cmd(source, dest, CACTUS_SET_ARCH_TIMER_CMD, deadline, wait,
+ 0, 0);
+}
+
+static inline uint64_t cactus_get_timer_deadline(struct ffa_value ret)
+{
+ return (uint64_t)ret.arg4;
+}
+
+static inline uint64_t cactus_get_timer_wait_time(struct ffa_value ret)
+{
+ return (uint64_t)ret.arg5;
+}
+
#endif
diff --git a/include/runtime_services/spm_common.h b/include/runtime_services/spm_common.h
index c794cb0..4dd5e5c 100644
--- a/include/runtime_services/spm_common.h
+++ b/include/runtime_services/spm_common.h
@@ -24,6 +24,8 @@
/* ID for the first Secure Partition. */
#define SPM_VM_ID_FIRST SP_ID(1)
+#define TIMER_VIRTUAL_INTID U(3)
+
/* INTID for the managed exit virtual interrupt. */
#define MANAGED_EXIT_INTERRUPT_ID U(4)