VirtualBox

Changeset 36360 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 23, 2011 10:22:48 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70701
Message:

Runtime/r0drv/linux: fail to lock kernel memory for kmap()'ed memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r35603 r36360  
    891891     */
    892892#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
    893     fLinearMapping = virt_addr_valid(pvLast)          && virt_addr_valid(pv);
     893    fLinearMapping = virt_addr_valid(pvLast) && virt_addr_valid(pv);
    894894#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
    895895    fLinearMapping = VALID_PAGE(virt_to_page(pvLast)) && VALID_PAGE(virt_to_page(pv));
    896896#else
    897897# error "not supported"
     898#endif
     899    /*
     900     * kmap()'ed memory. Only relevant for 32-bit Linux kernels with HIGHMEM
     901     * enabled. Unfortunately there is no easy way to retrieve the page object
     902     * for such temporarily mapped memory, virt_to_page() does not work here.
     903     * There is even no function to check if a virtual address is inside the
     904     * kmap() area or not :-( kmap_atomic_to_page() looks promising but the test
     905     * 'if (vaddr < FIXADDR_START)' if wrong -- the kmap() area is located
     906     * below the fixmap area. vmalloc_to_page() would work but is only allowed
     907     * for vmalloc'ed memory.
     908     */
     909#ifdef CONFIG_HIGHMEM
     910    if (pv < PKMAP_BASE + LAST_PKMAP*PAGE_SIZE && pvLast >= PKMAP_BASE)
     911        return VERR_INVALID_PARAMETER;
    898912#endif
    899913    if (!fLinearMapping)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette