aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_emulate
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-12-16 15:45:40 +0100
committerJan Beulich <jbeulich@suse.com>2011-12-16 15:45:40 +0100
commita1b22e625dee30b9ca572e5b7fe66f1aebd44d7d (patch)
tree3284bfa225b3b7e5716d3aede98720684e1f46f0 /xen/arch/x86/x86_emulate
parent6e359548a1c9afdaee765ccd8b9635424acdb1bd (diff)
downloadxen-a1b22e625dee30b9ca572e5b7fe66f1aebd44d7d.tar.gz
xen-a1b22e625dee30b9ca572e5b7fe66f1aebd44d7d.tar.bz2
xen-a1b22e625dee30b9ca572e5b7fe66f1aebd44d7d.zip
x86/emulator: workaround for AMD erratum 573
The only cases where we might end up emulating fsincos (as any other x87 operations without memory operands) are - when a HVM guest is in real mode (not applicable on AMD) - between two half page table updates in PAE mode (unlikely, and not doing the emulation here does affect only performance, not correctness) - when a guest maliciously (or erroneously) modifies an (MMIO or page table update) instruction under emulation (unspecified behavior) Hence, in order to avoid the erratum to cause harm to the entire host, don't emulate fsincos on the affected AMD CPU families. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/x86_emulate')
-rw-r--r--xen/arch/x86/x86_emulate/x86_emulate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index d6eeb6562a..c7489276a8 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2761,6 +2761,9 @@ x86_emulate(
case 0xd9: /* FPU 0xd9 */
switch ( modrm )
{
+ case 0xfb: /* fsincos */
+ fail_if(cpu_has_amd_erratum(573));
+ /* fall through */
case 0xc0 ... 0xc7: /* fld %stN */
case 0xc8 ... 0xcf: /* fxch %stN */
case 0xd0: /* fnop */
@@ -2786,7 +2789,6 @@ x86_emulate(
case 0xf8: /* fprem */
case 0xf9: /* fyl2xp1 */
case 0xfa: /* fsqrt */
- case 0xfb: /* fsincos */
case 0xfc: /* frndint */
case 0xfd: /* fscale */
case 0xfe: /* fsin */