[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 20/38] tcg/i386: implement fences
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC 20/38] tcg/i386: implement fences |
Date: |
Sun, 23 Aug 2015 20:23:49 -0400 |
Signed-off-by: Emilio G. Cota <address@hidden>
---
tcg/i386/tcg-target.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
index 887f22f..6600c45 100644
--- a/tcg/i386/tcg-target.c
+++ b/tcg/i386/tcg-target.c
@@ -1123,6 +1123,13 @@ static void tcg_out_jmp(TCGContext *s, tcg_insn_unit
*dest)
tcg_out_branch(s, 0, dest);
}
+static inline void tcg_out_fence(TCGContext *s, uint8_t op)
+{
+ tcg_out8(s, 0x0f);
+ tcg_out8(s, 0xae);
+ tcg_out8(s, op);
+}
+
#if defined(CONFIG_SOFTMMU)
/* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
* int mmu_idx, uintptr_t ra)
@@ -2088,6 +2095,16 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
}
break;
+ case INDEX_op_fence_load:
+ tcg_out_fence(s, 0xe8);
+ break;
+ case INDEX_op_fence_full:
+ tcg_out_fence(s, 0xf0);
+ break;
+ case INDEX_op_fence_store:
+ tcg_out_fence(s, 0xf8);
+ break;
+
case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */
case INDEX_op_mov_i64:
case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */
@@ -2226,6 +2243,9 @@ static const TCGTargetOpDef x86_op_defs[] = {
{ INDEX_op_qemu_ld_i64, { "r", "r", "L", "L" } },
{ INDEX_op_qemu_st_i64, { "L", "L", "L", "L" } },
#endif
+ { INDEX_op_fence_load, { } },
+ { INDEX_op_fence_store, { } },
+ { INDEX_op_fence_full, { } },
{ -1 },
};
--
1.9.1
- Re: [Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions, (continued)
[Qemu-devel] [RFC 11/38] qemu-thread: handle spurious futex_wait wakeups, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 13/38] cputlb: add physical address to CPUTLBEntry, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 14/38] softmmu: add helpers to get ld/st physical addresses, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 17/38] aie: add target helpers, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 15/38] radix-tree: add generic lockless radix tree module, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 16/38] aie: add module for Atomic Instruction Emulation, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 20/38] tcg/i386: implement fences,
Emilio G. Cota <=
[Qemu-devel] [RFC 29/38] tcg: export have_tb_lock, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 23/38] cpu-exec: grab iothread lock during interrupt handling, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 24/38] cpu-exec: reset mmap_lock after exiting the CPU loop, Emilio G. Cota, 2015/08/23