I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I found the generic_apic_probe always led to a kernel panic when I try to make the minimal DomU kernel. The 2.6.32.41 pv linux use the new apic probe mechanism: static __init int xen_safe_probe(void) { if (!xen_initial_domain()) return 0; return 1; } #ifdef CONFIG_XEN_DOM0 #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags & SIF_INITDOMAIN) #else /* !CONFIG_XEN_DOM0 */ #define xen_initial_domain() (0) #endif /* CONFIG_XEN_DOM0 */ If do not define the CONFIG_XEN_DOM0, xen_safe_probe will always return 0 which causes the kernel panic. For the minimal DomU kernel, the CONFIG_XEN_DOM0 is needless, and in this scenario, how to pass the apic probe safely? Thanks! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2011-May-27 13:57 UTC
Re: [Xen-devel] apic probe of 2.6.32.41 pv linux
On Fri, May 27, 2011 at 05:58:51PM +0800, Jiageng Yu wrote:> I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I > found the generic_apic_probe always led to a kernel panic when I try > to make the minimal DomU kernel. > > The 2.6.32.41 pv linux use the new apic probe mechanism:new..? What was it before?> > static __init int xen_safe_probe(void) { > if (!xen_initial_domain()) > return 0; > return 1; > } > > #ifdef CONFIG_XEN_DOM0 > #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags > & SIF_INITDOMAIN) > #else /* !CONFIG_XEN_DOM0 */ > #define xen_initial_domain() (0) > #endif /* CONFIG_XEN_DOM0 */ > > > If do not define the CONFIG_XEN_DOM0, xen_safe_probe will always > return 0 which causes the kernel panic. For the minimal DomU kernel, > the CONFIG_XEN_DOM0 is needless, and in this scenario, how to pass the > apic probe safely?> > Thanks! > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
2011/5/27 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>:> On Fri, May 27, 2011 at 05:58:51PM +0800, Jiageng Yu wrote: >> I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I >> found the generic_apic_probe always led to a kernel panic when I try >> to make the minimal DomU kernel. >> >> The 2.6.32.41 pv linux use the new apic probe mechanism: > > new..? What was it before?The linux kernel will invoke probe_default, which permanently returns 1. I wander to know may I just return 1 in 2.6.32.41 kernel? If there is no further problems.>> >> static __init int xen_safe_probe(void) { >> if (!xen_initial_domain()) >> return 0; >> return 1; >> } >> >> #ifdef CONFIG_XEN_DOM0 >> #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags >> & SIF_INITDOMAIN) >> #else /* !CONFIG_XEN_DOM0 */ >> #define xen_initial_domain() (0) >> #endif /* CONFIG_XEN_DOM0 */ >> >> >> If do not define the CONFIG_XEN_DOM0, xen_safe_probe will always >> return 0 which causes the kernel panic. For the minimal DomU kernel, >> the CONFIG_XEN_DOM0 is needless, and in this scenario, how to pass the >> apic probe safely? > >> >> Thanks! >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Fri, 27 May 2011, Jiageng Yu wrote:> 2011/5/27 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>: > > On Fri, May 27, 2011 at 05:58:51PM +0800, Jiageng Yu wrote: > >> I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I > >> found the generic_apic_probe always led to a kernel panic when I try > >> to make the minimal DomU kernel. > >> > >> The 2.6.32.41 pv linux use the new apic probe mechanism: > > > > new..? What was it before? > > > The linux kernel will invoke probe_default, which permanently returns 1. > I wander to know may I just return 1 in 2.6.32.41 kernel? If there is > no further problems. >It seems to me that we have to return 1 unless CONFIG_X86_LOCAL_APIC is disabled, and in that case we wouldn''t need to set anything at all. Considering that the default apic probe function will just return 1, I suggest we just remove xen_safe_probe completely. In fact we don''t have it upstream. Patch completely untested below: --- diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 0493093..0c31ceb 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -759,14 +759,6 @@ static __init int xen_safe_flat_acpi_madt_oem_check(char *oem_id, return 1; } -static __init int xen_safe_probe(void) { - - if (!xen_initial_domain()) - return 0; - - return 1; -} - struct apic apic_xen = { .name = "xen", }; @@ -779,7 +771,6 @@ static __init void set_xen_basic_apic_ops(void) apic->icr_write = xen_apic_icr_write; apic->wait_icr_idle = xen_apic_wait_icr_idle; apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; - apic->probe = xen_safe_probe; apic->acpi_madt_oem_check = xen_safe_flat_acpi_madt_oem_check; /* Copy over the full contents of the newly modified apic into * our apic_xen, which is to be called first by apic_probe[]. */ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2011-May-27 15:24 UTC
Re: [Xen-devel] apic probe of 2.6.32.41 pv linux
On Fri, May 27, 2011 at 10:44:05PM +0800, Jiageng Yu wrote:> 2011/5/27 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>: > > On Fri, May 27, 2011 at 05:58:51PM +0800, Jiageng Yu wrote: > >> I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I > >> found the generic_apic_probe always led to a kernel panic when I try > >> to make the minimal DomU kernel. > >> > >> The 2.6.32.41 pv linux use the new apic probe mechanism: > > > > new..? What was it before? > > > The linux kernel will invoke probe_default, which permanently returns 1. > I wander to know may I just return 1 in 2.6.32.41 kernel? If there is > no further problems.Can''t you just look in the git history to check for this? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
2011/5/28 Jeremy Fitzhardinge <jeremy@goop.org>:> On 05/27/2011 02:29 AM, Jiageng Yu wrote: >> I have updated the pv linux kernel from 2.6.32.40 to 2.6.32.41. I >> found the generic_apic_probe always led to a kernel panic when I try >> to make the minimal DomU kernel. >> >> The 2.6.32.41 pv linux use the new apic probe mechanism: >> >> static __init int xen_safe_probe(void) { >> if (!xen_initial_domain()) >> return 0; >> return 1; >> } >> >> #ifdef CONFIG_XEN_DOM0 >> #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags >> & SIF_INITDOMAIN) >> #else /* !CONFIG_XEN_DOM0 */ >> #define xen_initial_domain() (0) >> #endif /* CONFIG_XEN_DOM0 */ >> >> >> If do not define the CONFIG_XEN_DOM0, xen_safe_probe will always >> return 0 which causes the kernel panic. For the minimal DomU kernel, >> the CONFIG_XEN_DOM0 is needless, and in this scenario, how to pass the >> apic probe safely? > > Thanks for looking into this. In theory a minimal domU kernel should > never have anything to do with APICs, since there are none present in a > PV domain. Do you have a stack backtrace for when it crashes? > > Thanks, > J >Thanks, Jeremy. This is the panic output when starting the domU kernel: _______________________________________________________ <0>Kernel panic - not syncing: Didn''t find an APIC driver Pid: 0, comm: swapper Not tainted 2.6.32.41 #1 Call Trace: [<c0123406>] ? panic+0x46/0x100 [<c032a08d>] ? generic_apic_probe+0x6d/0x70 [<c03220eb>] ? xen_pagetable_setup_done+0x6b/0x70 [<c0323533>] ? setup_arch+0x483/0x [<c020305b>] ? dom0_write_console+0x1b/0x40990 [<c0124077>] ? printk+0x47/0x60 [<c031f67b>] ? start_kernel+0x6b/0x2d0 [<c0321516>] ? xen_start_kernel+0x396/0x3d0 _______________________________________________________ For debugging perpose, I insert xen_raw_console_write into printk, and the dom0_write_console belongs to xen_raw_console_write function. My config file is: ____________________________________________________ kernel = "/root/xen-unstable.hg/linux-stubdom/vmlinuz-ioemu" ramdisk = "/root/xen-unstable.hg/linux-stubdom/ramdisk-ioemu" memory = 32 name="stubdom" vif=[''bridge=eth0''] vnc=0; vfb=[''sdl=1''] ____________________________________________________ The domU kernel config file is attached. I have cut the options about backend drivers, dom0, and privileged_guest. So, there is no CONFIG_XEN_DOM0 option when starting the domU kernel. Thanks. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel