aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorTony Nguyen <tony.nguyen@bt.com>2019-08-24 04:36:54 +1000
committerRichard Henderson <richard.henderson@linaro.org>2019-09-03 08:30:39 -0700
commit9bf825bf3df4ebae3af51566c8088e3f1249a910 (patch)
tree1d6d1d8a389a7da714c8021bb5f1d256c5d64987 /exec.c
parentbe5c4787e9a6eed12fd765d9e890f7cc6cd63220 (diff)
memory: Single byte swap along the I/O path
Now that MemOp has been pushed down into the memory API, and callers are encoding endianness, we can collapse byte swaps along the I/O path into the accelerator and target independent adjust_endianness. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g. SPARC64 Invert Endian TTE bit, with redundant byte swaps cancelling out. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Tony Nguyen <tony.nguyen@bt.com> Message-Id: <911ff31af11922a9afba9b7ce128af8b8b80f316.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/exec.c b/exec.c
index e4652c0e75..53a15b7ad7 100644
--- a/exec.c
+++ b/exec.c
@@ -3363,14 +3363,9 @@ static MemTxResult flatview_write_continue(FlatView *fv, hwaddr addr,
l = memory_access_size(mr, l, addr1);
/* XXX: could force current_cpu to NULL to avoid
potential bugs */
- val = ldn_p(buf, l);
- /*
- * TODO: Merge bswap from ldn_p into memory_region_dispatch_write
- * by using ldn_he_p and dropping MO_TE to get a host-endian value.
- */
+ val = ldn_he_p(buf, l);
result |= memory_region_dispatch_write(mr, addr1, val,
- size_memop(l) | MO_TE,
- attrs);
+ size_memop(l), attrs);
} else {
/* RAM case */
ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l, false);
@@ -3431,13 +3426,9 @@ MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr,
/* I/O case */
release_lock |= prepare_mmio_access(mr);
l = memory_access_size(mr, l, addr1);
- /*
- * TODO: Merge bswap from stn_p into memory_region_dispatch_read
- * by using stn_he_p and dropping MO_TE to get a host-endian value.
- */
result |= memory_region_dispatch_read(mr, addr1, &val,
- size_memop(l) | MO_TE, attrs);
- stn_p(buf, l, val);
+ size_memop(l), attrs);
+ stn_he_p(buf, l, val);
} else {
/* RAM case */
ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l, false);