]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: nuke VM_MIXEDMAP on BO mappings v3
authorChristian König <christian.koenig@amd.com>
Tue, 1 Jun 2021 17:47:50 +0000 (19:47 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 8 Jun 2021 09:47:51 +0000 (11:47 +0200)
commit8aeb564a0aff1d36e868ed1dc51f5118e46c03d9
tree2357efae00423f561935a120cdb3988af240250b
parent454c13700cba3a132b2954d7131279a3957c679a
drm/ttm: nuke VM_MIXEDMAP on BO mappings v3

We discussed if that is really the right approach for quite a while now, but
digging deeper into a bug report on arm turned out that this is actually
horrible broken right now.

The reason for this is that vmf_insert_mixed_prot() always tries to grab
a reference to the underlaying page on architectures without
ARCH_HAS_PTE_SPECIAL and as far as I can see also enabled GUP.

So nuke using VM_MIXEDMAP here and use VM_PFNMAP instead.

Also make sure to reject mappings without VM_SHARED.

v2: reject COW mappings, merge function with only caller
v3: adjust comment as suggested by Thomas

Signed-off-by: Christian König <christian.koenig@amd.com>
Bugs: https://gitlab.freedesktop.org/drm/amd/-/issues/1606#note_936174
Link: https://patchwork.freedesktop.org/patch/msgid/20210607135830.8574-1-christian.koenig@amd.com
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/ttm/ttm_bo_vm.c