[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 21/57] tcg/i386: Use full load/store helpers in user-only mode
From: |
Richard Henderson |
Subject: |
[PATCH v3 21/57] tcg/i386: Use full load/store helpers in user-only mode |
Date: |
Tue, 25 Apr 2023 20:31:10 +0100 |
Instead of using helper_unaligned_{ld,st}, use the full load/store helpers.
This will allow the fast path to increase alignment to implement atomicity
while not immediately raising an alignment exception.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/i386/tcg-target.c.inc | 48 ++-------------------------------------
1 file changed, 2 insertions(+), 46 deletions(-)
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 696c656f3b..32ef9ad4e4 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -1778,7 +1778,6 @@ typedef struct {
int seg;
} HostAddress;
-#if defined(CONFIG_SOFTMMU)
/*
* Because i686 has no register parameters and because x86_64 has xchg
* to handle addr/data register overlap, we have placed all input arguments
@@ -1846,51 +1845,8 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s,
TCGLabelQemuLdst *l)
tcg_out_jmp(s, l->raddr);
return true;
}
-#else
-static bool tcg_out_fail_alignment(TCGContext *s, TCGLabelQemuLdst *l)
-{
- /* resolve label address */
- tcg_patch32(l->label_ptr[0], s->code_ptr - l->label_ptr[0] - 4);
-
- if (TCG_TARGET_REG_BITS == 32) {
- int ofs = 0;
-
- tcg_out_st(s, TCG_TYPE_PTR, TCG_AREG0, TCG_REG_ESP, ofs);
- ofs += 4;
-
- tcg_out_st(s, TCG_TYPE_I32, l->addrlo_reg, TCG_REG_ESP, ofs);
- ofs += 4;
- if (TARGET_LONG_BITS == 64) {
- tcg_out_st(s, TCG_TYPE_I32, l->addrhi_reg, TCG_REG_ESP, ofs);
- ofs += 4;
- }
-
- tcg_out_pushi(s, (uintptr_t)l->raddr);
- } else {
- tcg_out_mov(s, TCG_TYPE_TL, tcg_target_call_iarg_regs[1],
- l->addrlo_reg);
- tcg_out_mov(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[0], TCG_AREG0);
-
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_RAX, (uintptr_t)l->raddr);
- tcg_out_push(s, TCG_REG_RAX);
- }
-
- /* "Tail call" to the helper, with the return address back inline. */
- tcg_out_jmp(s, (const void *)(l->is_ld ? helper_unaligned_ld
- : helper_unaligned_st));
- return true;
-}
-
-static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l)
-{
- return tcg_out_fail_alignment(s, l);
-}
-
-static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l)
-{
- return tcg_out_fail_alignment(s, l);
-}
+#ifndef CONFIG_SOFTMMU
static HostAddress x86_guest_base = {
.index = -1
};
@@ -1922,7 +1878,7 @@ static inline int setup_guest_base_seg(void)
return 0;
}
#endif /* setup_guest_base_seg */
-#endif /* SOFTMMU */
+#endif /* !SOFTMMU */
/*
* For softmmu, perform the TLB load and compare.
--
2.34.1
- [PATCH v3 12/57] tcg: Add 128-bit guest memory primitives, (continued)
- [PATCH v3 12/57] tcg: Add 128-bit guest memory primitives, Richard Henderson, 2023/04/25
- [PATCH v3 13/57] meson: Detect atomic128 support with optimization, Richard Henderson, 2023/04/25
- [PATCH v3 14/57] tcg/i386: Add have_atomic16, Richard Henderson, 2023/04/25
- [PATCH v3 15/57] accel/tcg: Use have_atomic16 in ldst_atomicity.c.inc, Richard Henderson, 2023/04/25
- [PATCH v3 16/57] accel/tcg: Add aarch64 specific support in ldst_atomicity, Richard Henderson, 2023/04/25
- [PATCH v3 18/57] tcg/aarch64: Detect have_lse, have_lse2 for darwin, Richard Henderson, 2023/04/25
- [PATCH v3 17/57] tcg/aarch64: Detect have_lse, have_lse2 for linux, Richard Henderson, 2023/04/25
- [PATCH v3 19/57] accel/tcg: Add have_lse2 support in ldst_atomicity, Richard Henderson, 2023/04/25
- [PATCH v3 20/57] tcg: Introduce TCG_OPF_TYPE_MASK, Richard Henderson, 2023/04/25
- [PATCH v3 22/57] tcg/aarch64: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 21/57] tcg/i386: Use full load/store helpers in user-only mode,
Richard Henderson <=
- [PATCH v3 23/57] tcg/ppc: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 24/57] tcg/loongarch64: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 25/57] tcg/riscv: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 27/57] tcg/arm: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 26/57] tcg/arm: Adjust constraints on qemu_ld/st, Richard Henderson, 2023/04/25
- [PATCH v3 29/57] tcg/s390x: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 33/57] tcg/sparc64: Split out tcg_out_movi_s32, Richard Henderson, 2023/04/25
- [PATCH v3 28/57] tcg/mips: Use full load/store helpers in user-only mode, Richard Henderson, 2023/04/25
- [PATCH v3 30/57] tcg/sparc64: Allocate %g2 as a third temporary, Richard Henderson, 2023/04/25
- [PATCH v3 31/57] tcg/sparc64: Rename tcg_out_movi_imm13 to tcg_out_movi_s13, Richard Henderson, 2023/04/25