Make flatview_access_valid() take a MemTxAttrs argument
As part of plumbing MemTxAttrs down to the IOMMU translate method, add MemTxAttrs as an argument to flatview_access_valid(). Its callers now all have an attrs value to hand, so we can correct our earlier temporary use of MEMTXATTRS_UNSPECIFIED. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180521140402.23318-10-peter.maydell@linaro.org
This commit is contained in:
parent
8372d38327
commit
eace72b7a6
12
exec.c
12
exec.c
|
@ -2697,7 +2697,7 @@ static MemTxResult flatview_read(FlatView *fv, hwaddr addr,
|
||||||
static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs attrs,
|
static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs attrs,
|
||||||
const uint8_t *buf, int len);
|
const uint8_t *buf, int len);
|
||||||
static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
|
static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
|
||||||
bool is_write);
|
bool is_write, MemTxAttrs attrs);
|
||||||
|
|
||||||
static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data,
|
static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data,
|
||||||
unsigned len, MemTxAttrs attrs)
|
unsigned len, MemTxAttrs attrs)
|
||||||
|
@ -2773,7 +2773,7 @@ static bool subpage_accepts(void *opaque, hwaddr addr,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return flatview_access_valid(subpage->fv, addr + subpage->base,
|
return flatview_access_valid(subpage->fv, addr + subpage->base,
|
||||||
len, is_write);
|
len, is_write, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const MemoryRegionOps subpage_ops = {
|
static const MemoryRegionOps subpage_ops = {
|
||||||
|
@ -3461,7 +3461,7 @@ static void cpu_notify_map_clients(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
|
static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
|
||||||
bool is_write)
|
bool is_write, MemTxAttrs attrs)
|
||||||
{
|
{
|
||||||
MemoryRegion *mr;
|
MemoryRegion *mr;
|
||||||
hwaddr l, xlat;
|
hwaddr l, xlat;
|
||||||
|
@ -3471,9 +3471,7 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len,
|
||||||
mr = flatview_translate(fv, addr, &xlat, &l, is_write);
|
mr = flatview_translate(fv, addr, &xlat, &l, is_write);
|
||||||
if (!memory_access_is_direct(mr, is_write)) {
|
if (!memory_access_is_direct(mr, is_write)) {
|
||||||
l = memory_access_size(mr, l, addr);
|
l = memory_access_size(mr, l, addr);
|
||||||
/* When our callers all have attrs we'll pass them through here */
|
if (!memory_region_access_valid(mr, xlat, l, is_write, attrs)) {
|
||||||
if (!memory_region_access_valid(mr, xlat, l, is_write,
|
|
||||||
MEMTXATTRS_UNSPECIFIED)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3493,7 +3491,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr,
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
fv = address_space_to_flatview(as);
|
fv = address_space_to_flatview(as);
|
||||||
result = flatview_access_valid(fv, addr, len, is_write);
|
result = flatview_access_valid(fv, addr, len, is_write, attrs);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue