Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6336997yba; Thu, 11 Apr 2019 17:48:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6e6w/r7fGxo/YpB2gh80OS2SnbDVLL1TPACd1OOoKuVpfYZl2BdkLqewlyocTdJ/Uq1nE X-Received: by 2002:a62:6490:: with SMTP id y138mr53297516pfb.230.1555030088102; Thu, 11 Apr 2019 17:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555030088; cv=none; d=google.com; s=arc-20160816; b=xbsrboFZ0pFo5CNTTgtavzdFcWWlAVMIH1txK8eeYs4mkQCh4G0wkMx1X0PE2bZ6FS ThqoxLLMkGe7oNBdfbnQGNPTLnRWjwPXMF0yPtu7Rp1pfbyihIzPw/oub6xNqhQ7ini2 oO0gBqMuLV5Q1lzH9B7GFClQxlO9Gd+wJllJTymbx3wPcS0k8f5if5ePH5OKmJJnxQ2B TbfL+GQBXY5F/vIQIWeBTsP3vYoUyDHGoQIldp5j0jn6+4CQ3Mm9BL5U3urAb7hNm6Bx RM4VngciHf3jnCPRfvv0X6NPCjadmKOftScw1SUaZ/7XB0itHT0o3dWTDYkM7pkmxqxs 65vw== 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=GPUmj1Q+2idw+A20s9DVUae2fDyT2TeCVYfliLpPelE=; b=VMteJRM7tkfT1jg6E7PB0aBI0ZRSZFRfkSmVhbdS1z81HcknC9Kl3YOLyLS8uaUkma dR+ciza/gV5GxPwOGAVGof/2DrvG6Ekdxub8g5+Bo0T63ZjHuiSGoStlQfF3vwzk/mk9 G3fa6/vFVaWEUILKk+37SZnjjviWckEEEk8F6VoBCsgugNouSp/kQrW0hramoli6fh9I bak5sNocQSJ3YpJc683Y/rmzDsRPUoV9OdGZDT75rwQMpPlx1b+T7JwUNEZc3rcF+qrx IXHK5fr/umGYwE56FmDnymn4VltK4TWldpju2Fo+6nCyAKvQfMqKyg5c2lsmGOEaawl+ a8sg== 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 w23si33899642plk.109.2019.04.11.17.47.51; Thu, 11 Apr 2019 17:48:08 -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 S1726864AbfDLAXx (ORCPT + 99 others); Thu, 11 Apr 2019 20:23:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60024 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfDLAXx (ORCPT ); Thu, 11 Apr 2019 20:23:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3C3D85545; Fri, 12 Apr 2019 00:23:52 +0000 (UTC) Received: from localhost (ovpn-12-23.pek2.redhat.com [10.72.12.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51A9D608BB; Fri, 12 Apr 2019 00:23:48 +0000 (UTC) Date: Fri, 12 Apr 2019 08:23:45 +0800 From: Baoquan He To: Junichi Nomura , Dave Young Cc: Borislav Petkov , Chao Fan , Kairui Song , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Message-ID: <20190412002345.GA6356@MiWiFi-R3L-srv> References: <20190408231011.GA5402@jeru.linux.bs1.fc.nec.co.jp> <20190410171431.GE26580@zn.tnic> <7cbc096d-0548-18b1-a335-8ba114f234a7@ce.jp.nec.com> <20190411080927.GA30080@zn.tnic> <20190411084235.GJ3805@localhost.localdomain> <1bb7bccb-0270-d073-fa2f-43e1a1c73fbe@ce.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1bb7bccb-0270-d073-fa2f-43e1a1c73fbe@ce.jp.nec.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 12 Apr 2019 00:23:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/11/19 at 09:14am, Junichi Nomura wrote: > On 4/11/19 5:42 PM, Baoquan He wrote: > > On 04/11/19 at 08:16am, Junichi Nomura wrote: > >> kexec_get_rsdp_addr() might fail on kexec-booted kernel, e.g. if the > >> setup_data was invalid. In such a case, falling back to efi_get_rsdp_addr() > >> will hit the problem of accessing invalid table pointer again. > > > > Seems you are trying to address Dave Young's comment in > > http://lkml.kernel.org/r/20190404073233.GC5708@dhcp-128-65.nay.redhat.com > > Right. His "In case kexec_get_rsdp_addr failed.." comment. > > > We may need discuss and make clear if those are doable. E.g the first > > comment, if not hang by below line of code, returning 0 for what? Can > > kexec still be saved, or just reset to firmware? > > > > error("EFI system table not found in kexec boot_params.") > > If we return 0 and also don't hang in the rest of get_rsdp_addr(), > it just work as the same way as v5.0 and earlier kernel do. > > Failure cases in kexec_get_rsdp_addr() are followings: > 1. efi_setup_data is invalid > 2. loader signature is invalid > 3. EFI systab is not found in boot_params > 4. RSDP is not found by parsing tables pointed to by efi_setup_data > > I think all of them are critical for EFI boot, so one option could be > we never return failure in kexec_get_rsdp_addr() and just hang. > But hanging in this very early stage of boot may make the problem > harder to investigate once happens. Even earlyprintk is not working yet. > So the other option is returning 0 to defer the crash for later stage. OK, I got the point, thanks. So it is deferred to the late stage, KASLR may not avoid those memory region which is marked as hotpluggable in SRAT. Kernel can boot up, but doesn't function well on hotplug stuff. In this case, people don't know why it happened. We are still blind. Seems early console in efi is the problem, but not kexec or hotplug. I am fine to hang, or make it continue booting for now. Hi Dave, Is it possible to fix the efi early console issue? I mean the feasibility, I believe it won't be easy. Ask this because not only this issue encountered, any other issue could be triggered during boot decompressing stage. If efi has this problem, we can't debug them either.