[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 032/113] address_space_map: address_space_to_flatvi
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 032/113] address_space_map: address_space_to_flatview needs RCU lock |
Date: |
Mon, 18 Jun 2018 20:41:58 -0500 |
From: Paolo Bonzini <address@hidden>
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.
Reviewed-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit ad0c60fa572d4050255b698ecdb67294dd4c0125)
Signed-off-by: Michael Roth <address@hidden>
---
exec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/exec.c b/exec.c
index 7c4fb68368..e30155c113 100644
--- a/exec.c
+++ b/exec.c
@@ -3395,7 +3395,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;
@@ -3403,6 +3403,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)) {
--
2.11.0
- [Qemu-stable] [PATCH 023/113] linux-user: fix mmap/munmap/mprotect/mremap/shmat, (continued)
- [Qemu-stable] [PATCH 023/113] linux-user: fix mmap/munmap/mprotect/mremap/shmat, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 024/113] linux-user: fix assertion in shmdt, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 025/113] linux-user: fix target_mprotect/target_munmap error return values, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 027/113] openpic_kvm: drop address_space_to_flatview call, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 026/113] sparc: fix leon3 casa instruction when MMU is disabled, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 028/113] memory: inline some performance-sensitive accessors, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 029/113] address_space_write: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 002/113] pci-bridge/i82801b11: clear bridge registers on platform reset, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 031/113] address_space_access_valid: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 030/113] address_space_read: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 032/113] address_space_map: address_space_to_flatview needs RCU lock,
Michael Roth <=
- [Qemu-stable] [PATCH 035/113] migration/block: reset dirty bitmap before read in bulk phase, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 033/113] address_space_rw: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 034/113] memory: fix flatview_access_valid RCU read lock/unlock imbalance, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 036/113] multiboot: bss_end_addr can be zero, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 037/113] multiboot: Remove unused variables from multiboot.c, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 039/113] multiboot: fprintf(stderr...) -> error_report(), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 038/113] multiboot: Use header names when displaying fields, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 040/113] multiboot: Reject kernels exceeding the address space, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 003/113] virtio-balloon: unref the memory region before continuing, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 041/113] multiboot: Check validity of mh_header_addr, Michael Roth, 2018/06/18