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

[Xen-devel] [PATCH] x86/pv: Fix assertion failure in pv_emulate_privileged_op()



The ABI of {read,write}_msr() are required them to use x86_emul_hw_exception()
if they raise an exception with the emulator core.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
---
 xen/arch/x86/pv/emul-priv-op.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index ef13d99..dd90713 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -844,7 +844,12 @@ static int read_msr(unsigned int reg, uint64_t *val,
     int ret;
 
     if ( (ret = guest_rdmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
+    {
+        if ( ret == X86EMUL_EXCEPTION )
+            x86_emul_hw_exception(TRAP_gp_fault, 0, ctxt);
+
         return ret;
+    }
 
     switch ( reg )
     {
@@ -993,7 +998,12 @@ static int write_msr(unsigned int reg, uint64_t val,
     int ret;
 
     if ( (ret = guest_wrmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
+    {
+        if ( ret == X86EMUL_EXCEPTION )
+            x86_emul_hw_exception(TRAP_gp_fault, 0, ctxt);
+
         return ret;
+    }
 
     switch ( reg )
     {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.