[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 30/60] MIPS: Correct FCR0 initialization
From: |
Michael Tokarev |
Subject: |
[Qemu-stable] [PATCH 30/60] MIPS: Correct FCR0 initialization |
Date: |
Mon, 4 Feb 2013 14:40:40 +0400 |
From: Nathan Froyd <address@hidden>
This change addresses a problem where QEMU incorrectly traps on
floating-point MADD group instructions with SIGILL, at least while
emulating MIPS32r2 processors. These instructions use the COP1X major
opcode and include ones like:
madd.d $f2,$f4,$f2,$f6
Here's Nathan's original analysis of the problem:
"QEMU essentially does:
d = find_cpu (cpu_string) // get CPU definition
fpu_init (env, d) // initialize fpu state (init FCR0, basically)
cpu_reset (env)
...and the cpu_reset call clears all interesting state that fpu_init
setup, then proceeds to reinitialize all the CP0 registers...but not
FCR0."
I have verified this change with system emulation running the GDB test
suite for the mips-sde-elf target (o32, big endian, 24Kf CPU emulated),
there were 55 progressions and no regressions.
Signed-off-by: Maciej W. Rozycki <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>
(cherry picked from commit f1cb0951c5298753652a73cfd8efc0b1a82f37de)
Signed-off-by: Michael Tokarev <address@hidden>
---
target-mips/translate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 5ed58f6..8ff1fab 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12783,6 +12783,7 @@ void cpu_state_reset(CPUMIPSState *env)
env->CP0_SRSConf3 = env->cpu_model->CP0_SRSConf3;
env->CP0_SRSConf4_rw_bitmask = env->cpu_model->CP0_SRSConf4_rw_bitmask;
env->CP0_SRSConf4 = env->cpu_model->CP0_SRSConf4;
+ env->active_fpu.fcr0 = env->cpu_model->CP1_fcr0;
env->insn_flags = env->cpu_model->insn_flags;
#if defined(CONFIG_USER_ONLY)
--
1.7.10.4
- [Qemu-stable] [PATCH 38/60] xhci: fix usb name in caps, (continued)
- [Qemu-stable] [PATCH 38/60] xhci: fix usb name in caps, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 33/60] e1000: drop check_rxov, always treat RX ring with RDH == RDT as empty, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 20/60] ui/vnc: Only report/use TIGHT_PNG encoding if enabled., Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 21/60] vnc: fix "info vnc" with "-vnc ..., reverse=on", Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 56/60] target-xtensa: fix search_pc for the last TB opcode, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 07/60] cpu_physical_memory_write_rom() needs to do TB invalidates, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 26/60] target-i386: Allow tsc-frequency to be larger then 2.147G, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 42/60] target-mips: fix wrong microMIPS opcode encoding, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 57/60] buffered_file: do not send more than s->bytes_xfer bytes per tick, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 25/60] hw: Fix return value check for bdrv_read, bdrv_write, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 30/60] MIPS: Correct FCR0 initialization,
Michael Tokarev <=
- [Qemu-stable] [PATCH 11/60] net: add -netdev options to man page, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 50/60] slirp: Don't crash on packets from 0.0.0.0/8., Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 58/60] qxl: save qemu_create_displaysurface_from result, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 49/60] tap: reset vnet header size on open, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 19/60] fix entry pointer for ELF kernels loaded with -kernel option, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 18/60] e1000: flush queue whenever can_receive can go from false to true, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 27/60] x86: Fixed incorrect segment base address addition in 64-bits mode, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 09/60] ahci: properly reset PxCMD on HBA reset, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 60/60] migration: Fix madvise breakage if host and guest have different page sizes, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 39/60] m68k: Return semihosting errno values correctly, Michael Tokarev, 2013/02/04