linux/drivers/gpu/drm/nouveau
Māris Nartišs da5e45e619 drm/nouveau/mmu: ALIGN_DOWN correct variable
Commit 7110c89bb8852ff8b0f88ce05b332b3fe22bd11e ("mmu: swap out round
for ALIGN") replaced two calls to round/rounddown with ALIGN/ALIGN_DOWN,
but erroneously applied ALIGN_DOWN to a different variable (addr) and left
intended variable (tail) not rounded/ALIGNed.

As a result screen corruption, X lockups are observable. An example of kernel
log of affected system with NV98 card where it was bisected:

nouveau 0000:01:00.0: gr: TRAP_M2MF 00000002 [IN]
nouveau 0000:01:00.0: gr: TRAP_M2MF 00320951 400007c0 00000000 04000000
nouveau 0000:01:00.0: gr: 00200000 [] ch 1 [000fbbe000 DRM] subc 4 class 5039
mthd 0100 data 00000000
nouveau 0000:01:00.0: fb: trapped read at 0040000000 on channel 1
[0fbbe000 DRM]
engine 00 [PGRAPH] client 03 [DISPATCH] subclient 04 [M2M_IN] reason 00000006
[NULL_DMAOBJ]

Fixes bug 105173 ("[MCP79][Regression] Unhandled NULL pointer dereference in
nvkm_object_unmap since kernel 4.15")
https://bugs.freedesktop.org/show_bug.cgi?id=105173

Fixes: 7110c89bb885 ("mmu: swap out round for ALIGN ")
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Maris Nartiss <maris.nartiss@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org # v4.15+
2018-03-16 11:55:04 +10:00
..
dispnv04 main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
include drm/nouveau: Add support for BLCG on Kepler2 2018-02-02 15:24:09 +10:00
nvif drm/nouveau/mmu: define user interfaces to mmu vmm opertaions 2017-11-02 13:32:31 +10:00
nvkm drm/nouveau/mmu: ALIGN_DOWN correct variable 2018-03-16 11:55:04 +10:00
Kbuild drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
Kconfig drm/nouveau/mmu: implement new vmm backend 2017-11-02 13:32:27 +10:00
nouveau_abi16.c drm/nouveau: remove trivial cases of nvxx_device() usage 2017-11-02 13:32:32 +10:00
nouveau_abi16.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_acpi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_acpi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_backlight.c
nouveau_bios.c drm/nouveau/bios: make const arrays hwsq_signature and edid_sig static 2017-11-03 09:12:10 +10:00
nouveau_bios.h
nouveau_bo.c Linux 4.15-rc8 2018-01-18 09:32:15 +10:00
nouveau_bo.h drm/nouveau/bo: add helper functions for handling pinned+mapped buffers 2018-02-02 15:24:06 +10:00
nouveau_chan.c drm/nouveau: switch over to new memory and vmm interfaces 2017-11-02 13:32:33 +10:00
nouveau_chan.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_connector.c drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
nouveau_connector.h
nouveau_crtc.h drm/nouveau/kms/nv50: prepare for double-buffered LUTs 2018-02-02 15:24:06 +10:00
nouveau_debugfs.c
nouveau_debugfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_display.c drm/nouveau: Use drm_fb_helper_output_poll_changed() 2017-12-08 13:07:01 +01:00
nouveau_display.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_dma.c drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
nouveau_dma.h drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
nouveau_dp.c
nouveau_drm.c drm/nouveau: fix race when adding delayed work items 2017-12-23 08:56:59 +10:00
nouveau_drv.h Merge branch 'linux-4.15' of git://github.com/skeggsb/linux into drm-fixes 2017-12-19 13:21:11 +10:00
nouveau_encoder.h
nouveau_fbcon.c drm/nouveau/fbcon: add module parameter to select bits-per-pixel 2018-02-02 15:24:05 +10:00
nouveau_fbcon.h drm/nouveau: Use drm_fb_helper_output_poll_changed() 2017-12-08 13:07:01 +01:00
nouveau_fence.c drm/nouveau: remove unused nouveau_fence_work() 2017-11-02 13:32:33 +10:00
nouveau_fence.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_gem.c drm/ttm: remove ttm_bo_unreserve_ticket 2017-12-06 12:47:20 -05:00
nouveau_gem.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_hwmon.c drm/nouveau/hwmon: Change permissions to numeric 2017-06-16 14:05:03 +10:00
nouveau_hwmon.h
nouveau_ioc32.c
nouveau_ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_led.c
nouveau_led.h
nouveau_mem.c drm/nouveau: use alternate memory type for system-memory buffers with kind != 0 2017-12-19 10:16:37 +10:00
nouveau_mem.h drm/nouveau: switch over to new memory and vmm interfaces 2017-11-02 13:32:33 +10:00
nouveau_nvif.c
nouveau_platform.c
nouveau_platform.h
nouveau_prime.c
nouveau_reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_sgdma.c main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
nouveau_ttm.c drm/nouveau: use alternate memory type for system-memory buffers with kind != 0 2017-12-19 10:16:37 +10:00
nouveau_ttm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_usif.c
nouveau_usif.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_vga.c drm/nouveau: Use drm_fb_helper_output_poll_changed() 2017-12-08 13:07:01 +01:00
nouveau_vga.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nouveau_vmm.c drm/nouveau: fix obvious memory leak 2017-12-20 08:40:36 +10:00
nouveau_vmm.h drm/nouveau/mmu: remove old vmm frontend 2017-11-02 13:32:33 +10:00
nv04_fbcon.c
nv04_fence.c
nv10_fence.c
nv10_fence.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nv17_fence.c
nv50_display.c drm/nouveau/kms/nv50: fix handling of gamma since atomic conversion 2018-02-02 15:24:07 +10:00
nv50_display.h
nv50_fbcon.c drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
nv50_fence.c
nv84_fence.c drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
nvc0_fbcon.c drm/nouveau: separate constant-va tracking from nvkm vma structure 2017-11-02 13:32:21 +10:00
nvc0_fence.c