diff options
-rw-r--r-- | sys/arch/mips64/mips64/tlbhandler.S | 27 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/machdep.c | 17 |
2 files changed, 39 insertions, 5 deletions
diff --git a/sys/arch/mips64/mips64/tlbhandler.S b/sys/arch/mips64/mips64/tlbhandler.S index d78fe8cebc6..8a9f82765d9 100644 --- a/sys/arch/mips64/mips64/tlbhandler.S +++ b/sys/arch/mips64/mips64/tlbhandler.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tlbhandler.S,v 1.33 2012/03/28 20:44:23 miod Exp $ */ +/* $OpenBSD: tlbhandler.S,v 1.34 2012/04/09 16:54:39 miod Exp $ */ /* * Copyright (c) 1995-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -59,16 +59,37 @@ .ent xtlb_miss_err_r4k, 0 xtlb_miss_err_r4k: /* - * R4000 errata: TLB miss exception may be invoked with BadVAddr + * R4000 errata #27: TLB miss exception may be invoked with BadVAddr * being incorrect. */ tlbp mfc0 k1, COP_0_TLB_INDEX - bltz k1, xtlb_miss # missing! + bltz k1, xtlb_miss # missing! nop eret nop .end xtlb_miss_err_r4k + + .globl xtlb_miss_err_r4000SC + .ent xtlb_miss_err_r4000SC, 0 +xtlb_miss_err_r4000SC: + /* + * R4000SC errata #12: In addition to errata #27 above, the tlbp + * instruction needs to be issued in uncached space, to prevent + * BadVAddr to be further corrupted if a VCE exception occurs + * immediately after the TLB miss exception has been serviced. + */ + tlbp + mfc0 k1, COP_0_TLB_INDEX + bltz k1, 1f # missing! + nop + eret + nop +1: + LA k1, xtlb_miss + jr k1 + nop + .end xtlb_miss_err_r4000SC #endif /* CPU_R4000 */ #if defined(CPU_R5000) || defined(CPU_RM7000) .globl xtlb_miss_err_r5k diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index 4e29f8f0a7a..d4fa84805cd 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.117 2012/04/06 18:24:29 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.118 2012/04/09 16:54:40 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -536,7 +536,15 @@ mips_init(int argc, void *argv, caddr_t boot_esym) case MIPS_R4000: { extern void xtlb_miss_err_r4k; - xtlb_handler = (vaddr_t)&xtlb_miss_err_r4k; + extern void xtlb_miss_err_r4000SC; + + if (curcpu()->ci_l2size == 0 || + ((cp0_get_prid() >> 4) & 0x0f) >= 4) /* R4400 */ + xtlb_handler = (vaddr_t)&xtlb_miss_err_r4k; + else { + xtlb_handler = (vaddr_t)&xtlb_miss_err_r4000SC; + xtlb_handler |= CKSEG1_BASE; + } } break; #endif @@ -828,6 +836,11 @@ arcbios_halt(int howto) #endif if (howto & RB_HALT) { +#ifdef TGT_INDIGO + /* Indigo does not support powerdown */ + if (sys_config.system_type == SGI_IP20) + howto &= ~RB_POWERDOWN; +#endif if (howto & RB_POWERDOWN) { #ifdef TGT_INDY /* |