Date: Wed, 23 May 2018 12:57:59 +0530 From: Pratyush Yadav <pratiy0100@gmail.com> To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com> Cc: FreeBSD-Xen <freebsd-xen@freebsd.org>, Akshay Jaggi <jaggi@freebsd.org>, Edward Napierala <trasz@freebsd.org> Subject: Re: Xen kernel fails to boot, d0v1 triple fault looks like the cuplrit Message-ID: <CA%2BX=3TK0M0j=oqyjgsggy4TdkhAuO6vpRqAaJnmOb_J8cvBZ9g@mail.gmail.com> In-Reply-To: <20180521090310.c46eexnwe4c7w62x@MacBook-Pro-de-Roger.local> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 21, 2018 at 2:33 PM, Roger Pau Monn=C3=A9 <roger.pau@citrix.com= > wrote: > Please try to avoid top posting. Sorry, I didn't know. I Googled top posting just now, and realized it is inconvenient for the reader. > Hm, it seems like dbg_stack is not properly allocated. Can you please > try the above debug patch and paste the boot log? > > ---8<--- > diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c > index 301461420874..8854242b4bf5 100644 > --- a/sys/amd64/amd64/mp_machdep.c > +++ b/sys/amd64/amd64/mp_machdep.c > @@ -304,6 +304,7 @@ init_secondary(void) > > /* Save the per-cpu pointer for use by the DB# handler. */ > np =3D ((struct nmi_pcpu *) &dbg_stack[PAGE_SIZE]) - 1; > +printf("ID %d dbg_stack: %p per-cpu: %p\n", cpu, dbg_stack, np); > np->np_pcpu =3D (register_t) pc; > > wrmsr(MSR_FSBASE, 0); /* User value */ > @@ -403,6 +404,7 @@ native_start_all_aps(void) > M_WAITOK | M_ZERO); > dbg_stack =3D (char *)kmem_malloc(kernel_arena, PAGE_SIZE= , > M_WAITOK | M_ZERO); > +printf("allocated dbg_stack: %p\n", dbg_stack); > dpcpu =3D (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, > M_WAITOK | M_ZERO); > I applied your patch. The boot stops at the same spot. Also, I can't see any of the two print messages added in the patch. I booted from a Live CD to look at the logs, but they are not stored. I checked dmesg.boot and messages, and /var/log/xen/ none of them have the logs. They all have logs of the previous boot. This is all what I can see from my screen: XEN) Scrubbing free RAM on 1 nodes using 4 CPUs (XEN) [VT-D] DMAR: [DMA Read} Request device [0000:00:1a.0] fault addr 9ce13000. iommu reg - ffff82c000203000 (XEN) [VT-D] DMAR: reason 06 - PTE read access is not set (XEN) ........... done (XEN) initial low memory virq threshold set at 0x200 pages. (XEN) Std. Loglevel: All (XEN) Guest Loglevel: All (XEN) Xen is keeping VGA console (XEN) Boot video device 00:02.0 (XEN) ***Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen) (XEN) Freed 320 kB init memory FreeBSD PVH running on xen-3.0-x86_64p Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #0 r333974M: Wed May 11 37:05 IST 2018 root@freebsd-test:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 WARNING: WITNESS option enabled, expect reduced performance. VT(vga): text 80x25 CPU: Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (2494.22-MHz K8-class CPU) Origin=3D"GenuineIntel" Id=3D0x306c3 Family=3D0x6 Model=3D0x3c Stepping= =3D3 Features=3D0x17c1cbf5<FPU,DE,TSC,MSR,PAE,MCE.CX8.APIC,SEP, MCA,CMOV,PAT,ACPI,MMX FXSR,SSE,SSE2,HTT> Features2=3D0xf6f83203<SSE3,PCLMULQDQ,SSSE3,FMA,CX16,SSE4. 1,SSE4.2,x2APIC,MOVBE POPCNT,AESNI,XSAVE,AVX,F16C,RDRAND,HV> AMD Features=3D0x20101800<SYSCALL,<s12>NX,LM> AMD Features2=3D0x21<<LAHF,ABM> Structured Extended Features=3D0x2329<FSGSBASE,BMI1,AVX2,BMI2,ERMS,NFPU= SG> Hypervisor: Origin =3D "XenVMMXenVMM" real memory =3D 5982789632 (5705 MB) avail memory =3D 4051214336 (3863 MB) (XEN) d0v1 Triple fault - invoking HVM shutdown action 0 (XEN) *** Dumping Dom0 vcpu#1 state: *** (XEN) ----[ Xen-4.7.2 x86_64 debug=3Dn Not tainted ]---- (XEN) CPU: 1 (XEN) RIP: 0020:[<ffffffff80b52fbe>] (XEN) RFLAGS: 0000000000010046 CONTEXT: hvm guest (d0v1) (XEN) rax: 0000000000000000 rbx: fffff801649a1ff8 rcx: 00000000000000c7 (XEN) rdx: ffffffff81b166f0 rsi: 0000000000000000 rdi: fffff801649a1ff8 (XEN) rbp: fffffe00027e8bb0 rsp: fffffe0027e8b80 r8: fefefefefefefeff (XEN) r15: ffffffff812f497c cr0: 0000000000000011 cr4: 0000000000000020 (XEN) cr3: 0000000002e36000 cr2: 0000000000000000 (XEN) ds: 0028 es: 0028 fs: 0028 gs: 0028 ss: 0028 cs: 0020 (XEN) Guest stack trace from rsp=3Dfffffe00009fffa0: (XEN) Fault while accessing guest memory. (XEN) Hardware Dom0 halted: halting machine When I run addr2line on ffffffff80b52fbe, I get: ./machine/pcpu.h:231 --=20 Regards, Pratyush Yadav
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BX=3TK0M0j=oqyjgsggy4TdkhAuO6vpRqAaJnmOb_J8cvBZ9g>