Skip to content

Commit 38b04a7

Browse files
Jon Mastersrafaeljw
authored andcommitted
ACPI: ARM64: support for ACPI_TABLE_UPGRADE
This patch adds support for ACPI_TABLE_UPGRADE for ARM64 To access initrd image we need to move initialization of linear mapping a bit earlier. The implementation of the feature acpi_table_upgrade() (drivers/acpi/tables.c) works with initrd data represented as an array in virtual memory. It uses some library utility to find the redefined tables in that array and iterates over it to copy the data to new allocated memory. So to access the initrd data via fixmap we need to rewrite it considerably. In x86 arch, kernel memory is already mapped by the time when acpi_table_upgrade() and acpi_boot_table_init() are called so I think that we can just move this mapping one function earlier too. Signed-off-by: Jon Masters <[email protected]> Signed-off-by: Aleksey Makarov <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 91dda51 commit 38b04a7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config ARM64
44
select ACPI_GENERIC_GSI if ACPI
55
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
66
select ARCH_HAS_DEVMEM_IS_ALLOWED
7+
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
78
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
89
select ARCH_HAS_ELF_RANDOMIZE
910
select ARCH_HAS_GCOV_PROFILE_ALL

arch/arm64/include/asm/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,6 @@ static inline const char *acpi_get_enable_method(int cpu)
113113
pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr);
114114
#endif
115115

116+
#define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
117+
116118
#endif /*_ASM_ACPI_H*/

arch/arm64/kernel/setup.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,13 @@ void __init setup_arch(char **cmdline_p)
260260
efi_init();
261261
arm64_memblock_init();
262262

263+
paging_init();
264+
265+
acpi_table_upgrade();
266+
263267
/* Parse the ACPI tables for possible boot-time configuration */
264268
acpi_boot_table_init();
265269

266-
paging_init();
267-
268270
if (acpi_disabled)
269271
unflatten_device_tree();
270272

0 commit comments

Comments
 (0)