xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix HVM domain featuresets when BIOS sets max_leaf limit
@ 2014-07-29 14:29 Andrew Cooper
  2014-07-29 14:29 ` [PATCH 1/5] x86/cpu: Newline on 'invalid siblings' warning Andrew Cooper
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Andrew Cooper @ 2014-07-29 14:29 UTC (permalink / raw)
  To: Xen-devel
  Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich

This patch series fixes an observed regression between Xen 4.1 and Xen 4.4 on
two particular IvyBridge DT systems, where windows 8.1 will work fine under
Xen 4.1, but unconditionally BSOD under Xen 4.4

The problem turns out to be specific to the BIOS settings on these two boxes.
When IA32_MISC_ENABLE[22] is set, the CPUID max leaf is limited to 3 for
legacy compatibility reasons.  Xen knows how to disable this limit and does
so, but only after trying to fix the CPUID.7[ECX=0] feature flags, which are
ignored base on a max_leaf test.  This causes the cpu_has_XXX tests for these
features to return false despite the feature actually being available.

This regression was introduced as a side effect of c/s 44e24f8567 "x86: don't
call generic_identify() redundantly" where the redundant call actually
resampled CPUID.7[ECX=0] properly to obtain the feature flags.

>From Windows point of view, sees the FSGSBASE feature but gets a #GP fault
when attempting to set it in CR4, as the Xen cpu_has_fsgsbase check fails.
(Windows then appears to forget that it failed to enable FSGSBASE, and BSODs
when it gets a further #GP fault the first time it uses the new instructions.)

Patch 1 is a misc newline corruption I discovered during debugging of the
issue, and is otherwise unrelated to the series.

Patch 2 is the main bugfix.

Patches 3 and 4 are improvements to hvmloader, as prerequisites to Patch 5
which introduces an hvmloader test for the WRFSBASE instruction.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>

Andrew Cooper (5):
  x86/cpu: Newline on 'invalid siblings' warning
  x86/cpu: Undo BIOS CPUID max_leaf limit before querying for features.
  hvmloader/tests: use .code64 in 64bit snippets
  hvmloader: Introduce cpuid_count() helper function
  hvmloader/tests: Introduce WRFSBASE test

 tools/firmware/hvmloader/tests.c |   76 +++++++++++++++++++++++++++++++++++---
 tools/firmware/hvmloader/util.c  |    9 -----
 tools/firmware/hvmloader/util.h  |   17 +++++++--
 xen/arch/x86/cpu/common.c        |    9 +++--
 4 files changed, 91 insertions(+), 20 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-07-29 15:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29 14:29 [PATCH 0/5] Fix HVM domain featuresets when BIOS sets max_leaf limit Andrew Cooper
2014-07-29 14:29 ` [PATCH 1/5] x86/cpu: Newline on 'invalid siblings' warning Andrew Cooper
2014-07-29 15:10   ` Jan Beulich
2014-07-29 15:53     ` Andrew Cooper
2014-07-29 14:29 ` [PATCH 2/5] x86/cpu: Undo BIOS CPUID max_leaf limit before querying for features Andrew Cooper
2014-07-29 14:29 ` [PATCH 3/5] hvmloader/tests: use .code64 in 64bit snippets Andrew Cooper
2014-07-29 15:14   ` Jan Beulich
2014-07-29 14:30 ` [PATCH 4/5] hvmloader: Introduce cpuid_count() helper function Andrew Cooper
2014-07-29 14:30 ` [PATCH 5/5] hvmloader/tests: Introduce WRFSBASE test Andrew Cooper
2014-07-29 15:22   ` Jan Beulich
2014-07-29 15:34     ` Andrew Cooper
2014-07-29 15:42       ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).