s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL
PATCH v2 1/1 s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL
s390_virtio_hypercall can trigger IO events and interrupts, most notably when using virtio-ccw devices.
--- target/s390x/misc_helper.c | 2 ++ 1 file changed, 2 insertions(+)
target/s390x/misc_helper.c +2 -0
@@ -307,7 +307,9 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)switch (num) {case 0x500 :/* KVM hypercall */ +qemu_mutex_lock_iothread (); r =s390_virtio_hypercall (env); +qemu_mutex_unlock_iothread ();break ;case 0x44 :/* yield */
Signature · 1 line
2.11.0
Hi Aurelien!
Why don't lock inside s390_virtio_hypercall() directly round the diag500 dispatch call?
regards,
Phil.
Quoted 24 lines · Aurelien Jarno
s390_virtio_hypercallcan trigger IO events and interrupts, most notably when using virtio-ccw devices.Reviewed-by Alexander Graf <[email protected]>Signed-off-by Aurelien Jarno <[email protected]>--- target/s390x/misc_helper.c | 2 ++ 1 file changed, 2 insertions(+)target/s390x/misc_helper.c +2
-0@@ -307,7 +307,9 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)switch (num) {case 0x500 :/* KVM hypercall */ +qemu_mutex_lock_iothread (); r =s390_virtio_hypercall (env); +qemu_mutex_unlock_iothread ();break ;case 0x44 :/* yield */
Quoted 4 lines · Philippe Mathieu-Daudé
Hi Aurelien!
Why don't lock inside
s390_virtio_hypercall()directly round the diag500 dispatch call?
s390_virtio_hypercall is shared between TCG and KVM. For KVM the lock is already done before calling s390_virtio_hypercall in kvm_arch_handle_exit.
Signature · 2 lines
Aurelien Jarno GPG: 4096R/1DDD8C9B [email protected] http://www.aurel32.net
Philippe Mathieu-Daudé
Reviewed-byQuoted 8 lines · Aurelien Jarno
Quoted 4 lines · Philippe Mathieu-Daudé
Hi Aurelien!
Why don't lock inside
s390_virtio_hypercall()directly round the diag500 dispatch call?
s390_virtio_hypercallis shared between TCG and KVM. For KVM the lock is already done before callings390_virtio_hypercallinkvm_arch_handle_exit.
Fair enough!