qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][MIPS] Enforce aligned pc
@ 2006-04-26 14:22 Marius Groeger
  2006-04-26 22:07 ` Fabrice Bellard
  0 siblings, 1 reply; 3+ messages in thread
From: Marius Groeger @ 2006-04-26 14:22 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 105 bytes --]

Hi,

this patch makes qemu throw an exception when the PC is not aligned to 
a word boundary.

-- 
Marius

[-- Attachment #2: Type: TEXT/PLAIN, Size: 498 bytes --]

--- target-mips/translate.c	23 Apr 2006 15:21:24 -0000	1.12
+++ target-mips/translate.c	26 Apr 2006 14:02:19 -0000
@@ -1320,6 +1707,12 @@
     uint16_t op, op1;
     int16_t imm;
 
+	/* make sure instructions are on a word boundary */
+	if (ctx->pc & 0x3) {
+		generate_exception(ctx, EXCP_AdEL);
+		return;
+	}
+
     if ((ctx->hflags & MIPS_HFLAG_BMASK) == MIPS_HFLAG_BL) {
         /* Handle blikely not taken case */
         MIPS_DEBUG("blikely condition (%08x)", ctx->pc + 4);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-26 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26 14:22 [Qemu-devel] [PATCH][MIPS] Enforce aligned pc Marius Groeger
2006-04-26 22:07 ` Fabrice Bellard
2006-04-26 22:53   ` Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).