Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp486639yba; Wed, 24 Apr 2019 04:54:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9Kw7sIPCZwTr2k/5IBgr1+5eF3KtzGHPvUzUICuQ49zThA78yWR/gG4AIQqgXk9PSFXzL X-Received: by 2002:aa7:85d9:: with SMTP id z25mr33333405pfn.31.1556106879136; Wed, 24 Apr 2019 04:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556106879; cv=none; d=google.com; s=arc-20160816; b=UcwhsnJOljv8queJi8gAeVqm90J0F06jvEJuTlylqFQRFUdOqGOtY4UWzOCRBrpLPV DXPVp414LO/Dg8IKi31kZeO8/OgjbdzYFQJVuCOQMb2EzfE9LNgBimr7/gUYreV+2/o0 acvhIZsf/lakyXBE8+zs1JKAYWoqytBZe0tA5hVZ/NMLMUWtLHFsvcslxR6n8rgzq/qz /u8dbp7B0IAFzkjggJQg3cnH8eznPdHNBY65wkl2PFrRBr+QQPHEFwzgGzWoN+QMN8CX YNAq+gRuiiAhkefmdq0Utf+Gzw0JJ8doN+7PlTV7bLDx36afqxXZ7FIgzI99HXh4VALN ie4Q== 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=RCPr+Bpv1PvmLhqWlzdwGPLFCdUpiW+JQjNCuXkw1SU=; b=knOUGyuUBPBh+/MS4LOp6SRn2+6EqYoiH1rT45F9CH7Jygs+Npbel6q2qzmljPmRoY l5gGkh0O7MGsLo4Qr8CThIb/3WzHgivQQfr3AY9uCw2N6JZbikkfeMqTMFDSr83I4FwL 7m/OdC5v+uXwraad4bExQiUurQSD/P51lmUVdG4hF3P3t1ipl9Yzw7SSI5OE4puEYeNo K4rSJsoH6E3QefAeY9c0M568Ti4jd/c/EEu4Q9MYmkEWuKS3mkRMcsK1EwYOz7pZyv7t L5tpmILCBoGGpLDw7+zGqS6VQmozWfVKNkcIWP/kBZVg6FUE00Iir8S4D2lBMgQdnKL/ C4QQ== 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 s145si17587343pgs.228.2019.04.24.04.54.22; Wed, 24 Apr 2019 04:54:39 -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 S1729156AbfDXLhK (ORCPT + 99 others); Wed, 24 Apr 2019 07:37:10 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:40259 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729021AbfDXLhH (ORCPT ); Wed, 24 Apr 2019 07:37:07 -0400 Received: by mail-io1-f67.google.com with SMTP id i21so14945570iol.7 for ; Wed, 24 Apr 2019 04:37:07 -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=RCPr+Bpv1PvmLhqWlzdwGPLFCdUpiW+JQjNCuXkw1SU=; b=fmfqwBeS4G4PAHj4V8QH2p2KdTxh1GebOV6KdY2S+Zs+RFaA4BDFjVTTsnAsXMOnWl JrQlkcrAcGA+LW7up9lDDiNWmvX3BO2jGC+JiZt3aBNXBuO5P+scae9sal1XuXSqgGj1 pE1dxpVq0D16ZSgKsJhHqAMnj/Bam47K9mAL5viZ8zZ7AXECmEDBxQERF5B8CqtFNuTV iKX8I2nSuNXqm7KCx/AFWzKPUYd3PzQ/x8xzATx7B1MqHgBLsoy+xjDMfb4J2DolxwEx KMojWJn5PYStZdB9FF7Fr1+ilMhkM6bO1Lv/A7gy+FnsnF2A7zLmDHsIV+PRuHGKf3bk BJ2w== X-Gm-Message-State: APjAAAVU0Zi0XBkSSXfjndqC7EzKw4+JoPj5UnWmnhGtdsbTTMTpIFCs G0YhOY4ypx4RVHdP37amod9H6ScvuhDP8pm5853KKQ== X-Received: by 2002:a5e:8b09:: with SMTP id g9mr2043236iok.137.1556105826608; Wed, 24 Apr 2019 04:37:06 -0700 (PDT) MIME-Version: 1.0 References: <20190422092804.15534-1-kasong@redhat.com> <965f770a-b103-72fb-eaef-cb337ebe8290@ce.jp.nec.com> <24f1dc7c-1dea-79b0-d364-0dc7d605ce01@ce.jp.nec.com> <20190424054135.GG3584@localhost.localdomain> <20190424061831.GA9059@dhcp-128-65.nay.redhat.com> <20190424074553.GH3584@localhost.localdomain> In-Reply-To: <20190424074553.GH3584@localhost.localdomain> From: Kairui Song Date: Wed, 24 Apr 2019 07:36:55 -0400 Message-ID: Subject: Re: [PATCH] x86/kexec: always ensure EFI systab region is mapped To: Baoquan He Cc: Dave Young , Junichi Nomura , "linux-kernel@vger.kernel.org" , Borislav Petkov , Thomas Gleixner , Chao Fan , "x86@kernel.org" , "kexec@lists.infradead.org" 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 Wed, Apr 24, 2019, 03:46 Baoquan He wrote: > > On 04/24/19 at 02:18pm, Dave Young wrote: > > On 04/24/19 at 01:41pm, Baoquan He wrote: > > > On 04/24/19 at 02:47am, Junichi Nomura wrote: > > > > On 4/24/19 2:15 AM, Kairui Song wrote: > > > > > On Mon, Apr 22, 2019 at 11:21 PM Junichi Nomura wrote: > > > > >> Is the mapping of ACPI tables just by luck, too? > > > > > > > > > > Good question, they should have same issue with systab, I ignored this one. > > > > > Then in first kernel when doing kexec it should ensure both ACPI > > > > > tables and the EFI systab are mapped, that should cover everything and > > > > > make it work. > > > > > > > > Right. > > > > > > > > > Is there anything else missing? > > > > No, as far as I looked around get_rsdp_addr(). > > > > > > Have made a draft patch to build ident mapping for ACPI tables too, it's > > > based on Kairui's patch. Dave has tested on his t400s laptop, and > > > passed. Please check if this adding is OK. > > > > > > Kairui, you can add this into your patch to make a new one and resend. > > > Or I can combine them and send for you today. > > > > > Since I can not reproduce the acpi table accessing fault with Kairui's patch, > > the test is just sanity testing on same hardware. But the patch looks > > good. > > Yes, usually vendor will put these efi systab, ACPI tables together. See > the regions you listed on your t420 laptop in another mail: > da99f000 - dae9efff Reserved (efi systab fall in this region) > daf9f000 - daffefff ACPI tables > > We build 1:1 mapping for kexec kernel down to PMD level. Means for a > region, it will align starting address down to PMD size, and align end > address up to PMD size. So the end of efi systab, 0xdae9efff, will cause > mapping built for the 2MB area, 0xdae00000-0xdaf00000. Clearly ACPI > tables are covered by that PMD entry. That's why only efi systab > mapping is built, accessing ACPI tables doesn't cause error. > > But we can't assume they will be put together always, so need map ACPI > tables too. > > > > > With Kairui's fix+ this acpi fix and Junichi's patch everything works. > > Can anyone send them for example patch 1/2: kexec early mapping for > > efi/acpi, patch 2/2: Junichi's previous patch. > > Kairui is having a workshop in the US, I can make a patchset to > include these two patches. > > For patch 1/2, I will combine the patch Kairui posted and my draft patch, > Kairui is the author certainly, since he debugged and found out the root > cause, and posted v1 when I was on vacation last week. > > For patch 2/2, I think the version Boris organized is good. > http://lkml.kernel.org/r/20190416095209.GG27892@zn.tnic > Thanks a lot Bao! I was offline for about 1 day due to timezone and flight, I have no problem with this and the ACPI mapping part looks good to me.