Juergen Keil
2008-Jun-02 14:30 UTC
[Xen-devel] 32-bit HVM cpuid(80000001), long mode feature?
When the 32-bit version of the xen-3.3-unstable hypervisor is used
on 64-bit x86 hardware, a hvm domU will currently detect the
presence of the long mode feature when looking at the feature
flags returned by cpuid(80000001).
But when the hvm domain tries it enable long mode, the 32-bit
hypervisor refuses this.
xen.hg/xen/arch/x86/hvm/hvm.c checks:
if ( (value & ~(EFER_FFXSE | EFER_LME | EFER_NX | EFER_SCE)) ||
((sizeof(long) != 8) && (value & EFER_LME)) ||
<<<<<<<<<<<<<<<<<<<<
(!cpu_has_nx && (value & EFER_NX)) ||
(!cpu_has_syscall && (value & EFER_SCE)) ||
(!cpu_has_ffxsr && (value & EFER_FFXSE)) )
{
gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
"EFER: %"PRIx64"\n", value);
hvm_inject_exception(TRAP_gp_fault, 0, 0);
return X86EMUL_EXCEPTION;
}
This confuses {Open}Solaris'' version of GRUB, when we try to start
an {Open}Solaris HVM domU on a 32-bit hypervisor, on a 64-bit cpu.
The hvm domain crashes with an error message like this on the xen console
(apparently because the bootstrap code automatically tries to boot into
the 64-bit kernel):
hvm.c:782:d12 Trying to set reserved bit in EFER: 900
Shouldn''t the 32-bit hypervisor stop announcing the long mode feature
(X86_FEATURE_LM) for hvm domains, in the default configuration?
On 3.1.4 this wasn''t a problem; long mode wasn''t announced
and
OpenSolaris did boot into the 32-bit kernel.
The attached patch strips the long mode X86_FEATURE_LM bit, unless
we''re running on a 64-bit hypervisor.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Keir Fraser
2008-Jun-02 14:44 UTC
Re: [Xen-devel] 32-bit HVM cpuid(80000001), long mode feature?
On 2/6/08 15:30, "Juergen Keil" <jk@tools.de> wrote:> The attached patch strips the long mode X86_FEATURE_LM bit, unless > we''re running on a 64-bit hypervisor.Looks good. I''ll tweak and apply. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel