[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/35] target-alpha: Implement TLB flush primitives.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 27/35] target-alpha: Implement TLB flush primitives. |
Date: |
Mon, 9 May 2011 14:34:41 -0700 |
Expose these via MTPR, more or less like the real HW does.
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/helper.h | 3 +++
target-alpha/op_helper.c | 11 ++++++++++-
target-alpha/translate.c | 32 +++++++++++++++++++++-----------
3 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/target-alpha/helper.h b/target-alpha/helper.h
index 9ffc372..2dec57e 100644
--- a/target-alpha/helper.h
+++ b/target-alpha/helper.h
@@ -110,6 +110,9 @@ DEF_HELPER_2(stl_phys, void, i64, i64)
DEF_HELPER_2(stq_phys, void, i64, i64)
DEF_HELPER_2(stl_c_phys, i64, i64, i64)
DEF_HELPER_2(stq_c_phys, i64, i64, i64)
+
+DEF_HELPER_FLAGS_0(tbia, TCG_CALL_CONST, void)
+DEF_HELPER_FLAGS_1(tbis, TCG_CALL_CONST, void, i64)
#endif
#include "def-helper.h"
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index 36b8289..d332719 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -1205,6 +1205,16 @@ void helper_hw_ret (uint64_t a)
swap_shadow_regs(env);
}
}
+
+void helper_tbia(void)
+{
+ tlb_flush(env, 1);
+}
+
+void helper_tbis(uint64_t p)
+{
+ tlb_flush_page(env, p);
+}
#endif
/*****************************************************************************/
@@ -1335,5 +1345,4 @@ void tlb_fill (target_ulong addr, int is_write, int
mmu_idx, void *retaddr)
}
env = saved_env;
}
-
#endif
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 8b9dded..8107d19 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1624,7 +1624,6 @@ static void gen_mfpr(int ra, int regno)
static void gen_mtpr(int rb, int regno)
{
TCGv tmp;
- int data;
if (rb == 31) {
tmp = tcg_const_i64(0);
@@ -1632,16 +1631,27 @@ static void gen_mtpr(int rb, int regno)
tmp = cpu_ir[rb];
}
- /* The basic registers are data only, and unknown registers
- are read-zero, write-ignore. */
- data = cpu_pr_data(regno);
- if (data != 0) {
- if (data & PR_BYTE) {
- tcg_gen_st8_i64(tmp, cpu_env, data & ~PR_BYTE);
- } else if (data & PR_LONG) {
- tcg_gen_st32_i64(tmp, cpu_env, data & ~PR_LONG);
- } else {
- tcg_gen_st_i64(tmp, cpu_env, data);
+ /* These two register numbers perform a TLB cache flush. Thankfully we
+ can only do this inside PALmode, which means that the current basic
+ block cannot be affected by the change in mappings. */
+ if (regno == 255) {
+ /* TBIA */
+ gen_helper_tbia();
+ } else if (regno == 254) {
+ /* TBIS */
+ gen_helper_tbis(tmp);
+ } else {
+ /* The basic registers are data only, and unknown registers
+ are read-zero, write-ignore. */
+ int data = cpu_pr_data(regno);
+ if (data != 0) {
+ if (data & PR_BYTE) {
+ tcg_gen_st8_i64(tmp, cpu_env, data & ~PR_BYTE);
+ } else if (data & PR_LONG) {
+ tcg_gen_st32_i64(tmp, cpu_env, data & ~PR_LONG);
+ } else {
+ tcg_gen_st_i64(tmp, cpu_env, data);
+ }
}
}
--
1.7.4.4
- [Qemu-devel] [PATCH 17/35] target-alpha: Add various symbolic constants., (continued)
- [Qemu-devel] [PATCH 17/35] target-alpha: Add various symbolic constants., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 18/35] target-alpha: Use kernel mmu_idx for pal_mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 20/35] target-alpha: Disable interrupts properly., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 21/35] target-alpha: Implement more CALL_PAL values inline., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 19/35] target-alpha: All ISA checks to use TB->FLAGS., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 22/35] target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 23/35] target-alpha: Remap PIO space for 43-bit KSEG for EV6., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 24/35] target-alpha: Trap for unassigned and unaligned addresses., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 25/35] target-alpha: Include the PCC_OFS in the RPCC return value., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 26/35] target-alpha: Use a fixed frequency for the RPCC in system mode., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 27/35] target-alpha: Implement TLB flush primitives.,
Richard Henderson <=
- [Qemu-devel] [PATCH 30/35] target-alpha: Implement WAIT IPR., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 33/35] target-alpha: Properly select the VGA controler to use., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 29/35] target-alpha: Add CLIPPER emulation., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 34/35] target-alpha: Enable PCI IDE, Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 35/35] target-alpha: Add ps2 keyboard., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 31/35] target-alpha: Implement HALT IPR., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 32/35] target-alpha: Add high-resolution access to wall clock and an alarm., Richard Henderson, 2011/05/09
- [Qemu-devel] [PATCH 28/35] target-alpha: Add custom PALcode image for CLIPPER emulation., Richard Henderson, 2011/05/09
- Re: [Qemu-devel] [PATCH 00/35] Alpha system emulation, v4, Paul Brook, 2011/05/10