]> git.proxmox.com Git - mirror_qemu.git/commit
memory: limit sections in the radix tree to the actual address space size
authorAvi Kivity <avi.kivity@gmail.com>
Tue, 30 Oct 2012 11:47:45 +0000 (13:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2013 16:43:35 +0000 (18:43 +0200)
commit86a8623692b1b559a419a92eb8b6897c221bca74
tree6cd80ea65366319d09ddded88acbafd2c63fbe39
parent311f83ca08c011b048c063c2fd3038a8957970bc
memory: limit sections in the radix tree to the actual address space size

The radix tree is statically sized to fit TARGET_PHYS_ADDR_SPACE_BITS.
If a larger memory region is registered, it will overflow.

Fix by limiting any section in the radix tree to the supported size.

This problem was not observed earlier since artificial regions (containers
and aliases) are eliminated by the memory core, leaving only device regions
which have reasonable sizes.  An IOMMU however cannot be eliminated by the
memory core, and may have an artificial size.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
[ Fail the build if TARGET_PHYS_ADDR_SPACE_BITS is too large - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c
include/exec/memory.h