From: Carsten Langgaard <carstenl@mips.com>
To: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: MIPS16 patch in unaligned.c
Date: Wed, 04 Dec 2002 13:53:29 +0100 [thread overview]
Message-ID: <3DEDFAC8.F295F7B2@mips.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]
The attached patch make sure we don't try to emulate load and stores,
when running in MIPS16 mode on CPUs, which support MIPS16.
Without this patch the kernel crashes, if running something nasty like
crashme on a CPU, which support MIPS16.
/Carsten
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
[-- Attachment #2: mips16.patch --]
[-- Type: text/plain, Size: 1551 bytes --]
Index: arch/mips/kernel/unaligned.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/unaligned.c,v
retrieving revision 1.15.2.7
diff -u -r1.15.2.7 unaligned.c
--- arch/mips/kernel/unaligned.c 7 Nov 2002 23:50:11 -0000 1.15.2.7
+++ arch/mips/kernel/unaligned.c 4 Dec 2002 12:37:38 -0000
@@ -494,10 +494,10 @@
/*
* Did we catch a fault trying to load an instruction?
- * This also catches attempts to activate MIPS16 code on
- * CPUs which don't support it.
+ * Or are we running in MIPS16 mode?
*/
- if (regs->cp0_badvaddr == regs->cp0_epc)
+ if ((regs->cp0_badvaddr == regs->cp0_epc) ||
+ (regs->cp0_epc & 0x1))
goto sigbus;
pc = regs->cp0_epc + ((regs->cp0_cause & CAUSEF_BD) ? 4 : 0);
Index: arch/mips64/kernel/unaligned.c
===================================================================
RCS file: /home/cvs/linux/arch/mips64/kernel/unaligned.c,v
retrieving revision 1.6.2.6
diff -u -r1.6.2.6 unaligned.c
--- arch/mips64/kernel/unaligned.c 7 Nov 2002 23:50:11 -0000 1.6.2.6
+++ arch/mips64/kernel/unaligned.c 4 Dec 2002 12:37:40 -0000
@@ -494,10 +494,10 @@
/*
* Did we catch a fault trying to load an instruction?
- * This also catches attempts to activate MIPS16 code on
- * CPUs which don't support it.
+ * Or are we running in MIPS16 mode?
*/
- if (regs->cp0_badvaddr == regs->cp0_epc)
+ if ((regs->cp0_badvaddr == regs->cp0_epc) ||
+ (regs->cp0_epc & 0x1))
goto sigbus;
pc = regs->cp0_epc + ((regs->cp0_cause & CAUSEF_BD) ? 4 : 0);
reply other threads:[~2002-12-04 12:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DEDFAC8.F295F7B2@mips.com \
--to=carstenl@mips.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.