]> Git Repo - qemu.git/commitdiff
Make address_space_access_valid() take a MemTxAttrs argument
authorPeter Maydell <[email protected]>
Thu, 31 May 2018 13:50:52 +0000 (14:50 +0100)
committerPeter Maydell <[email protected]>
Thu, 31 May 2018 15:32:35 +0000 (16:32 +0100)
As part of plumbing MemTxAttrs down to the IOMMU translate method,
add MemTxAttrs as an argument to address_space_access_valid().
Its callers either have an attrs value to hand, or don't care
and can use MEMTXATTRS_UNSPECIFIED.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Alex BennĂ©e <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 20180521140402[email protected]

exec.c
include/exec/memory.h
include/sysemu/dma.h
target/s390x/diag.c
target/s390x/excp_helper.c
target/s390x/mmu_helper.c
target/s390x/sigp.c

diff --git a/exec.c b/exec.c
index 1dc81cfe4a29866ae6c0fd02a5652921250647c8..22af4e8cb9cef36ff3ff1375bbe5dab4b4cf9887 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -3480,7 +3480,8 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
 }
 
 bool address_space_access_valid(AddressSpace *as, hwaddr addr,
-                                int len, bool is_write)
+                                int len, bool is_write,
+                                MemTxAttrs attrs)
 {
     FlatView *fv;
     bool result;
index d594639d7cc27c3ada1a21dc4946cd8ba9969a85..3f2671f3326fc0163c314964d450f03720c77a10 100644 (file)
@@ -1937,8 +1937,10 @@ static inline MemoryRegion *address_space_translate(AddressSpace *as,
  * @addr: address within that address space
  * @len: length of the area to be checked
  * @is_write: indicates the transfer direction
+ * @attrs: memory attributes
  */
-bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write);
+bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len,
+                                bool is_write, MemTxAttrs attrs);
 
 /* address_space_map: map a physical memory region into a host virtual address
  *
index 0d739026345f3f8373d6f25d4b4da0b72d32ad3e..5da3c4e3c5beb5a4bd7d6a36017b04f4808e3bc7 100644 (file)
@@ -77,7 +77,8 @@ static inline bool dma_memory_valid(AddressSpace *as,
                                     DMADirection dir)
 {
     return address_space_access_valid(as, addr, len,
-                                      dir == DMA_DIRECTION_FROM_DEVICE);
+                                      dir == DMA_DIRECTION_FROM_DEVICE,
+                                      MEMTXATTRS_UNSPECIFIED);
 }
 
 static inline int dma_memory_rw_relaxed(AddressSpace *as, dma_addr_t addr,
index ac2c40f363a43d17b0c12e815287b779d2494e3c..d1d3433aa7ad28383d98e1350bceb9ec2a89d852 100644 (file)
@@ -87,7 +87,8 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
             return;
         }
         if (!address_space_access_valid(&address_space_memory, addr,
-                                        sizeof(IplParameterBlock), false)) {
+                                        sizeof(IplParameterBlock), false,
+                                        MEMTXATTRS_UNSPECIFIED)) {
             s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
             return;
         }
@@ -116,7 +117,8 @@ out:
             return;
         }
         if (!address_space_access_valid(&address_space_memory, addr,
-                                        sizeof(IplParameterBlock), true)) {
+                                        sizeof(IplParameterBlock), true,
+                                        MEMTXATTRS_UNSPECIFIED)) {
             s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
             return;
         }
index dfee2211114d57bdc4480423f7ce0df0792332d6..f0ce60cff2f491e51b7a0caf06ea02eada39eca3 100644 (file)
@@ -120,7 +120,8 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, int size,
 
     /* check out of RAM access */
     if (!address_space_access_valid(&address_space_memory, raddr,
-                                    TARGET_PAGE_SIZE, rw)) {
+                                    TARGET_PAGE_SIZE, rw,
+                                    MEMTXATTRS_UNSPECIFIED)) {
         DPRINTF("%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", __func__,
                 (uint64_t)raddr, (uint64_t)ram_size);
         trigger_pgm_exception(env, PGM_ADDRESSING, ILEN_AUTO);
index a25deef5dd859c14346d61bef5f941ff038f9b81..145b62a7efc21dd1ab17e57f7e3bb30636367d8d 100644 (file)
@@ -461,7 +461,8 @@ static int translate_pages(S390CPU *cpu, vaddr addr, int nr_pages,
             return ret;
         }
         if (!address_space_access_valid(&address_space_memory, pages[i],
-                                        TARGET_PAGE_SIZE, is_write)) {
+                                        TARGET_PAGE_SIZE, is_write,
+                                        MEMTXATTRS_UNSPECIFIED)) {
             trigger_access_exception(env, PGM_ADDRESSING, ILEN_AUTO, 0);
             return -EFAULT;
         }
index aff1530c82b5c0993ebc3b4ff1a34d37b3cfa7be..c1f9245797e787ea926fd6ea4ab20a749fa94240 100644 (file)
@@ -280,7 +280,8 @@ static void sigp_set_prefix(CPUState *cs, run_on_cpu_data arg)
     cpu_synchronize_state(cs);
 
     if (!address_space_access_valid(&address_space_memory, addr,
-                                    sizeof(struct LowCore), false)) {
+                                    sizeof(struct LowCore), false,
+                                    MEMTXATTRS_UNSPECIFIED)) {
         set_sigp_status(si, SIGP_STAT_INVALID_PARAMETER);
         return;
     }
This page took 0.055504 seconds and 4 git commands to generate.