[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACPcB9cRjPPMkC7+yToCZ_MoVw8McMcycRQ6tZT3yjD6pi4-NA@mail.gmail.com>
Date: Mon, 10 Jun 2019 17:53:19 +0800
From: Kairui Song <kasong@...hat.com>
To: Junichi Nomura <j-nomura@...jp.nec.com>,
Dave Young <dyoung@...hat.com>,
Dirk van der Merwe <dirk.vandermerwe@...ronome.com>
Cc: Chao Fan <fanc.fnst@...fujitsu.com>,
Ingo Molnar <mingo@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Thomas Gleixner <tglx@...utronix.de>,
"the arch/x86 maintainers" <x86@...nel.org>,
kexec@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Baoquan He <bhe@...hat.com>, Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] x86/kexec: Add ACPI NVS region to the ident map
On Mon, Jun 10, 2019 at 3:37 PM Kairui Song <kasong@...hat.com> wrote:
>
> With the recent addition of RSDP parsing in decompression stage, kexec
> kernel now needs ACPI tables to be covered by the identity mapping.
> And in commit 6bbeb276b71f ("x86/kexec: Add the EFI system tables and
> ACPI tables to the ident map"), ACPI tables memory region was added to
> the ident map.
>
> But on some machines, there is only ACPI NVS memory region, and the ACPI
> tables is located in the NVS region instead. In such case second kernel
> will still fail when trying to access ACPI tables.
>
> So, to fix the problem, add NVS memory region in the ident map as well.
>
> Fixes: 6bbeb276b71f ("x86/kexec: Add the EFI system tables and ACPI tables to the ident map")
> Suggested-by: Junichi Nomura <j-nomura@...jp.nec.com>
> Signed-off-by: Kairui Song <kasong@...hat.com>
> ---
>
> Tested with my laptop and VM, on top of current tip:x86/boot.
>
> arch/x86/kernel/machine_kexec_64.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> index 3c77bdf7b32a..a406602fdb3c 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -54,14 +54,26 @@ static int mem_region_callback(struct resource *res, void *arg)
> static int
> map_acpi_tables(struct x86_mapping_info *info, pgd_t *level4p)
> {
> - unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> + int ret;
> + unsigned long flags;
> struct init_pgtable_data data;
>
> data.info = info;
> data.level4p = level4p;
> flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> - return walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1,
> - &data, mem_region_callback);
> +
> + ret = walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1,
> + &data, mem_region_callback);
> + if (ret && ret != -EINVAL)
> + return ret;
> +
> + /* ACPI tables could be located in ACPI Non-volatile Storage region */
> + ret = walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1,
> + &data, mem_region_callback);
> + if (ret && ret != -EINVAL)
> + return ret;
> +
> + return 0;
> }
> #else
> static int map_acpi_tables(struct x86_mapping_info *info, pgd_t *level4p) { return 0; }
> --
> 2.21.0
>
Hi, could you help test the tip branch with this applied? This should
fix all the issues, I can't find any other issues now. Thanks.
--
Best Regards,
Kairui Song
Powered by blists - more mailing lists