linux/include/drm
Jason Gunthorpe 0d97950953 drm/ttm: remove ttm_bo_vm_insert_huge()
The huge page functionality in TTM does not work safely because PUD and
PMD entries do not have a special bit.

get_user_pages_fast() considers any page that passed pmd_huge() as
usable:

	if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) ||
		     pmd_devmap(pmd))) {

And vmf_insert_pfn_pmd_prot() unconditionally sets

	entry = pmd_mkhuge(pfn_t_pmd(pfn, prot));

eg on x86 the page will be _PAGE_PRESENT | PAGE_PSE.

As such gup_huge_pmd() will try to deref a struct page:

	head = try_grab_compound_head(pmd_page(orig), refs, flags);

and thus crash.

Thomas further notices that the drivers are not expecting the struct page
to be used by anything - in particular the refcount incr above will cause
them to malfunction.

Thus everything about this is not able to fully work correctly considering
GUP_fast. Delete it entirely. It can return someday along with a proper
PMD/PUD_SPECIAL bit in the page table itself to gate GUP_fast.

Fixes: 314b6580ad ("drm/ttm, drm/vmwgfx: Support huge TTM pagefaults")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Thomas Hellström <thomas.helllstrom@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
[danvet: Update subject per Thomas' &Christian's review]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/0-v2-a44694790652+4ac-ttm_pmd_jgg@nvidia.com
2021-11-05 11:13:19 +01:00
..
bridge drm: bridge: dw-hdmi: Attach to next bridge if available 2021-07-28 16:33:13 +03:00
i2c
ttm drm/ttm: remove ttm_bo_vm_insert_huge() 2021-11-05 11:13:19 +01:00
amd_asic_type.h drm/amdgpu: add cyan_skillfish asic type 2021-07-23 10:08:00 -04:00
drm_aperture.h drm/aperture: Pass DRM driver structure instead of driver name 2021-07-01 11:11:55 +02:00
drm_atomic_helper.h drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
drm_atomic_state_helper.h
drm_atomic_uapi.h
drm_atomic.h drm: fix doc warnings in drm_atomic.h 2021-06-04 12:40:01 -04:00
drm_audio_component.h ALSA: hda/i915 - fix list corruption with concurrent probes 2020-10-09 16:46:04 +02:00
drm_auth.h drm: clarify usage of drm leases 2021-07-29 09:12:01 +02:00
drm_blend.h
drm_bridge_connector.h
drm_bridge.h drm/bridge: Add stubs for devm_drm_of_get_bridge when OF is disabled 2021-09-30 15:54:32 +02:00
drm_cache.h drm: Add a prefetching memcpy_from_wc 2021-06-07 16:07:08 +02:00
drm_client.h drm/gem: Store client buffer mappings as struct dma_buf_map 2020-11-09 09:19:45 +01:00
drm_color_mgmt.h
drm_connector.h drm/connector: Add support for out-of-band hotplug notification (v3) 2021-08-20 12:35:59 +02:00
drm_crtc_helper.h
drm_crtc.h drm: drm_crc: fix a kernel-doc markup 2021-01-14 15:11:46 +01:00
drm_damage_helper.h drm/plane: Move drm_plane_enable_fb_damage_clips into core 2021-07-27 12:21:22 +02:00
drm_debugfs_crc.h
drm_debugfs.h
drm_device.h drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_displayid.h drm/displayid: rename displayid_hdr to displayid_header 2021-03-31 15:42:39 +03:00
drm_dp_aux_bus.h drm: Introduce the DP AUX bus 2021-06-11 12:30:39 -07:00
drm_dp_dual_mode_helper.h drm/dp_dual_mode: Pass drm_device to drm_lspcon_(get|set)_mode() 2021-04-27 18:43:44 -04:00
drm_dp_helper.h drm/dp: Add Additional DP2 Headers 2021-09-30 17:17:38 -04:00
drm_dp_mst_helper.h drm/dp_mst: Use kHz as link rate units when settig source max link caps at init 2021-05-27 15:30:59 -04:00
drm_drv.h drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_dsc.h - Display hotplug fix for gen2/gen3 (Chris) 2021-01-07 12:20:29 +01:00
drm_edid.h drm/edid: Fix drm_edid_encode_panel_id() kerneldoc warning 2021-09-27 17:14:47 -07:00
drm_encoder_slave.h
drm_encoder.h drm/encoder: Add macro drmm_plain_encoder_alloc() 2021-03-29 16:46:43 +01:00
drm_fb_cma_helper.h drm: Add and export function drm_fb_cma_sync_non_coherent 2021-05-25 11:42:09 +01:00
drm_fb_helper.h drm/aperture: Inline fbdev conflict helpers into aperture helpers 2021-04-14 09:00:04 +02:00
drm_file.h drm: add lockdep assert to drm_is_current_master_locked 2021-08-05 12:08:15 +02:00
drm_fixed.h
drm_flip_work.h
drm_format_helper.h drm/format-helper: Add drm_fb_xrgb8888_to_rgb888() 2021-10-04 12:04:19 +02:00
drm_fourcc.h drm: Define DRM_FORMAT_MAX_PLANES 2021-08-02 16:41:20 +02:00
drm_framebuffer.h drm: Define DRM_FORMAT_MAX_PLANES 2021-08-02 16:41:20 +02:00
drm_gem_atomic_helper.h drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_cma_helper.h drm: Add support for GEM buffers backed by non-coherent memory 2021-05-25 11:41:07 +01:00
drm_gem_framebuffer_helper.h drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_shmem_helper.h drm/shmem-helper: Removed drm_gem_shmem_create_object_cached() 2020-11-24 09:10:33 +01:00
drm_gem_ttm_helper.h drm/gem-ttm-helper: Provide helper for struct drm_driver.dumb_map_offset 2021-04-11 20:14:45 +02:00
drm_gem_vram_helper.h drm/vram-helper: Unexport drm_vram_helper_{alloc,release}_mm() 2021-07-05 08:55:11 +02:00
drm_gem.h drm: Drop drm_gem_object_put_locked() 2021-07-27 18:09:18 -07:00
drm_hashtab.h
drm_hdcp.h drm/hdcp: DP HDCP2.2 errata LC_Send_L_Prime=16 2021-03-31 14:27:43 +03:00
drm_ioctl.h drm: unexport drm_ioctl_permit 2021-08-13 17:50:48 +02:00
drm_lease.h
drm_legacy.h drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_managed.h drm: Remove drmm_add_final_kfree() declaration from public headers 2020-12-05 20:01:12 +01:00
drm_mipi_dbi.h drm/dbi: Print errors for mipi_dbi_command() 2021-07-05 00:22:51 +02:00
drm_mipi_dsi.h drm/mipi-dsi: Create devm device attachment 2021-09-24 19:25:33 +02:00
drm_mm.h drm: fix spelling error in comments 2020-09-17 13:39:44 +02:00
drm_mode_config.h drm: Improve the output_poll_changed description 2021-09-03 11:45:45 +02:00
drm_mode_object.h
drm_modes.h drm/modes: add non-OF stub for of_get_drm_display_mode 2021-01-08 19:42:14 +01:00
drm_modeset_helper_vtables.h drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default 2021-06-24 15:35:13 +02:00
drm_modeset_helper.h
drm_modeset_lock.h drm/locking: add backtrace for locking contended locks without backoff 2021-10-13 15:54:46 +03:00
drm_of.h
drm_panel.h drm/dp: Move panel DP AUX backlight support to drm_dp_helper 2021-07-13 06:38:37 -07:00
drm_pciids.h
drm_plane_helper.h
drm_plane.h drm/plane: Fix comment typo 2021-08-29 21:31:51 +02:00
drm_prime.h drm/prime: split array import functions v4 2020-11-30 15:00:45 +01:00
drm_print.h drm/print: Add deprecation notes to DRM_...() functions 2021-09-24 14:56:56 -07:00
drm_probe_helper.h drm/probe-helper: Create a HPD IRQ event helper for a single connector 2021-09-28 12:29:13 +02:00
drm_property.h drm: document drm_property_enum.value for bitfields 2021-07-26 10:08:22 +02:00
drm_rect.h drm/plane: remove drm_helper_get_plane_damage_clips 2021-07-27 12:21:22 +02:00
drm_scdc_helper.h
drm_self_refresh_helper.h
drm_simple_kms_helper.h drm/simple-kms: Support custom CRTC state 2021-08-08 20:14:08 +02:00
drm_syncobj.h
drm_sysfs.h
drm_util.h
drm_utils.h
drm_vblank_work.h drm/vblank: Add vblank works 2020-07-16 18:16:31 -04:00
drm_vblank.h drm/vblank: Document drm_crtc_vblank_restore constraints 2021-02-10 12:38:55 +01:00
drm_vma_manager.h drm/vma: Add a driver_private member to vma_node. 2021-06-11 10:53:18 +02:00
drm_writeback.h
gma_drm.h
gpu_scheduler.h drm/sched: Fix drm_sched_fence_free() so it can be passed an uninitialized fence 2021-09-07 09:58:26 +02:00
gud.h drm/gud: Add GUD_PIXEL_FORMAT_RGB888 2021-10-04 12:06:14 +02:00
i915_component.h
i915_drm.h
i915_mei_hdcp_interface.h
i915_pciids.h drm/i915/adl_p: Add PCI Devices IDs 2021-05-07 10:51:38 +03:00
intel_lpe_audio.h
intel-gtt.h iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header 2020-09-04 12:12:45 +02:00
spsc_queue.h
task_barrier.h