From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, Eric Auger <eric.auger@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [RFC PATCH 02/11] Make address_space_map() take a MemTxAttrs argument
Date: Mon, 30 Apr 2018 19:18:56 +0100 [thread overview]
Message-ID: <20180430181905.32327-3-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180430181905.32327-1-peter.maydell@linaro.org>
As part of plumbing MemTxAttrs down to the IOMMU translate method,
add MemTxAttrs as an argument to address_space_map().
Its callers either have an attrs value to hand, or don't care
and can use MEMTXATTRS_UNSPECIFIED.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/exec/memory.h | 3 ++-
include/sysemu/dma.h | 3 ++-
exec.c | 6 ++++--
target/ppc/mmu-hash64.c | 3 ++-
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index f416d1e985..1af4e3cd5b 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1953,9 +1953,10 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
* @addr: address within that address space
* @plen: pointer to length of buffer; updated on return
* @is_write: indicates the transfer direction
+ * @attrs: memory attributes
*/
void *address_space_map(AddressSpace *as, hwaddr addr,
- hwaddr *plen, bool is_write);
+ hwaddr *plen, bool is_write, MemTxAttrs attrs);
/* address_space_unmap: Unmaps a memory region previously mapped by address_space_map()
*
diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h
index c228c66513..0d73902634 100644
--- a/include/sysemu/dma.h
+++ b/include/sysemu/dma.h
@@ -132,7 +132,8 @@ static inline void *dma_memory_map(AddressSpace *as,
hwaddr xlen = *len;
void *p;
- p = address_space_map(as, addr, &xlen, dir == DMA_DIRECTION_FROM_DEVICE);
+ p = address_space_map(as, addr, &xlen, dir == DMA_DIRECTION_FROM_DEVICE,
+ MEMTXATTRS_UNSPECIFIED);
*len = xlen;
return p;
}
diff --git a/exec.c b/exec.c
index a0f27b7b8c..eb6471abfe 100644
--- a/exec.c
+++ b/exec.c
@@ -3494,7 +3494,8 @@ flatview_extend_translation(FlatView *fv, hwaddr addr,
void *address_space_map(AddressSpace *as,
hwaddr addr,
hwaddr *plen,
- bool is_write)
+ bool is_write,
+ MemTxAttrs attrs)
{
hwaddr len = *plen;
hwaddr l, xlat;
@@ -3581,7 +3582,8 @@ void *cpu_physical_memory_map(hwaddr addr,
hwaddr *plen,
int is_write)
{
- return address_space_map(&address_space_memory, addr, plen, is_write);
+ return address_space_map(&address_space_memory, addr, plen, is_write,
+ MEMTXATTRS_UNSPECIFIED);
}
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index 7e0adecfd9..4839dc22f0 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -431,7 +431,8 @@ const ppc_hash_pte64_t *ppc_hash64_map_hptes(PowerPCCPU *cpu,
return NULL;
}
- hptes = address_space_map(CPU(cpu)->as, base + pte_offset, &plen, false);
+ hptes = address_space_map(CPU(cpu)->as, base + pte_offset, &plen, false,
+ MEMTXATTRS_UNSPECIFIED);
if (plen < (n * HASH_PTE_SIZE_64)) {
hw_error("%s: Unable to map all requested HPTEs\n", __func__);
}
--
2.17.0
next prev parent reply other threads:[~2018-04-30 18:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 18:18 [Qemu-devel] [RFC PATCH 00/11] iommu: add MemTxAttrs argument to IOMMU translate function Peter Maydell
2018-04-30 18:18 ` [Qemu-devel] [RFC PATCH 01/11] Make address_space_translate() take a MemTxAttrs argument Peter Maydell
2018-04-30 18:18 ` Peter Maydell [this message]
2018-04-30 18:18 ` [Qemu-devel] [RFC PATCH 03/11] Make address_space_access_valid() " Peter Maydell
2018-04-30 18:18 ` [Qemu-devel] [RFC PATCH 04/11] Make flatview_extend_translation() " Peter Maydell
2018-04-30 18:18 ` [Qemu-devel] [RFC PATCH 05/11] Make memory_region_access_valid() " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 06/11] Make MemoryRegion valid.accepts callback " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 07/11] Make flatview_access_valid() " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 08/11] Make flatview_translate() " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 09/11] Make address_space_get_iotlb_entry() " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 10/11] Make flatview_do_translate() " Peter Maydell
2018-04-30 18:19 ` [Qemu-devel] [RFC PATCH 11/11] Add MemTxAttrs argument to IOMMU translate function Peter Maydell
2018-04-30 18:37 ` [Qemu-devel] [RFC PATCH 00/11] iommu: add " no-reply
2018-04-30 18:39 ` no-reply
2018-04-30 18:44 ` no-reply
2018-05-01 8:57 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180430181905.32327-3-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=eric.auger@redhat.com \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).