diff mbox series

memory: fix flatview_access_valid RCU read lock/unlock imbalance

Message ID 20180307130238.19358-1-pbonzini@redhat.com
State New
Headers show
Series memory: fix flatview_access_valid RCU read lock/unlock imbalance | expand

Commit Message

Paolo Bonzini March 7, 2018, 1:02 p.m. UTC
Fixes: 11e732a5ed46903f997985bed4c3767ca28a7eb6
Reported-by: Cornelia Huck <cohuck@redhat.com>
Reported-by: luigi burdo <intermediadc@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 exec.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Cornelia Huck March 7, 2018, 1:23 p.m. UTC | #1
On Wed,  7 Mar 2018 14:02:38 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Fixes: 11e732a5ed46903f997985bed4c3767ca28a7eb6
> Reported-by: Cornelia Huck <cohuck@redhat.com>
> Reported-by: luigi burdo <intermediadc@hotmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  exec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/exec.c b/exec.c
> index 604f03c535..a9181e6417 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3393,7 +3393,6 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
>          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, that fixes master for me.

Tested-by: Cornelia Huck <cohuck@redhat.com>
Thomas Huth March 7, 2018, 1:29 p.m. UTC | #2
On 07.03.2018 14:02, Paolo Bonzini wrote:
> Fixes: 11e732a5ed46903f997985bed4c3767ca28a7eb6
> Reported-by: Cornelia Huck <cohuck@redhat.com>
> Reported-by: luigi burdo <intermediadc@hotmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  exec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/exec.c b/exec.c
> index 604f03c535..a9181e6417 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3393,7 +3393,6 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
>          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, this seems to fix the problem with the sam640ex and 40p machines.

Tested-by: Thomas Huth <thuth@redhat.com>
Peter Maydell March 9, 2018, 4:42 p.m. UTC | #3
On 7 March 2018 at 13:29, Thomas Huth <thuth@redhat.com> wrote:
> On 07.03.2018 14:02, Paolo Bonzini wrote:
>> Fixes: 11e732a5ed46903f997985bed4c3767ca28a7eb6
>> Reported-by: Cornelia Huck <cohuck@redhat.com>
>> Reported-by: luigi burdo <intermediadc@hotmail.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  exec.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/exec.c b/exec.c
>> index 604f03c535..a9181e6417 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -3393,7 +3393,6 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
>>          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, this seems to fix the problem with the sam640ex and 40p machines.
>
> Tested-by: Thomas Huth <thuth@redhat.com>

Thanks, applied to master since I ran into this too.

-- PMM
diff mbox series

Patch

diff --git a/exec.c b/exec.c
index 604f03c535..a9181e6417 100644
--- a/exec.c
+++ b/exec.c
@@ -3393,7 +3393,6 @@  static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
         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;
             }
         }