Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp174692yba; Tue, 14 May 2019 22:25:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2W0g1wdsHeIuZ+NYwZDwYwlvmCYbIFBJk647j1asSsSFSYDZM/oiVaaYoxE2uwatsGYND X-Received: by 2002:a62:bd0e:: with SMTP id a14mr25571814pff.44.1557897904170; Tue, 14 May 2019 22:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557897904; cv=none; d=google.com; s=arc-20160816; b=RvxcheqcZyPACJ0Ot4Bq68udlWsbbe5fkFxRscjdn143doSVfMh+pnQctcHpqM73dr afFcBrdfILaCv+Wav6eeX34dgaf8L0R0i9xe8lAzxJAkaFYtdcz43Q/ovrKrYNA5HbK+ HqesCXcWtugzn9A4sb+g+xL7oDZZV9afbD5ICa199sv/ig3c0etiNWDspJW1D4R53Qer F7YY0k0zitNnzZDf1bQwP1OYdLzjdsUi/fer5DbyyOSD34CXIQeW7da7aSo075YQ0oAK wjEIFZ3ANWxizuyaJ/8oRpCCc4seHdsTrfsT4IAgxLwXYnmS9pW9GxAqBSekVnCGD5qx 2ykw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=JKCT1GWAD11Rpe+UJvycQQ7rAbQtvzsgjZ+9QyQKTMQ=; b=zm7GB7NSmD6KrpQlteQQsTrabuIN/nJzmgOMmxjV8juz7YdGIXgfPMza6cLu0TG+RV fH078b79K2hv1wmKeXGHm+uSDRKTlFt7WD7EngEGaVQ2Lyl3bGa0UkE3HUi3Ec4HC2Fk G42YKtkFvZ0s5ESwWhRx0lEJ4AzMXI2uR1JLDbcnmW7hIZ9vlbM0/5niBY9aKOXcjbZp ZEMbZvPz+2H3zBs+iLxhxsIaJLw1DcfP/R3T1PUCgSCCUYDGkz9nl5XdbpRDAlZvxa7a ubU/HjyjSRLPjTccu9QvUweLFOby1nkfZbrnL8tuie2WAF5+3zZ4mgO0TqTC8/IsMq2o 1ewg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q125si1148124pfq.163.2019.05.14.22.24.48; Tue, 14 May 2019 22:25:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726084AbfEOFXm convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 May 2019 01:23:42 -0400 Received: from tyo161.gate.nec.co.jp ([114.179.232.161]:57151 "EHLO tyo161.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbfEOFXl (ORCPT ); Wed, 15 May 2019 01:23:41 -0400 Received: from mailgate02.nec.co.jp ([114.179.233.122]) by tyo161.gate.nec.co.jp (8.15.1/8.15.1) with ESMTPS id x4F5MFXo002708 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 May 2019 14:22:15 +0900 Received: from mailsv01.nec.co.jp (mailgate-v.nec.co.jp [10.204.236.94]) by mailgate02.nec.co.jp (8.15.1/8.15.1) with ESMTP id x4F5MERe023708; Wed, 15 May 2019 14:22:15 +0900 Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv01.nec.co.jp (8.15.1/8.15.1) with ESMTP id x4F5KPwI027934; Wed, 15 May 2019 14:22:14 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.136] [10.38.151.136]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-5066124; Wed, 15 May 2019 14:17:20 +0900 Received: from BPXM12GP.gisp.nec.co.jp ([10.38.151.204]) by BPXC08GP.gisp.nec.co.jp ([10.38.151.136]) with mapi id 14.03.0319.002; Wed, 15 May 2019 14:17:19 +0900 From: Junichi Nomura To: Baoquan He , Borislav Petkov , "kasong@redhat.com" CC: "dyoung@redhat.com" , "fanc.fnst@cn.fujitsu.com" , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "hpa@zytor.com" , "tglx@linutronix.de" Subject: Re: [PATCH v6 1/2] x86/kexec: Build identity mapping for EFI systab and ACPI tables Thread-Topic: [PATCH v6 1/2] x86/kexec: Build identity mapping for EFI systab and ACPI tables Thread-Index: AQHVCt13YD4lckvUHUCIqj5Wl9aEBQ== Date: Wed, 15 May 2019 05:17:19 +0000 Message-ID: <20190515051717.GA13703@jeru.linux.bs1.fc.nec.co.jp> References: <20190424092944.30481-1-bhe@redhat.com> <20190424092944.30481-2-bhe@redhat.com> <20190429002318.GA25400@MiWiFi-R3L-srv> <20190429135536.GC2324@zn.tnic> <20190513014248.GA16774@MiWiFi-R3L-srv> <20190513070725.GA20105@zn.tnic> <20190513073254.GB16774@MiWiFi-R3L-srv> <20190513075006.GB20105@zn.tnic> <20190513080210.GC16774@MiWiFi-R3L-srv> In-Reply-To: <20190513080210.GC16774@MiWiFi-R3L-srv> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.34.125.85] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kairui, On 5/13/19 5:02 PM, Baoquan He wrote: > On 05/13/19 at 09:50am, Borislav Petkov wrote: >> On Mon, May 13, 2019 at 03:32:54PM +0800, Baoquan He wrote: >> So we're going to try it again this cycle and if there's no fallout, it >> will go upstream. If not, it will have to be fixed. The usual thing. >> >> And I don't care if Kairui's patch fixes this one problem - judging by >> the fragility of this whole thing, it should be hammered on one more >> cycle on as many boxes as possible to make sure there's no other SNAFUs. >> >> So go test it on more machines instead. I've pushed it here: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=next-merge-window > > Pingfan has got a machine to reproduce the kexec breakage issue, and > applying these two patches fix it. He planned to paste the test result. > I will ask him to try this branch if he has time, or I can get his > machine to test. > > Junichi, also have a try on Boris's branch in NEC's test environment? while the patch set works on most of the machines I'm testing around, I found kexec(1) fails to load kernel on a few machines if this patch is applied. Those machines don't have IORES_DESC_ACPI_TABLES region and have ACPI tables in IORES_DESC_ACPI_NV_STORAGE region instead. So I think map_acpi_tables() should try to map both regions. I tried following change in addition and it worked. -- Jun'ichi Nomura, NEC Corporation / NEC Solution Innovators, Ltd. diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 3c77bdf..3837c4a 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -56,12 +56,22 @@ static int mem_region_callback(struct resource *res, void *arg) { unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY; struct init_pgtable_data data; + 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; + + 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; }