tcg patch queue
cover tcg patch queue
The following changes since commit fec105c2abda8567ec15230429c41429b5ee307c:
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100)
are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20190903
for you to fetch changes up to c25c283df0f08582df29f1d5d7be1516b851532d:
tcg: Factor out probe_write() logic into probe_access() (2019-09-03 08:34:18 -0700)
----------------------------------------------------------------
Allow page table bit to swap endianness. Reorganize watchpoints out of i/o path. Return host address from probe_write / probe_access.
----------------------------------------------------------------
David Hildenbrand (11):
exec: Factor out core logic of check_watchpoint()
tcg: Check for watchpoints in probe_write()
s390x/tcg: Use guest_addr_valid() instead of h2g_valid() in probe_write_access() s390x/tcg: Fix length calculation in probe_write_access()
tcg: Factor out CONFIG_USER_ONLY probe_write() from s390x code
tcg: Enforce single page access in probe_write()
mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well hppa/tcg: Call probe_write() also for CONFIG_USER_ONLY
s390x/tcg: Pass a size to probe_write() in do_csst()
tcg: Make probe_write() return a pointer to the host page
tcg: Factor out probe_write() logic into probe_access()
Richard Henderson (6):
exec: Move user-only watchpoint stubs inline
cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK
exec: Factor out cpu_watchpoint_address_matches
cputlb: Fix size operand for tlb_fill on unaligned store
cputlb: Remove double-alignment in store_helper
cputlb: Handle watchpoints via TLB_WATCHPOINT
Tony Nguyen (19):
tcg: TCGMemOp is now accelerator independent MemOp
memory: Introduce size_memop
target/mips: Access MemoryRegion with MemOp hw/s390x: Access MemoryRegion with MemOp hw/intc/armv7m_nic: Access MemoryRegion with MemOp hw/virtio: Access MemoryRegion with MemOp hw/vfio: Access MemoryRegion with MemOp
exec: Access MemoryRegion with MemOp
cputlb: Access MemoryRegion with MemOp
memory: Access MemoryRegion with MemOp hw/s390x: Hard code size with MO_{8|16|32|64} target/mips: Hard code size with MO_{8|16|32|64}
exec: Hard code size with MO_{8|16|32|64}
memory: Access MemoryRegion with endianness
cputlb: Replace size and endian operands for MemOp
memory: Single byte swap along the I/O path
cputlb: Byte swap memory transaction attribute target/sparc: Add TLB entry with attributes target/sparc: sun4u Invert Endian TTE bit
include/exec/cpu-all.h | 8 +- include/exec/exec-all.h | 10 +- include/exec/memattrs.h | 2 + include/exec/memop.h | 134 +++++++++++ include/exec/memory.h | 12 +- include/hw/core/cpu.h | 37 +++ target/arm/translate-a64.h | 2 +- target/arm/translate.h | 2 +- target/sparc/cpu.h | 2 + tcg/tcg-op.h | 80 +++--- tcg/tcg.h | 101 +------- trace/mem-internal.h | 4 +- trace/mem.h | 4 +- accel/tcg/cputlb.c | 414 ++++++++++++++++++-------------- accel/tcg/user-exec.c | 32 +++ exec.c | 177 +++----------- hw/intc/armv7m_nvic.c | 13 +- hw/s390x/s390-pci-inst.c | 11 +- hw/vfio/pci-quirks.c | 7 +- hw/virtio/virtio-pci.c | 15 +- memory.c | 58 +++-- memory_ldst.inc.c | 81 ++----- target/alpha/translate.c | 2 +- target/arm/translate-a64.c | 48 ++-- target/arm/translate-sve.c | 2 +- target/arm/translate.c | 32 +-- target/hppa/op_helper.c | 2 - target/hppa/translate.c | 14 +- target/i386/translate.c | 132 +++++----- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 4 +- target/mips/op_helper.c | 13 +- target/mips/translate.c | 8 +- target/openrisc/translate.c | 4 +- target/ppc/translate.c | 12 +- target/riscv/insn_trans/trans_rva.inc.c | 8 +- target/riscv/insn_trans/trans_rvi.inc.c | 4 +- target/s390x/mem_helper.c | 13 +- target/s390x/translate.c | 6 +- target/s390x/translate_vx.inc.c | 10 +- target/sparc/mmu_helper.c | 40 +-- target/sparc/translate.c | 14 +- target/tilegx/translate.c | 10 +- target/tricore/translate.c | 8 +- tcg/aarch64/tcg-target.inc.c | 26 +- tcg/arm/tcg-target.inc.c | 26 +- tcg/i386/tcg-target.inc.c | 24 +- tcg/mips/tcg-target.inc.c | 16 +- tcg/optimize.c | 2 +- tcg/ppc/tcg-target.inc.c | 12 +- tcg/riscv/tcg-target.inc.c | 20 +- tcg/s390/tcg-target.inc.c | 14 +- tcg/sparc/tcg-target.inc.c | 6 +- tcg/tcg-op.c | 38 +-- tcg/tcg.c | 2 +- MAINTAINERS | 1 + tcg/README | 2 +- 57 files changed, 918 insertions(+), 865 deletions(-) create mode 100644 include/exec/memop.h
PATCH 1/36 tcg: TCGMemOp is now accelerator independent MemOp
From: Tony Nguyen <[email protected]>
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path.
Target dependant attributes are conditionalized upon NEED_CPU_H.
Message-Id: <81d9cd7d7f5aaadfa772d6c48ecee834e9cf7882.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memop.h | 110 ++++++++++++++++++++ target/arm/translate-a64.h | 2 +- target/arm/translate.h | 2 +- tcg/tcg-op.h | 80 +++++++------- tcg/tcg.h | 101 ++---------------- trace/mem-internal.h | 4 +- trace/mem.h | 4 +- accel/tcg/cputlb.c | 2 +- target/alpha/translate.c | 2 +- target/arm/translate-a64.c | 48 ++++----- target/arm/translate-sve.c | 2 +- target/arm/translate.c | 32 +++--- target/hppa/translate.c | 14 +-- target/i386/translate.c | 132 ++++++++++++------------ target/m68k/translate.c | 2 +- target/microblaze/translate.c | 4 +- target/mips/translate.c | 8 +- target/openrisc/translate.c | 4 +- target/ppc/translate.c | 12 +-- target/riscv/insn_trans/trans_rva.inc.c | 8 +- target/riscv/insn_trans/trans_rvi.inc.c | 4 +- target/s390x/translate.c | 6 +- target/s390x/translate_vx.inc.c | 10 +- target/sparc/translate.c | 14 +-- target/tilegx/translate.c | 10 +- target/tricore/translate.c | 8 +- tcg/aarch64/tcg-target.inc.c | 26 ++--- tcg/arm/tcg-target.inc.c | 26 ++--- tcg/i386/tcg-target.inc.c | 24 ++--- tcg/mips/tcg-target.inc.c | 16 +-- tcg/optimize.c | 2 +- tcg/ppc/tcg-target.inc.c | 12 +-- tcg/riscv/tcg-target.inc.c | 20 ++-- tcg/s390/tcg-target.inc.c | 14 +-- tcg/sparc/tcg-target.inc.c | 6 +- tcg/tcg-op.c | 38 +++---- tcg/tcg.c | 2 +- MAINTAINERS | 1 + tcg/README | 2 +- 39 files changed, 418 insertions(+), 396 deletions(-) create mode 100644 include/exec/memop.h
include/exec/memop.h new file +110 -0
@@ -0,0 +1,110 @@ +/* +* Constants for memory operations +* +* Authors: +* Richard Henderson <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +* +*/ + +#ifndef MEMOP_H +#define MEMOP_H + +typedef enum MemOp { +MO_8 =0 , +MO_16 =1 , +MO_32 =2 , +MO_64 =3 , +MO_SIZE =3 ,/* Mask for the above. */ + +MO_SIGN =4 ,/* Sign-extended, otherwise zero-extended. */ + +MO_BSWAP =8 ,/* Host reverse endian. */ +#ifdef HOST_WORDS_BIGENDIAN +MO_LE =MO_BSWAP , +MO_BE =0 , +#else +MO_LE =0 , +MO_BE =MO_BSWAP , +#endif +#ifdef NEED_CPU_H +#ifdef TARGET_WORDS_BIGENDIAN +MO_TE =MO_BE , +#else +MO_TE =MO_LE , +#endif +#endif + +/* +* MO_UNALN accesses are never checked for alignment. +* MO_ALIGN accesses will result in a call to the CPU's +* do_unaligned_access hook if the guest address is not aligned. +* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. +* +* Some architectures (e.g. ARMv8) need the address which is aligned +* to a size more than the size of the memory access. +* Some architectures (e.g. SPARCv9) need an address which is aligned, +* but less strictly than the natural alignment. +* +* MO_ALIGN supposes the alignment size is the size of a memory access. +* +* There are three options: +* - unaligned access permitted (MO_UNALN). +* - an alignment to the size of an access (MO_ALIGN); +* - an alignment to a specified size, which may be more or less than +* the access size (MO_ALIGN_x where 'x' is a size in bytes); + */ +MO_ASHIFT =4 , +MO_AMASK =7 <<MO_ASHIFT , +#ifdef NEED_CPU_H +#ifdef TARGET_ALIGNED_ONLY +MO_ALIGN =0 , +MO_UNALN =MO_AMASK , +#else +MO_ALIGN =MO_AMASK , +MO_UNALN =0 , +#endif +#endif + MO_ALIGN_2 = 1 << MO_ASHIFT, +MO_ALIGN_4 =2 <<MO_ASHIFT , +MO_ALIGN_8 =3 <<MO_ASHIFT , +MO_ALIGN_16 =4 <<MO_ASHIFT , +MO_ALIGN_32 =5 <<MO_ASHIFT , +MO_ALIGN_64 =6 <<MO_ASHIFT , + +/* Combinations of the above, for ease of use. */ +MO_UB =MO_8 , +MO_UW =MO_16 , +MO_UL =MO_32 , +MO_SB =MO_SIGN |MO_8 , +MO_SW =MO_SIGN |MO_16 , +MO_SL =MO_SIGN |MO_32 , +MO_Q =MO_64 , + +MO_LEUW =MO_LE |MO_UW , +MO_LEUL =MO_LE |MO_UL , +MO_LESW =MO_LE |MO_SW , +MO_LESL =MO_LE |MO_SL , +MO_LEQ =MO_LE |MO_Q , + +MO_BEUW =MO_BE |MO_UW , +MO_BEUL =MO_BE |MO_UL , +MO_BESW =MO_BE |MO_SW , +MO_BESL =MO_BE |MO_SL , +MO_BEQ =MO_BE |MO_Q , + +#ifdef NEED_CPU_H +MO_TEUW =MO_TE |MO_UW , +MO_TEUL =MO_TE |MO_UL , +MO_TESW =MO_TE |MO_SW , +MO_TESL =MO_TE |MO_SL , +MO_TEQ =MO_TE |MO_Q , +#endif + +MO_SSIZE =MO_SIZE |MO_SIGN , +}MemOp ; + +#endif
target/arm/translate-a64.h +1 -1
@@ -62,7 +62,7 @@ static inline void assert_fp_access_checked(DisasContext *s)* the FP/vector register Qn. */ static inline int vec_reg_offset (DisasContext *s,int regno, -int element,TCGMemOp size) +int element,MemOp size) {int element_size =1 << size;int offs = element * element_size;
target/arm/translate.h +1 -1
@@ -23,7 +23,7 @@ typedef struct DisasContext {int condexec_cond;int thumb;int sctlr_b; -TCGMemOp be_data; +MemOp be_data;#if !defined(CONFIG_USER_ONLY )int user;#endif
tcg/tcg-op.h +40 -40
96 lines not on this page · raw message
tcg/tcg.h +6 -95
136 lines not on this page · raw message
trace/mem-internal.h +2 -2
@@ -16,7 +16,7 @@#define TRACE_MEM_ST (1ULL << 5)/* store (y/n) */ static inline uint8_t trace_mem_build_info ( -int size_shift,bool sign_extend,TCGMemOp endianness,bool store) +int size_shift,bool sign_extend,MemOp endianness,bool store) {uint8_t res;
@@ -33,7 +33,7 @@ static inline uint8_t trace_mem_build_info(return res; } -static inline uint8_t trace_mem_get_info (TCGMemOp op,bool store) +static inline uint8_t trace_mem_get_info (MemOp op,bool store) {return trace_mem_build_info (op &MO_SIZE , !!(op &MO_SIGN ), op &MO_BSWAP , store);
trace/mem.h +2 -2
@@ -18,7 +18,7 @@* * Return a value for the 'info' argument in guest memory access traces. */ -static uint8_t trace_mem_get_info (TCGMemOp op,bool store); +static uint8_t trace_mem_get_info (MemOp op,bool store);/** * trace_mem_build_info:
@@ -26,7 +26,7 @@ static uint8_t trace_mem_get_info(TCGMemOp op, bool store);* Return a value for the 'info' argument in guest memory access traces. */ static uint8_t trace_mem_build_info (int size_shift,bool sign_extend, -TCGMemOp endianness,bool store); +MemOp endianness,bool store);#include "trace/mem-internal.h"
accel/tcg/cputlb.c +1 -1
@@ -1133,7 +1133,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,uintptr_t index =tlb_index (env, mmu_idx, addr);CPUTLBEntry *tlbe =tlb_entry (env, mmu_idx, addr);target_ulong tlb_addr =tlb_addr_write (tlbe); -TCGMemOp mop =get_memop (oi); +MemOp mop =get_memop (oi);int a_bits =get_alignment_bits (mop);int s_bits = mop &MO_SIZE ;void *hostaddr;
target/alpha/translate.c +1 -1
@@ -403,7 +403,7 @@ static inline void gen_store_mem(DisasContext *ctx,static DisasJumpType gen_store_conditional (DisasContext *ctx,int ra,int rb,int32_t disp16,int mem_idx, -TCGMemOp op) +MemOp op) {TCGLabel *lab_fail, *lab_done;TCGv addr, val;
target/arm/translate-a64.c +24 -24
192 lines not on this page · raw message
target/arm/translate-sve.c +1 -1
@@ -4567,7 +4567,7 @@ static bool trans_STR_pri(DisasContext *s, arg_rri *a)*/ /* The memory mode of the dtype. */ -static const TCGMemOp dtype_mop[16 ] = { +static const MemOp dtype_mop[16 ] = {MO_UB ,MO_UB ,MO_UB ,MO_UB ,MO_SL ,MO_UW ,MO_UW ,MO_UW ,MO_SW ,MO_SW ,MO_UL ,MO_UL ,
target/arm/translate.c +16 -16
@@ -114,7 +114,7 @@ typedef enum ISSInfo { } ISSInfo;/* Save the syndrome information for a Data Abort */ -static void disas_set_da_iss (DisasContext *s,TCGMemOp memop,ISSInfo issinfo) +static void disas_set_da_iss (DisasContext *s,MemOp memop,ISSInfo issinfo) {uint32_t syn;int sas = memop &MO_SIZE ;
@@ -1042,7 +1042,7 @@ static inline void store_reg_from_load(DisasContext *s, int reg, TCGv_i32 var)* that the address argument is TCGv_i32 rather than TCGv. */ -static inline TCGv gen_aa32_addr (DisasContext *s,TCGv_i32 a32,TCGMemOp op) +static inline TCGv gen_aa32_addr (DisasContext *s,TCGv_i32 a32,MemOp op) {TCGv addr =tcg_temp_new ();tcg_gen_extu_i32_tl (addr, a32);
@@ -1055,7 +1055,7 @@ static inline TCGv gen_aa32_addr(DisasContext *s, TCGv_i32 a32, TCGMemOp op) }static void gen_aa32_ld_i32 (DisasContext *s,TCGv_i32 val,TCGv_i32 a32, -int index,TCGMemOp opc) +int index,MemOp opc) {TCGv addr;
@@ -1070,7 +1070,7 @@ static void gen_aa32_ld_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32, }static void gen_aa32_st_i32 (DisasContext *s,TCGv_i32 val,TCGv_i32 a32, -int index,TCGMemOp opc) +int index,MemOp opc) {TCGv addr;
@@ -1123,7 +1123,7 @@ static inline void gen_aa32_frob64(DisasContext *s, TCGv_i64 val) }static void gen_aa32_ld_i64 (DisasContext *s,TCGv_i64 val,TCGv_i32 a32, -int index,TCGMemOp opc) +int index,MemOp opc) {TCGv addr =gen_aa32_addr (s, a32, opc);tcg_gen_qemu_ld_i64 (val, addr, index, opc);
@@ -1138,7 +1138,7 @@ static inline void gen_aa32_ld64(DisasContext *s, TCGv_i64 val, }static void gen_aa32_st_i64 (DisasContext *s,TCGv_i64 val,TCGv_i32 a32, -int index,TCGMemOp opc) +int index,MemOp opc) {TCGv addr =gen_aa32_addr (s, a32, opc);
@@ -1369,7 +1369,7 @@ neon_reg_offset (int reg, int n)* where 0 is the least significant end of the register. */ static inline long -neon_element_offset (int reg,int element,TCGMemOp size) +neon_element_offset (int reg,int element,MemOp size) {int element_size =1 << size;int ofs = element * element_size;
@@ -1391,7 +1391,7 @@ static TCGv_i32 neon_load_reg(int reg, int pass)return tmp; } -static void neon_load_element (TCGv_i32 var,int reg,int ele,TCGMemOp mop) +static void neon_load_element (TCGv_i32 var,int reg,int ele,MemOp mop) {long offset =neon_element_offset (reg, ele, mop &MO_SIZE );
@@ -1410,7 +1410,7 @@ static void neon_load_element(TCGv_i32 var, int reg, int ele, TCGMemOp mop) } } -static void neon_load_element64 (TCGv_i64 var,int reg,int ele,TCGMemOp mop) +static void neon_load_element64 (TCGv_i64 var,int reg,int ele,MemOp mop) {long offset =neon_element_offset (reg, ele, mop &MO_SIZE );
@@ -1438,7 +1438,7 @@ static void neon_store_reg(int reg, int pass, TCGv_i32 var)tcg_temp_free_i32 (var); } -static void neon_store_element (int reg,int ele,TCGMemOp size,TCGv_i32 var) +static void neon_store_element (int reg,int ele,MemOp size,TCGv_i32 var) {long offset =neon_element_offset (reg, ele, size);
@@ -1457,7 +1457,7 @@ static void neon_store_element(int reg, int ele, TCGMemOp size, TCGv_i32 var) } } -static void neon_store_element64 (int reg,int ele,TCGMemOp size,TCGv_i64 var) +static void neon_store_element64 (int reg,int ele,MemOp size,TCGv_i64 var) {long offset =neon_element_offset (reg, ele, size);
@@ -3523,7 +3523,7 @@ static int disas_neon_ls_insn(DisasContext *s, uint32_t insn)int n;int vec_size;int mmu_idx; -TCGMemOp endian; +MemOp endian;TCGv_i32 addr;TCGv_i32 tmp;TCGv_i32 tmp2;
@@ -6830,7 +6830,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) }else if ((insn &0x380 ) ==0 ) {/* VDUP */ int element; -TCGMemOp size; +MemOp size;if ((insn & (7 <<16 )) ==0 || (q && (rd &1 ))) {return 1 ;
@@ -7395,7 +7395,7 @@ static void gen_load_exclusive(DisasContext *s, int rt, int rt2, TCGv_i32 addr, int size) {TCGv_i32 tmp =tcg_temp_new_i32 (); -TCGMemOp opc = size |MO_ALIGN | s->be_data; +MemOp opc = size |MO_ALIGN | s->be_data; s->is_ldex = true;
@@ -7449,7 +7449,7 @@ static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2,TCGv taddr;TCGLabel *done_label;TCGLabel *fail_label; -TCGMemOp opc = size |MO_ALIGN | s->be_data; +MemOp opc = size |MO_ALIGN | s->be_data;/* if (env->exclusive_addr == addr && env->exclusive_val == [addr]) { [addr] = {Rt};
@@ -8557,7 +8557,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)*/ TCGv taddr; -TCGMemOp opc = s->be_data; +MemOp opc = s->be_data; rm = (insn) &0xf ;
target/hppa/translate.c +7 -7
@@ -1500,7 +1500,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs,*/ static void do_load_32 (DisasContext *ctx,TCGv_i32 dest,unsigned rb,unsigned rx,int scale,target_sreg disp, -unsigned sp,int modify,TCGMemOp mop) +unsigned sp,int modify,MemOp mop) {TCGv_reg ofs;TCGv_tl addr;
@@ -1518,7 +1518,7 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb,static void do_load_64 (DisasContext *ctx,TCGv_i64 dest,unsigned rb,unsigned rx,int scale,target_sreg disp, -unsigned sp,int modify,TCGMemOp mop) +unsigned sp,int modify,MemOp mop) {TCGv_reg ofs;TCGv_tl addr;
@@ -1536,7 +1536,7 @@ static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb,static void do_store_32 (DisasContext *ctx,TCGv_i32 src,unsigned rb,unsigned rx,int scale,target_sreg disp, -unsigned sp,int modify,TCGMemOp mop) +unsigned sp,int modify,MemOp mop) {TCGv_reg ofs;TCGv_tl addr;
@@ -1554,7 +1554,7 @@ static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb,static void do_store_64 (DisasContext *ctx,TCGv_i64 src,unsigned rb,unsigned rx,int scale,target_sreg disp, -unsigned sp,int modify,TCGMemOp mop) +unsigned sp,int modify,MemOp mop) {TCGv_reg ofs;TCGv_tl addr;
@@ -1580,7 +1580,7 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb,static bool do_load (DisasContext *ctx,unsigned rt,unsigned rb,unsigned rx,int scale,target_sreg disp, -unsigned sp,int modify,TCGMemOp mop) +unsigned sp,int modify,MemOp mop) {TCGv_reg dest;
@@ -1653,7 +1653,7 @@ static bool trans_fldd(DisasContext *ctx, arg_ldst *a)static bool do_store (DisasContext *ctx,unsigned rt,unsigned rb,target_sreg disp,unsigned sp, -int modify,TCGMemOp mop) +int modify,MemOp mop) {nullify_over (ctx);do_store_reg (ctx,load_gpr (ctx, rt), rb,0 ,0 , disp, sp, modify, mop);
@@ -2939,7 +2939,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)static bool trans_ldc (DisasContext *ctx,arg_ldst *a) { -TCGMemOp mop =MO_TEUL |MO_ALIGN_16 | a->size; +MemOp mop =MO_TEUL |MO_ALIGN_16 | a->size;TCGv_reg zero, dest, ofs;TCGv_tl addr;
target/i386/translate.c +66 -66
473 lines not on this page · raw message
target/m68k/translate.c +1 -1
@@ -2414,7 +2414,7 @@ DISAS_INSN(cas)uint16_t ext;TCGv load;TCGv cmp; -TCGMemOp opc; +MemOp opc;switch ((insn >>9 ) &3 ) {case 1 :
target/microblaze/translate.c +2 -2
@@ -919,7 +919,7 @@ static void dec_load(DisasContext *dc)unsigned int size;bool rev = false, ex = false, ea = false;int mem_index =cpu_mmu_index (&dc->cpu->env, false); -TCGMemOp mop; +MemOp mop; mop = dc->opcode &3 ; size =1 << mop;
@@ -1035,7 +1035,7 @@ static void dec_store(DisasContext *dc)unsigned int size;bool rev = false, ex = false, ea = false;int mem_index =cpu_mmu_index (&dc->cpu->env, false); -TCGMemOp mop; +MemOp mop; mop = dc->opcode &3 ; size =1 << mop;
target/mips/translate.c +4 -4
@@ -2526,7 +2526,7 @@ typedef struct DisasContext {int32_t CP0_Config5;/* Routine used to access memory */ int mem_idx; -TCGMemOp default_tcg_memop_mask; +MemOp default_tcg_memop_mask;uint32_t hflags, saved_hflags;target_ulong btarget;bool ulri;
@@ -3706,7 +3706,7 @@ static void gen_st(DisasContext *ctx, uint32_t opc, int rt,/* Store conditional */ static void gen_st_cond (DisasContext *ctx,int rt,int base,int offset, -TCGMemOp tcg_mo,bool eva) +MemOp tcg_mo,bool eva) {TCGv addr, t0, val;TCGLabel *l1 =gen_new_label ();
@@ -4549,7 +4549,7 @@ static void gen_HILO(DisasContext *ctx, uint32_t opc, int acc, int reg) }static inline void gen_r6_ld (target_long addr,int reg,int memidx, -TCGMemOp memop) +MemOp memop) {TCGv t0 =tcg_const_tl (addr);tcg_gen_qemu_ld_tl (t0, t0, memidx, memop);
@@ -21827,7 +21827,7 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)extract32 (ctx->opcode,0 ,8 );TCGv va =tcg_temp_new ();TCGv t1 =tcg_temp_new (); -TCGMemOp memop = (extract32 (ctx->opcode,8 ,3 )) == +MemOp memop = (extract32 (ctx->opcode,8 ,3 )) ==NM_P_LS_UAWM ?MO_UNALN :0 ; count = (count ==0 ) ?8 : count;
target/openrisc/translate.c +2 -2
@@ -681,7 +681,7 @@ static bool trans_l_lwa(DisasContext *dc, arg_load *a)return true; } -static void do_load (DisasContext *dc,arg_load *a,TCGMemOp mop) +static void do_load (DisasContext *dc,arg_load *a,MemOp mop) {TCGv ea;
@@ -763,7 +763,7 @@ static bool trans_l_swa(DisasContext *dc, arg_store *a)return true; } -static void do_store (DisasContext *dc,arg_store *a,TCGMemOp mop) +static void do_store (DisasContext *dc,arg_store *a,MemOp mop) {TCGv t0 =tcg_temp_new ();tcg_gen_addi_tl (t0, cpu_R[a->a], a->i);
target/ppc/translate.c +6 -6
@@ -163,7 +163,7 @@ struct DisasContext {int mem_idx;int access_type;/* Translation flags */ -TCGMemOp default_tcg_memop_mask; +MemOp default_tcg_memop_mask;#if defined(TARGET_PPC64 )bool sf_mode;bool has_cfar;
@@ -3142,7 +3142,7 @@ static void gen_isync(DisasContext *ctx)#define MEMOP_GET_SIZE (x) (1 << ((x) & MO_SIZE)) -static void gen_load_locked (DisasContext *ctx,TCGMemOp memop) +static void gen_load_locked (DisasContext *ctx,MemOp memop) {TCGv gpr = cpu_gpr[rD (ctx->opcode)];TCGv t0 =tcg_temp_new ();
@@ -3167,7 +3167,7 @@ LARX(lbarx, DEF_MEMOP(MO_UB)) LARX(lharx, DEF_MEMOP(MO_UW)) LARX(lwarx, DEF_MEMOP(MO_UL)) -static void gen_fetch_inc_conditional (DisasContext *ctx,TCGMemOp memop, +static void gen_fetch_inc_conditional (DisasContext *ctx,MemOp memop,TCGv EA ,TCGCond cond,int addend) {TCGv t =tcg_temp_new ();
@@ -3193,7 +3193,7 @@ static void gen_fetch_inc_conditional(DisasContext *ctx, TCGMemOp memop,tcg_temp_free (u); } -static void gen_ld_atomic (DisasContext *ctx,TCGMemOp memop) +static void gen_ld_atomic (DisasContext *ctx,MemOp memop) {uint32_t gpr_FC =FC (ctx->opcode);TCGv EA =tcg_temp_new ();
@@ -3306,7 +3306,7 @@ static void gen_ldat(DisasContext *ctx) }#endif -static void gen_st_atomic (DisasContext *ctx,TCGMemOp memop) +static void gen_st_atomic (DisasContext *ctx,MemOp memop) {uint32_t gpr_FC =FC (ctx->opcode);TCGv EA =tcg_temp_new ();
@@ -3389,7 +3389,7 @@ static void gen_stdat(DisasContext *ctx) }#endif -static void gen_conditional_store (DisasContext *ctx,TCGMemOp memop) +static void gen_conditional_store (DisasContext *ctx,MemOp memop) {TCGLabel *l1 =gen_new_label ();TCGLabel *l2 =gen_new_label ();
target/riscv/insn_trans/trans_rva.inc.c +4 -4
@@ -18,7 +18,7 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -static inline bool gen_lr (DisasContext *ctx,arg_atomic *a,TCGMemOp mop) +static inline bool gen_lr (DisasContext *ctx,arg_atomic *a,MemOp mop) {TCGv src1 =tcg_temp_new ();/* Put addr in load_res, data in load_val. */
@@ -37,7 +37,7 @@ static inline bool gen_lr(DisasContext *ctx, arg_atomic *a, TCGMemOp mop)return true; } -static inline bool gen_sc (DisasContext *ctx,arg_atomic *a,TCGMemOp mop) +static inline bool gen_sc (DisasContext *ctx,arg_atomic *a,MemOp mop) {TCGv src1 =tcg_temp_new ();TCGv src2 =tcg_temp_new ();
@@ -82,8 +82,8 @@ static inline bool gen_sc(DisasContext *ctx, arg_atomic *a, TCGMemOp mop) }static bool gen_amo (DisasContext *ctx,arg_atomic *a, -void (*func)(TCGv ,TCGv ,TCGv ,TCGArg ,TCGMemOp ), -TCGMemOp mop) +void (*func)(TCGv ,TCGv ,TCGv ,TCGArg ,MemOp ), +MemOp mop) {TCGv src1 =tcg_temp_new ();TCGv src2 =tcg_temp_new ();
target/riscv/insn_trans/trans_rvi.inc.c +2 -2
@@ -135,7 +135,7 @@ static bool trans_bgeu(DisasContext *ctx, arg_bgeu *a)return gen_branch (ctx, a,TCG_COND_GEU ); } -static bool gen_load (DisasContext *ctx,arg_lb *a,TCGMemOp memop) +static bool gen_load (DisasContext *ctx,arg_lb *a,MemOp memop) {TCGv t0 =tcg_temp_new ();TCGv t1 =tcg_temp_new ();
@@ -174,7 +174,7 @@ static bool trans_lhu(DisasContext *ctx, arg_lhu *a)return gen_load (ctx, a,MO_TEUW ); } -static bool gen_store (DisasContext *ctx,arg_sb *a,TCGMemOp memop) +static bool gen_store (DisasContext *ctx,arg_sb *a,MemOp memop) {TCGv t0 =tcg_temp_new ();TCGv dat =tcg_temp_new ();
target/s390x/translate.c +3 -3
@@ -152,7 +152,7 @@ static inline int vec_full_reg_offset(uint8_t reg) return offsetof(CPUS390XState, vregs[reg][0]); } -static inline int vec_reg_offset (uint8_t reg,uint8_t enr,TCGMemOp es) +static inline int vec_reg_offset (uint8_t reg,uint8_t enr,MemOp es) {/* Convert element size (es) - e.g. MO_8 - to bytes */ const uint8_t bytes =1 << es;
@@ -2262,7 +2262,7 @@ static DisasJumpType op_csst(DisasContext *s, DisasOps *o)#ifndef CONFIG_USER_ONLY static DisasJumpType op_csp (DisasContext *s,DisasOps *o) { -TCGMemOp mop = s->insn->data; +MemOp mop = s->insn->data;TCGv_i64 addr, old, cc;TCGLabel *lab =gen_new_label ();
@@ -3228,7 +3228,7 @@ static DisasJumpType op_lm64(DisasContext *s, DisasOps *o)static DisasJumpType op_lpd (DisasContext *s,DisasOps *o) {TCGv_i64 a1, a2; -TCGMemOp mop = s->insn->data; +MemOp mop = s->insn->data;/* In a parallel context, stop the world and single step. */ if (tb_cflags (s->base.tb) &CF_PARALLEL ) {
target/s390x/translate_vx.inc.c +5 -5
@@ -57,13 +57,13 @@#define FPF_LONG 3#define FPF_EXT 4 -static inline bool valid_vec_element (uint8_t enr,TCGMemOp es) +static inline bool valid_vec_element (uint8_t enr,MemOp es) {return !(enr & ~(NUM_VEC_ELEMENTS (es) -1 )); }static void read_vec_element_i64 (TCGv_i64 dst,uint8_t reg,uint8_t enr, -TCGMemOp memop) +MemOp memop) {const int offs =vec_reg_offset (reg, enr, memop &MO_SIZE );
@@ -96,7 +96,7 @@ static void read_vec_element_i64(TCGv_i64 dst, uint8_t reg, uint8_t enr, }static void read_vec_element_i32 (TCGv_i32 dst,uint8_t reg,uint8_t enr, -TCGMemOp memop) +MemOp memop) {const int offs =vec_reg_offset (reg, enr, memop &MO_SIZE );
@@ -123,7 +123,7 @@ static void read_vec_element_i32(TCGv_i32 dst, uint8_t reg, uint8_t enr, }static void write_vec_element_i64 (TCGv_i64 src,int reg,uint8_t enr, -TCGMemOp memop) +MemOp memop) {const int offs =vec_reg_offset (reg, enr, memop &MO_SIZE );
@@ -146,7 +146,7 @@ static void write_vec_element_i64(TCGv_i64 src, int reg, uint8_t enr, }static void write_vec_element_i32 (TCGv_i32 src,int reg,uint8_t enr, -TCGMemOp memop) +MemOp memop) {const int offs =vec_reg_offset (reg, enr, memop &MO_SIZE );
target/sparc/translate.c +7 -7
@@ -2019,7 +2019,7 @@ static inline void gen_ne_fop_QD(DisasContext *dc, int rd, int rs, }static void gen_swap (DisasContext *dc,TCGv dst,TCGv src, -TCGv addr,int mmu_idx,TCGMemOp memop) +TCGv addr,int mmu_idx,MemOp memop) {gen_address_mask (dc, addr);tcg_gen_atomic_xchg_tl (dst, addr, src, mmu_idx, memop);
@@ -2050,10 +2050,10 @@ typedef struct {ASIType type;int asi;int mem_idx; -TCGMemOp memop; +MemOp memop; } DisasASI; -static DisasASI get_asi (DisasContext *dc,int insn,TCGMemOp memop) +static DisasASI get_asi (DisasContext *dc,int insn,MemOp memop) {int asi =GET_FIELD (insn,19 ,26 );ASIType type =GET_ASI_HELPER ;
@@ -2267,7 +2267,7 @@ static DisasASI get_asi(DisasContext *dc, int insn, TCGMemOp memop) }static void gen_ld_asi (DisasContext *dc,TCGv dst,TCGv addr, -int insn,TCGMemOp memop) +int insn,MemOp memop) {DisasASI da =get_asi (dc, insn, memop);
@@ -2305,7 +2305,7 @@ static void gen_ld_asi(DisasContext *dc, TCGv dst, TCGv addr, }static void gen_st_asi (DisasContext *dc,TCGv src,TCGv addr, -int insn,TCGMemOp memop) +int insn,MemOp memop) {DisasASI da =get_asi (dc, insn, memop);
@@ -2511,7 +2511,7 @@ static void gen_ldf_asi(DisasContext *dc, TCGv addr,case GET_ASI_BLOCK :/* Valid for lddfa on aligned registers only. */ if (size ==8 && (rd &7 ) ==0 ) { -TCGMemOp memop; +MemOp memop;TCGv eight;int i;
@@ -2625,7 +2625,7 @@ static void gen_stf_asi(DisasContext *dc, TCGv addr,case GET_ASI_BLOCK :/* Valid for stdfa on aligned registers only. */ if (size ==8 && (rd &7 ) ==0 ) { -TCGMemOp memop; +MemOp memop;TCGv eight;int i;
target/tilegx/translate.c +5 -5
@@ -290,7 +290,7 @@ static void gen_cmul2(TCGv tdest, TCGv tsrca, TCGv tsrcb, int sh, int rd) }static TileExcp gen_st_opcode (DisasContext *dc,unsigned dest,unsigned srca, -unsigned srcb,TCGMemOp memop,const char *name) +unsigned srcb,MemOp memop,const char *name) {if (dest) {return TILEGX_EXCP_OPCODE_UNKNOWN ;
@@ -305,7 +305,7 @@ static TileExcp gen_st_opcode(DisasContext *dc, unsigned dest, unsigned srca, }static TileExcp gen_st_add_opcode (DisasContext *dc,unsigned srca,unsigned srcb, -int imm,TCGMemOp memop,const char *name) +int imm,MemOp memop,const char *name) {TCGv tsrca =load_gr (dc, srca);TCGv tsrcb =load_gr (dc, srcb);
@@ -496,7 +496,7 @@ static TileExcp gen_rr_opcode(DisasContext *dc, unsigned opext, {TCGv tdest, tsrca;const char *mnemonic; -TCGMemOp memop; +MemOp memop;TileExcp ret =TILEGX_EXCP_NONE ;bool prefetch_nofault = false;
@@ -1478,7 +1478,7 @@ static TileExcp gen_rri_opcode(DisasContext *dc, unsigned opext,TCGv tsrca =load_gr (dc, srca);bool prefetch_nofault = false;const char *mnemonic; -TCGMemOp memop; +MemOp memop;int i2, i3;TCGv t0;
@@ -2106,7 +2106,7 @@ static TileExcp decode_y2(DisasContext *dc, tilegx_bundle_bits bundle)unsigned srca =get_SrcA_Y2 (bundle);unsigned srcbdest =get_SrcBDest_Y2 (bundle);const char *mnemonic; -TCGMemOp memop; +MemOp memop;bool prefetch_nofault = false;switch (OEY2 (opc, mode)) {
target/tricore/translate.c +4 -4
@@ -219,7 +219,7 @@ static inline void generate_trap(DisasContext *ctx, int class, int tin);/* Functions for load/save to/from memory */ static inline void gen_offset_ld (DisasContext *ctx,TCGv r1,TCGv r2, -int16_t con,TCGMemOp mop) +int16_t con,MemOp mop) {TCGv temp =tcg_temp_new ();tcg_gen_addi_tl (temp, r2, con);
@@ -228,7 +228,7 @@ static inline void gen_offset_ld(DisasContext *ctx, TCGv r1, TCGv r2, }static inline void gen_offset_st (DisasContext *ctx,TCGv r1,TCGv r2, -int16_t con,TCGMemOp mop) +int16_t con,MemOp mop) {TCGv temp =tcg_temp_new ();tcg_gen_addi_tl (temp, r2, con);
@@ -276,7 +276,7 @@ static void gen_offset_ld_2regs(TCGv rh, TCGv rl, TCGv base, int16_t con, }static void gen_st_preincr (DisasContext *ctx,TCGv r1,TCGv r2,int16_t off, -TCGMemOp mop) +MemOp mop) {TCGv temp =tcg_temp_new ();tcg_gen_addi_tl (temp, r2, off);
@@ -286,7 +286,7 @@ static void gen_st_preincr(DisasContext *ctx, TCGv r1, TCGv r2, int16_t off, }static void gen_ld_preincr (DisasContext *ctx,TCGv r1,TCGv r2,int16_t off, -TCGMemOp mop) +MemOp mop) {TCGv temp =tcg_temp_new ();tcg_gen_addi_tl (temp, r2, off);
tcg/aarch64/tcg-target.inc.c +13 -13
@@ -1423,7 +1423,7 @@ static inline void tcg_out_rev16(TCGContext *s, TCGReg rd, TCGReg rn)tcg_out_insn (s,3507 ,REV16 ,TCG_TYPE_I32 , rd, rn); } -static inline void tcg_out_sxt (TCGContext *s,TCGType ext,TCGMemOp s_bits, +static inline void tcg_out_sxt (TCGContext *s,TCGType ext,MemOp s_bits,TCGReg rd,TCGReg rn) {/* Using ALIASes SXTB, SXTH, SXTW, of SBFM Xd, Xn, #0, #7|15|31 */
@@ -1431,7 +1431,7 @@ static inline void tcg_out_sxt(TCGContext *s, TCGType ext, TCGMemOp s_bits,tcg_out_sbfm (s, ext, rd, rn,0 , bits); } -static inline void tcg_out_uxt (TCGContext *s,TCGMemOp s_bits, +static inline void tcg_out_uxt (TCGContext *s,MemOp s_bits,TCGReg rd,TCGReg rn) {/* Using ALIASes UXTB, UXTH of UBFM Wd, Wn, #0, #7|15 */
@@ -1580,8 +1580,8 @@ static inline void tcg_out_adr(TCGContext *s, TCGReg rd, void *target)static bool tcg_out_qemu_ld_slow_path (TCGContext *s,TCGLabelQemuLdst *lb) {TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp size = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp size = opc &MO_SIZE ;if (!reloc_pc19 (lb->label_ptr[0 ], s->code_ptr)) {return false;
@@ -1605,8 +1605,8 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)static bool tcg_out_qemu_st_slow_path (TCGContext *s,TCGLabelQemuLdst *lb) {TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp size = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp size = opc &MO_SIZE ;if (!reloc_pc19 (lb->label_ptr[0 ], s->code_ptr)) {return false;
@@ -1649,7 +1649,7 @@ QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, table) != 8);slow path for the failure case, which will be patched later when finalizing the slow path. Generated code returns the host addend in X1, clobbers X0,X2,X3,TMP. */ -static void tcg_out_tlb_read (TCGContext *s,TCGReg addr_reg,TCGMemOp opc, +static void tcg_out_tlb_read (TCGContext *s,TCGReg addr_reg,MemOp opc,tcg_insn_unit **label_ptr,int mem_index,bool is_read) {
@@ -1709,11 +1709,11 @@ static void tcg_out_tlb_read(TCGContext *s, TCGReg addr_reg, TCGMemOp opc,#endif /* CONFIG_SOFTMMU */ -static void tcg_out_qemu_ld_direct (TCGContext *s,TCGMemOp memop,TCGType ext, +static void tcg_out_qemu_ld_direct (TCGContext *s,MemOp memop,TCGType ext,TCGReg data_r,TCGReg addr_r,TCGType otype,TCGReg off_r) { -const TCGMemOp bswap = memop &MO_BSWAP ; +const MemOp bswap = memop &MO_BSWAP ;switch (memop &MO_SSIZE ) {case MO_UB :
@@ -1765,11 +1765,11 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGMemOp memop, TCGType ext, } } -static void tcg_out_qemu_st_direct (TCGContext *s,TCGMemOp memop, +static void tcg_out_qemu_st_direct (TCGContext *s,MemOp memop,TCGReg data_r,TCGReg addr_r,TCGType otype,TCGReg off_r) { -const TCGMemOp bswap = memop &MO_BSWAP ; +const MemOp bswap = memop &MO_BSWAP ;switch (memop &MO_SIZE ) {case MO_8 :
@@ -1804,7 +1804,7 @@ static void tcg_out_qemu_st_direct(TCGContext *s, TCGMemOp memop,static void tcg_out_qemu_ld (TCGContext *s,TCGReg data_reg,TCGReg addr_reg,TCGMemOpIdx oi,TCGType ext) { -TCGMemOp memop =get_memop (oi); +MemOp memop =get_memop (oi);const TCGType otype =TARGET_LONG_BITS ==64 ?TCG_TYPE_I64 :TCG_TYPE_I32 ;#ifdef CONFIG_SOFTMMU unsigned mem_index =get_mmuidx (oi);
@@ -1829,7 +1829,7 @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg data_reg, TCGReg addr_reg,static void tcg_out_qemu_st (TCGContext *s,TCGReg data_reg,TCGReg addr_reg,TCGMemOpIdx oi) { -TCGMemOp memop =get_memop (oi); +MemOp memop =get_memop (oi);const TCGType otype =TARGET_LONG_BITS ==64 ?TCG_TYPE_I64 :TCG_TYPE_I32 ;#ifdef CONFIG_SOFTMMU unsigned mem_index =get_mmuidx (oi);
tcg/arm/tcg-target.inc.c +13 -13
@@ -1233,7 +1233,7 @@ QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, table) != 4);containing the addend of the tlb entry. Clobbers R0, R1, R2, TMP. */ static TCGReg tcg_out_tlb_read (TCGContext *s,TCGReg addrlo,TCGReg addrhi, -TCGMemOp opc,int mem_index,bool is_load) +MemOp opc,int mem_index,bool is_load) {int cmp_off = (is_load ? offsetof(CPUTLBEntry , addr_read) : offsetof(CPUTLBEntry , addr_write));
@@ -1348,7 +1348,7 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) {TCGReg argreg, datalo, datahi;TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);void *func;if (!reloc_pc24 (lb->label_ptr[0 ], s->code_ptr)) {
@@ -1412,7 +1412,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) {TCGReg argreg, datalo, datahi;TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);if (!reloc_pc24 (lb->label_ptr[0 ], s->code_ptr)) {return false;
@@ -1453,11 +1453,11 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) }#endif /* SOFTMMU */ -static inline void tcg_out_qemu_ld_index (TCGContext *s,TCGMemOp opc, +static inline void tcg_out_qemu_ld_index (TCGContext *s,MemOp opc,TCGReg datalo,TCGReg datahi,TCGReg addrlo,TCGReg addend) { -TCGMemOp bswap = opc &MO_BSWAP ; +MemOp bswap = opc &MO_BSWAP ;switch (opc &MO_SSIZE ) {case MO_UB :
@@ -1514,11 +1514,11 @@ static inline void tcg_out_qemu_ld_index(TCGContext *s, TCGMemOp opc, } } -static inline void tcg_out_qemu_ld_direct (TCGContext *s,TCGMemOp opc, +static inline void tcg_out_qemu_ld_direct (TCGContext *s,MemOp opc,TCGReg datalo,TCGReg datahi,TCGReg addrlo) { -TCGMemOp bswap = opc &MO_BSWAP ; +MemOp bswap = opc &MO_BSWAP ;switch (opc &MO_SSIZE ) {case MO_UB :
@@ -1577,7 +1577,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is64) { TCGReg addrlo, datalo, datahi, addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#ifdef CONFIG_SOFTMMU int mem_index;TCGReg addend;
@@ -1614,11 +1614,11 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is64)#endif } -static inline void tcg_out_qemu_st_index (TCGContext *s,int cond,TCGMemOp opc, +static inline void tcg_out_qemu_st_index (TCGContext *s,int cond,MemOp opc,TCGReg datalo,TCGReg datahi,TCGReg addrlo,TCGReg addend) { -TCGMemOp bswap = opc &MO_BSWAP ; +MemOp bswap = opc &MO_BSWAP ;switch (opc &MO_SIZE ) {case MO_8 :
@@ -1659,11 +1659,11 @@ static inline void tcg_out_qemu_st_index(TCGContext *s, int cond, TCGMemOp opc, } } -static inline void tcg_out_qemu_st_direct (TCGContext *s,TCGMemOp opc, +static inline void tcg_out_qemu_st_direct (TCGContext *s,MemOp opc,TCGReg datalo,TCGReg datahi,TCGReg addrlo) { -TCGMemOp bswap = opc &MO_BSWAP ; +MemOp bswap = opc &MO_BSWAP ;switch (opc &MO_SIZE ) {case MO_8 :
@@ -1708,7 +1708,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is64) { TCGReg addrlo, datalo, datahi, addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#ifdef CONFIG_SOFTMMU int mem_index;TCGReg addend;
tcg/i386/tcg-target.inc.c +12 -12
@@ -1697,7 +1697,7 @@ static void * const qemu_st_helpers[16] = {First argument register is clobbered. */ static inline void tcg_out_tlb_load (TCGContext *s,TCGReg addrlo,TCGReg addrhi, -int mem_index,TCGMemOp opc, +int mem_index,MemOp opc,tcg_insn_unit **label_ptr,int which) {const TCGReg r0 =TCG_REG_L0 ;
@@ -1810,7 +1810,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, bool is_64,static bool tcg_out_qemu_ld_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);TCGReg data_reg;tcg_insn_unit **label_ptr = &l->label_ptr[0 ];int rexw = (l->type ==TCG_TYPE_I64 ?P_REXW :0 );
@@ -1895,8 +1895,8 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l)static bool tcg_out_qemu_st_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp s_bits = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp s_bits = opc &MO_SIZE ;tcg_insn_unit **label_ptr = &l->label_ptr[0 ];TCGReg retaddr;
@@ -1995,10 +1995,10 @@ static inline int setup_guest_base_seg(void)static void tcg_out_qemu_ld_direct (TCGContext *s,TCGReg datalo,TCGReg datahi,TCGReg base,int index,intptr_t ofs, -int seg,bool is64,TCGMemOp memop) +int seg,bool is64,MemOp memop) { -const TCGMemOp real_bswap = memop &MO_BSWAP ; -TCGMemOp bswap = real_bswap; +const MemOp real_bswap = memop &MO_BSWAP ; +MemOp bswap = real_bswap;int rexw = is64 *P_REXW ;int movop = OPC_MOVL_GvEv;
@@ -2103,7 +2103,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is64)TCGReg datalo, datahi, addrlo; TCGReg addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )int mem_index;tcg_insn_unit *label_ptr[2 ];
@@ -2137,15 +2137,15 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is64)static void tcg_out_qemu_st_direct (TCGContext *s,TCGReg datalo,TCGReg datahi,TCGReg base,int index,intptr_t ofs, -int seg,TCGMemOp memop) +int seg,MemOp memop) {/* ??? Ideally we wouldn't need a scratch register. For user-only, we could perform the bswap twice to restore the original value instead of moving to the scratch. But as it is, the L constraint means that TCG_REG_L0 is definitely free here. */ const TCGReg scratch =TCG_REG_L0 ; -const TCGMemOp real_bswap = memop &MO_BSWAP ; -TCGMemOp bswap = real_bswap; +const MemOp real_bswap = memop &MO_BSWAP ; +MemOp bswap = real_bswap;int movop = OPC_MOVL_EvGv;if (have_movbe && real_bswap) {
@@ -2221,7 +2221,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is64)TCGReg datalo, datahi, addrlo; TCGReg addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )int mem_index;tcg_insn_unit *label_ptr[2 ];
tcg/mips/tcg-target.inc.c +8 -8
@@ -1215,7 +1215,7 @@ static void tcg_out_tlb_load(TCGContext *s, TCGReg base, TCGReg addrl, TCGReg addrh, TCGMemOpIdx oi, tcg_insn_unit *label_ptr[2], bool is_load) { - TCGMemOp opc = get_memop(oi); + MemOp opc = get_memop(oi);unsigned s_bits = opc &MO_SIZE ;unsigned a_bits =get_alignment_bits (opc);int mem_index =get_mmuidx (oi);
@@ -1313,7 +1313,7 @@ static void add_qemu_ldst_label(TCGContext *s, int is_ld, TCGMemOpIdx oi,static bool tcg_out_qemu_ld_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);TCGReg v0;int i;
@@ -1363,8 +1363,8 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l)static bool tcg_out_qemu_st_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp s_bits = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp s_bits = opc &MO_SIZE ;int i;/* resolve label address */
@@ -1413,7 +1413,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l)#endif static void tcg_out_qemu_ld_direct (TCGContext *s,TCGReg lo,TCGReg hi, -TCGReg base,TCGMemOp opc,bool is_64) +TCGReg base,MemOp opc,bool is_64) {switch (opc & (MO_SSIZE |MO_BSWAP )) {case MO_UB :
@@ -1521,7 +1521,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) TCGReg addr_regl, addr_regh __attribute__((unused));TCGReg data_regl, data_regh;TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )tcg_insn_unit *label_ptr[2 ];#endif
@@ -1558,7 +1558,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) }static void tcg_out_qemu_st_direct (TCGContext *s,TCGReg lo,TCGReg hi, -TCGReg base,TCGMemOp opc) +TCGReg base,MemOp opc) {/* Don't clutter the code below with checks to avoid bswapping ZERO. */ if ((lo | hi) ==0 ) {
@@ -1624,7 +1624,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) TCGReg addr_regl, addr_regh __attribute__((unused));TCGReg data_regl, data_regh;TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )tcg_insn_unit *label_ptr[2 ];#endif
tcg/optimize.c +1 -1
@@ -1013,7 +1013,7 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(qemu_ld): {TCGMemOpIdx oi = op->args[nb_oargs + nb_iargs]; -TCGMemOp mop =get_memop (oi); +MemOp mop =get_memop (oi);if (!(mop &MO_SIGN )) { mask = (2ULL << ((8 << (mop &MO_SIZE )) -1 )) -1 ; }
tcg/ppc/tcg-target.inc.c +6 -6
@@ -1506,7 +1506,7 @@ QEMU_BUILD_BUG_ON(TLB_MASK_TABLE_OFS(0) < -32768);in CR7, loads the addend of the TLB into R3, and returns the register containing the guest address (zero-extended into R4). Clobbers R0 and R2. */ -static TCGReg tcg_out_tlb_read (TCGContext *s,TCGMemOp opc, +static TCGReg tcg_out_tlb_read (TCGContext *s,MemOp opc,TCGReg addrlo,TCGReg addrhi,int mem_index,bool is_read) {
@@ -1633,7 +1633,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOpIdx oi,static bool tcg_out_qemu_ld_slow_path (TCGContext *s,TCGLabelQemuLdst *lb) {TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);TCGReg hi, lo, arg =TCG_REG_R3 ;if (!reloc_pc14 (lb->label_ptr[0 ], s->code_ptr)) {
@@ -1680,8 +1680,8 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)static bool tcg_out_qemu_st_slow_path (TCGContext *s,TCGLabelQemuLdst *lb) {TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp s_bits = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp s_bits = opc &MO_SIZE ;TCGReg hi, lo, arg =TCG_REG_R3 ;if (!reloc_pc14 (lb->label_ptr[0 ], s->code_ptr)) {
@@ -1744,7 +1744,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64)TCGReg datalo, datahi, addrlo, rbase; TCGReg addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc, s_bits; +MemOp opc, s_bits;#ifdef CONFIG_SOFTMMU int mem_index;tcg_insn_unit *label_ptr;
@@ -1819,7 +1819,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)TCGReg datalo, datahi, addrlo, rbase; TCGReg addrhi __attribute__((unused));TCGMemOpIdx oi; -TCGMemOp opc, s_bits; +MemOp opc, s_bits;#ifdef CONFIG_SOFTMMU int mem_index;tcg_insn_unit *label_ptr;
tcg/riscv/tcg-target.inc.c +10 -10
@@ -970,7 +970,7 @@ static void tcg_out_tlb_load(TCGContext *s, TCGReg addrl, TCGReg addrh, TCGMemOpIdx oi, tcg_insn_unit **label_ptr, bool is_load) { - TCGMemOp opc = get_memop(oi); + MemOp opc = get_memop(oi);unsigned s_bits = opc &MO_SIZE ;unsigned a_bits =get_alignment_bits (opc);tcg_target_long compare_mask;
@@ -1044,7 +1044,7 @@ static void add_qemu_ldst_label(TCGContext *s, int is_ld, TCGMemOpIdx oi,static bool tcg_out_qemu_ld_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);TCGReg a0 = tcg_target_call_iarg_regs[0 ];TCGReg a1 = tcg_target_call_iarg_regs[1 ];TCGReg a2 = tcg_target_call_iarg_regs[2 ];
@@ -1077,8 +1077,8 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l)static bool tcg_out_qemu_st_slow_path (TCGContext *s,TCGLabelQemuLdst *l) {TCGMemOpIdx oi = l->oi; -TCGMemOp opc =get_memop (oi); -TCGMemOp s_bits = opc &MO_SIZE ; +MemOp opc =get_memop (oi); +MemOp s_bits = opc &MO_SIZE ;TCGReg a0 = tcg_target_call_iarg_regs[0 ];TCGReg a1 = tcg_target_call_iarg_regs[1 ];TCGReg a2 = tcg_target_call_iarg_regs[2 ];
@@ -1121,9 +1121,9 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l)#endif /* CONFIG_SOFTMMU */ static void tcg_out_qemu_ld_direct (TCGContext *s,TCGReg lo,TCGReg hi, -TCGReg base,TCGMemOp opc,bool is_64) +TCGReg base,MemOp opc,bool is_64) { -const TCGMemOp bswap = opc &MO_BSWAP ; +const MemOp bswap = opc &MO_BSWAP ;/* We don't yet handle byteswapping, assert */ g_assert (!bswap);
@@ -1172,7 +1172,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) TCGReg addr_regl, addr_regh __attribute__((unused));TCGReg data_regl, data_regh;TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )tcg_insn_unit *label_ptr[1 ];#endif
@@ -1208,9 +1208,9 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) }static void tcg_out_qemu_st_direct (TCGContext *s,TCGReg lo,TCGReg hi, -TCGReg base,TCGMemOp opc) +TCGReg base,MemOp opc) { -const TCGMemOp bswap = opc &MO_BSWAP ; +const MemOp bswap = opc &MO_BSWAP ;/* We don't yet handle byteswapping, assert */ g_assert (!bswap);
@@ -1243,7 +1243,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) TCGReg addr_regl, addr_regh __attribute__((unused));TCGReg data_regl, data_regh;TCGMemOpIdx oi; -TCGMemOp opc; +MemOp opc;#if defined(CONFIG_SOFTMMU )tcg_insn_unit *label_ptr[1 ];#endif
tcg/s390/tcg-target.inc.c +7 -7
@@ -1430,7 +1430,7 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit *dest) } } -static void tcg_out_qemu_ld_direct (TCGContext *s,TCGMemOp opc,TCGReg data, +static void tcg_out_qemu_ld_direct (TCGContext *s,MemOp opc,TCGReg data,TCGReg base,TCGReg index,int disp) {switch (opc & (MO_SSIZE |MO_BSWAP )) {
@@ -1489,7 +1489,7 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGMemOp opc, TCGReg data, } } -static void tcg_out_qemu_st_direct (TCGContext *s,TCGMemOp opc,TCGReg data, +static void tcg_out_qemu_st_direct (TCGContext *s,MemOp opc,TCGReg data,TCGReg base,TCGReg index,int disp) {switch (opc & (MO_SIZE |MO_BSWAP )) {
@@ -1544,7 +1544,7 @@ QEMU_BUILD_BUG_ON(TLB_MASK_TABLE_OFS(0) < -(1 << 19));/* Load and compare a TLB entry, leaving the flags set. Loads the TLB addend into R2. Returns a register with the santitized guest address. */ -static TCGReg tcg_out_tlb_read (TCGContext * s,TCGReg addr_reg,TCGMemOp opc, +static TCGReg tcg_out_tlb_read (TCGContext *s,TCGReg addr_reg,MemOp opc,int mem_index,bool is_ld) {unsigned s_bits = opc &MO_SIZE ;
@@ -1614,7 +1614,7 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)TCGReg addr_reg = lb->addrlo_reg;TCGReg data_reg = lb->datalo_reg;TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);if (!patch_reloc (lb->label_ptr[0 ],R_390_PC16DBL , (intptr_t )s->code_ptr,2 )) {
@@ -1639,7 +1639,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)TCGReg addr_reg = lb->addrlo_reg;TCGReg data_reg = lb->datalo_reg;TCGMemOpIdx oi = lb->oi; -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);if (!patch_reloc (lb->label_ptr[0 ],R_390_PC16DBL , (intptr_t )s->code_ptr,2 )) {
@@ -1694,7 +1694,7 @@ static void tcg_prepare_user_ldst(TCGContext *s, TCGReg *addr_reg,static void tcg_out_qemu_ld (TCGContext * s,TCGReg data_reg,TCGReg addr_reg,TCGMemOpIdx oi) { -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);#ifdef CONFIG_SOFTMMU unsigned mem_index =get_mmuidx (oi);tcg_insn_unit *label_ptr;
@@ -1721,7 +1721,7 @@ static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,static void tcg_out_qemu_st (TCGContext * s,TCGReg data_reg,TCGReg addr_reg,TCGMemOpIdx oi) { -TCGMemOp opc =get_memop (oi); +MemOp opc =get_memop (oi);#ifdef CONFIG_SOFTMMU unsigned mem_index =get_mmuidx (oi);tcg_insn_unit *label_ptr;
tcg/sparc/tcg-target.inc.c +3 -3
@@ -1081,7 +1081,7 @@ QEMU_BUILD_BUG_ON(TLB_MASK_TABLE_OFS(0) < -(1 << 12));is in the returned register, maybe %o0. The TLB addend is in %o1. */ static TCGReg tcg_out_tlb_load (TCGContext *s,TCGReg addr,int mem_index, -TCGMemOp opc,int which) +MemOp opc,int which) {int fast_off =TLB_MASK_TABLE_OFS (mem_index);int mask_off = fast_off + offsetof(CPUTLBDescFast , mask);
@@ -1164,7 +1164,7 @@ static const int qemu_st_opc[16] = {static void tcg_out_qemu_ld (TCGContext *s,TCGReg data,TCGReg addr,TCGMemOpIdx oi,bool is_64) { -TCGMemOp memop =get_memop (oi); +MemOp memop =get_memop (oi);#ifdef CONFIG_SOFTMMU unsigned memi =get_mmuidx (oi);TCGReg addrz, param;
@@ -1246,7 +1246,7 @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg data, TCGReg addr,static void tcg_out_qemu_st (TCGContext *s,TCGReg data,TCGReg addr,TCGMemOpIdx oi) { -TCGMemOp memop =get_memop (oi); +MemOp memop =get_memop (oi);#ifdef CONFIG_SOFTMMU unsigned memi =get_mmuidx (oi);TCGReg addrz, param;
tcg/tcg-op.c +19 -19
@@ -2714,7 +2714,7 @@ void tcg_gen_lookup_and_goto_ptr(void) } } -static inline TCGMemOp tcg_canonicalize_memop (TCGMemOp op,bool is64,bool st) +static inline MemOp tcg_canonicalize_memop (MemOp op,bool is64,bool st) {/* Trigger the asserts within as early as possible. */ (void )get_alignment_bits (op);
@@ -2743,7 +2743,7 @@ static inline TCGMemOp tcg_canonicalize_memop(TCGMemOp op, bool is64, bool st) }static void gen_ldst_i32 (TCGOpcode opc,TCGv_i32 val,TCGv addr, -TCGMemOp memop,TCGArg idx) +MemOp memop,TCGArg idx) {TCGMemOpIdx oi =make_memop_idx (memop, idx);#if TARGET_LONG_BITS ==32
@@ -2758,7 +2758,7 @@ static void gen_ldst_i32(TCGOpcode opc, TCGv_i32 val, TCGv addr, }static void gen_ldst_i64 (TCGOpcode opc,TCGv_i64 val,TCGv addr, -TCGMemOp memop,TCGArg idx) +MemOp memop,TCGArg idx) {TCGMemOpIdx oi =make_memop_idx (memop, idx);#if TARGET_LONG_BITS ==32
@@ -2788,9 +2788,9 @@ static void tcg_gen_req_mo(TCGBar type) } } -void tcg_gen_qemu_ld_i32 (TCGv_i32 val,TCGv addr,TCGArg idx,TCGMemOp memop) +void tcg_gen_qemu_ld_i32 (TCGv_i32 val,TCGv addr,TCGArg idx,MemOp memop) { -TCGMemOp orig_memop; +MemOp orig_memop;tcg_gen_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); memop =tcg_canonicalize_memop (memop,0 ,0 );
@@ -2825,7 +2825,7 @@ void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, TCGMemOp memop) } } -void tcg_gen_qemu_st_i32 (TCGv_i32 val,TCGv addr,TCGArg idx,TCGMemOp memop) +void tcg_gen_qemu_st_i32 (TCGv_i32 val,TCGv addr,TCGArg idx,MemOp memop) {TCGv_i32 swap =NULL ;
@@ -2858,9 +2858,9 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, TCGMemOp memop) } } -void tcg_gen_qemu_ld_i64 (TCGv_i64 val,TCGv addr,TCGArg idx,TCGMemOp memop) +void tcg_gen_qemu_ld_i64 (TCGv_i64 val,TCGv addr,TCGArg idx,MemOp memop) { -TCGMemOp orig_memop; +MemOp orig_memop;if (TCG_TARGET_REG_BITS ==32 && (memop &MO_SIZE ) <MO_64 ) {tcg_gen_qemu_ld_i32 (TCGV_LOW (val), addr, idx, memop);
@@ -2911,7 +2911,7 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, TCGMemOp memop) } } -void tcg_gen_qemu_st_i64 (TCGv_i64 val,TCGv addr,TCGArg idx,TCGMemOp memop) +void tcg_gen_qemu_st_i64 (TCGv_i64 val,TCGv addr,TCGArg idx,MemOp memop) {TCGv_i64 swap =NULL ;
@@ -2953,7 +2953,7 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, TCGMemOp memop) } } -static void tcg_gen_ext_i32 (TCGv_i32 ret,TCGv_i32 val,TCGMemOp opc) +static void tcg_gen_ext_i32 (TCGv_i32 ret,TCGv_i32 val,MemOp opc) {switch (opc &MO_SSIZE ) {case MO_SB :
@@ -2974,7 +2974,7 @@ static void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, TCGMemOp opc) } } -static void tcg_gen_ext_i64 (TCGv_i64 ret,TCGv_i64 val,TCGMemOp opc) +static void tcg_gen_ext_i64 (TCGv_i64 ret,TCGv_i64 val,MemOp opc) {switch (opc &MO_SSIZE ) {case MO_SB :
@@ -3034,7 +3034,7 @@ static void * const table_cmpxchg[16] = { };void tcg_gen_atomic_cmpxchg_i32 (TCGv_i32 retv,TCGv addr,TCGv_i32 cmpv, -TCGv_i32 newv,TCGArg idx,TCGMemOp memop) +TCGv_i32 newv,TCGArg idx,MemOp memop) { memop =tcg_canonicalize_memop (memop,0 ,0 );
@@ -3078,7 +3078,7 @@ void tcg_gen_atomic_cmpxchg_i32(TCGv_i32 retv, TCGv addr, TCGv_i32 cmpv, }void tcg_gen_atomic_cmpxchg_i64 (TCGv_i64 retv,TCGv addr,TCGv_i64 cmpv, -TCGv_i64 newv,TCGArg idx,TCGMemOp memop) +TCGv_i64 newv,TCGArg idx,MemOp memop) { memop =tcg_canonicalize_memop (memop,1 ,0 );
@@ -3142,7 +3142,7 @@ void tcg_gen_atomic_cmpxchg_i64(TCGv_i64 retv, TCGv addr, TCGv_i64 cmpv, }static void do_nonatomic_op_i32 (TCGv_i32 ret,TCGv addr,TCGv_i32 val, -TCGArg idx,TCGMemOp memop,bool new_val, +TCGArg idx,MemOp memop,bool new_val,void (*gen)(TCGv_i32 ,TCGv_i32 ,TCGv_i32 )) {TCGv_i32 t1 =tcg_temp_new_i32 ();
@@ -3160,7 +3160,7 @@ static void do_nonatomic_op_i32(TCGv_i32 ret, TCGv addr, TCGv_i32 val, }static void do_atomic_op_i32 (TCGv_i32 ret,TCGv addr,TCGv_i32 val, -TCGArg idx,TCGMemOp memop,void *const table[]) +TCGArg idx,MemOp memop,void *const table[]) {gen_atomic_op_i32 gen;
@@ -3185,7 +3185,7 @@ static void do_atomic_op_i32(TCGv_i32 ret, TCGv addr, TCGv_i32 val, }static void do_nonatomic_op_i64 (TCGv_i64 ret,TCGv addr,TCGv_i64 val, -TCGArg idx,TCGMemOp memop,bool new_val, +TCGArg idx,MemOp memop,bool new_val,void (*gen)(TCGv_i64 ,TCGv_i64 ,TCGv_i64 )) {TCGv_i64 t1 =tcg_temp_new_i64 ();
@@ -3203,7 +3203,7 @@ static void do_nonatomic_op_i64(TCGv_i64 ret, TCGv addr, TCGv_i64 val, }static void do_atomic_op_i64 (TCGv_i64 ret,TCGv addr,TCGv_i64 val, -TCGArg idx,TCGMemOp memop,void *const table[]) +TCGArg idx,MemOp memop,void *const table[]) { memop =tcg_canonicalize_memop (memop,1 ,0 );
@@ -3257,7 +3257,7 @@ static void * const table_##NAME[16] = { \ WITH_ATOMIC64([MO_64 | MO_BE] = gen_helper_atomic_##NAME##q_be) \ }; \ void tcg_gen_atomic_##NAME##_i32 \ - (TCGv_i32 ret, TCGv addr, TCGv_i32 val, TCGArg idx, TCGMemOp memop) \ + (TCGv_i32 ret, TCGv addr, TCGv_i32 val, TCGArg idx, MemOp memop) \ { \ if (tcg_ctx->tb_cflags & CF_PARALLEL) { \ do_atomic_op_i32(ret, addr, val, idx, memop, table_##NAME); \
@@ -3267,7 +3267,7 @@ void tcg_gen_atomic_##NAME##_i32 \ } \ } \ void tcg_gen_atomic_##NAME##_i64 \ - (TCGv_i64 ret, TCGv addr, TCGv_i64 val, TCGArg idx, TCGMemOp memop) \ + (TCGv_i64 ret, TCGv addr, TCGv_i64 val, TCGArg idx, MemOp memop) \ { \ if (tcg_ctx->tb_cflags & CF_PARALLEL) { \ do_atomic_op_i64(ret, addr, val, idx, memop, table_##NAME); \
tcg/tcg.c +1 -1
@@ -2055,7 +2055,7 @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs)case INDEX_op_qemu_st_i64: {TCGMemOpIdx oi = op->args[k++]; -TCGMemOp op =get_memop (oi); +MemOp op =get_memop (oi);unsigned ix =get_mmuidx (oi);if (op & ~(MO_AMASK |MO_BSWAP |MO_SSIZE )) {
MAINTAINERS +1 -0
@@ -1890,6 +1890,7 @@ M: Paolo Bonzini <[email protected]> S: Supported F: include/exec/ioport.h F: ioport.c +F: include/exec/memop.h F: include/exec/memory.h F: include/exec/ram_addr.h F: memory.c
tcg/README +1 -1
@@ -512,7 +512,7 @@ Both t0 and t1 may be split into little-endian ordered pairs of registers if dealing with 64-bit quantities on a 32-bit host. The memidx selects the qemu tlb index to use (e.g. user or kernel access). -The flags are the TCGMemOp bits, selecting the sign, width, and endianness +The flags are the MemOp bits, selecting the sign, width, and endianness of the memory access. For a 32-bit host, qemu_ld/st_i64 is guaranteed to only be used with a
Signature · 1 line
2.17.1
PATCH 2/36 memory: Introduce size_memop
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Introduce no-op size_memop to aid preparatory conversion of interfaces.
Once interfaces are converted, size_memop will be implemented to return a MemOp from size in bytes.
Message-Id: <35b8ee74020f67cf40848fb7d5f127cf96c851d6.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memop.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
include/exec/memop.h +10 -0
@@ -107,4 +107,14 @@ typedef enum MemOp {MO_SSIZE =MO_SIZE |MO_SIGN , } MemOp; +/* Size in bytes to MemOp. */ +static inline unsigned size_memop (unsigned size) +{ +/* +* FIXME: No-op to aid conversion of memory_region_dispatch_{read|write} +* "unsigned size" operand into a "MemOp op". +*/ +return size; +} +#endif
Signature · 1 line
2.17.1
PATCH 3/36 target/mips: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <af407f0a34dc95ef5aaf2c00dffda7c65df23c3a.1566466906.git.tony.nguyen@bt.com>
--- target/mips/op_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
target/mips/op_helper.c +3 -2
@@ -24,6 +24,7 @@#include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" +#include "exec/memop.h" #include "sysemu/kvm.h" #include "fpu/softfloat.h"
@@ -4741,11 +4742,11 @@ void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)if (op ==9 ) {/* Index Store Tag */ memory_region_dispatch_write (env->itc_tag, index, env->CP0_TagLo, -8 ,MEMTXATTRS_UNSPECIFIED ); +size_memop (8 ),MEMTXATTRS_UNSPECIFIED ); }else if (op ==5 ) {/* Index Load Tag */ memory_region_dispatch_read (env->itc_tag, index, &env->CP0_TagLo, -8 ,MEMTXATTRS_UNSPECIFIED ); +size_memop (8 ),MEMTXATTRS_UNSPECIFIED ); }#endif }
Signature · 1 line
2.17.1
PATCH 4/36 hw/s390x: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <2f41da26201fb9b0339c2b7fde34df864f7f9ea8.1566466906.git.tony.nguyen@bt.com>
--- hw/s390x/s390-pci-inst.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/s390x/s390-pci-inst.c +5 -3
@@ -15,6 +15,7 @@#include "cpu.h" #include "s390-pci-inst.h" #include "s390-pci-bus.h" +#include "exec/memop.h" #include "exec/memory-internal.h" #include "qemu/error-report.h" #include "sysemu/hw_accel.h"
@@ -372,7 +373,7 @@ static MemTxResult zpci_read_bar(S390PCIBusDevice *pbdev, uint8_t pcias, mr = pbdev->pdev->io_regions[pcias].memory; mr =s390_get_subregion (mr, offset, len); offset -= mr->addr; -return memory_region_dispatch_read (mr, offset, data, len, +return memory_region_dispatch_read (mr, offset, data,size_memop (len),MEMTXATTRS_UNSPECIFIED ); }
@@ -471,7 +472,7 @@ static MemTxResult zpci_write_bar(S390PCIBusDevice *pbdev, uint8_t pcias, mr = pbdev->pdev->io_regions[pcias].memory; mr =s390_get_subregion (mr, offset, len); offset -= mr->addr; -return memory_region_dispatch_write (mr, offset, data, len, +return memory_region_dispatch_write (mr, offset, data,size_memop (len),MEMTXATTRS_UNSPECIFIED ); }
@@ -780,7 +781,8 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,for (i =0 ; i < len /8 ; i++) { result =memory_region_dispatch_write (mr, offset + i *8 , -ldq_p (buffer + i *8 ),8 , +ldq_p (buffer + i *8 ), +size_memop (8 ),MEMTXATTRS_UNSPECIFIED );if (result !=MEMTX_OK ) {s390_program_interrupt (env,PGM_OPERAND ,6 , ra);
Signature · 1 line
2.17.1
PATCH 5/36 hw/intc/armv7m_nic: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <21113bae2f54b45176701e0bf595937031368ae6.1566466906.git.tony.nguyen@bt.com>
--- hw/intc/armv7m_nvic.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
hw/intc/armv7m_nvic.c +8 -4
@@ -21,6 +21,7 @@#include "hw/qdev-properties.h" #include "target/arm/cpu.h" #include "exec/exec-all.h" +#include "exec/memop.h" #include "qemu/log.h" #include "qemu/module.h" #include "trace.h"
@@ -2348,7 +2349,8 @@ static MemTxResult nvic_sysreg_ns_write(void *opaque, hwaddr addr,if (attrs.secure) {/* S accesses to the alias act like NS accesses to the real region */ attrs.secure =0 ; -return memory_region_dispatch_write (mr, addr, value, size, attrs); +return memory_region_dispatch_write (mr, addr, value,size_memop (size), + attrs); }else {/* NS attrs are RAZ/WI for privileged, and BusFault for user */ if (attrs.user) {
@@ -2367,7 +2369,8 @@ static MemTxResult nvic_sysreg_ns_read(void *opaque, hwaddr addr,if (attrs.secure) {/* S accesses to the alias act like NS accesses to the real region */ attrs.secure =0 ; -return memory_region_dispatch_read (mr, addr, data, size, attrs); +return memory_region_dispatch_read (mr, addr, data,size_memop (size), + attrs); }else {/* NS attrs are RAZ/WI for privileged, and BusFault for user */ if (attrs.user) {
@@ -2393,7 +2396,8 @@ static MemTxResult nvic_systick_write(void *opaque, hwaddr addr,/* Direct the access to the correct systick */ mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->systick[attrs.secure]),0 ); -return memory_region_dispatch_write (mr, addr, value, size, attrs); +return memory_region_dispatch_write (mr, addr, value,size_memop (size), + attrs); } static MemTxResult nvic_systick_read(void *opaque, hwaddr addr,
@@ -2405,7 +2409,7 @@ static MemTxResult nvic_systick_read(void *opaque, hwaddr addr,/* Direct the access to the correct systick */ mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->systick[attrs.secure]),0 ); -return memory_region_dispatch_read (mr, addr, data, size, attrs); +return memory_region_dispatch_read (mr, addr, data,size_memop (size), attrs); }static const MemoryRegionOps nvic_systick_ops = {
Signature · 1 line
2.17.1
PATCH 6/36 hw/virtio: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <ebf1f78029d5ac1de1739a11d679740a87a1f02f.1566466906.git.tony.nguyen@bt.com>
--- hw/virtio/virtio-pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
hw/virtio/virtio-pci.c +5 -2
@@ -17,6 +17,7 @@#include "qemu/osdep.h" +#include "exec/memop.h" #include "standard-headers/linux/virtio_pci.h" #include "hw/virtio/virtio.h" #include "migration/qemu-file-types.h"
@@ -552,7 +553,8 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr,/* As length is under guest control, handle illegal values. */ return ; } -memory_region_dispatch_write (mr, addr, val, len,MEMTXATTRS_UNSPECIFIED ); +memory_region_dispatch_write (mr, addr, val,size_memop (len), +MEMTXATTRS_UNSPECIFIED ); } static void
@@ -575,7 +577,8 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,/* Make sure caller aligned buf properly */ assert (!(((uintptr_t )buf) & (len -1 ))); -memory_region_dispatch_read (mr, addr, &val, len,MEMTXATTRS_UNSPECIFIED ); +memory_region_dispatch_read (mr, addr, &val,size_memop (len), +MEMTXATTRS_UNSPECIFIED );switch (len) {case 1 :pci_set_byte (buf, val);
Signature · 1 line
2.17.1
PATCH 7/36 hw/vfio: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <e70ff5814ac3656974180db6375397c43b0bc8b8.1566466906.git.tony.nguyen@bt.com>
--- hw/vfio/pci-quirks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/vfio/pci-quirks.c +4 -2
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "exec/memop.h" #include "qemu/units.h" #include "qemu/error-report.h" #include "qemu/main-loop.h"
@@ -1073,7 +1074,7 @@ static void vfio_rtl8168_quirk_address_write(void *opaque, hwaddr addr,/* Write to the proper guest MSI-X table instead */ memory_region_dispatch_write (&vdev->pdev.msix_table_mmio, - offset, val, size, + offset, val,size_memop (size),MEMTXATTRS_UNSPECIFIED ); }return ;/* Do not write guest MSI-X data to hardware */
@@ -1104,7 +1105,8 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,if (rtl->enabled && (vdev->pdev.cap_present &QEMU_PCI_CAP_MSIX )) {hwaddr offset = rtl->addr &0xfff ;memory_region_dispatch_read (&vdev->pdev.msix_table_mmio, offset, - &data, size,MEMTXATTRS_UNSPECIFIED ); + &data,size_memop (size), +MEMTXATTRS_UNSPECIFIED );trace_vfio_quirk_rtl8168_msix_read (vdev->vbasedev.name, offset, data); }
Signature · 1 line
2.17.1
PATCH 8/36 exec: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <3b042deef0a60dd49ae2320ece92120ba6027f2b.1566466906.git.tony.nguyen@bt.com>
--- exec.c | 6 ++++-- memory_ldst.inc.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-)
exec.c +4 -2
@@ -3364,7 +3364,8 @@ static MemTxResult flatview_write_continue(FlatView *fv, hwaddr addr,/* XXX: could force current_cpu to NULL to avoid potential bugs */ val =ldn_p (buf, l); - result |=memory_region_dispatch_write (mr, addr1, val, l, attrs); + result |=memory_region_dispatch_write (mr, addr1, val, +size_memop (l), attrs); }else {/* RAM case */ ptr =qemu_ram_ptr_length (mr->ram_block, addr1, &l, false);
@@ -3425,7 +3426,8 @@ MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr,/* I/O case */ release_lock |=prepare_mmio_access (mr); l =memory_access_size (mr, l, addr1); - result |=memory_region_dispatch_read (mr, addr1, &val, l, attrs); + result |=memory_region_dispatch_read (mr, addr1, &val, +size_memop (l), attrs);stn_p (buf, l, val); }else {/* RAM case */
memory_ldst.inc.c +9 -9
@@ -38,7 +38,7 @@ static inline uint32_t glue(address_space_ldl_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,4 , attrs); + r =memory_region_dispatch_read (mr, addr1, &val,size_memop (4 ), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap32 (val);
@@ -114,7 +114,7 @@ static inline uint64_t glue(address_space_ldq_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,8 , attrs); + r =memory_region_dispatch_read (mr, addr1, &val,size_memop (8 ), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap64 (val);
@@ -188,7 +188,7 @@ uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,1 , attrs); + r =memory_region_dispatch_read (mr, addr1, &val,size_memop (1 ), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -224,7 +224,7 @@ static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,2 , attrs); + r =memory_region_dispatch_read (mr, addr1, &val,size_memop (2 ), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap16 (val);
@@ -300,7 +300,7 @@ void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL,if (l <4 || !memory_access_is_direct (mr, true)) { release_lock |=prepare_mmio_access (mr); - r =memory_region_dispatch_write (mr, addr1, val,4 , attrs); + r =memory_region_dispatch_write (mr, addr1, val,size_memop (4 ), attrs); }else { ptr =qemu_map_ram_ptr (mr->ram_block, addr1);stl_p (ptr, val);
@@ -346,7 +346,7 @@ static inline void glue(address_space_stl_internal, SUFFIX)(ARG1_DECL, val = bswap32(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,4 , attrs); + r =memory_region_dispatch_write (mr, addr1, val,size_memop (4 ), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -408,7 +408,7 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL, mr =TRANSLATE (addr, &addr1, &l, true, attrs);if (!memory_access_is_direct (mr, true)) { release_lock |=prepare_mmio_access (mr); - r =memory_region_dispatch_write (mr, addr1, val,1 , attrs); + r =memory_region_dispatch_write (mr, addr1, val,size_memop (1 ), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -451,7 +451,7 @@ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, val = bswap16(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,2 , attrs); + r =memory_region_dispatch_write (mr, addr1, val,size_memop (2 ), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -524,7 +524,7 @@ static void glue(address_space_stq_internal, SUFFIX)(ARG1_DECL, val = bswap64(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,8 , attrs); + r =memory_region_dispatch_write (mr, addr1, val,size_memop (8 ), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
Signature · 1 line
2.17.1
PATCH 9/36 cputlb: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op".
Convert interfaces by using no-op size_memop.
After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op".
As size_memop is a no-op, this patch does not change any behaviour.
Message-Id: <c4571c76467ade83660970f7ef9d7292297f1908.1566466906.git.tony.nguyen@bt.com>
--- accel/tcg/cputlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
accel/tcg/cputlb.c +4 -4
@@ -906,8 +906,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,qemu_mutex_lock_iothread (); locked = true; } - r =memory_region_dispatch_read (mr, mr_offset, - &val, size, iotlbentry->attrs); + r =memory_region_dispatch_read (mr, mr_offset, &val,size_memop (size), + iotlbentry->attrs);if (r !=MEMTX_OK ) {hwaddr physaddr = mr_offset + section->offset_within_address_space -
@@ -947,8 +947,8 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,qemu_mutex_lock_iothread (); locked = true; } - r =memory_region_dispatch_write (mr, mr_offset, - val, size, iotlbentry->attrs); + r =memory_region_dispatch_write (mr, mr_offset, val,size_memop (size), + iotlbentry->attrs);if (r !=MEMTX_OK ) {hwaddr physaddr = mr_offset + section->offset_within_address_space -
Signature · 1 line
2.17.1
PATCH 10/36 memory: Access MemoryRegion with MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Convert memory_region_dispatch_{read|write} operand "unsigned size" into a "MemOp op".
Message-Id: <1dd82df5801866743f838f1d046475115a1d32da.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memop.h | 22 +++++++++++++++------- include/exec/memory.h | 9 +++++---- memory.c | 7 +++++-- 3 files changed, 25 insertions(+), 13 deletions(-)
include/exec/memop.h +15 -7
@@ -12,6 +12,8 @@ #ifndef MEMOP_H #define MEMOP_H +#include "qemu/host-utils.h" + typedef enum MemOp { MO_8 = 0, MO_16 = 1,
@@ -107,14 +109,20 @@ typedef enum MemOp {MO_SSIZE =MO_SIZE |MO_SIGN , } MemOp; -/* Size in bytes to MemOp. */ -static inline unsigned size_memop (unsigned size) +/* MemOp to size in bytes. */ +static inline unsigned memop_size (MemOp op) { -/* -* FIXME: No-op to aid conversion of memory_region_dispatch_{read|write} -* "unsigned size" operand into a "MemOp op". -*/ -return size; +return 1 << (op &MO_SIZE ); +} + +/* Size in bytes to MemOp. */ +static inline MemOp size_memop (unsigned size) +{ +#ifdef CONFIG_DEBUG_TCG +/* Power of 2 up to 8. */ +assert ((size & (size -1 )) ==0 && size >=1 && size <=8 ); +#endif +return ctz32 (size); }#endif
include/exec/memory.h +5 -4
@@ -19,6 +19,7 @@#include "exec/cpu-common.h" #include "exec/hwaddr.h" #include "exec/memattrs.h" +#include "exec/memop.h" #include "exec/ramlist.h" #include "qemu/bswap.h" #include "qemu/queue.h"
@@ -1749,13 +1750,13 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner);* @mr: #MemoryRegion to access * @addr: address within that region * @pval: pointer to uint64_t which the data is written to -* @size: size of the access in bytes +* @op: size, sign, and endianness of the memory operation * @attrs: memory transaction attributes to use for the access */ MemTxResult memory_region_dispatch_read (MemoryRegion *mr,hwaddr addr,uint64_t *pval, -unsigned size, +MemOp op,MemTxAttrs attrs);/** * memory_region_dispatch_write: perform a write directly to the specified
@@ -1764,13 +1765,13 @@ MemTxResult memory_region_dispatch_read(MemoryRegion *mr,* @mr: #MemoryRegion to access * @addr: address within that region * @data: data to write -* @size: size of the access in bytes +* @op: size, sign, and endianness of the memory operation * @attrs: memory transaction attributes to use for the access */ MemTxResult memory_region_dispatch_write (MemoryRegion *mr,hwaddr addr,uint64_t data, -unsigned size, +MemOp op,MemTxAttrs attrs);/**
memory.c +5 -2
@@ -1446,9 +1446,10 @@ static MemTxResult memory_region_dispatch_read1(MemoryRegion *mr,MemTxResult memory_region_dispatch_read (MemoryRegion *mr,hwaddr addr,uint64_t *pval, -unsigned size, +MemOp op,MemTxAttrs attrs) { +unsigned size =memop_size (op);MemTxResult r;if (!memory_region_access_valid (mr, addr, size, false, attrs)) {
@@ -1490,9 +1491,11 @@ static bool memory_region_dispatch_write_eventfds(MemoryRegion *mr,MemTxResult memory_region_dispatch_write (MemoryRegion *mr,hwaddr addr,uint64_t data, -unsigned size, +MemOp op,MemTxAttrs attrs) { +unsigned size =memop_size (op); +if (!memory_region_access_valid (mr, addr, size, true, attrs)) {unassigned_mem_write (mr, addr, data, size);return MEMTX_DECODE_ERROR ;
Signature · 1 line
2.17.1
PATCH 11/36 hw/s390x: Hard code size with MO_{8|16|32|64}
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op".
Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls.
Message-Id: <76dc97273a8eb5e10170ffc16526863df808f487.1566466906.git.tony.nguyen@bt.com>
--- hw/s390x/s390-pci-inst.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/s390x/s390-pci-inst.c +1 -2
@@ -782,8 +782,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,for (i =0 ; i < len /8 ; i++) { result =memory_region_dispatch_write (mr, offset + i *8 ,ldq_p (buffer + i *8 ), -size_memop (8 ), -MEMTXATTRS_UNSPECIFIED ); +MO_64 ,MEMTXATTRS_UNSPECIFIED );if (result !=MEMTX_OK ) {s390_program_interrupt (env,PGM_OPERAND ,6 , ra);return 0 ;
Signature · 1 line
2.17.1
PATCH 12/36 target/mips: Hard code size with MO_{8|16|32|64}
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op".
Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls.
Message-Id: <99c4459d5c1dc9013820be3dbda9798165c15b99.1566466906.git.tony.nguyen@bt.com>
--- target/mips/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
target/mips/op_helper.c +2 -2
@@ -4742,11 +4742,11 @@ void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)if (op ==9 ) {/* Index Store Tag */ memory_region_dispatch_write (env->itc_tag, index, env->CP0_TagLo, -size_memop (8 ),MEMTXATTRS_UNSPECIFIED ); +MO_64 ,MEMTXATTRS_UNSPECIFIED ); }else if (op ==5 ) {/* Index Load Tag */ memory_region_dispatch_read (env->itc_tag, index, &env->CP0_TagLo, -size_memop (8 ),MEMTXATTRS_UNSPECIFIED ); +MO_64 ,MEMTXATTRS_UNSPECIFIED ); }#endif }
Signature · 1 line
2.17.1
PATCH 13/36 exec: Hard code size with MO_{8|16|32|64}
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op".
Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls.
Message-Id: <99f69701cad294db638f84abebc58115e1b9de9a.1566466906.git.tony.nguyen@bt.com>
--- memory_ldst.inc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
memory_ldst.inc.c +9 -9
@@ -38,7 +38,7 @@ static inline uint32_t glue(address_space_ldl_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,size_memop (4 ), attrs); + r =memory_region_dispatch_read (mr, addr1, &val,MO_32 , attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap32 (val);
@@ -114,7 +114,7 @@ static inline uint64_t glue(address_space_ldq_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,size_memop (8 ), attrs); + r =memory_region_dispatch_read (mr, addr1, &val,MO_64 , attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap64 (val);
@@ -188,7 +188,7 @@ uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,size_memop (1 ), attrs); + r =memory_region_dispatch_read (mr, addr1, &val,MO_8 , attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -224,7 +224,7 @@ static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,size_memop (2 ), attrs); + r =memory_region_dispatch_read (mr, addr1, &val,MO_16 , attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap16 (val);
@@ -300,7 +300,7 @@ void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL,if (l <4 || !memory_access_is_direct (mr, true)) { release_lock |=prepare_mmio_access (mr); - r =memory_region_dispatch_write (mr, addr1, val,size_memop (4 ), attrs); + r =memory_region_dispatch_write (mr, addr1, val,MO_32 , attrs); }else { ptr =qemu_map_ram_ptr (mr->ram_block, addr1);stl_p (ptr, val);
@@ -346,7 +346,7 @@ static inline void glue(address_space_stl_internal, SUFFIX)(ARG1_DECL, val = bswap32(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,size_memop (4 ), attrs); + r =memory_region_dispatch_write (mr, addr1, val,MO_32 , attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -408,7 +408,7 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL, mr =TRANSLATE (addr, &addr1, &l, true, attrs);if (!memory_access_is_direct (mr, true)) { release_lock |=prepare_mmio_access (mr); - r =memory_region_dispatch_write (mr, addr1, val,size_memop (1 ), attrs); + r =memory_region_dispatch_write (mr, addr1, val,MO_8 , attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -451,7 +451,7 @@ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, val = bswap16(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,size_memop (2 ), attrs); + r =memory_region_dispatch_write (mr, addr1, val,MO_16 , attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -524,7 +524,7 @@ static void glue(address_space_stq_internal, SUFFIX)(ARG1_DECL, val = bswap64(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,size_memop (8 ), attrs); + r =memory_region_dispatch_write (mr, addr1, val,MO_64 , attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
Signature · 1 line
2.17.1
PATCH 14/36 memory: Access MemoryRegion with endianness
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former.
Call memory_region_dispatch_{read|write} with endianness encoded into the "MemOp op" operand.
This patch does not change any behaviour as memory_region_dispatch_{read|write} is yet to handle the endianness.
Once it does handle endianness, callers with byte swaps can collapse them into adjust_endianness.
Message-Id: <8066ab3eb037c0388dfadfe53c5118429dd1de3a.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memory.h | 3 +++ accel/tcg/cputlb.c | 8 ++++++-- exec.c | 13 +++++++++++-- hw/intc/armv7m_nvic.c | 15 ++++++++------- hw/s390x/s390-pci-inst.c | 6 ++++-- hw/vfio/pci-quirks.c | 5 +++-- hw/virtio/virtio-pci.c | 6 ++++-- memory.c | 18 ++++++++++++++++++ memory_ldst.inc.c | 24 ++++++++++++++++++------ 9 files changed, 75 insertions(+), 23 deletions(-)
include/exec/memory.h +3 -0
@@ -2211,6 +2211,9 @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, } } +/* enum device_endian to MemOp. */ +MemOp devend_memop (enum device_endian end); +#endif #endif
accel/tcg/cputlb.c +6 -2
@@ -906,7 +906,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,qemu_mutex_lock_iothread (); locked = true; } - r =memory_region_dispatch_read (mr, mr_offset, &val,size_memop (size), + r =memory_region_dispatch_read (mr, mr_offset, &val, +size_memop (size) |MO_TE , iotlbentry->attrs);if (r !=MEMTX_OK ) { hwaddr physaddr = mr_offset +
@@ -947,7 +948,8 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,qemu_mutex_lock_iothread (); locked = true; } - r =memory_region_dispatch_write (mr, mr_offset, val,size_memop (size), + r =memory_region_dispatch_write (mr, mr_offset, val, +size_memop (size) |MO_TE , iotlbentry->attrs);if (r !=MEMTX_OK ) { hwaddr physaddr = mr_offset +
@@ -1305,6 +1307,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, } } +/* TODO: Merge bswap into io_readx -> memory_region_dispatch_read. */ res =io_readx (env, &env_tlb (env)->d[mmu_idx].iotlb[index], mmu_idx, addr, retaddr, access_type, size);return handle_bswap (res, size, big_endian);
@@ -1553,6 +1556,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, } } +/* TODO: Merge bswap into io_writex -> memory_region_dispatch_write. */ io_writex (env, &env_tlb (env)->d[mmu_idx].iotlb[index], mmu_idx,handle_bswap (val, size, big_endian), addr, retaddr, size);
exec.c +11 -2
@@ -3364,8 +3364,13 @@ static MemTxResult flatview_write_continue(FlatView *fv, hwaddr addr,/* 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. +*/ result |=memory_region_dispatch_write (mr, addr1, val, -size_memop (l), attrs); +size_memop (l) |MO_TE , + attrs); }else {/* RAM case */ ptr =qemu_ram_ptr_length (mr->ram_block, addr1, &l, false);
@@ -3426,8 +3431,12 @@ 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), attrs); +size_memop (l) |MO_TE , attrs);stn_p (buf, l, val); }else {/* RAM case */
hw/intc/armv7m_nvic.c +8 -7
@@ -2349,8 +2349,8 @@ static MemTxResult nvic_sysreg_ns_write(void *opaque, hwaddr addr,if (attrs.secure) {/* S accesses to the alias act like NS accesses to the real region */ attrs.secure =0 ; -return memory_region_dispatch_write (mr, addr, value,size_memop (size), - attrs); +return memory_region_dispatch_write (mr, addr, value, +size_memop (size) |MO_TE , attrs); }else {/* NS attrs are RAZ/WI for privileged, and BusFault for user */ if (attrs.user) {
@@ -2369,8 +2369,8 @@ static MemTxResult nvic_sysreg_ns_read(void *opaque, hwaddr addr,if (attrs.secure) {/* S accesses to the alias act like NS accesses to the real region */ attrs.secure =0 ; -return memory_region_dispatch_read (mr, addr, data,size_memop (size), - attrs); +return memory_region_dispatch_read (mr, addr, data, +size_memop (size) |MO_TE , attrs); }else {/* NS attrs are RAZ/WI for privileged, and BusFault for user */ if (attrs.user) {
@@ -2396,8 +2396,8 @@ static MemTxResult nvic_systick_write(void *opaque, hwaddr addr,/* Direct the access to the correct systick */ mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->systick[attrs.secure]),0 ); -return memory_region_dispatch_write (mr, addr, value,size_memop (size), - attrs); +return memory_region_dispatch_write (mr, addr, value, +size_memop (size) |MO_TE , attrs); } static MemTxResult nvic_systick_read(void *opaque, hwaddr addr,
@@ -2409,7 +2409,8 @@ static MemTxResult nvic_systick_read(void *opaque, hwaddr addr,/* Direct the access to the correct systick */ mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->systick[attrs.secure]),0 ); -return memory_region_dispatch_read (mr, addr, data,size_memop (size), attrs); +return memory_region_dispatch_read (mr, addr, data,size_memop (size) |MO_TE , + attrs); }static const MemoryRegionOps nvic_systick_ops = {
hw/s390x/s390-pci-inst.c +4 -2
@@ -373,7 +373,8 @@ static MemTxResult zpci_read_bar(S390PCIBusDevice *pbdev, uint8_t pcias, mr = pbdev->pdev->io_regions[pcias].memory; mr =s390_get_subregion (mr, offset, len); offset -= mr->addr; -return memory_region_dispatch_read (mr, offset, data,size_memop (len), +return memory_region_dispatch_read (mr, offset, data, +size_memop (len) |MO_BE ,MEMTXATTRS_UNSPECIFIED ); }
@@ -472,7 +473,8 @@ static MemTxResult zpci_write_bar(S390PCIBusDevice *pbdev, uint8_t pcias, mr = pbdev->pdev->io_regions[pcias].memory; mr =s390_get_subregion (mr, offset, len); offset -= mr->addr; -return memory_region_dispatch_write (mr, offset, data,size_memop (len), +return memory_region_dispatch_write (mr, offset, data, +size_memop (len) |MO_BE ,MEMTXATTRS_UNSPECIFIED ); }
hw/vfio/pci-quirks.c +3 -2
@@ -1074,7 +1074,8 @@ static void vfio_rtl8168_quirk_address_write(void *opaque, hwaddr addr,/* Write to the proper guest MSI-X table instead */ memory_region_dispatch_write (&vdev->pdev.msix_table_mmio, - offset, val,size_memop (size), + offset, val, +size_memop (size) |MO_LE ,MEMTXATTRS_UNSPECIFIED ); }return ;/* Do not write guest MSI-X data to hardware */
@@ -1105,7 +1106,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,if (rtl->enabled && (vdev->pdev.cap_present &QEMU_PCI_CAP_MSIX )) {hwaddr offset = rtl->addr &0xfff ;memory_region_dispatch_read (&vdev->pdev.msix_table_mmio, offset, - &data,size_memop (size), + &data,size_memop (size) |MO_LE ,MEMTXATTRS_UNSPECIFIED );trace_vfio_quirk_rtl8168_msix_read (vdev->vbasedev.name, offset, data); }
hw/virtio/virtio-pci.c +4 -2
@@ -553,7 +553,8 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr,/* As length is under guest control, handle illegal values. */ return ; } -memory_region_dispatch_write (mr, addr, val,size_memop (len), +/* TODO: Merge bswap from cpu_to_leXX into memory_region_dispatch_write. */ +memory_region_dispatch_write (mr, addr, val,size_memop (len) |MO_LE ,MEMTXATTRS_UNSPECIFIED ); }
@@ -577,7 +578,8 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,/* Make sure caller aligned buf properly */ assert (!(((uintptr_t )buf) & (len -1 ))); -memory_region_dispatch_read (mr, addr, &val,size_memop (len), +/* TODO: Merge bswap from leXX_to_cpu into memory_region_dispatch_read. */ +memory_region_dispatch_read (mr, addr, &val,size_memop (len) |MO_LE ,MEMTXATTRS_UNSPECIFIED );switch (len) {case 1 :
memory.c +18 -0
@@ -3285,3 +3285,21 @@ static void memory_register_types(void) }type_init (memory_register_types) + +MemOp devend_memop(enum device_endian end) +{ +static MemOp conv[] = { + [DEVICE_LITTLE_ENDIAN ] =MO_LE , + [DEVICE_BIG_ENDIAN ] =MO_BE , + [DEVICE_NATIVE_ENDIAN ] =MO_TE , + [DEVICE_HOST_ENDIAN ] =0 , + }; +switch (end) { +case DEVICE_LITTLE_ENDIAN : +case DEVICE_BIG_ENDIAN : +case DEVICE_NATIVE_ENDIAN : +return conv[end]; +default : +g_assert_not_reached (); + } +}
memory_ldst.inc.c +18 -6
@@ -38,7 +38,9 @@ static inline uint32_t glue(address_space_ldl_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,MO_32 , attrs); +/* TODO: Merge bswap32 into memory_region_dispatch_read. */ + r =memory_region_dispatch_read (mr, addr1, &val, +MO_32 |devend_memop (endian), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap32 (val);
@@ -114,7 +116,9 @@ static inline uint64_t glue(address_space_ldq_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,MO_64 , attrs); +/* TODO: Merge bswap64 into memory_region_dispatch_read. */ + r =memory_region_dispatch_read (mr, addr1, &val, +MO_64 |devend_memop (endian), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap64 (val);
@@ -224,7 +228,9 @@ static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, release_lock |=prepare_mmio_access (mr);/* I/O case */ - r =memory_region_dispatch_read (mr, addr1, &val,MO_16 , attrs); +/* TODO: Merge bswap16 into memory_region_dispatch_read. */ + r =memory_region_dispatch_read (mr, addr1, &val, +MO_16 |devend_memop (endian), attrs);#if defined(TARGET_WORDS_BIGENDIAN )if (endian ==DEVICE_LITTLE_ENDIAN ) { val =bswap16 (val);
@@ -346,7 +352,9 @@ static inline void glue(address_space_stl_internal, SUFFIX)(ARG1_DECL, val = bswap32(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,MO_32 , attrs); +/* TODO: Merge bswap32 into memory_region_dispatch_write. */ + r =memory_region_dispatch_write (mr, addr1, val, +MO_32 |devend_memop (endian), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -451,7 +459,9 @@ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, val = bswap16(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,MO_16 , attrs); +/* TODO: Merge bswap16 into memory_region_dispatch_write. */ + r =memory_region_dispatch_write (mr, addr1, val, +MO_16 |devend_memop (endian), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
@@ -524,7 +534,9 @@ static void glue(address_space_stq_internal, SUFFIX)(ARG1_DECL, val = bswap64(val); }#endif - r =memory_region_dispatch_write (mr, addr1, val,MO_64 , attrs); +/* TODO: Merge bswap64 into memory_region_dispatch_write. */ + r =memory_region_dispatch_write (mr, addr1, val, +MO_64 |devend_memop (endian), attrs); }else {/* RAM case */ ptr =qemu_map_ram_ptr (mr->ram_block, addr1);
Signature · 1 line
2.17.1
PATCH 15/36 cputlb: Replace size and endian operands for MemOp
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former.
Message-Id: <755b7104410956b743e1f1e9c34ab87db113360f.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memop.h | 6 ++ accel/tcg/cputlb.c | 170 +++++++++++++++++++++---------------------- 2 files changed, 87 insertions(+), 89 deletions(-)
include/exec/memop.h +6 -0
@@ -125,4 +125,10 @@ static inline MemOp size_memop(unsigned size) return ctz32(size); } +/* Big endianness from MemOp. */ +static inline bool memop_big_endian (MemOp op) +{ +return (op &MO_BSWAP ) ==MO_BE ; +} +#endif
accel/tcg/cputlb.c +81 -89
398 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 16/36 memory: Single byte swap along the I/O path
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
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.
Message-Id: <911ff31af11922a9afba9b7ce128af8b8b80f316.1566466906.git.tony.nguyen@bt.com>
--- accel/tcg/cputlb.c | 42 ++-------------------------- exec.c | 17 +++--------- hw/virtio/virtio-pci.c | 10 +++---- memory.c | 33 ++++++++-------------- memory_ldst.inc.c | 63 ------------------------------------------ 5 files changed, 23 insertions(+), 142 deletions(-)
accel/tcg/cputlb.c +3 -39
@@ -1200,38 +1200,6 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,cpu_loop_exit_atomic (env_cpu (env), retaddr); } -#ifdef TARGET_WORDS_BIGENDIAN -#define NEED_BE_BSWAP 0 -#define NEED_LE_BSWAP 1 -#else -#define NEED_BE_BSWAP 1 -#define NEED_LE_BSWAP 0 -#endif - -/* -* Byte Swap Helper -* -* This should all dead code away depending on the build host and -* access type. -*/ - -static inline uint64_t handle_bswap (uint64_t val,MemOp op) -{ -if ((memop_big_endian (op) &&NEED_BE_BSWAP ) || - (!memop_big_endian (op) &&NEED_LE_BSWAP )) { -switch (op &MO_SIZE ) { -case MO_8 :return val; -case MO_16 :return bswap16 (val); -case MO_32 :return bswap32 (val); -case MO_64 :return bswap64 (val); -default : -g_assert_not_reached (); - } - }else { -return val; - } -} -/* * Load Helpers *
@@ -1306,10 +1274,8 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, } } -/* TODO: Merge bswap into io_readx -> memory_region_dispatch_read. */ - res =io_readx (env, &env_tlb (env)->d[mmu_idx].iotlb[index], - mmu_idx, addr, retaddr, access_type, op); -return handle_bswap (res, op); +return io_readx (env, &env_tlb (env)->d[mmu_idx].iotlb[index], + mmu_idx, addr, retaddr, access_type, op); }/* Handle slow unaligned access (it spans two pages or IO). */
@@ -1552,10 +1518,8 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, } } -/* TODO: Merge bswap into io_writex -> memory_region_dispatch_write. */ io_writex (env, &env_tlb (env)->d[mmu_idx].iotlb[index], mmu_idx, -handle_bswap (val, op), - addr, retaddr, op); + val, addr, retaddr, op);return ; }
exec.c +4 -13
@@ -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);
hw/virtio/virtio-pci.c +4 -6
@@ -544,16 +544,15 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr, val =pci_get_byte (buf);break ;case 2 : - val =cpu_to_le16 (pci_get_word (buf)); + val =pci_get_word (buf);break ;case 4 : - val =cpu_to_le32 (pci_get_long (buf)); + val =pci_get_long (buf);break ;default :/* As length is under guest control, handle illegal values. */ return ; } -/* TODO: Merge bswap from cpu_to_leXX into memory_region_dispatch_write. */ memory_region_dispatch_write (mr, addr, val,size_memop (len) |MO_LE ,MEMTXATTRS_UNSPECIFIED ); }
@@ -578,7 +577,6 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,/* Make sure caller aligned buf properly */ assert (!(((uintptr_t )buf) & (len -1 ))); -/* TODO: Merge bswap from leXX_to_cpu into memory_region_dispatch_read. */ memory_region_dispatch_read (mr, addr, &val,size_memop (len) |MO_LE ,MEMTXATTRS_UNSPECIFIED );switch (len) {
@@ -586,10 +584,10 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,pci_set_byte (buf, val);break ;case 2 : -pci_set_word (buf,le16_to_cpu (val)); +pci_set_word (buf, val);break ;case 4 : -pci_set_long (buf,le32_to_cpu (val)); +pci_set_long (buf, val);break ;default :/* As length is under guest control, handle illegal values. */
memory.c +12 -21
@@ -351,32 +351,23 @@ static bool memory_region_big_endian(MemoryRegion *mr)#endif } -static bool memory_region_wrong_endianness (MemoryRegion *mr) +static void adjust_endianness (MemoryRegion *mr,uint64_t *data,MemOp op) { -#ifdef TARGET_WORDS_BIGENDIAN -return mr->ops->endianness ==DEVICE_LITTLE_ENDIAN ; -#else -return mr->ops->endianness ==DEVICE_BIG_ENDIAN ; -#endif -} - -static void adjust_endianness (MemoryRegion *mr,uint64_t *data,unsigned size) -{ -if (memory_region_wrong_endianness (mr)) { -switch (size) { -case 1 : +if ((op &MO_BSWAP ) !=devend_memop (mr->ops->endianness)) { +switch (op &MO_SIZE ) { +case MO_8 :break ; -case 2 : +case MO_16 : *data =bswap16 (*data);break ; -case 4 : +case MO_32 : *data =bswap32 (*data);break ; -case 8 : +case MO_64 : *data =bswap64 (*data);break ;default : -abort (); +g_assert_not_reached (); } } }
@@ -1458,7 +1449,7 @@ MemTxResult memory_region_dispatch_read(MemoryRegion *mr, } r =memory_region_dispatch_read1 (mr, addr, pval, size, attrs); -adjust_endianness (mr, pval, size); +adjust_endianness (mr, pval, op);return r; }
@@ -1501,7 +1492,7 @@ MemTxResult memory_region_dispatch_write(MemoryRegion *mr,return MEMTX_DECODE_ERROR ; } -adjust_endianness (mr, &data, size); +adjust_endianness (mr, &data, op);if ((!kvm_eventfds_enabled ()) &&memory_region_dispatch_write_eventfds (mr, addr, data, size, attrs)) {
@@ -2350,7 +2341,7 @@ void memory_region_add_eventfd(MemoryRegion *mr, }if (size) { -adjust_endianness (mr, &mrfd.data, size); +adjust_endianness (mr, &mrfd.data,size_memop (size) |MO_TE ); }memory_region_transaction_begin ();for (i =0 ; i < mr->ioeventfd_nb; ++i) {
@@ -2385,7 +2376,7 @@ void memory_region_del_eventfd(MemoryRegion *mr,unsigned i;if (size) { -adjust_endianness (mr, &mrfd.data, size); +adjust_endianness (mr, &mrfd.data,size_memop (size) |MO_TE ); }memory_region_transaction_begin ();for (i =0 ; i < mr->ioeventfd_nb; ++i) {
memory_ldst.inc.c +0 -63
105 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 17/36 cputlb: Byte swap memory transaction attribute
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Notice new attribute, byte swap, and force the transaction through the memory slow path.
Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit.
Message-Id: <2a10a1f1c00a894af1212c8f68ef09c2966023c1.1566466906.git.tony.nguyen@bt.com>
--- include/exec/memattrs.h | 2 ++ accel/tcg/cputlb.c | 12 ++++++++++++ 2 files changed, 14 insertions(+)
include/exec/memattrs.h +2 -0
@@ -37,6 +37,8 @@ typedef struct MemTxAttrs { unsigned int user:1;/* Requester ID (for MSI for example) */ unsigned int requester_id:16; +/* Invert endianness for this page */ + unsigned int byte_swap:1;/* * The following are target-specific page-table bits. These are not * related to actual memory transactions at all. However, this structure
accel/tcg/cputlb.c +12 -0
@@ -738,6 +738,10 @@ void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr,*/ address |=TLB_RECHECK ; } +if (attrs.byte_swap) { +/* Force the access through the I/O slow path. */ + address |=TLB_MMIO ; + }if (!memory_region_is_ram (section->mr) && !memory_region_is_romd (section->mr)) {/* IO memory case */
@@ -891,6 +895,10 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,bool locked = false;MemTxResult r; +if (iotlbentry->attrs.byte_swap) { + op ^=MO_BSWAP ; + } + section =iotlb_to_section (cpu, iotlbentry->addr, iotlbentry->attrs); mr = section->mr; mr_offset = (iotlbentry->addr &TARGET_PAGE_MASK ) + addr;
@@ -933,6 +941,10 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,bool locked = false;MemTxResult r; +if (iotlbentry->attrs.byte_swap) { + op ^=MO_BSWAP ; + } + section =iotlb_to_section (cpu, iotlbentry->addr, iotlbentry->attrs); mr = section->mr; mr_offset = (iotlbentry->addr &TARGET_PAGE_MASK ) + addr;
Signature · 1 line
2.17.1
PATCH 18/36 target/sparc: Add TLB entry with attributes
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64.
Message-Id: <f8fcc3138570c460ef289a6b34ba7715ba36f99e.1566466906.git.tony.nguyen@bt.com>
--- target/sparc/mmu_helper.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-)
target/sparc/mmu_helper.c +18 -14
@@ -88,7 +88,7 @@ static const int perm_table[2][8] = { };static int get_physical_address (CPUSPARCState *env,hwaddr *physical, -int *prot,int *access_index, +int *prot,int *access_index,MemTxAttrs *attrs,target_ulong address,int rw,int mmu_idx,target_ulong *page_size) {
@@ -219,6 +219,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,target_ulong vaddr;target_ulong page_size;int error_code =0 , prot, access_index; +MemTxAttrs attrs = {};/* * TODO: If we ever need tlb_vaddr_to_host for this target,
@@ -229,7 +230,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,assert (!probe); address &=TARGET_PAGE_MASK ; - error_code =get_physical_address (env, &paddr, &prot, &access_index, + error_code =get_physical_address (env, &paddr, &prot, &access_index, &attrs, address, access_type, mmu_idx, &page_size); vaddr = address;
@@ -490,8 +491,8 @@ static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,return 0 ; } -static int get_physical_address_data (CPUSPARCState *env, -hwaddr *physical,int *prot, +static int get_physical_address_data (CPUSPARCState *env,hwaddr *physical, +int *prot,MemTxAttrs *attrs,target_ulong address,int rw,int mmu_idx) {CPUState *cs =env_cpu (env);
@@ -608,8 +609,8 @@ static int get_physical_address_data(CPUSPARCState *env,return 1 ; } -static int get_physical_address_code (CPUSPARCState *env, -hwaddr *physical,int *prot, +static int get_physical_address_code (CPUSPARCState *env,hwaddr *physical, +int *prot,MemTxAttrs *attrs,target_ulong address,int mmu_idx) {CPUState *cs =env_cpu (env);
@@ -686,7 +687,7 @@ static int get_physical_address_code(CPUSPARCState *env, }static int get_physical_address (CPUSPARCState *env,hwaddr *physical, -int *prot,int *access_index, +int *prot,int *access_index,MemTxAttrs *attrs,target_ulong address,int rw,int mmu_idx,target_ulong *page_size) {
@@ -716,11 +717,11 @@ static int get_physical_address(CPUSPARCState *env, hwaddr *physical, }if (rw ==2 ) { -return get_physical_address_code (env, physical, prot, address, +return get_physical_address_code (env, physical, prot, attrs, address, mmu_idx); }else { -return get_physical_address_data (env, physical, prot, address, rw, - mmu_idx); +return get_physical_address_data (env, physical, prot, attrs, address, + rw, mmu_idx); } }
@@ -734,10 +735,11 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,target_ulong vaddr;hwaddr paddr;target_ulong page_size; +MemTxAttrs attrs = {};int error_code =0 , prot, access_index; address &=TARGET_PAGE_MASK ; - error_code =get_physical_address (env, &paddr, &prot, &access_index, + error_code =get_physical_address (env, &paddr, &prot, &access_index, &attrs, address, access_type, mmu_idx, &page_size);if (likely (error_code ==0 )) {
@@ -747,7 +749,8 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, env->dmmu.mmu_primary_context, env->dmmu.mmu_secondary_context); -tlb_set_page (cs, vaddr, paddr, prot, mmu_idx, page_size); +tlb_set_page_with_attrs (cs, vaddr, paddr, attrs, prot, mmu_idx, + page_size);return true; }if (probe) {
@@ -849,9 +852,10 @@ static int cpu_sparc_get_phys_page(CPUSPARCState *env, hwaddr *phys, {target_ulong page_size;int prot, access_index; +MemTxAttrs attrs = {}; -return get_physical_address (env, phys, &prot, &access_index, addr, rw, - mmu_idx, &page_size); +return get_physical_address (env, phys, &prot, &access_index, &attrs, addr, + rw, mmu_idx, &page_size); }#if defined(TARGET_SPARC64 )
Signature · 1 line
2.17.1
PATCH 19/36 target/sparc: sun4u Invert Endian TTE bit
In reply to Richard HendersonFrom: Tony Nguyen <[email protected]>
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers.
Tested working on OpenBSD.
Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =)
Message-Id: <3c8d5181a584f1b3712d3d8d66801b13cecb4b88.1566466906.git.tony.nguyen@bt.com>
--- target/sparc/cpu.h | 2 ++ target/sparc/mmu_helper.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
target/sparc/cpu.h +2 -0
@@ -275,6 +275,7 @@ enum {#define TTE_VALID_BIT (1ULL << 63)#define TTE_NFO_BIT (1ULL << 60) +#define TTE_IE_BIT (1ULL << 59)#define TTE_USED_BIT (1ULL << 41)#define TTE_LOCKED_BIT (1ULL << 6)#define TTE_SIDEEFFECT_BIT (1ULL << 3)
@@ -291,6 +292,7 @@ enum {#define TTE_IS_VALID (tte) ((tte) & TTE_VALID_BIT)#define TTE_IS_NFO (tte) ((tte) & TTE_NFO_BIT) +#define TTE_IS_IE (tte) ((tte) & TTE_IE_BIT)#define TTE_IS_USED (tte) ((tte) & TTE_USED_BIT)#define TTE_IS_LOCKED (tte) ((tte) & TTE_LOCKED_BIT)#define TTE_IS_SIDEEFFECT (tte) ((tte) & TTE_SIDEEFFECT_BIT)
target/sparc/mmu_helper.c +7 -1
@@ -537,6 +537,10 @@ static int get_physical_address_data(CPUSPARCState *env, hwaddr *physical,if (ultrasparc_tag_match (&env->dtlb[i], address, context, physical)) {int do_fault =0 ; +if (TTE_IS_IE (env->dtlb[i].tte)) { + attrs->byte_swap = true; + } +/* access ok? */ /* multiple bits in SFSR.FT may be set on TT_DFAULT */ if (TTE_IS_PRIV (env->dtlb[i].tte) && is_user) {
@@ -792,7 +796,7 @@ void dump_mmu(CPUSPARCState *env) }if (TTE_IS_VALID (env->dtlb[i].tte)) { qemu_printf("[%02u] VA: %" PRIx64 ", PA: %llx" - ", %s, %s, %s, %s, ctx %" PRId64 " %s\n", + ", %s, %s, %s, %s, ie %s, ctx %" PRId64 " %s\n", i, env->dtlb[i].tag & (uint64_t)~0x1fffULL, TTE_PA(env->dtlb[i].tte),
@@ -801,6 +805,8 @@ void dump_mmu(CPUSPARCState *env)TTE_IS_W_OK (env->dtlb[i].tte) ?"RW" :"RO" ,TTE_IS_LOCKED (env->dtlb[i].tte) ?"locked" :"unlocked" , +TTE_IS_IE (env->dtlb[i].tte) ? +"yes" :"no" , env->dtlb[i].tag & (uint64_t )0x1fffULL ,TTE_IS_GLOBAL (env->dtlb[i].tte) ? "global" : "local");
Signature · 1 line
2.17.1
PATCH 20/36 exec: Move user-only watchpoint stubs inline
In reply to Richard HendersonLet the user-only watchpoint stubs resolve to empty inline functions.
--- include/hw/core/cpu.h | 23 +++++++++++++++++++++++ exec.c | 26 ++------------------------ 2 files changed, 25 insertions(+), 24 deletions(-)
include/hw/core/cpu.h +23 -0
@@ -1070,12 +1070,35 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)return false; } +#ifdef CONFIG_USER_ONLY +static inline int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, +int flags,CPUWatchpoint **watchpoint) +{ +return -ENOSYS ; +} + +static inline int cpu_watchpoint_remove (CPUState *cpu,vaddr addr, +vaddr len,int flags) +{ +return -ENOSYS ; +} + +static inline void cpu_watchpoint_remove_by_ref (CPUState *cpu, +CPUWatchpoint *wp) +{ +} + +static inline void cpu_watchpoint_remove_all (CPUState *cpu,int mask) +{ +} +#else int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len,int flags,CPUWatchpoint **watchpoint);int cpu_watchpoint_remove (CPUState *cpu,vaddr addr,vaddr len,int flags);void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint);void cpu_watchpoint_remove_all (CPUState *cpu,int mask); +#endif /** * cpu_get_address_space:
exec.c +2 -24
@@ -1062,28 +1062,7 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) }#endif -#if defined(CONFIG_USER_ONLY ) -void cpu_watchpoint_remove_all (CPUState *cpu,int mask) - -{ -} - -int cpu_watchpoint_remove (CPUState *cpu,vaddr addr,vaddr len, -int flags) -{ -return -ENOSYS ; -} - -void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint) -{ -} - -int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, -int flags,CPUWatchpoint **watchpoint) -{ -return -ENOSYS ; -} -#else +#ifndef CONFIG_USER_ONLY /* Add a watchpoint. */ int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len,int flags,CPUWatchpoint **watchpoint)
@@ -1173,8 +1152,7 @@ static inline bool cpu_watchpoint_address_matches(CPUWatchpoint *wp,return !(addr > wpend || wp->vaddr > addrend); } - -#endif +#endif /* !CONFIG_USER_ONLY */ /* Add a breakpoint. */ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
Signature · 1 line
2.17.1
PATCH 21/36 exec: Factor out core logic of check_watchpoint()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
We want to perform the same checks in probe_write() to trigger a cpu exit before doing any modifications. We'll have to pass a PC.
Message-Id: <[email protected]> [rth: Use vaddr for len, like other watchpoint functions; Move user-only stub to static inline.]
--- include/hw/core/cpu.h | 7 +++++++ exec.c | 26 ++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-)
include/hw/core/cpu.h +7 -0
@@ -1091,6 +1091,11 @@ static inline void cpu_watchpoint_remove_by_ref(CPUState *cpu,static inline void cpu_watchpoint_remove_all (CPUState *cpu,int mask) { } + +static inline void cpu_check_watchpoint (CPUState *cpu,vaddr addr,vaddr len, +MemTxAttrs atr,int fl,uintptr_t ra) +{ +}#else int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len,int flags,CPUWatchpoint **watchpoint);
@@ -1098,6 +1103,8 @@ int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len, int flags);void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint);void cpu_watchpoint_remove_all (CPUState *cpu,int mask); +void cpu_check_watchpoint (CPUState *cpu,vaddr addr,vaddr len, +MemTxAttrs attrs,int flags,uintptr_t ra);#endif /**
exec.c +18 -8
@@ -2789,11 +2789,10 @@ static const MemoryRegionOps notdirty_mem_ops = { };/* Generate a debug exception if a watchpoint has been hit. */ -static void check_watchpoint (int offset,int len,MemTxAttrs attrs,int flags) +void cpu_check_watchpoint (CPUState *cpu,vaddr addr,vaddr len, +MemTxAttrs attrs,int flags,uintptr_t ra) { -CPUState *cpu = current_cpu;CPUClass *cc =CPU_GET_CLASS (cpu); -target_ulong vaddr;CPUWatchpoint *wp;assert (tcg_enabled ());
@@ -2804,17 +2803,17 @@ static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)cpu_interrupt (cpu,CPU_INTERRUPT_DEBUG );return ; } - vaddr = (cpu->mem_io_vaddr &TARGET_PAGE_MASK ) + offset; - vaddr = cc->adjust_watchpoint_address (cpu, vaddr, len); + + addr = cc->adjust_watchpoint_address (cpu, addr, len); QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { -if (cpu_watchpoint_address_matches (wp, vaddr, len) +if (cpu_watchpoint_address_matches (wp, addr, len) && (wp->flags & flags)) {if (flags ==BP_MEM_READ ) { wp->flags |=BP_WATCHPOINT_HIT_READ ; }else { wp->flags |=BP_WATCHPOINT_HIT_WRITE ; } - wp->hitaddr = vaddr; + wp->hitaddr =MAX (addr, wp->vaddr); wp->hitattrs = attrs;if (!cpu->watchpoint_hit) { if (wp->flags & BP_CPU &&
@@ -2829,11 +2828,14 @@ static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)if (wp->flags &BP_STOP_BEFORE_ACCESS ) { cpu->exception_index =EXCP_DEBUG ;mmap_unlock (); -cpu_loop_exit (cpu); +cpu_loop_exit_restore (cpu, ra); }else {/* Force execution of one insn next time. */ cpu->cflags_next_tb =1 |curr_cflags ();mmap_unlock (); +if (ra) { +cpu_restore_state (cpu, ra, true); + }cpu_loop_exit_noexc (cpu); } }
@@ -2843,6 +2845,14 @@ static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags) } } +static void check_watchpoint (int offset,int len,MemTxAttrs attrs,int flags) +{ +CPUState *cpu = current_cpu; +vaddr addr = (cpu->mem_io_vaddr &TARGET_PAGE_MASK ) + offset; + +cpu_check_watchpoint (cpu, addr, len, attrs, flags,0 ); +} +/* Watchpoint access routines. Watchpoints are inserted using TLB tricks, so these check for a hit then pass through to the normal out-of-line phys routines. */
Signature · 1 line
2.17.1
PATCH 22/36 cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK
In reply to Richard HendersonWe had two different mechanisms to force a recheck of the tlb.
Before TLB_RECHECK was introduced, we had a PAGE_WRITE_INV bit that would immediate set TLB_INVALID_MASK, which automatically means that a second check of the tlb entry fails.
We can use the same mechanism to handle small pages. Conserve TLB_* bits by removing TLB_RECHECK.
--- include/exec/cpu-all.h | 5 +-- accel/tcg/cputlb.c | 86 +++++++++++------------------------------- 2 files changed, 24 insertions(+), 67 deletions(-)
include/exec/cpu-all.h +1 -4
@@ -329,14 +329,11 @@ CPUArchState *cpu_copy(CPUArchState *env);#define TLB_NOTDIRTY (1 << (TARGET_PAGE_BITS - 2))/* Set if TLB entry is an IO callback. */ #define TLB_MMIO (1 << (TARGET_PAGE_BITS - 3)) -/* Set if TLB entry must have MMU lookup repeated for every access */ -#define TLB_RECHECK (1 << (TARGET_PAGE_BITS - 4))/* Use this mask to check interception with an alignment mask * in a TCG backend. */ -#define TLB_FLAGS_MASK (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO \ - | TLB_RECHECK) +#define TLB_FLAGS_MASK (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO)/** * tlb_hit_page: return true if page aligned @addr is a hit against the
accel/tcg/cputlb.c +23 -63
144 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 22/36] cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK
Quoted 32 lines · Richard Henderson
We had two different mechanisms to force a recheck of the tlb.
Before
TLB_RECHECKwas introduced, we had aPAGE_WRITE_INVbit that would immediate setTLB_INVALID_MASK, which automatically means that a second check of the tlb entry fails.We can use the same mechanism to handle small pages. Conserve TLB_* bits by removing
TLB_RECHECK.Reviewed-by David Hildenbrand <[email protected]>Signed-off-by Richard Henderson <[email protected]>---
accel/tcg/cputlb.c +0
-14@@ -1265,27 +1269,6 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,if ((addr & (size -1 )) !=0 ) { goto do_unaligned_access; } - -if (tlb_addr &TLB_RECHECK ) { -/* -* This is a TLB_RECHECK access, where the MMU protection -* covers a smaller range than a target page, and we must -* repeat the MMU check here. This tlb_fill() call might -* longjump out if this access should cause a guest exception. -*/ -tlb_fill (env_cpu (env), addr, size, - access_type, mmu_idx, retaddr); - index =tlb_index (env, mmu_idx, addr); - entry =tlb_entry (env, mmu_idx, addr); - - tlb_addr = code_read ? entry->addr_code : entry->addr_read;
accel/tcg/cputlb.c load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, · line 1274
Quoted 10 lines
accel/tcg/cputlb.c +0
-7- tlb_addr &= ~TLB_RECHECK ; -if (!(tlb_addr & ~TARGET_PAGE_MASK )) { -/* RAM access */ - goto do_aligned_access; - } - } -return io_readx (env, &env_tlb (env)->d[mmu_idx].iotlb[index], mmu_idx, addr, retaddr, access_type, op); }
In the old version of this code, we do the "tlb fill if TLB_RECHECK is set", and then we say "now we've done the refill have we actually got RAM", and we avoid calling io_readx() if that is the case. This is necessary because io_readx() will misbehave if you try to call it on RAM (notably if what we have is notdirty-mem then we need to do the read-from-actual-host-ram because the IO ops backing notdirty-mem are intended for writes only).
With this patch applied, we seem to have lost the handling for if the tlb_fill in a TLB_RECHECK case gives us back some real RAM. (Similarly for store_helper().)
I think this is what's causing Mark Cave-Ayland's Solaris test case to fail.
More generally, I don't really understand why this merging is correct -- "TLB needs a recheck" is not the same thing as "TLB is invalid" and I don't think we can merge the two bits.
thanks
-- PMM
Re: [Qemu-devel] [PATCH 22/36] cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK
Quoted 40 lines · Peter Maydell
Quoted 38 lines · Richard Henderson
We had two different mechanisms to force a recheck of the tlb.
Before
TLB_RECHECKwas introduced, we had aPAGE_WRITE_INVbit that would immediate setTLB_INVALID_MASK, which automatically means that a second check of the tlb entry fails.We can use the same mechanism to handle small pages. Conserve TLB_* bits by removing
TLB_RECHECK.Reviewed-by David Hildenbrand <[email protected]>Signed-off-by Richard Henderson <[email protected]>---
accel/tcg/cputlb.c +0
-20@@ -1265,27 +1269,6 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,if ((addr & (size -1 )) !=0 ) { goto do_unaligned_access; } - -if (tlb_addr &TLB_RECHECK ) { -/* -* This is a TLB_RECHECK access, where the MMU protection -* covers a smaller range than a target page, and we must -* repeat the MMU check here. This tlb_fill() call might -* longjump out if this access should cause a guest exception. -*/ -tlb_fill (env_cpu (env), addr, size, - access_type, mmu_idx, retaddr); - index =tlb_index (env, mmu_idx, addr); - entry =tlb_entry (env, mmu_idx, addr); - - tlb_addr = code_read ? entry->addr_code : entry->addr_read; - tlb_addr &= ~TLB_RECHECK ; -if (!(tlb_addr & ~TARGET_PAGE_MASK )) { -/* RAM access */ - goto do_aligned_access; - } - }
Quoted 8 lines
accel/tcg/cputlb.c load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, · line 1274
Quoted 4 lines
accel/tcg/cputlb.c +0
-1-return io_readx (env, &env_tlb (env)->d[mmu_idx].iotlb[index], mmu_idx, addr, retaddr, access_type, op); }In the old version of this code, we do the "tlb fill if
TLB_RECHECKis set", and then we say "now we've done the refill have we actually got RAM", and we avoid callingio_readx()if that is the case.
I don't think that's the case, since,
if (!victim_tlb_hit(env, mmu_idx, index, tlb_off,
addr & TARGET_PAGE_MASK)) {
tlb_fill(env_cpu(env), addr, size,
access_type, mmu_idx, retaddr);
index = tlb_index(env, mmu_idx, addr);
entry = tlb_entry(env, mmu_idx, addr);
}
tlb_addr = code_read ? entry->addr_code : entry->addr_read;
tlb_addr &= ~TLB_INVALID_MASK;
}the last line here clears INVALID. The only bits that could remain should be WATCHPOINT and MMIO. (NOTDIRTY can only be set for entry->addr_write, not for addr_read/addr_code.)
And for that matter, once we've processed the watchpoint we remove TLB_WATCHPOINT as well, so that we only enter io_readx() if MMIO is set.
Quoted 8 lines
This is necessary because
io_readx()will misbehave if you try to call it on RAM (notably if what we have is notdirty-mem then we need to do the read-from-actual-host-ram because the IO ops backing notdirty-mem are intended for writes only).With this patch applied, we seem to have lost the handling for if the
tlb_fillin aTLB_RECHECKcase gives us back some real RAM. (Similarly forstore_helper().)
Again, I disagree. I think there must be some other explanation.
Quoted 4 lines
More generally, I don't really understand why this merging is correct -- "TLB needs a recheck" is not the same thing as "TLB is invalid" and I don't think we can merge the two bits.
"TLB is invalid" means that we cannot use an existing tlb entry, therefore we must go back to tlb_fill. "TLB needs a recheck" means we must go back to tlb_fill -- exactly the same.
The only odd bit about "TLB is invalid" is that it applies to the *next* lookup. If we have just returned from tlb_fill, then the tlb entry *must* be valid. If it were not valid, then tlb_fill would not return at all.
So, on the paths that use tlb_fill, we clear TLB_INVALID_MASK, indicating that the lookup has just been done.
Which, honestly, ought to have happened with TLB_RECHECK because it was not uncommon to perform two tlb_fill in a row -- the first because of a true tlb miss and the second because the entry supplied by the fill has TLB_RECHECK set.
r~
PATCH 23/36 exec: Factor out cpu_watchpoint_address_matches
In reply to Richard HendersonWe want to move the check for watchpoints from memory_region_section_get_iotlb to tlb_set_page_with_attrs. Isolate the loop over watchpoints to an exported function.
Rename the existing cpu_watchpoint_address_matches to watchpoint_address_matches, since it doesn't actually have a cpu argument.
--- include/hw/core/cpu.h | 7 +++++++ exec.c | 45 ++++++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 16 deletions(-)
include/hw/core/cpu.h +7 -0
@@ -1096,6 +1096,12 @@ static inline void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, MemTxAttrs atr, int fl, uintptr_t ra) { } + +static inline int cpu_watchpoint_address_matches (CPUState *cpu, +vaddr addr,vaddr len) +{ +return 0 ; +}#else int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len,int flags,CPUWatchpoint **watchpoint);
@@ -1105,6 +1111,7 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint);void cpu_watchpoint_remove_all (CPUState *cpu,int mask);void cpu_check_watchpoint (CPUState *cpu,vaddr addr,vaddr len,MemTxAttrs attrs,int flags,uintptr_t ra); +int cpu_watchpoint_address_matches (CPUState *cpu,vaddr addr,vaddr len);#endif /**
exec.c +29 -16
75 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 24/36 cputlb: Fix size operand for tlb_fill on unaligned store
In reply to Richard HendersonWe are currently passing the size of the full write to the tlb_fill for the second page. Instead pass the real size of the write to that page.
This argument is unused within all tlb_fill, except to be logged via tracing, so in practice this makes no difference.
But in a moment we'll need the value of size2 for watchpoints, and if we've computed the value we might as well use it.
--- accel/tcg/cputlb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
accel/tcg/cputlb.c +4 -1
@@ -1504,6 +1504,8 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,uintptr_t index2;CPUTLBEntry *entry2;target_ulong page2, tlb_addr2; +size_t size2; + do_unaligned_access:/* * Ensure the second page is in the TLB. Note that the first page
@@ -1511,13 +1513,14 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,* cannot evict the first. */ page2 = (addr + size) &TARGET_PAGE_MASK ; + size2 = (addr + size) & ~TARGET_PAGE_MASK ; index2 =tlb_index (env, mmu_idx, page2); entry2 =tlb_entry (env, mmu_idx, page2); tlb_addr2 =tlb_addr_write (entry2);if (!tlb_hit_page (tlb_addr2, page2) && !victim_tlb_hit (env, mmu_idx, index2, tlb_off, page2 &TARGET_PAGE_MASK )) { -tlb_fill (env_cpu (env), page2, size,MMU_DATA_STORE , +tlb_fill (env_cpu (env), page2, size2,MMU_DATA_STORE , mmu_idx, retaddr); }
Signature · 1 line
2.17.1
PATCH 25/36 cputlb: Remove double-alignment in store_helper
In reply to Richard HendersonWe have already aligned page2 to the start of the next page. There is no reason to do that a second time.
--- accel/tcg/cputlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
accel/tcg/cputlb.c +1 -2
@@ -1518,8 +1518,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, entry2 =tlb_entry (env, mmu_idx, page2); tlb_addr2 =tlb_addr_write (entry2);if (!tlb_hit_page (tlb_addr2, page2) - && !victim_tlb_hit (env, mmu_idx, index2, tlb_off, - page2 &TARGET_PAGE_MASK )) { + && !victim_tlb_hit (env, mmu_idx, index2, tlb_off, page2)) {tlb_fill (env_cpu (env), page2, size2,MMU_DATA_STORE , mmu_idx, retaddr); }
Signature · 1 line
2.17.1
PATCH 26/36 cputlb: Handle watchpoints via TLB_WATCHPOINT
In reply to Richard HendersonThe raising of exceptions from check_watchpoint, buried inside of the I/O subsystem, is fundamentally broken. We do not have the helper return address with which we can unwind guest state.
Replace PHYS_SECTION_WATCH and io_mem_watch with TLB_WATCHPOINT. Move the call to cpu_check_watchpoint into the cputlb helpers where we do have the helper return address.
This allows watchpoints on RAM to bypass the full i/o access path.
--- include/exec/cpu-all.h | 5 +- accel/tcg/cputlb.c | 89 ++++++++++++++++++++++++++++---- exec.c | 114 +++-------------------------------------- 3 files changed, 90 insertions(+), 118 deletions(-)
include/exec/cpu-all.h +4 -1
@@ -329,11 +329,14 @@ CPUArchState *cpu_copy(CPUArchState *env);#define TLB_NOTDIRTY (1 << (TARGET_PAGE_BITS - 2))/* Set if TLB entry is an IO callback. */ #define TLB_MMIO (1 << (TARGET_PAGE_BITS - 3)) +/* Set if TLB entry contains a watchpoint. */ +#define TLB_WATCHPOINT (1 << (TARGET_PAGE_BITS - 4))/* Use this mask to check interception with an alignment mask * in a TCG backend. */ -#define TLB_FLAGS_MASK (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO) +#define TLB_FLAGS_MASK \ + (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO | TLB_WATCHPOINT)/** * tlb_hit_page: return true if page aligned @addr is a hit against the
accel/tcg/cputlb.c +79 -10
151 lines not on this page · raw message
exec.c +7 -107
163 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 27/36 tcg: Check for watchpoints in probe_write()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Let size > 0 indicate a promise to write to those bytes. Check for write watchpoints in the probed range.
Message-Id: <[email protected]>
--- accel/tcg/cputlb.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
accel/tcg/cputlb.c +13 -2
@@ -1086,13 +1086,24 @@ void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_idx, {uintptr_t index =tlb_index (env, mmu_idx, addr);CPUTLBEntry *entry =tlb_entry (env, mmu_idx, addr); +target_ulong tlb_addr =tlb_addr_write (entry); -if (!tlb_hit (tlb_addr_write (entry), addr)) { -/* TLB entry is for a different page */ +if (unlikely (!tlb_hit (tlb_addr, addr))) {if (!VICTIM_TLB_HIT (addr_write, addr)) {tlb_fill (env_cpu (env), addr, size,MMU_DATA_STORE , mmu_idx, retaddr); +/* TLB resize via tlb_fill may have moved the entry. */ + index =tlb_index (env, mmu_idx, addr); + entry =tlb_entry (env, mmu_idx, addr); } + tlb_addr =tlb_addr_write (entry); + } + +/* Handle watchpoints. */ +if ((tlb_addr &TLB_WATCHPOINT ) && size >0 ) { +cpu_check_watchpoint (env_cpu (env), addr, size, +env_tlb (env)->d[mmu_idx].iotlb[index].attrs, +BP_MEM_WRITE , retaddr); } }
Signature · 1 line
2.17.1
PATCH 28/36 s390x/tcg: Use guest_addr_valid() instead of h2g_valid() in probe_write_access()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
If I'm not completely wrong, we are dealing with guest addresses here and not with host addresses. Use the right check.
Message-Id: <[email protected]>
--- target/s390x/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/mem_helper.c +1 -1
@@ -2616,7 +2616,7 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, uintptr_t ra) {#ifdef CONFIG_USER_ONLY -if (!h2g_valid (addr) || !h2g_valid (addr + len -1 ) || +if (!guest_addr_valid (addr) || !guest_addr_valid (addr + len -1 ) ||page_check_range (addr, len,PAGE_WRITE ) <0 ) {s390_program_interrupt (env,PGM_ADDRESSING ,ILEN_AUTO , ra); }
Signature · 1 line
2.17.1
PATCH 29/36 s390x/tcg: Fix length calculation in probe_write_access()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Hm... how did that "-" slip in (-TAGRET_PAGE_SIZE would be correct). This currently makes us exceed one page in a single probe_write() call, essentially leaving some memory unchecked.
Message-Id: <[email protected]>
--- target/s390x/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/mem_helper.c +1 -1
@@ -2623,7 +2623,7 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,#else /* test the actual access, not just any access to the page due to LAP */ while (len) { -const uint64_t pagelen = -(addr | -TARGET_PAGE_MASK ); +const uint64_t pagelen = -(addr |TARGET_PAGE_MASK );const uint64_t curlen =MIN (pagelen, len);probe_write (env, addr, curlen,cpu_mmu_index (env, false), ra);
Signature · 1 line
2.17.1
PATCH 30/36 tcg: Factor out CONFIG_USER_ONLY probe_write() from s390x code
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Factor it out into common code. Similar to the !CONFIG_USER_ONLY variant, let's not allow to cross page boundaries.
Message-Id: <[email protected]>
--- include/exec/exec-all.h | 4 ++-- accel/tcg/user-exec.c | 14 ++++++++++++++ target/s390x/mem_helper.c | 7 ------- 3 files changed, 16 insertions(+), 9 deletions(-)
include/exec/exec-all.h +2 -2
@@ -260,8 +260,6 @@ void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr,void tlb_set_page (CPUState *cpu,target_ulong vaddr,hwaddr paddr,int prot,int mmu_idx,target_ulong size); -void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr);#else static inline void tlb_init (CPUState *cpu) {
@@ -312,6 +310,8 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu, { }#endif +void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, +uintptr_t retaddr);#define CODE_GEN_ALIGN 16/* must be >= of the size of a icache line */
accel/tcg/user-exec.c +14 -0
@@ -188,6 +188,20 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,g_assert_not_reached (); } +void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, +uintptr_t retaddr) +{ +if (!guest_addr_valid (addr) || +page_check_range (addr, size,PAGE_WRITE ) <0 ) { +CPUState *cpu =env_cpu (env); +CPUClass *cc =CPU_GET_CLASS (cpu); + + cc->tlb_fill (cpu, addr, size,MMU_DATA_STORE ,MMU_USER_IDX , false, + retaddr); +g_assert_not_reached (); + } +} +#if defined(__i386__)#if defined(__NetBSD__)
target/s390x/mem_helper.c +0 -7
@@ -2615,12 +2615,6 @@ uint32_t HELPER(cu42)(CPUS390XState *env, uint32_t r1, uint32_t r2, uint32_t m3)void probe_write_access (CPUS390XState *env,uint64_t addr,uint64_t len,uintptr_t ra) { -#ifdef CONFIG_USER_ONLY -if (!guest_addr_valid (addr) || !guest_addr_valid (addr + len -1 ) || -page_check_range (addr, len,PAGE_WRITE ) <0 ) { -s390_program_interrupt (env,PGM_ADDRESSING ,ILEN_AUTO , ra); - } -#else /* test the actual access, not just any access to the page due to LAP */ while (len) {const uint64_t pagelen = -(addr |TARGET_PAGE_MASK );
@@ -2630,7 +2624,6 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, addr =wrap_address (env, addr + curlen); len -= curlen; } -#endif }void HELPER (probe_write_access )(CPUS390XState *env,uint64_t addr,uint64_t len)
Signature · 1 line
2.17.1
PATCH 31/36 tcg: Enforce single page access in probe_write()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Let's enforce the interface restriction.
Message-Id: <[email protected]>
--- accel/tcg/cputlb.c | 2 ++ accel/tcg/user-exec.c | 2 ++ 2 files changed, 4 insertions(+)
accel/tcg/cputlb.c +2 -0
@@ -1088,6 +1088,8 @@ void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_idx,CPUTLBEntry *entry =tlb_entry (env, mmu_idx, addr);target_ulong tlb_addr =tlb_addr_write (entry); +g_assert (-(addr |TARGET_PAGE_MASK ) >= size); +if (unlikely (!tlb_hit (tlb_addr, addr))) {if (!VICTIM_TLB_HIT (addr_write, addr)) { tlb_fill(env_cpu(env), addr, size, MMU_DATA_STORE,
accel/tcg/user-exec.c +2 -0
@@ -191,6 +191,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx,uintptr_t retaddr) { +g_assert (-(addr |TARGET_PAGE_MASK ) >= size); +if (!guest_addr_valid (addr) ||page_check_range (addr, size,PAGE_WRITE ) <0 ) {CPUState *cpu =env_cpu (env);
Signature · 1 line
2.17.1
PATCH 32/36 mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Let's call it also for CONFIG_USER_ONLY. While at it, add a FIXME and get rid of one local variable.
MIPS code probably needs a bigger refactoring in regards of ensure_writable_pages(), similar to s390x, so for example, watchpoints can be handled reliably later. The actually accessed addresses should be probed only, not full pages.
Message-Id: <[email protected]>
--- target/mips/op_helper.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
target/mips/op_helper.c +3 -5
@@ -4537,16 +4537,14 @@ static inline void ensure_writable_pages(CPUMIPSState *env,int mmu_idx, uintptr_t retaddr) { -#if !defined(CONFIG_USER_ONLY ) -target_ulong page_addr; + /* FIXME: Probe the actual accesses (pass and use a size) */ if (unlikely(MSA_PAGESPAN(addr))) {/* first page */ probe_write(env, addr, 0, mmu_idx, retaddr);/* second page */ - page_addr = (addr &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; -probe_write (env, page_addr,0 , mmu_idx, retaddr); + addr = (addr &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; +probe_write (env, addr,0 , mmu_idx, retaddr); } -#endif } void helper_msa_st_b(CPUMIPSState *env, uint32_t wd,
Signature · 1 line
2.17.1
PATCH 33/36 hppa/tcg: Call probe_write() also for CONFIG_USER_ONLY
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
We now have a variant for CONFIG_USER_ONLY as well.
Message-Id: <[email protected]>
--- target/hppa/op_helper.c | 2 -- 1 file changed, 2 deletions(-)
target/hppa/op_helper.c +0 -2
@@ -137,9 +137,7 @@ static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val,default :/* Nothing is stored, but protection is checked and the cacheline is marked dirty. */ -#ifndef CONFIG_USER_ONLY probe_write (env, addr,0 ,cpu_mmu_index (env,0 ), ra); -#endif break ; } }
Signature · 1 line
2.17.1
PATCH 34/36 s390x/tcg: Pass a size to probe_write() in do_csst()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
... and also call it for CONFIG_USER_ONLY. This function probably will also need some refactoring in regards to probing, however, we'll have to come back to that later, once cleaning up the other mem helpers.
The alignment check always makes sure that the write access falls into a single page.
Message-Id: <[email protected]>
--- target/s390x/mem_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
target/s390x/mem_helper.c +1 -3
@@ -1443,9 +1443,7 @@ static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1, }/* Sanity check writability of the store address. */ -#ifndef CONFIG_USER_ONLY -probe_write (env, a2,0 , mem_idx, ra); -#endif +probe_write (env, a2,1 << sc, mem_idx, ra);/* * Note that the compare-and-swap is atomic, and the store is atomic,
Signature · 1 line
2.17.1
PATCH 35/36 tcg: Make probe_write() return a pointer to the host page
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
... similar to tlb_vaddr_to_host(); however, allow access to the host page except when TLB_NOTDIRTY or TLB_MMIO is set.
Message-Id: <[email protected]>
--- include/exec/exec-all.h | 4 ++-- accel/tcg/cputlb.c | 21 ++++++++++++++++----- accel/tcg/user-exec.c | 6 ++++-- 3 files changed, 22 insertions(+), 9 deletions(-)
include/exec/exec-all.h +2 -2
@@ -310,8 +310,8 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu, { }#endif -void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr); +void *probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, +uintptr_t retaddr);#define CODE_GEN_ALIGN 16/* must be >= of the size of a icache line */
accel/tcg/cputlb.c +16 -5
@@ -1078,11 +1078,11 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr)/* Probe for whether the specified guest write access is permitted. * If it is not permitted then an exception will be taken in the same * way as if this were a real write access (and we will not return). -* Otherwise the function will return, and there will be a valid -* entry in the TLB for this access. +* If the size is 0 or the page requires I/O access, returns NULL; otherwise, +* returns the address of the host page similar to tlb_vaddr_to_host(). */ -void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr) +void *probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, +uintptr_t retaddr) {uintptr_t index =tlb_index (env, mmu_idx, addr);CPUTLBEntry *entry =tlb_entry (env, mmu_idx, addr);
@@ -1101,12 +1101,23 @@ void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_idx, tlb_addr =tlb_addr_write (entry); } +if (!size) { +return NULL ; + } +/* Handle watchpoints. */ -if ((tlb_addr &TLB_WATCHPOINT ) && size >0 ) { +if (tlb_addr &TLB_WATCHPOINT ) {cpu_check_watchpoint (env_cpu (env), addr, size,env_tlb (env)->d[mmu_idx].iotlb[index].attrs,BP_MEM_WRITE , retaddr); } + +if (tlb_addr & (TLB_NOTDIRTY |TLB_MMIO )) { +/* I/O access */ +return NULL ; + } + +return (void *)((uintptr_t )addr + entry->addend); } void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
accel/tcg/user-exec.c +4 -2
@@ -188,8 +188,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,g_assert_not_reached (); } -void probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr) +void *probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, +uintptr_t retaddr) {g_assert (-(addr |TARGET_PAGE_MASK ) >= size);
@@ -202,6 +202,8 @@ void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_idx, retaddr);g_assert_not_reached (); } + +return size ?g2h (addr) :NULL ; }#if defined(__i386__)
Signature · 1 line
2.17.1
PATCH 36/36 tcg: Factor out probe_write() logic into probe_access()
In reply to Richard HendersonFrom: David Hildenbrand <[email protected]>
Let's also allow to probe other access types.
Message-Id: <[email protected]>
--- include/exec/exec-all.h | 10 ++++++++-- accel/tcg/cputlb.c | 43 ++++++++++++++++++++++++++++++----------- accel/tcg/user-exec.c | 26 +++++++++++++++++++------ 3 files changed, 60 insertions(+), 19 deletions(-)
include/exec/exec-all.h +8 -2
@@ -310,8 +310,14 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu, { }#endif -void *probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr); +void *probe_access (CPUArchState *env,target_ulong addr,int size, +MMUAccessType access_type,int mmu_idx,uintptr_t retaddr); + +static inline void *probe_write (CPUArchState *env,target_ulong addr,int size, +int mmu_idx,uintptr_t retaddr) +{ +return probe_access (env, addr, size,MMU_DATA_STORE , mmu_idx, retaddr); +}#define CODE_GEN_ALIGN 16/* must be >= of the size of a icache line */
accel/tcg/cputlb.c +32 -11
69 lines not on this page · raw message
accel/tcg/user-exec.c +20 -6
@@ -188,17 +188,31 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,g_assert_not_reached (); } -void *probe_write (CPUArchState *env,target_ulong addr,int size,int mmu_idx, -uintptr_t retaddr) +void *probe_access (CPUArchState *env,target_ulong addr,int size, +MMUAccessType access_type,int mmu_idx,uintptr_t retaddr) { +int flags; +g_assert (-(addr |TARGET_PAGE_MASK ) >= size); -if (!guest_addr_valid (addr) || -page_check_range (addr, size,PAGE_WRITE ) <0 ) { +switch (access_type) { +case MMU_DATA_STORE : + flags =PAGE_WRITE ; +break ; +case MMU_DATA_LOAD : + flags =PAGE_READ ; +break ; +case MMU_INST_FETCH : + flags =PAGE_EXEC ; +break ; +default : +g_assert_not_reached (); + } + +if (!guest_addr_valid (addr) ||page_check_range (addr, size, flags) <0 ) {CPUState *cpu =env_cpu (env);CPUClass *cc =CPU_GET_CLASS (cpu); - - cc->tlb_fill (cpu, addr, size,MMU_DATA_STORE ,MMU_USER_IDX , false, + cc->tlb_fill (cpu, addr, size, access_type,MMU_USER_IDX , false, retaddr);g_assert_not_reached (); }
Signature · 1 line
2.17.1
Quoted 111 lines · Richard Henderson
The following changes since commit
fec105c2abda8567ec15230429c41429b5ee307c:Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100)
are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20190903
for you to fetch changes up to
c25c283df0f08582df29f1d5d7be1516b851532d:tcg: Factor out
probe_write()logic intoprobe_access()(2019-09-03 08:34:18 -0700)----------------------------------------------------------------
Allow page table bit to swap endianness. Reorganize watchpoints out of i/o path. Return host address fromprobe_write/probe_access.----------------------------------------------------------------
David Hildenbrand (11):
exec: Factor out core logic ofcheck_watchpoint()
tcg: Check for watchpoints inprobe_write()
s390x/tcg: Useguest_addr_valid()instead ofh2g_valid()inprobe_write_access()s390x/tcg: Fix length calculation inprobe_write_access()
tcg: Factor outCONFIG_USER_ONLYprobe_write()from s390x code
tcg: Enforce single page access inprobe_write()
mips/tcg: Callprobe_write()forCONFIG_USER_ONLYas well hppa/tcg: Callprobe_write()also forCONFIG_USER_ONLY
s390x/tcg: Pass a size toprobe_write()indo_csst()
tcg: Makeprobe_write()return a pointer to the host page
tcg: Factor outprobe_write()logic intoprobe_access()Richard Henderson (6):
exec: Move user-only watchpoint stubs inline
cputlb: FoldTLB_RECHECKintoTLB_INVALID_MASK
exec: Factor outcpu_watchpoint_address_matches
cputlb: Fix size operand fortlb_fillon unaligned store
cputlb: Remove double-alignment instore_helper
cputlb: Handle watchpoints viaTLB_WATCHPOINTTony Nguyen (19):
tcg: TCGMemOp is now accelerator independent MemOp
memory: Introducesize_memop
target/mips: Access MemoryRegion with MemOp hw/s390x: Access MemoryRegion with MemOp hw/intc/armv7m_nic: Access MemoryRegion with MemOp hw/virtio: Access MemoryRegion with MemOp hw/vfio: Access MemoryRegion with MemOp
exec: Access MemoryRegion with MemOp
cputlb: Access MemoryRegion with MemOp
memory: Access MemoryRegion with MemOp hw/s390x: Hard code size with MO_{8|16|32|64} target/mips: Hard code size with MO_{8|16|32|64}
exec: Hard code size with MO_{8|16|32|64}
memory: Access MemoryRegion with endianness
cputlb: Replace size and endian operands for MemOp
memory: Single byte swap along the I/O path
cputlb: Byte swap memory transaction attribute target/sparc: Add TLB entry with attributes target/sparc: sun4u Invert Endian TTE bitinclude/exec/cpu-all.h | 8 +- include/exec/exec-all.h | 10 +- include/exec/memattrs.h | 2 + include/exec/memop.h | 134 +++++++++++ include/exec/memory.h | 12 +- include/hw/core/cpu.h | 37 +++ target/arm/translate-a64.h | 2 +- target/arm/translate.h | 2 +- target/sparc/cpu.h | 2 + tcg/tcg-op.h | 80 +++--- tcg/tcg.h | 101 +------- trace/mem-internal.h | 4 +- trace/mem.h | 4 +- accel/tcg/cputlb.c | 414 ++++++++++++++++++-------------- accel/tcg/user-exec.c | 32 +++ exec.c | 177 +++----------- hw/intc/armv7m_nvic.c | 13 +- hw/s390x/s390-pci-inst.c | 11 +- hw/vfio/pci-quirks.c | 7 +- hw/virtio/virtio-pci.c | 15 +- memory.c | 58 +++-- memory_ldst.inc.c | 81 ++----- target/alpha/translate.c | 2 +- target/arm/translate-a64.c | 48 ++-- target/arm/translate-sve.c | 2 +- target/arm/translate.c | 32 +-- target/hppa/op_helper.c | 2 - target/hppa/translate.c | 14 +- target/i386/translate.c | 132 +++++----- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 4 +- target/mips/op_helper.c | 13 +- target/mips/translate.c | 8 +- target/openrisc/translate.c | 4 +- target/ppc/translate.c | 12 +- target/riscv/insn_trans/trans_rva.inc.c | 8 +- target/riscv/insn_trans/trans_rvi.inc.c | 4 +- target/s390x/mem_helper.c | 13 +- target/s390x/translate.c | 6 +- target/s390x/translate_vx.inc.c | 10 +- target/sparc/mmu_helper.c | 40 +-- target/sparc/translate.c | 14 +- target/tilegx/translate.c | 10 +- target/tricore/translate.c | 8 +- tcg/aarch64/tcg-target.inc.c | 26 +- tcg/arm/tcg-target.inc.c | 26 +- tcg/i386/tcg-target.inc.c | 24 +- tcg/mips/tcg-target.inc.c | 16 +- tcg/optimize.c | 2 +- tcg/ppc/tcg-target.inc.c | 12 +- tcg/riscv/tcg-target.inc.c | 20 +-
Quoted 8 lines
tcg/s390/tcg-target.inc.c | 14 +- tcg/sparc/tcg-target.inc.c | 6 +- tcg/tcg-op.c | 38 +-- tcg/tcg.c | 2 +- MAINTAINERS | 1 + tcg/README | 2 +- 57 files changed, 918 insertions(+), 865 deletions(-) create mode 100644 include/exec/memop.h
Is this a pull request rather than just a queue update? I'm just wondering if I should wait for this to get merged first before I start testing the do_transaction_failed hook patches?
ATB,
Mark.
Quoted 15 lines · Mark Cave-Ayland
Quoted 12 lines · Richard Henderson
The following changes since commit
fec105c2abda8567ec15230429c41429b5ee307c:Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100)
are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20190903
for you to fetch changes up to
c25c283df0f08582df29f1d5d7be1516b851532d:tcg: Factor out
probe_write()logic intoprobe_access()(2019-09-03 08:34:18 -0700)
Quoted 8 lines
Quoted 4 lines
----------------------------------------------------------------
Allow page table bit to swap endianness. Reorganize watchpoints out of i/o path. Return host address fromprobe_write/probe_access.Is this a pull request rather than just a queue update? I'm just wondering if I should wait for this to get merged first before I start testing the
do_transaction_failedhook patches?
It's a pull -- Richard told me on irc that it was just an error in the subject line.
thanks
-- PMM
"PATCH" -> "PULL" in subject :)
I wonder if Peter's script works too, I guess it does.
Quoted 127 lines · Richard Henderson
The following changes since commit
fec105c2abda8567ec15230429c41429b5ee307c:Merge remote-tracking branch
'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100)are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20190903
for you to fetch changes up to
c25c283df0f08582df29f1d5d7be1516b851532d:tcg: Factor out
probe_write()logic intoprobe_access()(2019-09-03
08:34:18 -0700)----------------------------------------------------------------
Allow page table bit to swap endianness. Reorganize watchpoints out of i/o path. Return host address fromprobe_write/probe_access.----------------------------------------------------------------
David Hildenbrand (11):
exec: Factor out core logic ofcheck_watchpoint()
tcg: Check for watchpoints inprobe_write()s390x/tcg: Useguest_addr_valid()instead ofh2g_valid()inprobe_write_access()
s390x/tcg: Fix length calculation inprobe_write_access()
tcg: Factor outCONFIG_USER_ONLYprobe_write()from s390x code
tcg: Enforce single page access inprobe_write()mips/tcg: Callprobe_write()forCONFIG_USER_ONLYas well hppa/tcg: Callprobe_write()also forCONFIG_USER_ONLYs390x/tcg: Pass a size toprobe_write()indo_csst()
tcg: Makeprobe_write()return a pointer to the host page
tcg: Factor outprobe_write()logic intoprobe_access()Richard Henderson (6):
exec: Move user-only watchpoint stubs inline
cputlb: FoldTLB_RECHECKintoTLB_INVALID_MASK
exec: Factor outcpu_watchpoint_address_matches
cputlb: Fix size operand fortlb_fillon unaligned store
cputlb: Remove double-alignment instore_helper
cputlb: Handle watchpoints viaTLB_WATCHPOINTTony Nguyen (19):
tcg: TCGMemOp is now accelerator independent MemOp
memory: Introducesize_memop
target/mips: Access MemoryRegion with MemOp hw/s390x: Access MemoryRegion with MemOp hw/intc/armv7m_nic: Access MemoryRegion with MemOp hw/virtio: Access MemoryRegion with MemOp hw/vfio: Access MemoryRegion with MemOp
exec: Access MemoryRegion with MemOp
cputlb: Access MemoryRegion with MemOp
memory: Access MemoryRegion with MemOp hw/s390x: Hard code size with MO_{8|16|32|64} target/mips: Hard code size with MO_{8|16|32|64}
exec: Hard code size with MO_{8|16|32|64}
memory: Access MemoryRegion with endianness
cputlb: Replace size and endian operands for MemOp
memory: Single byte swap along the I/O path
cputlb: Byte swap memory transaction attribute target/sparc: Add TLB entry with attributes target/sparc: sun4u Invert Endian TTE bitinclude/exec/cpu-all.h | 8 +- include/exec/exec-all.h | 10 +- include/exec/memattrs.h | 2 + include/exec/memop.h | 134 +++++++++++ include/exec/memory.h | 12 +- include/hw/core/cpu.h | 37 +++ target/arm/translate-a64.h | 2 +- target/arm/translate.h | 2 +- target/sparc/cpu.h | 2 + tcg/tcg-op.h | 80 +++--- tcg/tcg.h | 101 +------- trace/mem-internal.h | 4 +- trace/mem.h | 4 +- accel/tcg/cputlb.c | 414 ++++++++++++++++++-------------- accel/tcg/user-exec.c | 32 +++ exec.c | 177 +++----------- hw/intc/armv7m_nvic.c | 13 +- hw/s390x/s390-pci-inst.c | 11 +- hw/vfio/pci-quirks.c | 7 +- hw/virtio/virtio-pci.c | 15 +- memory.c | 58 +++-- memory_ldst.inc.c | 81 ++----- target/alpha/translate.c | 2 +- target/arm/translate-a64.c | 48 ++-- target/arm/translate-sve.c | 2 +- target/arm/translate.c | 32 +-- target/hppa/op_helper.c | 2 - target/hppa/translate.c | 14 +- target/i386/translate.c | 132 +++++----- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 4 +- target/mips/op_helper.c | 13 +- target/mips/translate.c | 8 +- target/openrisc/translate.c | 4 +- target/ppc/translate.c | 12 +- target/riscv/insn_trans/trans_rva.inc.c | 8 +- target/riscv/insn_trans/trans_rvi.inc.c | 4 +- target/s390x/mem_helper.c | 13 +- target/s390x/translate.c | 6 +- target/s390x/translate_vx.inc.c | 10 +- target/sparc/mmu_helper.c | 40 +-- target/sparc/translate.c | 14 +- target/tilegx/translate.c | 10 +- target/tricore/translate.c | 8 +- tcg/aarch64/tcg-target.inc.c | 26 +- tcg/arm/tcg-target.inc.c | 26 +- tcg/i386/tcg-target.inc.c | 24 +- tcg/mips/tcg-target.inc.c | 16 +- tcg/optimize.c | 2 +- tcg/ppc/tcg-target.inc.c | 12 +- tcg/riscv/tcg-target.inc.c | 20 +- tcg/s390/tcg-target.inc.c | 14 +- tcg/sparc/tcg-target.inc.c | 6 +- tcg/tcg-op.c | 38 +-- tcg/tcg.c | 2 +- MAINTAINERS | 1 + tcg/README | 2 +- 57 files changed, 918 insertions(+), 865 deletions(-) create mode 100644 include/exec/memop.h
Peter Maydell
AppliedQuoted 9 lines · Richard Henderson
The following changes since commit
fec105c2abda8567ec15230429c41429b5ee307c:Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging (2019-09-03 14:03:15 +0100)
are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20190903
Quoted 9 lines
for you to fetch changes up to
c25c283df0f08582df29f1d5d7be1516b851532d:tcg: Factor out
probe_write()logic intoprobe_access()(2019-09-03 08:34:18 -0700)----------------------------------------------------------------
Allow page table bit to swap endianness. Reorganize watchpoints out of i/o path. Return host address fromprobe_write/probe_access.
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.
-- PMM