Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp395997yba; Wed, 24 Apr 2019 03:13:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1OchP+cEjWlZJWzYRmEfjgb0lL0p9aMKfTjKdlZvTmtwaori3addZwujiHRLPRTNmp9bA X-Received: by 2002:a17:902:441:: with SMTP id 59mr31818463ple.242.1556100785908; Wed, 24 Apr 2019 03:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556100785; cv=none; d=google.com; s=arc-20160816; b=wXQjzeeGboQRGUNnNQj9QCE9Q8uCc9KKiOzlgTPebX1QSspFElvigsBBjAFO+U1vBw qvcDcIt+6M08iO5tHFaM7t0bKjLpsVR2gXkzbWkXd4duY180MNGg8Eim2H4UaJQdDgKb cH9Cg/u4CLC2tYulbaI1cg6LTPTHi4JZU16F0d2tC9wJKQaqU/PpZWiCVkpRJ3y/j/yq 1RJMJCzyvFX+kSoVv50yHDKFkzjsbC0P53dDvqBkFWZF5Zu3kbpBFlJwoXKaDOCmo1AM HGH1EogTElCiKeRysrvjmBABmZJ1tn4C6lbOTegCZCc5c4O+NeEcTtQ0drj9JGpDQK6B 8g1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LnjnjwQyV+/Bhz8m1UDLZS+1pn0FORsLdZyw400WMZI=; b=rttG337dHcO4+x3+WY32Y70hJKb2B+xIywxOY1A+b53YXbvVYRoITxvQiFvmolj77I BUMikqZFViZ78JL7PBDXC2MtcKj8JZUfdBVwC0vmMK0MEAM/FI1+WEPCqugb9Eql9eGN E93BBKKvLDHQ9OC3Yjlb5TIS3oyPXAo89e5Z+Z/FKBywurkLkTYaWP1Eot2PxpcP5uEG P4Tng0NPZ7hbeUtUSw2RB+mkM/A3u8OY37p982cjRc62jkurRf8Nexiz2QQJXeuUsada 2+gR2acrHREMeSeB8fx7qDRgl8wLffAjQ/88sayfVcOOCbmQVU3rYMdn2bfCcoKYZ+mO jk8A== 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 v16si18484985plo.36.2019.04.24.03.12.50; Wed, 24 Apr 2019 03:13:05 -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 S1729830AbfDXHqA (ORCPT + 99 others); Wed, 24 Apr 2019 03:46:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63312 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbfDXHqA (ORCPT ); Wed, 24 Apr 2019 03:46:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 539DEC130701; Wed, 24 Apr 2019 07:46:00 +0000 (UTC) Received: from localhost (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA7905D9C8; Wed, 24 Apr 2019 07:45:56 +0000 (UTC) Date: Wed, 24 Apr 2019 15:45:53 +0800 From: Baoquan He To: Dave Young , Kairui Song , Junichi Nomura Cc: "linux-kernel@vger.kernel.org" , Borislav Petkov , Thomas Gleixner , Chao Fan , "x86@kernel.org" , "kexec@lists.infradead.org" Subject: Re: [PATCH] x86/kexec: always ensure EFI systab region is mapped Message-ID: <20190424074553.GH3584@localhost.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190424061831.GA9059@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 24 Apr 2019 07:46:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > With these fixes I think kexec will just work. Maybe we can go with > these fixes and leave other issues like the loader type flag etc as > future issue. Yes, agree. Thanks Baoquan