From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIa1x-00059w-VM for qemu-devel@nongnu.org; Fri, 24 Jul 2015 06:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIa1v-0000iG-21 for qemu-devel@nongnu.org; Fri, 24 Jul 2015 06:16:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIa1u-0000i5-Tw for qemu-devel@nongnu.org; Fri, 24 Jul 2015 06:16:39 -0400 From: Paolo Bonzini Date: Fri, 24 Jul 2015 12:16:22 +0200 Message-Id: <1437732994-20478-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1437732994-20478-1-git-send-email-pbonzini@redhat.com> References: <1437732994-20478-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 01/13] exec.c: Use atomic_rcu_read() to access dispatch in memory_region_section_get_iotlb() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell From: Peter Maydell When accessing the dispatch pointer in an AddressSpace within an RCU critical section we should always use atomic_rcu_read(). Fix an access within memory_region_section_get_iotlb() which was incorrectly doing a direct pointer access. Signed-off-by: Peter Maydell Message-Id: <1437391637-31576-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 7d60e15..0a4a0c5 100644 --- a/exec.c +++ b/exec.c @@ -954,7 +954,10 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu, iotlb |= PHYS_SECTION_ROM; } } else { - iotlb = section - section->address_space->dispatch->map.sections; + AddressSpaceDispatch *d; + + d = atomic_rcu_read(§ion->address_space->dispatch); + iotlb = section - d->map.sections; iotlb += xlat; } -- 2.4.3