VirtualBox

Changeset 67174 in vbox


Ignore:
Timestamp:
May 31, 2017 2:05:16 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115850
Message:

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
The vboxvideo causes a NULL pointer dereference inside the kernel on
kernel 4.10+ when ttm needs to make room in the video memory and tries
to evict things.

This is caused by upstream kernel commit a2ab19fed9d1 ("drm/ttm: make
eviction decision a driver callback v2") introducing a new
eviction_valuable callback which the vboxvideo driver does not define:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=a2ab19fed9d1dc5a7a2ced44f4b289885c522a8f

This commit adds a definition for this callback, fixing the crash.

Signed-off-by: Hans de Goede <hdegoede@…>
Further updated to add a definition for the io_mem_pfn callback, added in
upstream kernel commit ea642c32 ("drm/ttm: add io_mem_pfn callback").

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_ttm.c

    r66544 r67174  
    263263    .ttm_tt_unpopulate = vbox_ttm_tt_unpopulate,
    264264    .init_mem_type = vbox_bo_init_mem_type,
     265#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
     266    .eviction_valuable = ttm_bo_eviction_valuable,
     267#endif
    265268    .evict_flags = vbox_bo_evict_flags,
    266269    .move = vbox_bo_move,
     
    268271    .io_mem_reserve = &vbox_ttm_io_mem_reserve,
    269272    .io_mem_free = &vbox_ttm_io_mem_free,
     273#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
     274    .io_mem_pfn = ttm_bo_default_io_mem_pfn,
     275#endif
    270276#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
    271277    .lru_tail = &ttm_bo_default_lru_tail,
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