[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 7/7] target/mips: Check ELPA flag only in some ca
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PATCH v5 7/7] target/mips: Check ELPA flag only in some cases of MFHC0 and MTHC0 |
Date: |
Mon, 9 Jul 2018 13:57:43 +0200 |
From: Yongbok Kim <address@hidden>
MFHC0 and MTHC0 used to handle EntryLo0 and EntryLo1 registers only,
and placing ELPA flag checks before switch statement were technically
correct. However, after adding handling more registers, these checks
should be moved to act only in cases of handling EntryLo0 and
EntryLo1.
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Aleksandar Markovic <address@hidden>
---
target/mips/translate.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 9871182..de0d55b 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -4884,12 +4884,11 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, int
reg, int sel)
{
const char *rn = "invalid";
- CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
-
switch (reg) {
case 2:
switch (sel) {
case 0:
+ CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
gen_mfhc0_entrylo(arg, offsetof(CPUMIPSState, CP0_EntryLo0));
rn = "EntryLo0";
break;
@@ -4900,6 +4899,7 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, int
reg, int sel)
case 3:
switch (sel) {
case 0:
+ CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
gen_mfhc0_entrylo(arg, offsetof(CPUMIPSState, CP0_EntryLo1));
rn = "EntryLo1";
break;
@@ -4952,12 +4952,11 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int
reg, int sel)
const char *rn = "invalid";
uint64_t mask = ctx->PAMask >> 36;
- CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
-
switch (reg) {
case 2:
switch (sel) {
case 0:
+ CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
tcg_gen_andi_tl(arg, arg, mask);
gen_mthc0_entrylo(arg, offsetof(CPUMIPSState, CP0_EntryLo0));
rn = "EntryLo0";
@@ -4969,6 +4968,7 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int
reg, int sel)
case 3:
switch (sel) {
case 0:
+ CP0_CHECK(ctx->hflags & MIPS_HFLAG_ELPA);
tcg_gen_andi_tl(arg, arg, mask);
gen_mthc0_entrylo(arg, offsetof(CPUMIPSState, CP0_EntryLo1));
rn = "EntryLo1";
--
2.7.4
- [Qemu-devel] [PATCH v5 0/7] Maintenance and misc fixes and improvements, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 1/7] target/mips: Update maintainer's email addresses, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 2/7] target/mips: Workaround for checkpatch.pl hanging on msa_helper.c, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 3/7] target/mips: Update some CP0 registers bit definitions, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 4/7] target/mips: Avoid case statements formulated by ranges, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 5/7] target/mips: Add CP0 BadInstrX register, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 6/7] target/mips: Don't update BadVAddr register in Debug Mode, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v5 7/7] target/mips: Check ELPA flag only in some cases of MFHC0 and MTHC0,
Aleksandar Markovic <=