From: tip-bot for Kairui Song <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: rjw@rjwysocki.net, bp@suse.de, dyoung@redhat.com,
j-nomura@ce.jp.nec.com, linux-kernel@vger.kernel.org,
kasong@redhat.com, x86@kernel.org, mingo@kernel.org,
fanc.fnst@cn.fujitsu.com, tglx@linutronix.de, lijiang@redhat.com,
bhe@redhat.com, dirk.vandermerwe@netronome.com, hpa@zytor.com
Subject: [tip:x86/boot] x86/kexec: Add the ACPI NVS region to the ident map
Date: Mon, 10 Jun 2019 13:07:59 -0700 [thread overview]
Message-ID: <tip-5a949b38839e284b1307540c56b03caf57da9736@git.kernel.org> (raw)
In-Reply-To: <20190610073617.19767-1-kasong@redhat.com>
Commit-ID: 5a949b38839e284b1307540c56b03caf57da9736
Gitweb: https://git.kernel.org/tip/5a949b38839e284b1307540c56b03caf57da9736
Author: Kairui Song <kasong@redhat.com>
AuthorDate: Mon, 10 Jun 2019 15:36:17 +0800
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Mon, 10 Jun 2019 22:00:26 +0200
x86/kexec: Add the ACPI NVS region to the ident map
With the recent addition of RSDP parsing in the decompression stage,
a kexec-ed 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")
the ACPI tables memory region was added to the ident map.
But some machines have only an ACPI NVS memory region and the ACPI
tables are located in that region. In such case, the kexec-ed kernel
will still fail when trying to access ACPI tables if they're not mapped.
So add the NVS memory region to the ident map as well.
[ bp: Massage. ]
Fixes: 6bbeb276b71f ("x86/kexec: Add the EFI system tables and ACPI tables to the ident map")
Suggested-by: Junichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Kairui Song <kasong@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Junichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: kexec@lists.infradead.org
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190610073617.19767-1-kasong@redhat.com
---
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..b2b88dcaaf88 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;
struct init_pgtable_data data;
+ unsigned long flags;
+ int ret;
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; }
prev parent reply other threads:[~2019-06-10 20:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 7:36 [PATCH] x86/kexec: Add ACPI NVS region to the ident map Kairui Song
2019-06-10 9:51 ` Borislav Petkov
2019-06-10 10:18 ` Kairui Song
2019-06-10 10:59 ` Borislav Petkov
2019-06-10 11:07 ` Junichi Nomura
2019-06-10 11:24 ` Borislav Petkov
2019-06-10 9:53 ` Kairui Song
2019-06-10 20:07 ` tip-bot for Kairui Song [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-5a949b38839e284b1307540c56b03caf57da9736@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bhe@redhat.com \
--cc=bp@suse.de \
--cc=dirk.vandermerwe@netronome.com \
--cc=dyoung@redhat.com \
--cc=fanc.fnst@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=kasong@redhat.com \
--cc=lijiang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox