From: Greg Kroah-Hartman Date: Fri, 30 Aug 2024 11:15:34 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v4.19.321~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b710ef6ccda45cae2d5343febb7ba808b080925;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: drm-amdkfd-don-t-allow-mapping-the-mmio-hdp-page-with-large-pages.patch revert-mips-loongson64-reset-prioritise-firmware-service.patch --- diff --git a/queue-5.15/drm-amdkfd-don-t-allow-mapping-the-mmio-hdp-page-with-large-pages.patch b/queue-5.15/drm-amdkfd-don-t-allow-mapping-the-mmio-hdp-page-with-large-pages.patch new file mode 100644 index 00000000000..c2c96aa45c0 --- /dev/null +++ b/queue-5.15/drm-amdkfd-don-t-allow-mapping-the-mmio-hdp-page-with-large-pages.patch @@ -0,0 +1,47 @@ +From be4a2a81b6b90d1a47eaeaace4cc8e2cb57b96c7 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Sun, 14 Apr 2024 13:06:39 -0400 +Subject: drm/amdkfd: don't allow mapping the MMIO HDP page with large pages + +From: Alex Deucher + +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 +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Felix Kuehling +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +@@ -1290,7 +1290,7 @@ static int kfd_ioctl_alloc_memory_of_gpu + goto err_unlock; + } + offset = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd); +- if (!offset) { ++ if (!offset || (PAGE_SIZE > 4096)) { + err = -ENOMEM; + goto err_unlock; + } +@@ -2029,6 +2029,9 @@ static int kfd_mmio_mmap(struct kfd_dev + if (vma->vm_end - vma->vm_start != PAGE_SIZE) + return -EINVAL; + ++ if (PAGE_SIZE > 4096) ++ return -EINVAL; ++ + address = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd); + + vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_NORESERVE | diff --git a/queue-5.15/revert-mips-loongson64-reset-prioritise-firmware-service.patch b/queue-5.15/revert-mips-loongson64-reset-prioritise-firmware-service.patch new file mode 100644 index 00000000000..0269adc6586 --- /dev/null +++ b/queue-5.15/revert-mips-loongson64-reset-prioritise-firmware-service.patch @@ -0,0 +1,94 @@ +From 3ad155c8ce3a09338368e424316282d552eedbad Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Fri, 30 Aug 2024 13:02:51 +0200 +Subject: Revert "MIPS: Loongson64: reset: Prioritise firmware service" + +From: Greg Kroah-Hartman + +This reverts commit 77011a1d7a1a973d1657d06b658ce20f94172827 which is +commit 4e7ca0b57f3bc09ba3e4ab86bf6b7c35134bfd04 upstream. + +Turns out to break the 5.15.y build, it should not have been backported +that far. + +Reported-by: Guenter Roeck +Cc: Jiaxun Yang +Cc: Thomas Bogendoerfer +Link: https://lore.kernel.org/r/135ef4fd-4fc9-40b4-b188-8e64946f47c4@roeck-us.net +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/loongson64/reset.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +--- a/arch/mips/loongson64/reset.c ++++ b/arch/mips/loongson64/reset.c +@@ -11,7 +11,6 @@ + #include + #include + #include +-#include + #include + + #include +@@ -22,21 +21,36 @@ + #include + #include + +-static int firmware_restart(struct sys_off_data *unusedd) ++static void loongson_restart(char *command) + { + + void (*fw_restart)(void) = (void *)loongson_sysconf.restart_addr; + + fw_restart(); +- return NOTIFY_DONE; ++ while (1) { ++ if (cpu_wait) ++ cpu_wait(); ++ } + } + +-static int firmware_poweroff(struct sys_off_data *unused) ++static void loongson_poweroff(void) + { + void (*fw_poweroff)(void) = (void *)loongson_sysconf.poweroff_addr; + + fw_poweroff(); +- return NOTIFY_DONE; ++ while (1) { ++ if (cpu_wait) ++ cpu_wait(); ++ } ++} ++ ++static void loongson_halt(void) ++{ ++ pr_notice("\n\n** You can safely turn off the power now **\n\n"); ++ while (1) { ++ if (cpu_wait) ++ cpu_wait(); ++ } + } + + #ifdef CONFIG_KEXEC +@@ -140,17 +154,9 @@ static void loongson_crash_shutdown(stru + + static int __init mips_reboot_setup(void) + { +- if (loongson_sysconf.restart_addr) { +- register_sys_off_handler(SYS_OFF_MODE_RESTART, +- SYS_OFF_PRIO_FIRMWARE, +- firmware_restart, NULL); +- } +- +- if (loongson_sysconf.poweroff_addr) { +- register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, +- SYS_OFF_PRIO_FIRMWARE, +- firmware_poweroff, NULL); +- } ++ _machine_restart = loongson_restart; ++ _machine_halt = loongson_halt; ++ pm_power_off = loongson_poweroff; + + #ifdef CONFIG_KEXEC + kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL); diff --git a/queue-5.15/series b/queue-5.15/series index aa3c8fb3fad..e65f63d1d68 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -179,3 +179,5 @@ pinctrl-single-fix-potential-null-dereference-in-pcs_get_function.patch wifi-mwifiex-duplicate-static-structs-used-in-driver-instances.patch net-mana-fix-race-of-mana_hwc_post_rx_wqe-and-new-hwc-response.patch mptcp-sched-check-both-backup-in-retrans.patch +revert-mips-loongson64-reset-prioritise-firmware-service.patch +drm-amdkfd-don-t-allow-mapping-the-mmio-hdp-page-with-large-pages.patch