Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2021 10:36:40 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Neel Chauhan <nc@FreeBSD.org>
Cc:        Mark Johnston <markj@freebsd.org>, current@freebsd.org
Subject:   Re: Kernel/driver hacking: panic: Assertion vm_object_busied((m->object)) failed at /usr/src/sys/vm/vm_page.c:5455
Message-ID:  <6df7b46d-26ca-b897-66fd-b6a441475348@selasky.org>
In-Reply-To: <ea775950a74b75134a9f0193ba39e8b6@FreeBSD.org>
References:  <e542a0c737f24d15df0fadd985e94938@neelc.org> <YMpnf3DcEw6A/rzD@nuc> <8bd27c2a72ebfa9299bca7d930297faf@FreeBSD.org> <YMymO0fYbsHoK05J@nuc> <389e4560afdc211e9915746b11a0d0d0@FreeBSD.org> <61de965123274866935935bded6c3d58@FreeBSD.org> <ea775950a74b75134a9f0193ba39e8b6@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/20/21 7:32 AM, Neel Chauhan wrote:
> On 2021-06-18 20:03, Neel Chauhan wrote:
>> Apparently, the vm_start values is for some reason coming as 0 when it
>> is passed into vm_fault_cpu(). That's why it's giving these errors: of
>> course the address at 0 is mapped, it is (probably) used by the
>> kernel.
> 
> An update: The vm_start 0 seems to be expected. I checked the values 
> with printf()s.
> 
> I have posted this on Twitter, and am considering hiring a kernel 
> consultant to help if I am unable to do this on my own.
> 
> So I am guessing this line (Line 231) is incorrect:
> 
>      pa = sg_dma_address(sgl);
> 
> Source: 
> https://github.com/neelchauhan/drm-kmod/blob/d0eee96973ee0772e977b813678f92c5becf0507/drivers/gpu/drm/i915/intel_freebsd.c#L231 

Hi Neel,

sg_dma_address() is zero, because the memory hasn't been loaded.

You need to handle two cases there:

When r->iobase is -1 and when it is not.

I suspect you should add r->iobase to the sg_dma_address() only and only 
when it is non -1.

Also, there is a superfluous "pa = " in the beginning of the function.

--HPS




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6df7b46d-26ca-b897-66fd-b6a441475348>