aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/emulate.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-12-01 08:48:14 +0100
committerJan Beulich <jbeulich@suse.com>2011-12-01 08:48:14 +0100
commit11c35f84b53622c429071049b830bb9b7a880eff (patch)
tree63087f7a28dddc2acf531075ab36ca56dff4b50f /xen/arch/x86/hvm/emulate.c
parentb6cf65cf7aeb21cea11075da268563fca22ede9c (diff)
downloadxen-11c35f84b53622c429071049b830bb9b7a880eff.tar.gz
xen-11c35f84b53622c429071049b830bb9b7a880eff.tar.bz2
xen-11c35f84b53622c429071049b830bb9b7a880eff.zip
x86/emulator: generalize movq emulation (SSE2 and AVX variants)
Extend the existing movq emulation to also support its SSE2 and AVX variants, the latter implying the addition of VEX decoding. Fold the read and write cases (as most of the logic is identical), and add movntq and variants (as they're very similar). Extend the testing code to also exercise these instructions. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/emulate.c')
-rw-r--r--xen/arch/x86/hvm/emulate.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 0d6967a21c..15f413c576 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -16,6 +16,7 @@
#include <xen/paging.h>
#include <xen/trace.h>
#include <asm/event.h>
+#include <asm/xstate.h>
#include <asm/hvm/emulate.h>
#include <asm/hvm/hvm.h>
#include <asm/hvm/trace.h>
@@ -928,6 +929,20 @@ static int hvmemul_get_fpu(
if ( !cpu_has_mmx )
return X86EMUL_UNHANDLEABLE;
break;
+ case X86EMUL_FPU_xmm:
+ if ( !cpu_has_xmm ||
+ (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_EM) ||
+ !(curr->arch.hvm_vcpu.guest_cr[4] & X86_CR4_OSFXSR) )
+ return X86EMUL_UNHANDLEABLE;
+ break;
+ case X86EMUL_FPU_ymm:
+ if ( !(curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) ||
+ vm86_mode(ctxt->regs) ||
+ !(curr->arch.hvm_vcpu.guest_cr[4] & X86_CR4_OSXSAVE) ||
+ !(curr->arch.xcr0 & XSTATE_SSE) ||
+ !(curr->arch.xcr0 & XSTATE_YMM) )
+ return X86EMUL_UNHANDLEABLE;
+ break;
default:
return X86EMUL_UNHANDLEABLE;
}