Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 825586 - [Xen] FC 17 crashed when using as dom0 of xen
Summary: [Xen] FC 17 crashed when using as dom0 of xen
Status: CLOSED DUPLICATE of bug 801650
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 17
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-05-28 01:42 UTC by yang
Modified: 2012-05-29 21:00 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-05-29 21:00:48 UTC

Attachments (Terms of Use)

Description yang 2012-05-28 01:42:33 UTC
Description of problem:
When using fc 17 as dom0, you will see it crashed immediately when booting. And this issue only exists with xsave supported platform. After looking into this issue, i found the following patch is totally wrong. For legacy hypervisors, you need to add xsave=1 in kernel cmdline to avoid writing OXSAVE bit of cr4, not using such ugly way to hack it. 
Consider a xsave supported hypervisor, with this patch, dom0 kernel will confuse: it will try to use xsave, but the osxsave bit never be set. Then it crashed.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:


Legacy hypervisors (RHEL 5.0 and RHEL 5.1) do not handle guest writes to
cr4 gracefully. If a guest attempts to write a bit of cr4 that is
unsupported, then the HV is so offended it crashes the domain. While
later guest kernels (such as RHEL6) don't assume the HV supports all
features, they do expect nicer responses. That assumption introduced
code that probes whether or not xsave is supported early in the boot. So
now when attempting to boot a RHEL6 guest on RHEL5.0 or RHEL5.1 an early
crash will occur.

This patch is quite obviously an undesirable hack. The real fix for this
problem should be in the HV, and is, in later HVs. However, to support
running on old HVs, RHEL6 can take this small change. No impact will
occur for running on any RHEL HV (not even RHEL 5.5 supports xsave).
There is only potential for guest performance loss on upstream Xen.

 arch/x86/xen/enlighten.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 52f8e19..6db3d67 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -802,6 +802,7 @@ static void xen_write_cr4(unsigned long cr4)
        cr4 &= ~X86_CR4_PGE;
        cr4 &= ~X86_CR4_PSE;
+       cr4 &= ~X86_CR4_OSXSAVE;


Comment 1 Justin M. Forbes 2012-05-29 21:00:48 UTC

*** This bug has been marked as a duplicate of bug 801650 ***

Note You need to log in before you can comment on or make changes to this bug.