[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL for-2.12 1/8] s390x/kvm: call cpu_synchronize_state()
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL for-2.12 1/8] s390x/kvm: call cpu_synchronize_state() on every kvm_arch_handle_exit() |
Date: |
Mon, 9 Apr 2018 17:15:26 +0200 |
From: David Hildenbrand <address@hidden>
Manually having to use cpu_synchronize_state() is error prone. And as
Christian Borntraeger discovered, e.g. handle_diag() is currently
missing a cpu_synchronize_state(), as decode_basedisp_s() uses a
general purpose register value internally.
So let's do an overall cpu_synchronize_state(), which fixes at least the
one mentioned BUG. We will clean up the superfluous cpu_synchronize_state()
calls later.
We now also call it (although maybe not neded) for
- KVM_EXIT_S390_RESET -> s390_reipl_request()
- KVM_EXIT_DEBUG -> kvm_arch_handle_debug_exit()
- unmanagable/unimplemented intercepts
- ICPT_CPU_STOP -> do_stop_interrupt() -> cpu gets halted
- Scenarios where we inject an operation exception
- handle_stsi()
I don't think any of these are performance critical. Especially as we
have all information directly contained in kvm_run, there are no
additional IOCTLs to issue on modern kernels.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/kvm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index f570896dc1..fb59d92def 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -1778,6 +1778,8 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run
*run)
qemu_mutex_lock_iothread();
+ cpu_synchronize_state(cs);
+
switch (run->exit_reason) {
case KVM_EXIT_S390_SIEIC:
ret = handle_intercept(cpu);
--
2.14.3
- [qemu-s390x] [PULL for-2.12 0/8] s390x fixes for -rc3, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 2/8] s390: Refactor IPL parameter block generation, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 3/8] s390: Ensure IPL from SCSI works as expected, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 4/8] s390: Do not pass inofficial IPL type to the guest, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 1/8] s390x/kvm: call cpu_synchronize_state() on every kvm_arch_handle_exit(),
Cornelia Huck <=
- [qemu-s390x] [PULL for-2.12 7/8] s390x/mmu: don't overwrite pending exception in mmu translate, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 6/8] vfio-ccw: fix memory leaks in vfio_ccw_realize(), Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 8/8] s390x: load_psw() should only exchange the PSW for KVM, Cornelia Huck, 2018/04/09
- [qemu-s390x] [PULL for-2.12 5/8] pc-bios/s390: update images, Cornelia Huck, 2018/04/09
- Re: [qemu-s390x] [PULL for-2.12 0/8] s390x fixes for -rc3, Peter Maydell, 2018/04/10