xen/23853-x86-pv-cpuid-xsave.patch
Charles Arnold edf6bf0381 - Upstream patches from Jan
23955-x86-pv-cpuid-xsave.patch
  23957-cpufreq-error-paths.patch 

- Upstream patches from Jan
  23933-pt-bus2bridge-update.patch
  23726-x86-intel-flexmigration-v2.patch
  23925-x86-AMD-ARAT-Fam12.patch
  23246-x86-xsave-enable.patch
  23897-x86-mce-offline-again.patch 

- Update to Xen 4.1.2_rc3 c/s 23171

- bnc#720054 - Changed /etc/udev/rules.d/40-xen.rules to not run
  Xen's vif-bridge script when not running Xen.  This is not a
  solution to the bug but an improvement in the rules regardless.
  Updated udev-rules.patch

- Upstream patches from Jan
  23868-vtd-RMRR-validation.patch
  23871-x86-microcode-amd-silent.patch
  23898-cc-option-grep.patch 

- Add pciback init script and sysconf file, giving users a simple
  mechanism to configure pciback.
  init.pciback sysconfig.pciback

- update scripts to use xl -f, or xm if xend is running:
  xen-updown.sh, init.xendomains, xmclone.sh

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=146
2011-10-18 14:16:28 +00:00

62 lines
2.1 KiB
Diff

# HG changeset patch
# User Shan Haitao <haitao.shan@intel.com>
# Date 1316300518 -3600
# Node ID b78235de5c6407023759f9bbf723dd83887fedf0
# Parent c944e82bb092925f31403a129087e9d40e0fa06a
Fix PV CPUID virtualization of XSave
The patch will fix XSave CPUID virtualization for PV guests. The XSave
area size returned by CPUID leaf D is changed dynamically depending on
the XCR0. Tools/libxc only assigns a static value. The fix will adjust
xsave area size during runtime.
Note: This fix is already in HVM cpuid virtualization. And Dom0 is not
affected, either.
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2310,7 +2310,7 @@ void hvm_cpuid(unsigned int input, unsig
{
/* reset EBX to default value first */
*ebx = XSAVE_AREA_MIN_SIZE;
- for ( sub_leaf = 2; sub_leaf < 64; sub_leaf++ )
+ for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
{
if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) )
continue;
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -768,6 +768,30 @@ static void pv_cpuid(struct cpu_user_reg
{
if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) )
domain_cpuid(current->domain, a, c, &a, &b, &c, &d);
+
+ switch ( a )
+ {
+ case 0xd:
+ {
+ unsigned int sub_leaf, _eax, _ebx, _ecx, _edx;
+ /* EBX value of main leaf 0 depends on enabled xsave features */
+ if ( c == 0 && current->arch.xcr0 )
+ {
+ /* reset EBX to default value first */
+ b = XSAVE_AREA_MIN_SIZE;
+ for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
+ {
+ if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) )
+ continue;
+ domain_cpuid(current->domain, a, c, &_eax, &_ebx, &_ecx,
+ &_edx);
+ if ( (_eax + _ebx) > b )
+ b = _eax + _ebx;
+ }
+ }
+ break;
+ }
+ }
goto out;
}