qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] exec: Add missing rcu_read_unlock
@ 2017-01-09 11:09 Roman Kapl
  2017-01-09 11:52 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Kapl @ 2017-01-09 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Roman Kapl

rcu_read_unlock was not called if the address_space_access_valid result is
negative.

This caused (at least) a problem when qemu on PPC/E500+TAP failed to terminate
properly and instead got stuck in a deadlock.

Signed-off-by: Roman Kapl <rka@sysgo.com>
---
 exec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/exec.c b/exec.c
index 8d4bb0e..6895db5 100644
--- a/exec.c
+++ b/exec.c
@@ -2927,6 +2927,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
         if (!memory_access_is_direct(mr, is_write)) {
             l = memory_access_size(mr, l, addr);
             if (!memory_region_access_valid(mr, xlat, l, is_write)) {
+                rcu_read_unlock();
                 return false;
             }
         }
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] exec: Add missing rcu_read_unlock
  2017-01-09 11:09 [Qemu-devel] [PATCH] exec: Add missing rcu_read_unlock Roman Kapl
@ 2017-01-09 11:52 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2017-01-09 11:52 UTC (permalink / raw)
  To: Roman Kapl, qemu-devel, qemu-stable



On 09/01/2017 12:09, Roman Kapl wrote:
> rcu_read_unlock was not called if the address_space_access_valid result is
> negative.
> 
> This caused (at least) a problem when qemu on PPC/E500+TAP failed to terminate
> properly and instead got stuck in a deadlock.
> 
> Signed-off-by: Roman Kapl <rka@sysgo.com>
> ---
>  exec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/exec.c b/exec.c
> index 8d4bb0e..6895db5 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2927,6 +2927,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
>          if (!memory_access_is_direct(mr, is_write)) {
>              l = memory_access_size(mr, l, addr);
>              if (!memory_region_access_valid(mr, xlat, l, is_write)) {
> +                rcu_read_unlock();
>                  return false;
>              }
>          }
> 

Thanks, queued!

Cc: qemu-stable <qemu-stable@nongnu.org>

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-09 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 11:09 [Qemu-devel] [PATCH] exec: Add missing rcu_read_unlock Roman Kapl
2017-01-09 11:52 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).