Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2018 17:11:08 +0200
From:      Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To:        Pratyush Yadav <pratiy0100@gmail.com>
Cc:        FreeBSD-Xen <freebsd-xen@freebsd.org>
Subject:   Re: Xen kernel fails to boot, d0v1 triple fault looks like the cuplrit
Message-ID:  <20180523151108.cxize3bblbpw3ewc@MBP-de-Roger.citrite.net>
In-Reply-To: <CA%2BX=3TKx39D068NRzmdJ39-4%2BWmfa8gjncKCyBPT81hzDc=p%2BA@mail.gmail.com>
References:  <CA%2BX=3T%2BYiUmNNPSSA36QmwYsamgAf0hHEsEock-FcomCHc-Jww@mail.gmail.com> <20180519081030.qhzyjdrpwcekmcac@MacBook-Pro-de-Roger.local> <CA%2BX=3TKazXMk%2BUqL35Fzoa-F7YQWWtt-c6BSSNJQqL-WC31D1A@mail.gmail.com> <20180521090310.c46eexnwe4c7w62x@MacBook-Pro-de-Roger.local> <CA%2BX=3TK0M0j=oqyjgsggy4TdkhAuO6vpRqAaJnmOb_J8cvBZ9g@mail.gmail.com> <20180523081547.2vvthg42vmphvbex@MacBook-Pro-de-Roger.local> <CA%2BX=3TKx39D068NRzmdJ39-4%2BWmfa8gjncKCyBPT81hzDc=p%2BA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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é <roger.pau@citrix.com> 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);
 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180523151108.cxize3bblbpw3ewc>