Skip to content

Commit

Permalink
RISC-V: ACPI: fix early_ioremap to early_memremap
Browse files Browse the repository at this point in the history
commit 1966db6 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: 3b426d4 ("RISC-V: ACPI : Fix for usage of pointers in different address space")
Cc: [email protected]
Reviewed-by: Alexandre Ghiti <[email protected]>
Signed-off-by: Yunhui Cui <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
cuiyunhui authored and gregkh committed Nov 8, 2024
1 parent 1246d86 commit b6f95df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/riscv/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)
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)
{
if (!map || !size)
return;

early_iounmap(map, size);
early_memunmap(map, size);
}

void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
Expand Down

0 comments on commit b6f95df

Please sign in to comment.