From owner-freebsd-xen@freebsd.org Wed May 23 15:11:33 2018 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73343EFFE34 for ; Wed, 23 May 2018 15:11:33 +0000 (UTC) (envelope-from prvs=674474304=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7D8F6F298 for ; Wed, 23 May 2018 15:11:32 +0000 (UTC) (envelope-from prvs=674474304=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.49,433,1520899200"; d="scan'208";a="73597901" Date: Wed, 23 May 2018 17:11:08 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Pratyush Yadav CC: FreeBSD-Xen Subject: Re: Xen kernel fails to boot, d0v1 triple fault looks like the cuplrit Message-ID: <20180523151108.cxize3bblbpw3ewc@MBP-de-Roger.citrite.net> References: <20180519081030.qhzyjdrpwcekmcac@MacBook-Pro-de-Roger.local> <20180521090310.c46eexnwe4c7w62x@MacBook-Pro-de-Roger.local> <20180523081547.2vvthg42vmphvbex@MacBook-Pro-de-Roger.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180323 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 15:11:33 -0000 On Wed, May 23, 2018 at 08:27:29PM +0530, Pratyush Yadav wrote: > Hi, > > On Wed, May 23, 2018 at 1:45 PM, Roger Pau Monné wrote: > > It's too early for the logs to be stored anywhere. The point where you > > get the crash is when the APs are started, which is way before FreeBSD > > starts proving for disk devices. > > > > Can you please try the patch below? > > > > Thanks, Roger. > > ---8<--- > > diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c > > index 54184898e9bf..52391e2e7c08 100644 > > --- a/sys/x86/xen/pv.c > > +++ b/sys/x86/xen/pv.c > > @@ -113,6 +113,7 @@ static int xen_pv_start_all_aps(void); > > extern char *doublefault_stack; > > extern char *mce_stack; > > extern char *nmi_stack; > > +extern char *dbg_stack; > > #endif > > > > /* > > @@ -329,6 +330,8 @@ start_xen_ap(int cpu) > > (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); > > nmi_stack = > > (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); > > + dbg_stack = > > + (void *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); > > dpcpu = > > (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO); > > > > I think we have different pv.c files. For me, line 113 is: > /* Xen init_ops implementation. */ > > The declarations of doublefault_stach, mce_stack, etc are in line 101. > > Similarly, line 329 for me is: > { > > in function xen_pv_parse_symtab(void). The declarations your diff > mentions in line 329 are in line 224. > > This is in sync with the official repository [0]. Maybe you have > modifications that are not yet upstream? Sorry, I did indeed have other changes in pv.c. I'm appending the patch on top of current HEAD. > Anyway, I manually made the changes. It still does not boot (I used > make kernel -DKERNFAST, but I don't think that should make a > difference). FWIW, I think the recommended way is KERNFAST=1. Can you paste the error? I think you should no longer get a triple page fault in mp_machdep.c:307. Thanks, Roger. ---8<--- diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index c7e97c5b2b63..27e98012302b 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -101,6 +101,7 @@ static int xen_pv_start_all_aps(void); extern char *doublefault_stack; extern char *mce_stack; extern char *nmi_stack; +extern char *dbg_stack; #endif /* @@ -224,6 +225,8 @@ start_xen_ap(int cpu) (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + dbg_stack = + (void *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); dpcpu = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO);