Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Apr 2025 09:18:16 -0400
From:      Michael Butler <imb@protected-networks.net>
To:        Graham Perrin <grahamperrin@gmail.com>, freebsd-emulation@freebsd.org
Subject:   Re: (286206) fix for virtualbox-70 after current commit a3a88ed
Message-ID:  <35db08ea-067c-4e44-8e95-b9625548fc9a@protected-networks.net>
In-Reply-To: <ca282855-7f69-4b8a-86c0-889e9abaab48@protected-networks.net>
References:  <57719d32-1af1-4bc9-aa7b-cef3c5d50b5c@protected-networks.net> <9d760377-f0ca-425d-864d-f562a3422836@gmail.com> <ca282855-7f69-4b8a-86c0-889e9abaab48@protected-networks.net>

index | next in thread | previous in thread | raw e-mail

On 4/27/25 08:54, Michael Butler wrote:
> On 4/23/25 01:22, Graham Perrin wrote:
>> On 20/04/2025 16:21, Michael Butler wrote:
>>> In case anyone else is stuck on this ..
>>>
>>> Recent changes in -current to remove vm_page_prev and vm_page_next 
>>> break compilation and loading of the virtualbox kernel modules.
>>>
>>> This patch moves the troublesome call to the new KPI. I only tested 
>>> on virtualbox-70
>>
>>
>> Report 286193 was followed by <https://bugs.freebsd.org/bugzilla/ 
>> show_bug.cgi?id=286206>
>>
>> I'm testing the patch at attachment 259804.
> 
> Commit a114891 now breaks vbox kmods similarly :-(

To resolve this, it seems the following patch fragment works ..

*** src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c~      Sun Apr 
27 09:08:34 2025
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c       Sun Apr 
27 09:14:10 2025
***************
*** 471,477 ****
--- 471,481 ----
               {
                   Assert(enmType == RTR0MEMOBJTYPE_PHYS);
                   VM_OBJECT_WLOCK(pMemFreeBSD->pObject);
+ #if __FreeBSD_version < 1500038
                   pMemFreeBSD->Core.u.Phys.PhysBase = 
VM_PAGE_TO_PHYS(vm_page_find_least(pMemFreeBSD->pObject, 0));
+ #else
+                 pMemFreeBSD->Core.u.Phys.PhysBase = 
VM_PAGE_TO_PHYS(vm_radix_lookup_ge(&pMemFreeBSD->pObject->rtree, 0));
+ #endif
                   VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject);
                   pMemFreeBSD->Core.u.Phys.fAllocated = true;
               }



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35db08ea-067c-4e44-8e95-b9625548fc9a>