Larry, thanks - this work will be tracked with:

Ticket #19644 (accepted defect)
Linux kernel version: 5.8 - we need changes
https://www.virtualbox.org/ticket/19644


On Fri, 05 Jun 2020 23:39:08 +0200, Larry Finger <[email protected]> wrote:

In a little over one week, Linus will release Kernel 5.8.0-rc1. Shortly thereafter, openSUSE Tumbleweed will start builds using that kernel. Unless I have patched our copy of the code for the VB kernel modules, my mailbox will be flooded with build failure messages.

Thus far, I have found two incompatibilities with the 5.8 APIs. The first was the removal of __get_vm_area(). This one can be trivially replaced with __get_vm_area_caller(), which has one additional argument that is always "__builtin_return_address(0)."

A second API change is more complicated, and above my understanding. In the associated patch entitled "mm: only allow page table mappings for built-in zsmalloc", symbols map_vm_area() and unmap_kernel_range() are no longer exported. The first of these are used in this snippet found in src/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:

     if (iPage == cPages)
     {
         /*
          * Map the pages.
          *
* Not entirely sure we really need to set nr_pages and pages here, but * they provide a very convenient place for storing something we need
          * in the free function, if nothing else...
          */
# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
         struct page **papPagesIterator = papPages;
# endif
         pVmArea->nr_pages = cPages;
         pVmArea->pages    = papPages;
         if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC,
# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
                          &papPagesIterator
# else
                          papPages
# endif
                          ))
         {
             PRTMEMLNXHDREX pHdrEx = (PRTMEMLNXHDREX)pVmArea->addr;
             pHdrEx->pVmArea     = pVmArea;
             pHdrEx->pvDummy     = NULL;
             return &pHdrEx->Hdr;
         }
         /* bail out */
# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
         pVmArea->nr_pages = papPagesIterator - papPages;
# endif
     }

I think the code could use vm_map_ram() to map the papPages array directly, but I would appreciate any help the developers could provide.

Thanks,

Larry
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev


--
frankB

Oracle Virtualbox Development
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to