From owner-freebsd-current@freebsd.org Wed Sep 23 13:38:11 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11B9E3F9B21 for ; Wed, 23 Sep 2020 13:38:11 +0000 (UTC) (envelope-from oleg@theweb.org.ua) Received: from sigill.theweb.org.ua (noc.quadranet.com [66.63.164.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "sigill.theweb.org.ua", Issuer "sigill.theweb.org.ua" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxK4d2z7Qz4qMH for ; Wed, 23 Sep 2020 13:38:08 +0000 (UTC) (envelope-from oleg@theweb.org.ua) Received: from sigill.theweb.org.ua (localhost [127.0.0.1]) by sigill.theweb.org.ua (8.16.1/8.16.1) with ESMTPS id 08NDc4U6098615 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Wed, 23 Sep 2020 16:38:04 +0300 (EEST) (envelope-from oleg@theweb.org.ua) Received: (from oleg@localhost) by sigill.theweb.org.ua (8.16.1/8.16.1/Submit) id 08NDc48O098614 for freebsd-current@freebsd.org; Wed, 23 Sep 2020 16:38:04 +0300 (EEST) (envelope-from oleg@theweb.org.ua) X-Authentication-Warning: sigill.theweb.org.ua: oleg set sender to oleg@theweb.org.ua using -f From: "Oleg V. Nauman" To: freebsd-current@freebsd.org Subject: Re: Fwd: Re: r365488 page faults on AMD Ryzen 9 3950X Date: Wed, 23 Sep 2020 16:38:03 +0300 Message-ID: <2251935.mfXeX5GmMH@sigill.theweb.org.ua> Organization: Private persom In-Reply-To: <20200922225128.GA10974@raichu> References: <11d27d41-029a-d7f5-eccc-0ba3a3fcfe97@gwdg.de> <20200921221329.GD2570@kib.kiev.ua> <20200922225128.GA10974@raichu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Rspamd-Queue-Id: 4BxK4d2z7Qz4qMH X-Spamd-Bar: ++++ X-Spamd-Result: default: False [4.12 / 15.00]; HFILTER_HELO_NORES_A_OR_MX(0.30)[sigill.theweb.org.ua]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; HFILTER_HELO_IP_A(1.00)[sigill.theweb.org.ua]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; CTE_CASE(0.50)[]; ASN(0.00)[asn:8100, ipnet:66.63.164.0/23, country:US]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[oleg]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.35)[0.347]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.52)[0.521]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[theweb.org.ua]; NEURAL_SPAM_LONG(0.56)[0.556]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 13:38:11 -0000 On 2020 M09 23, Wed 01:51:28 EEST Mark Johnston wrote: > On Tue, Sep 22, 2020 at 01:13:29AM +0300, Konstantin Belousov wrote: > > On Mon, Sep 21, 2020 at 08:57:46PM +0200, Rainer Hurling wrote: > > > Fatal trap 12: page fault while in kernel mode > > > cpuid = 31; apic id = 1f > > > fault virtual address = 0x25407efa > > > > This address is very suspicious. > > > > I cannot claim it as the fact, but most likely cause for such garbage > > pointer value is mismatched ABI between kernel and module. In other > > words, the module was built against headers from different kernel. > > For some reason clang is not complaining about a missing declaration for > vm_pager_allocate(), despite -Wmissing-prototypes in the CFLAGS... > > This patch is required on top of a patched extract of the vbox sources: > > --- the-freebsd-kernel.h.orig 2020-09-22 18:49:26.499329000 -0400 > +++ the-freebsd-kernel.h 2020-09-22 18:49:55.317615000 -0400 > @@ -68,6 +68,7 @@ > #include > #include /* KERN_SUCCESS ++ */ > #include > +#include > #include /* vm_phys_alloc_* */ > #include /* kmem_alloc_attr */ > #include /* vm_contig_grow_cache */ > --- memobj-r0drv-freebsd.c.orig 2020-09-22 18:49:25.010456000 -0400 > +++ memobj-r0drv-freebsd.c 2020-09-22 18:49:47.462276000 -0400 > @@ -323,7 +323,8 @@ > size_t cPages = atop(pMemFreeBSD->Core.cb); > int rc; > > - pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages); > + pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, > + pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); > > /* No additional object reference for auto-deallocation upon unmapping. > */ #if __FreeBSD_version >= 1000055 > @@ -457,7 +458,8 @@ > return VERR_NO_MEMORY; > } > > - pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); > + pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, > + pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); > > if (PhysHighest != NIL_RTHCPHYS) > VmPhysAddrHigh = PhysHighest; This fixed the issue with panic, thank you