summaryrefslogtreecommitdiffstats
path: root/memory.c
diff options
context:
space:
mode:
authorPeter Maydell2018-05-31 18:00:55 +0200
committerPeter Maydell2018-05-31 18:00:55 +0200
commitc181ddaa176856b3cd2dfd12bbcf25fa9c884a97 (patch)
treef5b645728c9e6e164aaae9ec214222dd3ac54a7b /memory.c
parentMerge remote-tracking branch 'remotes/ehabkost/tags/numa-next-pull-request' i... (diff)
parentKVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice (diff)
downloadqemu-c181ddaa176856b3cd2dfd12bbcf25fa9c884a97.tar.gz
qemu-c181ddaa176856b3cd2dfd12bbcf25fa9c884a97.tar.xz
qemu-c181ddaa176856b3cd2dfd12bbcf25fa9c884a97.zip
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180531-1' into staging
target-arm queue: * target/arm: Honour FPCR.FZ in FRECPX * MAINTAINERS: Add entries for newer MPS2 boards and devices * hw/intc/arm_gicv3: Fix APxR<n> register dispatching * arm_gicv3_kvm: fix bug in writing zero bits back to the in-kernel GIC state * tcg: Fix helper function vs host abi for float16 * arm: fix qemu crash on startup with -bios option * arm: fix malloc type mismatch * xlnx-zdma: Correct mem leaks and memset to zero on desc unaligned errors * Correct CPACR reset value for v7 cores * memory.h: Improve IOMMU related documentation * exec: Plumb transaction attributes through various functions in preparation for allowing IOMMUs to see them * vmstate.h: Provide VMSTATE_BOOL_SUB_ARRAY * ARM: ACPI: Fix use-after-free due to memory realloc * KVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice # gpg: Signature made Thu 31 May 2018 16:54:40 BST # gpg: using RSA key 3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20180531-1: (25 commits) KVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice ARM: ACPI: Fix use-after-free due to memory realloc vmstate.h: Provide VMSTATE_BOOL_SUB_ARRAY Make address_space_translate_iommu take a MemTxAttrs argument Make flatview_do_translate() take a MemTxAttrs argument Make address_space_get_iotlb_entry() take a MemTxAttrs argument Make flatview_translate() take a MemTxAttrs argument Make flatview_access_valid() take a MemTxAttrs argument Make MemoryRegion valid.accepts callback take a MemTxAttrs argument Make memory_region_access_valid() take a MemTxAttrs argument Make flatview_extend_translation() take a MemTxAttrs argument Make address_space_access_valid() take a MemTxAttrs argument Make address_space_map() take a MemTxAttrs argument Make address_space_translate{, _cached}() take a MemTxAttrs argument Make tb_invalidate_phys_addr() take a MemTxAttrs argument memory.h: Improve IOMMU related documentation Correct CPACR reset value for v7 cores xlnx-zdma: Correct mem leaks and memset to zero on desc unaligned errors arm: fix malloc type mismatch arm: fix qemu crash on startup with -bios option ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/memory.c b/memory.c
index fc7f9b782b..10fa2ddd31 100644
--- a/memory.c
+++ b/memory.c
@@ -1269,7 +1269,8 @@ static void unassigned_mem_write(void *opaque, hwaddr addr,
}
static bool unassigned_mem_accepts(void *opaque, hwaddr addr,
- unsigned size, bool is_write)
+ unsigned size, bool is_write,
+ MemTxAttrs attrs)
{
return false;
}
@@ -1347,7 +1348,8 @@ static const MemoryRegionOps ram_device_mem_ops = {
bool memory_region_access_valid(MemoryRegion *mr,
hwaddr addr,
unsigned size,
- bool is_write)
+ bool is_write,
+ MemTxAttrs attrs)
{
int access_size_min, access_size_max;
int access_size, i;
@@ -1373,7 +1375,7 @@ bool memory_region_access_valid(MemoryRegion *mr,
access_size = MAX(MIN(size, access_size_max), access_size_min);
for (i = 0; i < size; i += access_size) {
if (!mr->ops->valid.accepts(mr->opaque, addr + i, access_size,
- is_write)) {
+ is_write, attrs)) {
return false;
}
}
@@ -1416,7 +1418,7 @@ MemTxResult memory_region_dispatch_read(MemoryRegion *mr,
{
MemTxResult r;
- if (!memory_region_access_valid(mr, addr, size, false)) {
+ if (!memory_region_access_valid(mr, addr, size, false, attrs)) {
*pval = unassigned_mem_read(mr, addr, size);
return MEMTX_DECODE_ERROR;
}
@@ -1458,7 +1460,7 @@ MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
unsigned size,
MemTxAttrs attrs)
{
- if (!memory_region_access_valid(mr, addr, size, true)) {
+ if (!memory_region_access_valid(mr, addr, size, true, attrs)) {
unassigned_mem_write(mr, addr, data, size);
return MEMTX_DECODE_ERROR;
}