[Qemu-devel] [PATCH] s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL

Aurelien Jarno posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170423160854.3478-1-aurelien@aurel32.net
Test checkpatch passed
Test docker passed
Test s390x passed
There is a newer version of this series
roms/qemu-palcode          | 2 +-
roms/seabios               | 2 +-
target/s390x/misc_helper.c | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL
Posted by Aurelien Jarno 6 years, 11 months ago
s390_virtio_hypercall can trigger IO events and interrupts, most notably
when using virtio-ccw devices.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 roms/qemu-palcode          | 2 +-
 roms/seabios               | 2 +-
 target/s390x/misc_helper.c | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/roms/qemu-palcode b/roms/qemu-palcode
index f3c7e44c70..c87a92639b 160000
--- a/roms/qemu-palcode
+++ b/roms/qemu-palcode
@@ -1 +1 @@
-Subproject commit f3c7e44c70254975df2a00af39701eafbac4d471
+Subproject commit c87a92639b28ac42bc8f6c67443543b405dc479b
diff --git a/roms/seabios b/roms/seabios
index 5f4c7b13cd..e2fc41e24e 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 5f4c7b13cdf9c450eb55645f4362ea58fa61b79b
+Subproject commit e2fc41e24ee0ada60fc511d60b15a41b294538be
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 */
-- 
2.11.0


Re: [Qemu-devel] [PATCH] s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL
Posted by Alexander Graf 6 years, 11 months ago

> Am 23.04.2017 um 18:08 schrieb Aurelien Jarno <aurelien@aurel32.net>:
> 
> s390_virtio_hypercall can trigger IO events and interrupts, most notably
> when using virtio-ccw devices.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> roms/qemu-palcode          | 2 +-
> roms/seabios               | 2 +-
> target/s390x/misc_helper.c | 2 ++
> 3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/roms/qemu-palcode b/roms/qemu-palcode
> index f3c7e44c70..c87a92639b 160000
> --- a/roms/qemu-palcode
> +++ b/roms/qemu-palcode
> @@ -1 +1 @@
> -Subproject commit f3c7e44c70254975df2a00af39701eafbac4d471
> +Subproject commit c87a92639b28ac42bc8f6c67443543b405dc479b
> diff --git a/roms/seabios b/roms/seabios
> index 5f4c7b13cd..e2fc41e24e 160000
> --- a/roms/seabios
> +++ b/roms/seabios
> @@ -1 +1 @@
> -Subproject commit 5f4c7b13cdf9c450eb55645f4362ea58fa61b79b
> +Subproject commit e2fc41e24ee0ada60fc511d60b15a41b294538be

I guess you didn't mean to send those hunks?

> 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();

That change however looks good to me. So without the subprj commits,

Reviewed-by: Alexander Graf <agraf@suse.de>

Alex

>         break;
>     case 0x44:
>         /* yield */
> -- 
> 2.11.0
> 


Re: [Qemu-devel] [PATCH] s390x/misc_helper.c: wrap s390_virtio_hypercall in BQL
Posted by Aurelien Jarno 6 years, 11 months ago
On 2017-04-23 19:19, Alexander Graf wrote:
> 
> 
> > Am 23.04.2017 um 18:08 schrieb Aurelien Jarno <aurelien@aurel32.net>:
> > 
> > s390_virtio_hypercall can trigger IO events and interrupts, most notably
> > when using virtio-ccw devices.
> > 
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> > roms/qemu-palcode          | 2 +-
> > roms/seabios               | 2 +-
> > target/s390x/misc_helper.c | 2 ++
> > 3 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/roms/qemu-palcode b/roms/qemu-palcode
> > index f3c7e44c70..c87a92639b 160000
> > --- a/roms/qemu-palcode
> > +++ b/roms/qemu-palcode
> > @@ -1 +1 @@
> > -Subproject commit f3c7e44c70254975df2a00af39701eafbac4d471
> > +Subproject commit c87a92639b28ac42bc8f6c67443543b405dc479b
> > diff --git a/roms/seabios b/roms/seabios
> > index 5f4c7b13cd..e2fc41e24e 160000
> > --- a/roms/seabios
> > +++ b/roms/seabios
> > @@ -1 +1 @@
> > -Subproject commit 5f4c7b13cdf9c450eb55645f4362ea58fa61b79b
> > +Subproject commit e2fc41e24ee0ada60fc511d60b15a41b294538be
> 
> I guess you didn't mean to send those hunks?

Indeed that's a mistake sorry, i'll resend a new version.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net