summaryrefslogtreecommitdiff
path: root/target/arm/machine.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-09-07 13:54:52 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-07 13:54:52 +0100
commit1e577cc7cffd3de14dbd321de5c3ef191c6ab07f (patch)
tree7458a34012b0601998c8b38e7dcc4bdd396083d2 /target/arm/machine.c
parent504e3cc36b68b34c176f3f4116b1d5677471ec20 (diff)
target/arm: Add state field, feature bit and migration for v8M secure state
As the first step in implementing ARM v8M's security extension: * add a new feature bit ARM_FEATURE_M_SECURITY * add the CPU state field that indicates whether the CPU is currently in the secure state * add a migration subsection for this new state (we will add the Secure copies of banked register state to this subsection in later patches) * add a #define for the one new-in-v8M exception type * make the CPU debug log print S/NS status Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 1503414539-28762-4-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/machine.c')
-rw-r--r--target/arm/machine.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/target/arm/machine.c b/target/arm/machine.c
index 7b6f9dec6b..f70fcf327a 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -235,6 +235,25 @@ static const VMStateDescription vmstate_pmsav8 = {
}
};
+static bool m_security_needed(void *opaque)
+{
+ ARMCPU *cpu = opaque;
+ CPUARMState *env = &cpu->env;
+
+ return arm_feature(env, ARM_FEATURE_M_SECURITY);
+}
+
+static const VMStateDescription vmstate_m_security = {
+ .name = "cpu/m-security",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = m_security_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32(env.v7m.secure, ARMCPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static int get_cpsr(QEMUFile *f, void *opaque, size_t size,
VMStateField *field)
{
@@ -485,6 +504,7 @@ const VMStateDescription vmstate_arm_cpu = {
&vmstate_pmsav7_rnr,
&vmstate_pmsav7,
&vmstate_pmsav8,
+ &vmstate_m_security,
NULL
}
};