• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãoaca53be34ac3e7cac5f39396a51a338860a5a837 (tree)
Hora2020-03-13 01:31:10
AutorBeata Michalska <beata.michalska@lina...>
CommiterPeter Maydell

Mensagem de Log

target/arm: kvm: Inject events at the last stage of sync

KVM_SET_VCPU_EVENTS might actually lead to vcpu registers being modified.
As such this should be the last step of sync to avoid potential overwriting
of whatever changes KVM might have done.

Signed-off-by: Beata Michalska <beata.michalska@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 20200312003401.29017-2-beata.michalska@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Mudança Sumário

Diff

--- a/target/arm/kvm32.c
+++ b/target/arm/kvm32.c
@@ -409,17 +409,22 @@ int kvm_arch_put_registers(CPUState *cs, int level)
409409 return ret;
410410 }
411411
412- ret = kvm_put_vcpu_events(cpu);
413- if (ret) {
414- return ret;
415- }
416-
417412 write_cpustate_to_list(cpu, true);
418413
419414 if (!write_list_to_kvmstate(cpu, level)) {
420415 return EINVAL;
421416 }
422417
418+ /*
419+ * Setting VCPU events should be triggered after syncing the registers
420+ * to avoid overwriting potential changes made by KVM upon calling
421+ * KVM_SET_VCPU_EVENTS ioctl
422+ */
423+ ret = kvm_put_vcpu_events(cpu);
424+ if (ret) {
425+ return ret;
426+ }
427+
423428 kvm_arm_sync_mpstate_to_kvm(cpu);
424429
425430 return ret;
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -1094,17 +1094,22 @@ int kvm_arch_put_registers(CPUState *cs, int level)
10941094 return ret;
10951095 }
10961096
1097- ret = kvm_put_vcpu_events(cpu);
1098- if (ret) {
1099- return ret;
1100- }
1101-
11021097 write_cpustate_to_list(cpu, true);
11031098
11041099 if (!write_list_to_kvmstate(cpu, level)) {
11051100 return -EINVAL;
11061101 }
11071102
1103+ /*
1104+ * Setting VCPU events should be triggered after syncing the registers
1105+ * to avoid overwriting potential changes made by KVM upon calling
1106+ * KVM_SET_VCPU_EVENTS ioctl
1107+ */
1108+ ret = kvm_put_vcpu_events(cpu);
1109+ if (ret) {
1110+ return ret;
1111+ }
1112+
11081113 kvm_arm_sync_mpstate_to_kvm(cpu);
11091114
11101115 return ret;