mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE
@ 2026-06-16 13:51 Vivian Wang
  2026-06-16 13:51 ` [PATCH 1/2] ACPI: tables: Add missing #include <asm/fixmap.h> Vivian Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vivian Wang @ 2026-06-16 13:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Paul Walmsley, Palmer Dabbelt,
	Alexandre Ghiti
  Cc: linux-acpi, linux-kernel, linux-riscv, Vivian Wang

I did end up using this for something, so this is probably also useful
for others.

---
Vivian Wang (2):
      ACPI: tables: Add missing #include <asm/fixmap.h>
      riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE

 arch/riscv/Kconfig            | 1 +
 arch/riscv/include/asm/acpi.h | 2 ++
 arch/riscv/kernel/acpi.c      | 5 +++++
 arch/riscv/kernel/setup.c     | 2 ++
 drivers/acpi/tables.c         | 1 +
 5 files changed, 11 insertions(+)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260616-riscv-acpi-table-upgrade-fb5e69c5bf66

Best regards,
--  
Vivian "dramforever" Wang


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ACPI: tables: Add missing #include <asm/fixmap.h>
  2026-06-16 13:51 [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
@ 2026-06-16 13:51 ` Vivian Wang
  2026-06-16 13:51 ` [PATCH 2/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
  2026-06-25 20:32 ` [PATCH 0/2] " Paul Walmsley
  2 siblings, 0 replies; 4+ messages in thread
From: Vivian Wang @ 2026-06-16 13:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Paul Walmsley, Palmer Dabbelt,
	Alexandre Ghiti
  Cc: linux-acpi, linux-kernel, linux-riscv, Vivian Wang

drivers/acpi/tables.c uses NR_FIX_BTMAPS without including
<asm/fixmap.h>. This isn't a problem for existing archs, but would be
when ARCH_HAS_ACPI_TABLE_UPGRADE is enabled for RISC-V. Add the missing
include.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
---
 drivers/acpi/tables.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 4286e4af1092..eb93c060426f 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -22,6 +22,7 @@
 #include <linux/initrd.h>
 #include <linux/security.h>
 #include <linux/kmemleak.h>
+#include <asm/fixmap.h>
 #include "internal.h"
 
 #ifdef CONFIG_ACPI_CUSTOM_DSDT

-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE
  2026-06-16 13:51 [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
  2026-06-16 13:51 ` [PATCH 1/2] ACPI: tables: Add missing #include <asm/fixmap.h> Vivian Wang
@ 2026-06-16 13:51 ` Vivian Wang
  2026-06-25 20:32 ` [PATCH 0/2] " Paul Walmsley
  2 siblings, 0 replies; 4+ messages in thread
From: Vivian Wang @ 2026-06-16 13:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Paul Walmsley, Palmer Dabbelt,
	Alexandre Ghiti
  Cc: linux-acpi, linux-kernel, linux-riscv, Vivian Wang

Implement the various required hooks and enable
ARCH_HAS_ACPI_TABLE_UPGRADE to allow use for ACPI_TABLE_UPGRADE, which
is useful for debugging ACPI table problems.

The implementation is based on arm64's of the same feature due to the
similarities of the requirements of the two platforms.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
---
 arch/riscv/Kconfig            | 1 +
 arch/riscv/include/asm/acpi.h | 2 ++
 arch/riscv/kernel/acpi.c      | 5 +++++
 arch/riscv/kernel/setup.c     | 2 ++
 4 files changed, 10 insertions(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index d235396c4514..2986d45bdc72 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -23,6 +23,7 @@ config RISCV
 	select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM_VMEMMAP
 	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
 	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
+	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_BINFMT_FLAT
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL if MMU
diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h
index 26ab37c171bc..d59bd06347cc 100644
--- a/arch/riscv/include/asm/acpi.h
+++ b/arch/riscv/include/asm/acpi.h
@@ -92,4 +92,6 @@ void acpi_map_cpus_to_nodes(void);
 static inline void acpi_map_cpus_to_nodes(void) { }
 #endif /* CONFIG_ACPI_NUMA */
 
+#define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
+
 #endif /*_ASM_ACPI_H*/
diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index 068e0b404b6f..efd52a5d05b5 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -353,3 +353,8 @@ int acpi_get_cpu_uid(unsigned int cpu, u32 *uid)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(acpi_get_cpu_uid);
+
+void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
+{
+	memblock_mark_nomap(addr, size);
+}
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index c89cc272440b..96b6a166ede1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -324,6 +324,8 @@ void __init setup_arch(char **cmdline_p)
 	efi_init();
 	paging_init();
 
+	acpi_table_upgrade();
+
 	/* Parse the ACPI tables for possible boot-time configuration */
 	acpi_boot_table_init();
 

-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE
  2026-06-16 13:51 [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
  2026-06-16 13:51 ` [PATCH 1/2] ACPI: tables: Add missing #include <asm/fixmap.h> Vivian Wang
  2026-06-16 13:51 ` [PATCH 2/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
@ 2026-06-25 20:32 ` Paul Walmsley
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2026-06-25 20:32 UTC (permalink / raw)
  To: Vivian Wang
  Cc: Rafael J. Wysocki, Len Brown, Paul Walmsley, Palmer Dabbelt,
	Alexandre Ghiti, linux-acpi, linux-kernel, linux-riscv

On Tue, 16 Jun 2026, Vivian Wang wrote:

> I did end up using this for something, so this is probably also useful
> for others.

Thanks, queued for v7.3.  Would assume that pretty much anyone 
working on RISC-V systems running ACPI right now would want this...


- Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-25 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-16 13:51 [PATCH 0/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
2026-06-16 13:51 ` [PATCH 1/2] ACPI: tables: Add missing #include <asm/fixmap.h> Vivian Wang
2026-06-16 13:51 ` [PATCH 2/2] riscv: acpi: Enable ARCH_HAS_ACPI_TABLE_UPGRADE Vivian Wang
2026-06-25 20:32 ` [PATCH 0/2] " Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®