From owner-freebsd-xen@freebsd.org Wed May 23 07:28:42 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 0C152EF2DEB for ; Wed, 23 May 2018 07:28:42 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 607407B9CD; Wed, 23 May 2018 07:28:41 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id o78-v6so6334942wmg.0; Wed, 23 May 2018 00:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ymyWJCD4okRKDkVpTT9tVLtYgns3nHDusTml2hTLv0g=; b=dENQJB2wcWhG4NDoFquOJW9ycpkAOa9FoGzXBIxGnP3ahYXWoDk55H7QVIvKKiTJQO MLAnePSq+x6ZGhHX2yXmAzN0X2w2NADezZiWyKaiSGCFqPVz+3WbecOpGu3zJ2n5vO6+ 6Q/X/PpgZysI2chM7zM2B2QIEfzk7AYNZX5ZDzfFmig0Pz+CZsz2kS04LtMOjJ9VVDlH yaohEqMvpyOP/v9hhXeLc9sf6bmCHvpWNU/zZzBEF5ri/JjQ71KXmORDIRgeIETQL0uv Lo422b3kS0vilKXmP0Gbx5Lw//Q3QKR5xGdwG4FTERDqiU0nx3QuJxIGyfInV9fW5eGV +9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ymyWJCD4okRKDkVpTT9tVLtYgns3nHDusTml2hTLv0g=; b=Il9Ag4MdXWSQY6EpI8WWFXmIVDsccqAwOZQhj3R/G0B8ML6WDOtNyPvAD1Z/ctniBr J+wJqDkoJxqseKr/EqDihBclilIVzIVSAKk35doctMGcSaC73nCdzAZ9jD3gvMCQnzcW +QvkhKXVqnT6wDf4tSAYIaiFGZJqz2tkTW9l7AHSrRWW4/59CtxzwrSUzKkNO2LHToaD jy1pN/aw6jn5OhvExPAVv36kVssacbcrki4JKfnOOO9/hmgbJmDiJIWH1fqbtAIRdV0O VkO9wgZW6YiqSh4JBVabd1APBFliWgb1cGSpy+wEkquIZctVSrLRL4ctXmb0UWa+mA1t sAZw== X-Gm-Message-State: ALKqPwfPtLVoC2n9t6ZxdhFMWQ2hRy7GzatsqCvOw5pRYDS+JqdtBUB6 PjVedlx9yz30R6bmie62AcywvGDr9xdi31bTZJIGEBVp X-Google-Smtp-Source: AB8JxZoyOfVzo7K9b8wJapegSnzOWL5BLzFaJ4LnoVSnhcm/uA6i4twiERiqP49YuFFHthnSmMGhrhEAYh5cH2OXq+o= X-Received: by 2002:a50:9953:: with SMTP id l19-v6mr5863997edb.179.1527060519895; Wed, 23 May 2018 00:28:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:aa21:0:0:0:0:0 with HTTP; Wed, 23 May 2018 00:27:59 -0700 (PDT) In-Reply-To: <20180521090310.c46eexnwe4c7w62x@MacBook-Pro-de-Roger.local> References: <20180519081030.qhzyjdrpwcekmcac@MacBook-Pro-de-Roger.local> <20180521090310.c46eexnwe4c7w62x@MacBook-Pro-de-Roger.local> From: Pratyush Yadav Date: Wed, 23 May 2018 12:57:59 +0530 Message-ID: Subject: Re: Xen kernel fails to boot, d0v1 triple fault looks like the cuplrit To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: FreeBSD-Xen , Akshay Jaggi , Edward Napierala Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 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 07:28:42 -0000 On Mon, May 21, 2018 at 2:33 PM, Roger Pau Monn=C3=A9 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 Features2=3D0xf6f83203 AMD Features=3D0x20101800NX,LM> AMD Features2=3D0x21< Structured Extended Features=3D0x2329 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:[] (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