feat: add support for partition lifecycle support fields
This patch adds support for parsing lifecycle fields specified by
partitions in respective manifests:
- `lifecycle-support`
- `abort-action`
Change-Id: I5e25bede1cd90be108255acd3a2855567c5e43b4
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/inc/hf/ffa_partition_manifest.h b/inc/hf/ffa_partition_manifest.h
index d32168b..9d06ea9 100644
--- a/inc/hf/ffa_partition_manifest.h
+++ b/inc/hf/ffa_partition_manifest.h
@@ -54,6 +54,30 @@
enum xlat_granule { PAGE_4KB = 0, PAGE_16KB, PAGE_64KB };
+/**
+ * Refer section 7.3 of the FF-A v1.3 ALP2 specification.
+ */
+enum abort_action {
+ /** Keep vCPU in STOPPED state. */
+ ACTION_STOP = 0,
+
+ /** Transition vCPU to NULL state. */
+ ACTION_DESTROY = 1,
+
+ /** Transition vCPU to STARTING state. */
+ ACTION_RESTART = 2,
+
+ /** SPMC aborts itself and informs SPMD. */
+ ACTION_PROPAGATE = 3,
+
+ /**
+ * SPMC takes implementation defined action if not specified explicitly.
+ */
+ ACTION_IMP_DEF,
+
+ /** No other actions supported. */
+};
+
struct sri_interrupts_policy {
/**
* When the partition is in waiting state at the moment one
@@ -267,4 +291,12 @@
/** optional - action in response to Other-Secure interrupt */
uint8_t other_s_interrupts_action;
+
+ /** optional - SP lifecycle supported. */
+ bool lifecycle_support;
+
+ /** optional - Action in response to FFA_ABORT if SP lifecycle
+ * supported.
+ */
+ uint8_t abort_action;
};
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index ba29930..7be2715 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -95,6 +95,8 @@
MANIFEST_ERROR_DMA_ACCESS_PERMISSIONS_OVERFLOW,
MANIFEST_ERROR_DMA_DEVICE_OVERFLOW,
MANIFEST_ERROR_VM_AVAILABILITY_MESSAGE_INVALID,
+ MANIFEST_ERROR_ILLEGAL_LIFECYCLE_SUPPORT,
+ MANIFEST_ERROR_ILLEGAL_ABORT_ACTION,
};
enum manifest_return_code manifest_init(struct mm_stage1_locked stage1_locked,
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index b5d01bf..311c703 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -273,6 +273,18 @@
/* List entry pointing to the next VM in the boot order list. */
struct list_entry boot_list_node;
+
+ /**
+ * Abort action taken by SPMC if the vCPU of this partition encounters
+ * a fatal error.
+ */
+ enum abort_action abort_action;
+
+ /**
+ * Whether the partition supports all the states defined in the
+ * Partition Lifecycle guidance.
+ */
+ bool lifecycle_support;
};
/** Encapsulates a VM whose lock is held. */