[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59ef4cd5-5703-2356-c893-9858985f91e0@intel.com>
Date: Mon, 14 Feb 2022 20:34:07 +0100
From: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
To: Amadeusz Sławiński
<amadeuszx.slawinski@...ux.intel.com>, <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H . Peter Anvin" <hpa@...or.com>
CC: <linux-kernel@...r.kernel.org>,
Cezary Rojewski <cezary.rojewski@...el.com>,
Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] x86: Preserve ACPI memory area during hibernation
On 1/21/2022 11:39 AM, Amadeusz Sławiński wrote:
> When overriding NHLT ACPI-table tests show that on some platforms
> there is problem that NHLT contains garbage after hibernation/resume
> cycle.
>
> Problem stems from the fact that ACPI override performs early memory
> allocation using memblock_phys_alloc_range() in
> memblock_phys_alloc_range(). This memory block is later being marked as
> ACPI memory block in arch_reserve_mem_area(). Later when memory areas
> are considered for hibernation it is being marked as nosave in
> e820__register_nosave_regions().
>
> Fix this by skipping ACPI memory area altogether when considering areas
> to mark as nosave.
This patch looks correct to me and I'm going to apply it as 5.18
material unless there are any objections or concerns (in which case
please let me know).
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@...ux.intel.com>
> Reviewed-by: Cezary Rojewski <cezary.rojewski@...el.com>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> arch/x86/kernel/e820.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index bc0657f0deed..88c1b785ffe4 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -758,6 +758,18 @@ void __init e820__register_nosave_regions(unsigned long limit_pfn)
> for (i = 0; i < e820_table->nr_entries; i++) {
> struct e820_entry *entry = &e820_table->entries[i];
>
> + /*
> + * Areas containing ACPI tables should be preserved during
> + * hibernation to prevent potential problems caused by BIOS
> + * upgrades when offline, as well as to preserve initrd
> + * ACPI tables overrides which are applied on boot.
> + * See also acpi_table_upgrade() & arch_reserve_mem_area()
> + */
> + if (entry->type == E820_TYPE_ACPI) {
> + pfn = PFN_UP(entry->addr + entry->size);
> + continue;
> + }
> +
> if (pfn < PFN_UP(entry->addr))
> register_nosave_region(pfn, PFN_UP(entry->addr));
>
Powered by blists - more mailing lists