[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 15/16] target/arm/kvm: Disable Realm reboot
From: |
Jean-Philippe Brucker |
Subject: |
[RFC PATCH 15/16] target/arm/kvm: Disable Realm reboot |
Date: |
Fri, 27 Jan 2023 15:07:28 +0000 |
A realm cannot be reset, it must be recreated from scratch. The RMM
specification defines states of a Realm as NEW -> ACTIVE -> SYSTEM_OFF,
after which the Realm can only be destroyed. A PCSI_SYSTEM_RESET call,
which normally reboots the system, puts the Realm in SYSTEM_OFF state.
QEMU does not support recreating a VM. Normally, a reboot request by the
guest causes all devices to reset, which cannot work for a Realm.
Indeed, loading images into Realm memory and changing the PC is only
allowed for a Realm in NEW state. Resetting the images for a Realm in
SYSTEM_OFF state will cause QEMU to crash with a bus error.
Handle reboot requests by the guest more gracefully, by indicating to
runstate.c that the vCPUs of a Realm are not resettable, and that QEMU
should exit.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
target/arm/kvm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index d8655d9041..02b5e8009f 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -1071,7 +1071,8 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
bool kvm_arch_cpu_check_are_resettable(void)
{
- return true;
+ /* A Realm cannot be reset */
+ return !kvm_arm_rme_enabled();
}
void kvm_arch_accel_class_init(ObjectClass *oc)
--
2.39.0
- Re: [RFC PATCH 06/16] target/arm/kvm-rme: Initialize vCPU, (continued)
- [RFC PATCH 10/16] target/arm/kvm-rme: Add measurement algorithm property, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 09/16] hw/arm/boot: Populate realm memory with boot images, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 08/16] target/arm/kvm-rme: Populate the realm with boot images, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 14/16] target/arm/kvm-rme: Add PMU num counters parameters, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 11/16] target/arm/kvm-rme: Add Realm Personalization Value parameter, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 15/16] target/arm/kvm: Disable Realm reboot,
Jean-Philippe Brucker <=
- [RFC PATCH 12/16] target/arm/kvm-rme: Add Realm SVE vector length, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 13/16] target/arm/kvm-rme: Add breakpoints and watchpoints parameters, Jean-Philippe Brucker, 2023/01/27
- [RFC PATCH 16/16] target/arm/kvm-rme: Disable readonly mappings, Jean-Philippe Brucker, 2023/01/27