[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC V3 25/29] target/arm/kvm: Write CPU state back to KVM on rese
From: |
Salil Mehta |
Subject: |
[PATCH RFC V3 25/29] target/arm/kvm: Write CPU state back to KVM on reset |
Date: |
Fri, 14 Jun 2024 00:36:35 +0100 |
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
When a KVM vCPU is reset following a PSCI CPU_ON call, its power state
is not synchronized with KVM at the moment. Because the vCPU is not
marked dirty, we miss the call to kvm_arch_put_registers() that writes
to KVM's MP_STATE. Force mp_state synchronization.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
target/arm/kvm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 1121771c4a..7acd83ce64 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -980,6 +980,7 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu)
void kvm_arm_reset_vcpu(ARMCPU *cpu)
{
int ret;
+ CPUState *cs = CPU(cpu);
/* Re-init VCPU so that all registers are set to
* their respective reset values.
@@ -1001,6 +1002,12 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu)
* for the same reason we do so in kvm_arch_get_registers().
*/
write_list_to_cpustate(cpu);
+
+ /*
+ * Ensure we call kvm_arch_put_registers(). The vCPU isn't marked dirty if
+ * it was parked in KVM and is now booting from a PSCI CPU_ON call.
+ */
+ cs->vcpu_dirty = true;
}
void kvm_arm_create_host_vcpu(ARMCPU *cpu)
--
2.34.1
- [PATCH RFC V3 15/29] hw/arm: MADT Tbl change to size the guest with possible vCPUs, (continued)
- [PATCH RFC V3 15/29] hw/arm: MADT Tbl change to size the guest with possible vCPUs, Salil Mehta, 2024/06/13
- [PATCH RFC V3 16/29] hw/acpi: Make _MAT method optional, Salil Mehta, 2024/06/13
- [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init, Salil Mehta, 2024/06/13
- [PATCH RFC V3 18/29] arm/virt: Add/update basic hot-(un)plug framework, Salil Mehta, 2024/06/13
- [PATCH RFC V3 19/29] arm/virt: Changes to (un)wire GICC<->vCPU IRQs during hot-(un)plug, Salil Mehta, 2024/06/13
- [PATCH RFC V3 20/29] hw/arm, gicv3: Changes to update GIC with vCPU hot-plug notification, Salil Mehta, 2024/06/13
- [PATCH RFC V3 21/29] hw/intc/arm-gicv3*: Changes required to (re)init the vCPU register info, Salil Mehta, 2024/06/13
- [PATCH RFC V3 22/29] arm/virt: Update the guest(via GED) about CPU hot-(un)plug events, Salil Mehta, 2024/06/13
- [PATCH RFC V3 23/29] hw/arm: Changes required for reset and to support next boot, Salil Mehta, 2024/06/13
- [PATCH RFC V3 24/29] target/arm: Add support of *unrealize* ARMCPU during vCPU Hot-unplug, Salil Mehta, 2024/06/13
- [PATCH RFC V3 25/29] target/arm/kvm: Write CPU state back to KVM on reset,
Salil Mehta <=
- [PATCH RFC V3 26/29] target/arm/kvm, tcg: Register/Handle SMCCC hypercall exits to VMM/Qemu, Salil Mehta, 2024/06/13
- [PATCH RFC V3 27/29] hw/arm: Support hotplug capability check using _OSC method, Salil Mehta, 2024/06/13
- [PATCH RFC V3 28/29] tcg/mttcg: enable threads to unregister in tcg_ctxs[], Salil Mehta, 2024/06/13
- [PATCH RFC V3 29/29] hw/arm/virt: Expose cold-booted CPUs as MADT GICC Enabled, Salil Mehta, 2024/06/13
- Re: [PATCH RFC V3 00/29] Support of Virtual CPU Hotplug for ARMv8 Arch, Vishnu Pajjuri, 2024/06/26