From 4ccb8ff9f90514af8537ea2707b4f5756bb22521 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 5 Nov 2024 17:26:37 +0100 Subject: [PATCH] 6.11-stable patches added patches: risc-v-acpi-fix-early_ioremap-to-early_memremap.patch --- ...-fix-early_ioremap-to-early_memremap.patch | 52 +++++++++++++++++++ queue-6.11/series | 1 + 2 files changed, 53 insertions(+) create mode 100644 queue-6.11/risc-v-acpi-fix-early_ioremap-to-early_memremap.patch diff --git a/queue-6.11/risc-v-acpi-fix-early_ioremap-to-early_memremap.patch b/queue-6.11/risc-v-acpi-fix-early_ioremap-to-early_memremap.patch new file mode 100644 index 00000000000..ee5a01ea836 --- /dev/null +++ b/queue-6.11/risc-v-acpi-fix-early_ioremap-to-early_memremap.patch @@ -0,0 +1,52 @@ +From 1966db682f064172891275cb951aa8c98a0a809b Mon Sep 17 00:00:00 2001 +From: Yunhui Cui +Date: Mon, 14 Oct 2024 21:01:41 +0800 +Subject: RISC-V: ACPI: fix early_ioremap to early_memremap + +From: Yunhui Cui + +commit 1966db682f064172891275cb951aa8c98a0a809b upstream. + +When SVPBMT is enabled, __acpi_map_table() will directly access the +data in DDR through the IO attribute, rather than through hardware +cache consistency, resulting in incorrect data in the obtained ACPI +table. + +The log: ACPI: [ACPI:0x18] Invalid zero length. + +We do not assume whether the bootloader flushes or not. We should +access in a cacheable way instead of maintaining cache consistency +by software. + +Fixes: 3b426d4b5b14 ("RISC-V: ACPI : Fix for usage of pointers in different address space") +Cc: stable@vger.kernel.org +Reviewed-by: Alexandre Ghiti +Signed-off-by: Yunhui Cui +Reviewed-by: Sunil V L +Link: https://lore.kernel.org/r/20241014130141.86426-1-cuiyunhui@bytedance.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/acpi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/riscv/kernel/acpi.c ++++ b/arch/riscv/kernel/acpi.c +@@ -210,7 +210,7 @@ void __init __iomem *__acpi_map_table(un + if (!size) + return NULL; + +- return early_ioremap(phys, size); ++ return early_memremap(phys, size); + } + + void __init __acpi_unmap_table(void __iomem *map, unsigned long size) +@@ -218,7 +218,7 @@ void __init __acpi_unmap_table(void __io + if (!map || !size) + return; + +- early_iounmap(map, size); ++ early_memunmap(map, size); + } + + void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) diff --git a/queue-6.11/series b/queue-6.11/series index 80082cf2e41..2602be6eaf2 100644 --- a/queue-6.11/series +++ b/queue-6.11/series @@ -132,3 +132,4 @@ iio-gts-helper-fix-memory-leaks-in-iio_gts_build_avail_scale_table.patch iio-light-veml6030-fix-microlux-value-calculation.patch nilfs2-fix-kernel-bug-due-to-missing-clearing-of-checked-flag.patch nilfs2-fix-potential-deadlock-with-newly-created-symlinks.patch +risc-v-acpi-fix-early_ioremap-to-early_memremap.patch -- 2.47.3