]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
whpx: arm64: add partition-wide reset on the reboot path
authorMohamed Mediouni <mohamed@unpredictable.fr>
Tue, 10 Feb 2026 11:34:49 +0000 (11:34 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 10 Feb 2026 11:34:49 +0000 (11:34 +0000)
This resets non-architectural state to allow for reboots to succeed.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
include/system/whpx-internal.h
target/arm/whpx/whpx-all.c

index 8ded54a39b75fdd0d4ad9c8425852b20c59f8e54..ad6ade223eec032948e0885c796e4e46ca61687a 100644 (file)
@@ -86,6 +86,8 @@ void whpx_apic_get(APICCommonState *s);
   X(HRESULT, WHvSetVirtualProcessorInterruptControllerState2, \
         (WHV_PARTITION_HANDLE Partition, UINT32 VpIndex, PVOID State, \
          UINT32 StateSize)) \
+  X(HRESULT, WHvResetPartition, \
+        (WHV_PARTITION_HANDLE Partition)) \
 
 #define LIST_WINHVEMULATION_FUNCTIONS(X) \
   X(HRESULT, WHvEmulatorCreateEmulator, (const WHV_EMULATOR_CALLBACKS* Callbacks, WHV_EMULATOR_HANDLE* Emulator)) \
index 44ef42307ba05bd8d2b16ec0d5231b1f02dfce4a..36c5e30a0349109bd5152fedecfef246e6fff778 100644 (file)
@@ -497,6 +497,8 @@ int whpx_vcpu_run(CPUState *cpu)
             if (arm_cpu->power_state != PSCI_OFF) {
                 whpx_psci_cpu_off(arm_cpu);
             }
+            /* Partition-wide reset, to reset state for reboots to succeed. */
+            whp_dispatch.WHvResetPartition(whpx->partition);
             bql_unlock();
             break;
         case WHvRunVpExitReasonNone: