diff mbox series

[2/2] ACPI: arm64: Reserve the ACPI tables in memblock

Message ID 20210429133533.1750721-3-maz@kernel.org (mailing list archive)
State New, archived
Headers show
Series arm64: kexec_file_load vs memory reservations | expand

Commit Message

Marc Zyngier April 29, 2021, 1:35 p.m. UTC
Just like the EFI reservations, ACPI tables can be stamped over
by kexec_file_load(), and the secondary kernel will be unable to
recover from such corruption.

It looks like our x86 friends have been there before, and have
recently added some infratructure that does what we need since
1a1c130ab757 ("ACPI: tables: x86: Reserve memory occupied by ACPI
tables"), though it appears to exist for different reasons.

Let's call into acpi_reserve_initial_tables() early so that
our tables are protected from the big bad kexec.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/kernel/acpi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Moritz Fischer May 3, 2021, 6:57 p.m. UTC | #1
Marc,

On Thu, Apr 29, 2021 at 02:35:33PM +0100, Marc Zyngier wrote:
> Just like the EFI reservations, ACPI tables can be stamped over
> by kexec_file_load(), and the secondary kernel will be unable to
> recover from such corruption.
> 
> It looks like our x86 friends have been there before, and have
> recently added some infratructure that does what we need since
> 1a1c130ab757 ("ACPI: tables: x86: Reserve memory occupied by ACPI
> tables"), though it appears to exist for different reasons.
> 
> Let's call into acpi_reserve_initial_tables() early so that
> our tables are protected from the big bad kexec.
> 

Feel free to add (and/or):

Tested-by: Moritz Fischer <mdf@kernel.org>
Reported-by: Moritz Fischer <mdf@kernel.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  arch/arm64/kernel/acpi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index cada0b816c8a..5b5406c92ee4 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -233,6 +233,7 @@ void __init acpi_boot_table_init(void)
>  		if (earlycon_acpi_spcr_enable)
>  			early_init_dt_scan_chosen_stdout();
>  	} else {
> +		acpi_reserve_initial_tables();
>  		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
>  		if (IS_ENABLED(CONFIG_ACPI_BGRT))
>  			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Thanks,
Moritz
diff mbox series

Patch

diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index cada0b816c8a..5b5406c92ee4 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -233,6 +233,7 @@  void __init acpi_boot_table_init(void)
 		if (earlycon_acpi_spcr_enable)
 			early_init_dt_scan_chosen_stdout();
 	} else {
+		acpi_reserve_initial_tables();
 		acpi_parse_spcr(earlycon_acpi_spcr_enable, true);
 		if (IS_ENABLED(CONFIG_ACPI_BGRT))
 			acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);