aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_emulate
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-08-31 09:54:25 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-08-31 09:54:25 +0100
commit2ea33061b38d5997323293da150b1bda8c6beba2 (patch)
treedb1f4dc533a6eebf23a6b43f100c38ed0ea22314 /xen/arch/x86/x86_emulate
parente4c0d3679f13bb6a6244612546111fbd24388dbf (diff)
downloadxen-2ea33061b38d5997323293da150b1bda8c6beba2.tar.gz
xen-2ea33061b38d5997323293da150b1bda8c6beba2.tar.bz2
xen-2ea33061b38d5997323293da150b1bda8c6beba2.zip
x86_emulate: honor failure of in_longmode()
Failure of in_longmode() shouldn't be treated the same as the function returning 'true'. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/x86_emulate')
-rw-r--r--xen/arch/x86/x86_emulate/x86_emulate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 5f8361e2b2..f2dfdf0c19 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3605,7 +3605,10 @@ x86_emulate(
ss.attr.bytes = 0xc93; /* G+DB+P+S+Data */
#ifdef __x86_64__
- if ( in_longmode(ctxt, ops) )
+ rc = in_longmode(ctxt, ops);
+ if ( rc < 0 )
+ goto cannot_emulate;
+ if ( rc )
{
cs.attr.fields.db = 0;
cs.attr.fields.l = 1;
@@ -3777,7 +3780,10 @@ x86_emulate(
ss.limit = ~0u; /* 4GB limit */
ss.attr.bytes = 0xc93; /* G+DB+P+S+Data */
- if ( in_longmode(ctxt, ops) )
+ rc = in_longmode(ctxt, ops);
+ if ( rc < 0 )
+ goto cannot_emulate;
+ if ( rc )
{
cs.attr.fields.db = 0;
cs.attr.fields.l = 1;