From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2Q9i-0008AC-LN for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2Q9e-0007bM-3i for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:38:58 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:32803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2Q9d-0007al-VL for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:38:54 -0400 Received: by mail-qk0-x244.google.com with SMTP id o85so7814545qkh.0 for ; Sun, 23 Apr 2017 15:38:52 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <20170423223240.17917-1-aurelien@aurel32.net> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Sun, 23 Apr 2017 19:38:48 -0300 MIME-Version: 1.0 In-Reply-To: <20170423223240.17917-1-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org Cc: Alexander Graf , Richard Henderson Hi Aurelien! Why don't lock inside s390_virtio_hypercall() directly round the diag500 dispatch call? regards, Phil. On 04/23/2017 07:32 PM, Aurelien Jarno wrote: > s390_virtio_hypercall can trigger IO events and interrupts, most notably > when using virtio-ccw devices. > > Reviewed-by: Alexander Graf > Signed-off-by: Aurelien Jarno > --- > target/s390x/misc_helper.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c > index 4946b56ab3..aec737d707 100644 > --- a/target/s390x/misc_helper.c > +++ b/target/s390x/misc_helper.c > @@ -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 */ >