Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MVME177 panic: pmap_enter_ptpage (PR #45915 on 6.x)



martin@ wrote:

> > For 6.2 (or 6.1.x), I'd like to change only MVMEPROM_ARG2() macro
> > and its users (i.e. outstr.c and outls.c).
> 
> That sounds fine as an interim step mostly for pullup reasons.

Strange enough, the following diff
(__asm statement with two pre-decrements against %sp)
generates _correct_ asm instructions:

Index: include/prom.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/include/prom.h,v
retrieving revision 1.17
diff -u -p -r1.17 prom.h
--- include/prom.h      24 Dec 2005 23:24:01 -0000      1.17
+++ include/prom.h      22 Sep 2013 17:28:10 -0000
@@ -155,8 +155,10 @@ struct mvmeprom_args {
        __asm volatile ("clrl %sp@-")
 #define MVMEPROM_ARG1(arg) \
        __asm volatile ("movel %0, %%sp@-"::"d" (arg))
-#define MVMEPROM_ARG2(arg) \
-       __asm volatile ("movel %0, %%sp@-"::"d" (arg))
+#define MVMEPROM_ARG2(arg0, arg1)                              \
+       __asm volatile ("movel %0, %%sp@-;"                     \
+                       "movel %1, %%sp@-;"                     \
+                       :: "r" (arg0), "r" (arg1):)
 #define MVMEPROM_GETRES(ret) \
        __asm volatile ("movel %%sp@+,%0": "=d" (ret):)
 #define MVMEPROM_GETSR(ret) \
Index: stand/libbug/outln.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/stand/libbug/outln.c,v
retrieving revision 1.3
diff -u -p -r1.3 outln.c
--- stand/libbug/outln.c        12 Jan 2008 09:54:31 -0000      1.3
+++ stand/libbug/outln.c        22 Sep 2013 17:28:10 -0000
@@ -13,7 +13,6 @@ void
 mvmeprom_outln(char *start, char *end)
 {
 
-       MVMEPROM_ARG1(end);
-       MVMEPROM_ARG2(start);
+       MVMEPROM_ARG2(end, start);
        MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
 }
Index: stand/libbug/outstr.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/stand/libbug/outstr.c,v
retrieving revision 1.3
diff -u -p -r1.3 outstr.c
--- stand/libbug/outstr.c       12 Jan 2008 09:54:31 -0000      1.3
+++ stand/libbug/outstr.c       22 Sep 2013 17:28:10 -0000
@@ -13,7 +13,6 @@ void
 mvmeprom_outstr(char *start, char *end)
 {
 
-       MVMEPROM_ARG1(end);
-       MVMEPROM_ARG2(start);
+       MVMEPROM_ARG2(end, start);
        MVMEPROM_CALL(MVMEPROM_OUTSTR);
 }

---

output of objdump -d netboot:
---
 :
003f4f84 <mvmeprom_outstr>:
  3f4f84:       202f 0008       movel %sp@(8),%d0
  3f4f88:       222f 0004       movel %sp@(4),%d1
  3f4f8c:       2f00            movel %d0,%sp@-
  3f4f8e:       2f01            movel %d1,%sp@-
  3f4f90:       4e4f            trap #15
  3f4f92:       0021 4e75       orib #117,%a1@- # .short 0x0021; rts
---

gcc-4.5 reorders instructions only if they are in single asm() statement?

I've also put the patched netboot.bin here:
ftp://ftp.netbsd.org/pub/NetBSD/misc/tsutsui/mvme68k/netbsd-6_20130917/netboot-20130922.bin

If it works, I'll commit it as an interim fix for netbsd-6 branches.
(not sure we'll eventually get a real fix though ;-p)

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index