[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/7] address_space_map: address_space_to_flatvie
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-devel] [PATCH 6/7] address_space_map: address_space_to_flatview needs RCU lock |
Date: |
Tue, 6 Mar 2018 18:46:54 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 05/03/18 19:36, Paolo Bonzini wrote:
> address_space_map is calling address_space_to_flatview but it can
> be called outside the RCU lock. The function itself is calling
> rcu_read_lock/rcu_read_unlock, just in the wrong place, so the
> fix is easy.
>
> Cc: address@hidden
> Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
> ---
> exec.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/exec.c b/exec.c
> index 177583c2ee..070eaff3e7 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3464,7 +3464,7 @@ void *address_space_map(AddressSpace *as,
> hwaddr l, xlat;
> MemoryRegion *mr;
> void *ptr;
> - FlatView *fv = address_space_to_flatview(as);
> + FlatView *fv;
>
> if (len == 0) {
> return NULL;
> @@ -3472,6 +3472,7 @@ void *address_space_map(AddressSpace *as,
>
> l = len;
> rcu_read_lock();
> + fv = address_space_to_flatview(as);
> mr = flatview_translate(fv, addr, &xlat, &l, is_write);
>
> if (!memory_access_is_direct(mr, is_write)) {
>
--
Alexey
- Re: [Qemu-devel] [PATCH 1/7] openpic_kvm: drop address_space_to_flatview call, (continued)
- [Qemu-devel] [PATCH 2/7] memory: inline some performance-sensitive accessors, Paolo Bonzini, 2018/03/05
- [Qemu-devel] [PATCH 3/7] address_space_write: address_space_to_flatview needs RCU lock, Paolo Bonzini, 2018/03/05
- [Qemu-devel] [PATCH 5/7] address_space_access_valid: address_space_to_flatview needs RCU lock, Paolo Bonzini, 2018/03/05
- [Qemu-devel] [PATCH 6/7] address_space_map: address_space_to_flatview needs RCU lock, Paolo Bonzini, 2018/03/05
- Re: [Qemu-devel] [PATCH 6/7] address_space_map: address_space_to_flatview needs RCU lock,
Alexey Kardashevskiy <=
- [Qemu-devel] [PATCH 4/7] address_space_read: address_space_to_flatview needs RCU lock, Paolo Bonzini, 2018/03/05
- [Qemu-devel] [PATCH 7/7] address_space_rw: address_space_to_flatview needs RCU lock, Paolo Bonzini, 2018/03/05
- Re: [Qemu-devel] [PATCH 0/7] memory: address_space_to_flatview needs RCU lock, Alexey Kardashevskiy, 2018/03/06