a4d1d9fe03
bnc#828623 - bnc#839596 - VUL-0: CVE-2013-1442: XSA-62: xen: Information leak on AVX and/or LWP capable CPUs 5242a1b5-x86-xsave-initialize-extended-register-state-when-guests-enable-it.patch - bnc#840592 - VUL-0: CVE-2013-4355: XSA-63: xen: Information leaks through I/O instruction emulation CVE-2013-4355-xsa63.patch - bnc#840593 - VUL-0: CVE-2013-4356: XSA-64: xen: Memory accessible by 64-bit PV guests under live migration CVE-2013-4356-xsa64.patch - bnc#841766 - VUL-1: CVE-2013-4361: XSA-66: xen: Information leak through fbld instruction emulation CVE-2013-4361-xsa66.patch - bnc#833796 - L3: Xen: migration broken from xsave-capable to xsave-incapable host 52205e27-x86-xsave-initialization-improvements.patch 522dc0e6-x86-xsave-fix-migration-from-xsave-capable-to-xsave-incapable-host.patch - bnc#839600 - [HP BCS SLES11 Bug]: In HP’s UEFI x86_64 platform and sles11sp3 with xen environment, xen hypervisor will panic on multiple blades nPar. 523172d5-x86-fix-memory-cut-off-when-using-PFN-compression.patch - bnc#833251 - [HP BCS SLES11 Bug]: In HP’s UEFI x86_64 platform and with xen environment, in booting stage ,xen hypervisor will panic. 522d896b-x86-EFI-properly-handle-run-time-memory-regions-outside-the-1-1-map.patch - bnc#834751 - [HP BCS SLES11 Bug]: In xen, “shutdown –y 0 –h” cannot power off system 522d896b-x86-EFI-properly-handle-run-time-memory-regions-outside-the-1-1-map.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=274
106 lines
3.4 KiB
Diff
106 lines
3.4 KiB
Diff
References: bnc#833796
|
|
|
|
# Commit c6066e78f4a66005b0d5d86c6ade32e2ab78923a
|
|
# Date 2013-08-30 10:56:07 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86/xsave: initialization improvements
|
|
|
|
- properly validate available feature set on APs
|
|
- also validate xsaveopt availability on APs
|
|
- properly indicate whether the initialization is on the BSP (we
|
|
shouldn't be using "cpu == 0" checks for this)
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Acked-by: Keir Fraser <keir@xen.org>
|
|
|
|
--- a/xen/arch/x86/cpu/common.c
|
|
+++ b/xen/arch/x86/cpu/common.c
|
|
@@ -304,7 +304,7 @@ void __cpuinit identify_cpu(struct cpuin
|
|
clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
|
|
|
|
if ( cpu_has_xsave )
|
|
- xstate_init();
|
|
+ xstate_init(c == &boot_cpu_data);
|
|
|
|
/*
|
|
* The vendor-specific functions might have changed features. Now
|
|
--- a/xen/arch/x86/xstate.c
|
|
+++ b/xen/arch/x86/xstate.c
|
|
@@ -247,11 +247,10 @@ void xstate_free_save_area(struct vcpu *
|
|
}
|
|
|
|
/* Collect the information of processor's extended state */
|
|
-void xstate_init(void)
|
|
+void xstate_init(bool_t bsp)
|
|
{
|
|
- u32 eax, ebx, ecx, edx;
|
|
- int cpu = smp_processor_id();
|
|
- u32 min_size;
|
|
+ u32 eax, ebx, ecx, edx, min_size;
|
|
+ u64 feature_mask;
|
|
|
|
if ( boot_cpu_data.cpuid_level < XSTATE_CPUID )
|
|
return;
|
|
@@ -260,6 +259,7 @@ void xstate_init(void)
|
|
|
|
BUG_ON((eax & XSTATE_FP_SSE) != XSTATE_FP_SSE);
|
|
BUG_ON((eax & XSTATE_YMM) && !(eax & XSTATE_SSE));
|
|
+ feature_mask = (((u64)edx << 32) | eax) & XCNTXT_MASK;
|
|
|
|
/* FP/SSE, XSAVE.HEADER, YMM */
|
|
min_size = XSTATE_AREA_MIN_SIZE;
|
|
@@ -271,31 +271,33 @@ void xstate_init(void)
|
|
* Set CR4_OSXSAVE and run "cpuid" to get xsave_cntxt_size.
|
|
*/
|
|
set_in_cr4(X86_CR4_OSXSAVE);
|
|
- if ( !set_xcr0((((u64)edx << 32) | eax) & XCNTXT_MASK) )
|
|
+ if ( !set_xcr0(feature_mask) )
|
|
BUG();
|
|
cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
|
|
|
|
- if ( cpu == 0 )
|
|
+ if ( bsp )
|
|
{
|
|
+ xfeature_mask = feature_mask;
|
|
/*
|
|
* xsave_cntxt_size is the max size required by enabled features.
|
|
* We know FP/SSE and YMM about eax, and nothing about edx at present.
|
|
*/
|
|
xsave_cntxt_size = ebx;
|
|
- xfeature_mask = eax + ((u64)edx << 32);
|
|
- xfeature_mask &= XCNTXT_MASK;
|
|
printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
|
|
__func__, xsave_cntxt_size, xfeature_mask);
|
|
-
|
|
- /* Check XSAVEOPT feature. */
|
|
- cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
|
|
- cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
|
|
}
|
|
else
|
|
{
|
|
+ BUG_ON(xfeature_mask != feature_mask);
|
|
BUG_ON(xsave_cntxt_size != ebx);
|
|
- BUG_ON(xfeature_mask != (xfeature_mask & XCNTXT_MASK));
|
|
}
|
|
+
|
|
+ /* Check XSAVEOPT feature. */
|
|
+ cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
|
|
+ if ( bsp )
|
|
+ cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
|
|
+ else
|
|
+ BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
|
|
}
|
|
|
|
int handle_xsetbv(u32 index, u64 new_bv)
|
|
--- a/xen/include/asm-x86/xstate.h
|
|
+++ b/xen/include/asm-x86/xstate.h
|
|
@@ -81,6 +81,6 @@ int __must_check handle_xsetbv(u32 index
|
|
/* extended state init and cleanup functions */
|
|
void xstate_free_save_area(struct vcpu *v);
|
|
int xstate_alloc_save_area(struct vcpu *v);
|
|
-void xstate_init(void);
|
|
+void xstate_init(bool_t bsp);
|
|
|
|
#endif /* __ASM_XSTATE_H */
|