Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1331506ybb; Fri, 29 Mar 2019 02:18:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCbqDQ0554vo+knQGhvh9AHv1KvqD3QxXPc7HL3OQ2GS5cKDZQrRJLRDxVE5X07o8dBf9e X-Received: by 2002:a65:5343:: with SMTP id w3mr26810892pgr.232.1553851086728; Fri, 29 Mar 2019 02:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553851086; cv=none; d=google.com; s=arc-20160816; b=oqu25r63p7kT51d9Q8fjAsvsq1cQRBuJu3CsukMwglBrx7572PMHHFOxEvXVrrfAWC WgsdxGZV0OLz7arrQB3qDt//ewtlFUB1bFsQmGebHMC2jG4CLW2qjdXf7VBHKnLyLVGs vxaw1lq6YW9KD/DNUGeyCcuNHyhq85qx43v30SXH4uKBuCOm5eQcxxNHzWUwRpxyQims 1OhBJgp0bUVJwbHwKAgNMZPTZLvdyx+exFNEGOxIwfFj4sjOoEpgLno6ARvhTTnhNW8D FOnf2FEpHMbyClta8d98Pvg2xXMIcID6dYqrUw5QZ5ps6cVg/wh5vfb4j+ueEn7e4MsZ DDwg== 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=fsW9ItIY9NCX026pgFQpUpyBJA/+Bjsk2rchH0rBhnU=; b=zEfqxavRqLc9XjqMUPHQsGmU/sGVESkAJAFMfu8Ty9DmGRyDelpUIimHQrMWngWP9O HTVpVQXmXPA7ldfFA+J7PkJpayYT/eny4+KpsFbxCQI9e3Q/wWC72X6wbiyzWGER38gr TjcJf3IXFmNPeDVumZTbg5IATQ2RdqFI89uM4RJds8JT7x8miv0uLCAKpnqX+tf/7B8p cDhtmj6XiIAVFak4DfVL6txjJfJ1iq4MPlfnik7vji+WQuS30YJ/cw3867J35nzawNEm 7snFdLAGv7egCXn8Q10ka5QbMblDkqI5EJ/Ocr6ykNJTe8lxP52ave5nQUS6M8CETl07 OH7Q== 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 m79si1417323pfi.81.2019.03.29.02.17.50; Fri, 29 Mar 2019 02:18:06 -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 S1729278AbfC2JRB (ORCPT + 99 others); Fri, 29 Mar 2019 05:17:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58126 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbfC2JRB (ORCPT ); Fri, 29 Mar 2019 05:17:01 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34BF3330255; Fri, 29 Mar 2019 09:17:01 +0000 (UTC) Received: from localhost (ovpn-12-24.pek2.redhat.com [10.72.12.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A64B5C226; Fri, 29 Mar 2019 09:16:57 +0000 (UTC) Date: Fri, 29 Mar 2019 17:16:55 +0800 From: "bhe@redhat.com" To: Chao Fan Cc: Junichi Nomura , Borislav Petkov , Dave Young , "kasong@redhat.com" , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Message-ID: <20190329091655.GE7627@MiWiFi-R3L-srv> References: <20190325123229.GL12016@zn.tnic> <20190325231000.GA9184@jeru.linux.bs1.fc.nec.co.jp> <20190326135714.GG1867@zn.tnic> <20190327014852.GA3659@MiWiFi-R3L-srv> <73322ba9-e436-68db-7863-afd31607d969@ce.jp.nec.com> <20190328064343.GA1877@MiWiFi-R3L-srv> <20190328074337.GA9470@jeru.linux.bs1.fc.nec.co.jp> <20190328155256.GP22720@zn.tnic> <20190329072037.GA5840@jeru.linux.bs1.fc.nec.co.jp> <20190329082929.GH4234@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329082929.GH4234@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 29 Mar 2019 09:17:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/29/19 at 04:29pm, Chao Fan wrote: > On Fri, Mar 29, 2019 at 07:20:38AM +0000, Junichi Nomura wrote: > >Commit 3a63f70bf4c3a ("x86/boot: Early parse RSDP and save it in > >boot_params") broke kexec boot on EFI systems. efi_get_rsdp_addr() > >in the early parsing code tries to search RSDP from EFI table but > >that will crash because the table address is virtual when the kernel > >was booted by kexec. > [...] > >- guid = tbl->guid; > >- table = tbl->table; > >- } > >- > >- if (!(efi_guidcmp(guid, ACPI_TABLE_GUID))) > >- rsdp_addr = table; > >- else if (!(efi_guidcmp(guid, ACPI_20_TABLE_GUID))) > >- return table; > >- } > >+ return __efi_get_rsdp_addr(config_tables, nr_tables, efi_64); > >+#else > >+ return 0; > > #endif > >- return rsdp_addr; > > I remeber the rsdp_addr is defined before #ifdef CONFIG_EFI > If so, you don't need > #else > return 0; it doesn't change the old logic. Junichi moved rsdp_addr definition inside the CONFIG_EFI iedeffery block. > > BY the way, what's your patch based on? I like add patch on my local > branch and then review code, but failed. > I try to use 'patch -p1 <' your patch to the latest tip master branch, > but failed. > > Thanks, > Chao Fan > > > } > > > > static u8 compute_checksum(u8 *buffer, u32 length) > >@@ -221,6 +284,9 @@ acpi_physical_address get_rsdp_addr(void) > > pa = boot_params->acpi_rsdp_addr; > > > > if (!pa) > >+ pa = kexec_get_rsdp_addr(); > >+ > >+ if (!pa) > > pa = efi_get_rsdp_addr(); > > > > if (!pa) > > > > > >