c9e3853c04
24448-x86-pt-irq-leak.patch - Upstream patches from Jan 24261-x86-cpuidle-Westmere-EX.patch 24417-amd-erratum-573.patch 24429-mceinj-tool.patch 24447-x86-TXT-INIT-SIPI-delay.patch ioemu-9868-MSI-X.patch - bnc#732884 - remove private runlevel 4 from init scripts xen.no-default-runlevel-4.patch - bnc#727515 - Fragmented packets hang network boot of HVM guest ipxe-gcc45-warnings.patch ipxe-ipv4-fragment.patch ipxe-enable-nics.patch - fate#310510 - fix xenpaging update xenpaging.autostart.patch, make changes with mem-swap-target permanent update xenpaging.doc.patch, mention issues with live migration - fate#310510 - fix xenpaging add xenpaging.evict_mmap_readonly.patch update xenpaging.error-handling.patch, reduce debug output - bnc#736824 - Microcode patches for AMD's 15h processors panic the system 24189-x86-p2m-pod-locking.patch 24412-x86-AMD-errata-model-shift.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=164
86 lines
2.9 KiB
Diff
86 lines
2.9 KiB
Diff
# HG changeset patch
|
|
# User Jan Beulich <jbeulich@suse.com>
|
|
# Date 1324046740 -3600
|
|
# Node ID 1452fb248cd513832cfbbd1100b9b72a0dde7ea6
|
|
# Parent 01c8b27e3d7d4ad2b469be9922bb04b5eb0195e8
|
|
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>
|
|
|
|
--- a/tools/tests/x86_emulator/x86_emulate.c
|
|
+++ b/tools/tests/x86_emulator/x86_emulate.c
|
|
@@ -3,5 +3,7 @@
|
|
#include <string.h>
|
|
#include <public/xen.h>
|
|
|
|
+#define cpu_has_amd_erratum(nr) 0
|
|
+
|
|
#include "x86_emulate/x86_emulate.h"
|
|
#include "x86_emulate/x86_emulate.c"
|
|
--- a/xen/arch/x86/x86_emulate.c
|
|
+++ b/xen/arch/x86/x86_emulate.c
|
|
@@ -10,8 +10,15 @@
|
|
*/
|
|
|
|
#include <asm/x86_emulate.h>
|
|
+#include <asm/processor.h> /* current_cpu_info */
|
|
+#include <asm/amd.h> /* cpu_has_amd_erratum() */
|
|
|
|
/* Avoid namespace pollution. */
|
|
#undef cmpxchg
|
|
+#undef cpuid
|
|
+#undef wbinvd
|
|
+
|
|
+#define cpu_has_amd_erratum(nr) \
|
|
+ cpu_has_amd_erratum(¤t_cpu_data, AMD_ERRATUM_##nr)
|
|
|
|
#include "x86_emulate/x86_emulate.c"
|
|
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
|
|
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
|
|
@@ -2621,6 +2621,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 */
|
|
@@ -2646,7 +2649,6 @@ x86_emulate(
|
|
case 0xf8: /* fprem */
|
|
case 0xf9: /* fyl2xp1 */
|
|
case 0xfa: /* fsqrt */
|
|
- case 0xfb: /* fsincos */
|
|
case 0xfc: /* frndint */
|
|
case 0xfd: /* fscale */
|
|
case 0xfe: /* fsin */
|
|
--- a/xen/include/asm-x86/amd.h
|
|
+++ b/xen/include/asm-x86/amd.h
|
|
@@ -138,6 +138,12 @@
|
|
AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), \
|
|
AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
|
|
|
|
+#define AMD_ERRATUM_573 \
|
|
+ AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf), \
|
|
+ AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf), \
|
|
+ AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf), \
|
|
+ AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
|
|
+
|
|
struct cpuinfo_x86;
|
|
int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
|
|
|