qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-i386: GPF on invalid MSRs
@ 2011-05-26  9:08 Josh Triplett
  2011-05-26  9:12 ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2011-05-26  9:08 UTC (permalink / raw)
  To: qemu-devel

qemu currently returns 0 for rdmsr on invalid MSRs, and ignores wrmsr on
invalid MSRs.  Real x86 processors GPF on invalid MSRs, which allows
software to detect unavailable MSRs.  Emulate this behavior correctly in
qemu.

Bug discovered via the BIOS Implementation Test Suite
<http://biosbits.org/>; fix tested the same way, for both 32-bit and
64-bit x86.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
 op_helper.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -Naur a/target-i386/op_helper.c b/target-i386/op_helper.c
--- a/target-i386/op_helper.c	2011-02-07 15:13:34.000000000 -0800
+++ b/target-i386/op_helper.c	2011-05-26 00:08:49.608636117 -0700
@@ -3135,7 +3135,7 @@
                 env->mce_banks[offset] = val;
             break;
         }
-        /* XXX: exception ? */
+        raise_exception(EXCP0D_GPF);
         break;
     }
 }
@@ -3266,7 +3266,7 @@
             val = env->mce_banks[offset];
             break;
         }
-        /* XXX: exception ? */
+        raise_exception(EXCP0D_GPF);
         val = 0;
         break;
     }

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

end of thread, other threads:[~2011-05-27 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26  9:08 [Qemu-devel] [PATCH] target-i386: GPF on invalid MSRs Josh Triplett
2011-05-26  9:12 ` Alexander Graf
2011-05-27 15:13   ` Josh Triplett
2011-05-27 15:16     ` Alexander Graf
2011-05-27 15:46       ` Josh Triplett

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).