Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2020 16:38:03 +0300
From:      "Oleg V. Nauman" <oleg@theweb.org.ua>
To:        freebsd-current@freebsd.org
Subject:   Re: Fwd: Re: r365488 page faults on AMD Ryzen 9 3950X
Message-ID:  <2251935.mfXeX5GmMH@sigill.theweb.org.ua>
In-Reply-To: <20200922225128.GA10974@raichu>
References:  <11d27d41-029a-d7f5-eccc-0ba3a3fcfe97@gwdg.de> <20200921221329.GD2570@kib.kiev.ua> <20200922225128.GA10974@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <vm/vm_kern.h>
>  #include <vm/vm_param.h>        /* KERN_SUCCESS ++ */
>  #include <vm/vm_page.h>
> +#include <vm/vm_pager.h>
>  #include <vm/vm_phys.h>         /* vm_phys_alloc_* */
>  #include <vm/vm_extern.h>       /* kmem_alloc_attr */
>  #include <vm/vm_pageout.h>      /* 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





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