Skip to contentSkip to conversation

m68k fixes for 2.12-rc4

GIT PULL Applied Laurent Vivier 2 participants 3 messages Apr 15, 2018 – Apr 16, 2018

lore
Share & tools
lore
#0 lore raw

The following changes since commit 38e83a71d02e026d4a6d0ab1ef9855c4924c2c68:

Update version for v2.12.0-rc3 release (2018-04-11 19:03:24 +0100)

are available in the Git repository at:

git://github.com/vivier/qemu-m68k.git tags/m68k-for-2.12-pull-request

for you to fetch changes up to 000761dc0c97d70e7314db3e8f52783880325a22:

m68k: fix exception stack frame for 68000 (2018-04-15 11:37:58 +0200)

----------------------------------------------------------------
This patch fixes a problem with the exception stack for 68000 only CPU. As we use 68040 for linux-user and coldfire for softmmu, I don't think we should trigger a -rc4 only for that, so merge this only if a -rc4 is needed by something else.
----------------------------------------------------------------

Pavel Dovgalyuk (1):
m68k: fix exception stack frame for 68000

 target/m68k/op_helper.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

[Qemu-devel] [PULL 1/1] m68k: fix exception stack frame for 68000

From: Pavel Dovgalyuk <[email protected]>

68000 CPUs do not save format in the exception stack frame. This patch adds feature checking to prevent format saving for 68000. m68k_ret() already includes this modification, this patch fixes the exception processing function too.

Message-Id: <20180413133041.29509.59064.stgit@pasha-VirtualBox>

---
 target/m68k/op_helper.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)
target/m68k/op_helper.c +18 -15
index 3a7f7f2219..8d09ed91c4 100644
@@ -287,22 +287,25 @@ static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp,
                                   uint16_t format, uint16_t sr,
                                   uint32_t addr, uint32_t retaddr)
 {
-    CPUState *cs = CPU(m68k_env_get_cpu(env));
-    switch (format) {
-    case 4:
-        *sp -= 4;
-        cpu_stl_kernel(env, *sp, env->pc);
-        *sp -= 4;
-        cpu_stl_kernel(env, *sp, addr);
-        break;
-    case 3:
-    case 2:
-        *sp -= 4;
-        cpu_stl_kernel(env, *sp, addr);
-        break;
+    if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) {
+        /*  all except 68000 */
+        CPUState *cs = CPU(m68k_env_get_cpu(env));
+        switch (format) {
+        case 4:
+            *sp -= 4;
+            cpu_stl_kernel(env, *sp, env->pc);
+            *sp -= 4;
+            cpu_stl_kernel(env, *sp, addr);
+            break;
+        case 3:
+        case 2:
+            *sp -= 4;
+            cpu_stl_kernel(env, *sp, addr);
+            break;
+        }
+        *sp -= 2;
+        cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
     }
-    *sp -= 2;
-    cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
     *sp -= 4;
     cpu_stl_kernel(env, *sp, retaddr);
     *sp -= 2;
Signature · 1 line
2.14.3
#2 lore raw
In reply to Laurent Vivier
Quoted 20 lines · Laurent Vivier

The following changes since commit 38e83a71d02e026d4a6d0ab1ef9855c4924c2c68:

Update version for v2.12.0-rc3 release (2018-04-11 19:03:24 +0100)

are available in the Git repository at:

git://github.com/vivier/qemu-m68k.git tags/m68k-for-2.12-pull-request

for you to fetch changes up to 000761dc0c97d70e7314db3e8f52783880325a22:

m68k: fix exception stack frame for 68000 (2018-04-15 11:37:58 +0200)

----------------------------------------------------------------
This patch fixes a problem with the exception stack for 68000 only CPU. As we use 68040 for linux-user and coldfire for softmmu, I don't think we should trigger a -rc4 only for that, so merge this only if a -rc4 is needed by something else.
----------------------------------------------------------------

Quoted 5 lines

Pavel Dovgalyuk (1):
m68k: fix exception stack frame for 68000

 target/m68k/op_helper.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

Applied, thanks.

-- PMM