]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdkfd: don't allow mapping the MMIO HDP page with large pages
authorAlex Deucher <alexander.deucher@amd.com>
Sun, 14 Apr 2024 17:06:39 +0000 (13:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:02:34 +0000 (12:02 +0200)
commit4b4cff994a27ebf7bd3fb9a798a1cdfa8d01b724
tree120049813b67253fac7272c0ef694a4af75d16ca
parent1a88c18da464db0ba8ea25196d0a06490f65322e
drm/amdkfd: don't allow mapping the MMIO HDP page with large pages

commit be4a2a81b6b90d1a47eaeaace4cc8e2cb57b96c7 upstream.

We don't get the right offset in that case.  The GPU has
an unused 4K area of the register BAR space into which you can
remap registers.  We remap the HDP flush registers into this
space to allow userspace (CPU or GPU) to flush the HDP when it
updates VRAM.  However, on systems with >4K pages, we end up
exposing PAGE_SIZE of MMIO space.

Fixes: d8e408a82704 ("drm/amdkfd: Expose HDP registers to user space")
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c