Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3023567ybi; Mon, 10 Jun 2019 03:00:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaLzehLrM0f/hdNfz6kWlqmuLUX6IC8OgHCiGtVJE1zITF0jDYW5EXstN91oczd0CE5VG/ X-Received: by 2002:a63:d103:: with SMTP id k3mr14333661pgg.189.1560160829644; Mon, 10 Jun 2019 03:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560160829; cv=none; d=google.com; s=arc-20160816; b=cp7whVTQ6N42r4POG1P326nKOZLe38jInhhlOBTjrwc6sYq0qFIDj3+gC2S6Rk7aa5 NEVloz17LebuBz0VzDADaiKH7QULVeMiXV+G5Td/knyjM/XNqkL1g5ydO9T4S1HtTflS U6LIpFyFlB6YuKAoi+WWuFYu9evbT1BTxfO7aAobjX9nLpN+U4zv2G8RvYMhbQS7HlxT Ss0RBym2qq37+I49ptT5Xsld6wH0fIrWEY+/LR6CMw3euJ8mzHZc3aEMQia717284rb2 2RhVaMKHzyarrPtf20S11iUMbBXvNW4Tv1dC4FchywP6WO72Lw6r6k0LMDP5LEMS2hQt 39SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zP+U4owfQx+AxiXAq571meL0GzDGTRsnhiqrLs/D2hU=; b=Vxgo+U9TDWMRs9Y+hPc9AZGga4VQpRD0JqKqXSlLptWTz0NmeMN9vzFE+RpzGvMSfZ dtAp5CdpmVlXV8KI+sUGdeeKi+8F2Nfr99xPMeaYMdfTNNOqr43/fQBcbIV614VqXDM4 Vf7r/NB+HGB96HhYkKWexnrbcf3XIhssjuiRuAbRwQm+wSrimxN8tn5M5pgsP75KAA5H ufddoec52FK+u3IEf6G6ZNjMaE+aeN5djXUCu4uwcOxrPgGRqQCWp0Cp+zlkZ9NAkOKr spVe7d6OiiPLB7G8RZCbPuThSVXqtU5jnmHORGBhcLUj7DqsrE9byoktgZ1nLQ6mF2Eu k9nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si8995287pls.392.2019.06.10.03.00.14; Mon, 10 Jun 2019 03:00:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388453AbfFJJxc (ORCPT + 99 others); Mon, 10 Jun 2019 05:53:32 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:54218 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388100AbfFJJxb (ORCPT ); Mon, 10 Jun 2019 05:53:31 -0400 Received: by mail-it1-f193.google.com with SMTP id m187so12275316ite.3 for ; Mon, 10 Jun 2019 02:53:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zP+U4owfQx+AxiXAq571meL0GzDGTRsnhiqrLs/D2hU=; b=ARGbZevxq0VLOmsQdM8PXUBDpmVT7rXJyatFJGHpRE4GKI4CJvGR4YeFxg0ePeWqLL 1EsUcodJN7qSqVqil143kwVUevPmHgFRjaJtUY/q7edwyyGJfAmKaOHdWlEtGo6gqMzN J+IV6tRYpMvXr0O8HJexiJW/JJjzB/PZ35yJJtPRapqZHaxqS+icRru7cXUJj/f/QlbO jaWWt0Ljfaukj/q6Q1O/P2s47yqbc/rlkf69bAEaaiizB2anOJcVahs90NHyE4hrdVUn teLQwpiB/Nz20l/LI82UAvwUngpZ7SyPpTVG1GWhF1O3aHlSgZyyGq5xqr/PhxLdU1XA xwaA== X-Gm-Message-State: APjAAAVIaQ5f9qf5ZBAWbYB0BCvPiCt1RmMLb+fDSpi8eUw3ufG8Osaa O5WksPfLzDaQrpZEn9pIZMfvNP+IaxOYvHDzrZ0LEw== X-Received: by 2002:a02:7b2d:: with SMTP id q45mr41554211jac.127.1560160410784; Mon, 10 Jun 2019 02:53:30 -0700 (PDT) MIME-Version: 1.0 References: <20190610073617.19767-1-kasong@redhat.com> In-Reply-To: <20190610073617.19767-1-kasong@redhat.com> From: Kairui Song Date: Mon, 10 Jun 2019 17:53:19 +0800 Message-ID: Subject: Re: [PATCH] x86/kexec: Add ACPI NVS region to the ident map To: Junichi Nomura , Dave Young , Dirk van der Merwe Cc: Chao Fan , Ingo Molnar , "Rafael J. Wysocki" , Thomas Gleixner , "the arch/x86 maintainers" , kexec@lists.infradead.org, Linux Kernel Mailing List , Baoquan He , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 10, 2019 at 3:37 PM Kairui Song 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 > Signed-off-by: Kairui Song > --- > > 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