Daniel P. Berrange
2007-Dec-17 15:42 UTC
[Xen-devel] Xen unstable fails to boot from cold on i386 core duo
Just testing xen-unstable on some of my machines here. I''ve got a failure to boot on a Mac Mini with a i386 Core Duo cpu. If I try to boot xen-unstable changeset 16606 from cold it will immediately crash with this: http://people.redhat.com/berrange/xen-3.2.0-fail.jpg Sorry for lame camera pic - this being a mac mini there''s no serial card, or even ability to add one in :-( If I boot into Xen 3.1.0 it works fine. If I warm-reboot from Xen 3.1.0 into Xen-unstable changeset 16606 it also works fine. So it seems only the boot from cold is problematic. Attaching the ''xm dmesg'' output from a succesfull warm-reboot into xen-unstable, and the CPU info. Any ideas / suggestions ? Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2007-Dec-18 00:00 UTC
Re: [Xen-devel] Xen unstable fails to boot from cold on i386 core duo
On Mon, Dec 17, 2007 at 03:42:21PM +0000, Daniel P. Berrange wrote:> Just testing xen-unstable on some of my machines here. I''ve got a failure > to boot on a Mac Mini with a i386 Core Duo cpu. > > If I try to boot xen-unstable changeset 16606 from cold it will immediately > crash with this: > > http://people.redhat.com/berrange/xen-3.2.0-fail.jpg > > Sorry for lame camera pic - this being a mac mini there''s no serial card, > or even ability to add one in :-( > > If I boot into Xen 3.1.0 it works fine. If I warm-reboot from Xen 3.1.0 > into Xen-unstable changeset 16606 it also works fine. So it seems only the > boot from cold is problematic. > > Attaching the ''xm dmesg'' output from a succesfull warm-reboot into > xen-unstable, and the CPU info. > > Any ideas / suggestions ?Converting ff16420d / vmx_cpu_up+0x25d address into a line number with eu-addr2line, it appears as if Xen is crashing & burning in the ''wrmsr'' call in the 2nd half of this conditional from arch/x86/hvm/vmx/vmcs.c: if ( eax & IA32_FEATURE_CONTROL_MSR_LOCK ) { if ( !(eax & (IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX)) ) { printk("CPU%d: VMX disabled by BIOS.\n", cpu); return 0; } } else { eax = (IA32_FEATURE_CONTROL_MSR_LOCK | IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX); wrmsr(IA32_FEATURE_CONTROL_MSR, eax, 0); } In Xen 3.1.0 (which works for me), the ''vmx_cpu_up'' method does not exist, but the ''start_vmx'' function which does more of less the same thing writes a slightly different msr: if ( eax & IA32_FEATURE_CONTROL_MSR_LOCK ) { if ( (eax & IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON) == 0x0 ) { printk("VMX disabled by Feature Control MSR.\n"); return 0; } } else { wrmsr(IA32_FEATURE_CONTROL_MSR, IA32_FEATURE_CONTROL_MSR_LOCK | IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON, 0); } I guess this explains why Xen-unstable works if I warm re-boot from xen-3.1.0, because the 3.1.0 hypervisor will have already enabled and lock VMX msr. Is it possible that older CPUs / BIOS don''t play nice with the extra bit IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX ...if they don''t have SMX support ? Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2007-Dec-18 02:03 UTC
Re: [Xen-devel] Xen unstable fails to boot from cold on i386 core duo
On Tue, Dec 18, 2007 at 12:00:57AM +0000, Daniel P. Berrange wrote:> Converting ff16420d / vmx_cpu_up+0x25d address into a line number with > eu-addr2line, it appears as if Xen is crashing & burning in the ''wrmsr'' > call in the 2nd half of this conditional from arch/x86/hvm/vmx/vmcs.c: > > if ( eax & IA32_FEATURE_CONTROL_MSR_LOCK ) > { > if ( !(eax & (IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | > IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX)) ) > { > printk("CPU%d: VMX disabled by BIOS.\n", cpu); > return 0; > } > } > else > { > eax = (IA32_FEATURE_CONTROL_MSR_LOCK | > IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | > IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX); > wrmsr(IA32_FEATURE_CONTROL_MSR, eax, 0); > }[snip]> Is it possible that older CPUs / BIOS don''t play nice with the extra bit > > IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX > > ...if they don''t have SMX support ?I have confirmed that if I modify Xen with this patch: --- xen-unstable-16606.orig/xen/arch/x86/hvm/vmx/vmcs.c 2007-12-13 04:31:03.000000000 -0500 +++ xen-unstable-16606/xen/arch/x86/hvm/vmx/vmcs.c 2007-12-17 20:21:43.000000000 -0500 @@ -265,8 +265,7 @@ int vmx_cpu_up(void) if ( eax & IA32_FEATURE_CONTROL_MSR_LOCK ) { - if ( !(eax & (IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | - IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX)) ) + if ( !(eax & (IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX))) { printk("CPU%d: VMX disabled by BIOS.\n", cpu); return 0; @@ -275,8 +274,7 @@ int vmx_cpu_up(void) else { eax = (IA32_FEATURE_CONTROL_MSR_LOCK | - IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX | - IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX); + IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX); wrmsr(IA32_FEATURE_CONTROL_MSR, eax, 0); } Everything works nicely again. Obviously this patch will break stuff related to SMX so a better solution is required by somebody with the knowledge in this area.... Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Dec-19 15:51 UTC
Re: [Xen-devel] Xen unstable fails to boot from cold on i386 core duo
On 18/12/07 02:03, "Daniel P. Berrange" <berrange@redhat.com> wrote:> Everything works nicely again. Obviously this patch will break stuff > related to SMX so a better solution is required by somebody with the > knowledge in this area....Try xen-unstable c/s 16643:35ab2bb25e09. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel