Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp947317yba; Thu, 4 Apr 2019 00:49:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSFVkzU3sO3Gjaf2MwDvClR3gpehACBjXF0WK68ANlQgNTwGtEei8Frw55yUDiKDAYTfsy X-Received: by 2002:a17:902:b717:: with SMTP id d23mr4703457pls.260.1554364180093; Thu, 04 Apr 2019 00:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554364180; cv=none; d=google.com; s=arc-20160816; b=gqRdmPAriAN6OL8VPTQF5xnnV2KHAc9vAoYm2LUBIL8I0Desp6Z4jbho6UXKkkWwVm LpMuchBsODKM6gTtoxTL5/QhZ2YcjZkTudU7C9lxJUkV+WNmDoM9RJdK3IgRG6W0OAEO QqFq0WjWZstNykyZ//rf1xFyPAqwewWybsCXdLZFdsGLDNE94GlFLxgZ4xSGHgsMF6Ly Cb6sGjvwwASfZZXOcwqxSoHVtDj21CnI707dvh2ojMjNoESnU4brZusSIVFQ2imFxf+X edTK5JpbqwevP+lazoqh57zyXZoaCF4edssXLtdPgvcGmE1SpptZ0fdWynf2RWJKrdL8 ibuw== 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=qjUyWZiiA80ctJqLoVlhzvv2s7oi3BoNQaA3YmOJHWI=; b=Tmn6OkWCDv9bpby8WLLErF8EWCzBGU2wLHpkeSBKMcG0f3+Tor313EYLmbR2oa1swv wFserB3peCvm6hd3y/SLs+q7nSytFZjKsJyOiIKer9K4KTsWn33LxVY8mmjRxVnFP+Ol xYMxAvlVyBgSDFqyJ6XtMJq8bLPofksENs5aKZ5g4uVYuc3/SRvz6vwnsoCkNRHeFxpT zRyWhfBh5+wpVeKQur1j3q//vUN0/dAAGG26ILHBlqKqDnrwHjRXGap+WD0DrWn4ZMcQ CxIhEyqfEJk/SJQw1vSSGdFJeQ5oK4eQVhXbbYBjXqkngSkT4YBxzcxKIyou0f/0Hfgq H14g== 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 k9si15408206pfo.173.2019.04.04.00.49.25; Thu, 04 Apr 2019 00:49:40 -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 S1727314AbfDDHsY (ORCPT + 99 others); Thu, 4 Apr 2019 03:48:24 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:45177 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725914AbfDDHsX (ORCPT ); Thu, 4 Apr 2019 03:48:23 -0400 X-IronPort-AV: E=Sophos;i="5.60,306,1549900800"; d="scan'208";a="58459807" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Apr 2019 15:48:21 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 1A4444CD80C3; Thu, 4 Apr 2019 15:48:21 +0800 (CST) Received: from localhost.localdomain (10.167.225.56) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 4 Apr 2019 15:48:28 +0800 Date: Thu, 4 Apr 2019 15:48:17 +0800 From: Chao Fan To: Dave Young CC: "bhe@redhat.com" , Junichi Nomura , Borislav Petkov , "kasong@redhat.com" , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Message-ID: <20190404074817.GM1555@localhost.localdomain> References: <20190403082305.GG1555@localhost.localdomain> <20190403090210.GH1555@localhost.localdomain> <20190404025234.GA12658@dhcp-128-65.nay.redhat.com> <20190404030037.GT7627@MiWiFi-R3L-srv> <20190404031030.GU7627@MiWiFi-R3L-srv> <20190404032238.GA16267@dhcp-128-65.nay.redhat.com> <20190404064130.GA5530@dhcp-128-65.nay.redhat.com> <20190404072007.GL1555@localhost.localdomain> <20190404074102.GA5970@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190404074102.GA5970@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: 1A4444CD80C3.A8FF3 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 04, 2019 at 03:41:02PM +0800, Dave Young wrote: >Hi Chao, >On 04/04/19 at 03:20pm, Chao Fan wrote: >> On Thu, Apr 04, 2019 at 02:41:30PM +0800, Dave Young wrote: >> >On 04/04/19 at 11:22am, Dave Young wrote: >> >> On 04/04/19 at 11:10am, Baoquan He wrote: >> >> > On 04/04/19 at 11:00am, Baoquan He wrote: >> >> > > On 04/04/19 at 10:52am, Dave Young wrote: >> >> > > > On 04/04/19 at 01:23am, Junichi Nomura wrote: >> >> > + /* Save RSDP address for later use. */ >> >> > + boot_params->acpi_rsdp_addr = get_rsdp_addr(); >> >> > + >> >> > + error("Hang kernel for kexec debugging"); >> >> > >> >> > Sorry, here I means calling error() to hang kernel after calling >> >> > get_rsdp_addr(). >> >> >> >> Thanks, it did not hang, it always reset to firmware/grub boot menu. >> >> I'm pretty sure now the bug exists in get_rsdp_addr(). >> > >> >static acpi_physical_address kexec_get_rsdp_addr(void) >> >{ >> >... >> > /* Get systab from boot params. */ >> > systab = (efi_system_table_64_t *) (ei->efi_systab | ((__u64)ei->efi_systab_hi << 32)); >> > if (!systab) >> > error("EFI system table not found in kexec boot_params."); >> > >> >... >> > -> add error("hang me") here will have a hang >> >... >> > return __efi_get_rsdp_addr((unsigned long)esd->tables, >> > systab->nr_tables, true); >> > >> >> I have an idea, but not sure whether is a problem. >> In code of Nomura: >> >> #if defined(CONFIG_EFI) && defined(CONFIG_X86_64) >> [...] >> if (strncmp(sig, EFI64_LOADER_SIGNATURE, 4)) { >> debug_putstr("Wrong kexec EFI loader signature.\n"); >> return 0; >> } >> >> /* Get systab from boot params. */ >> systab = (efi_system_table_64_t *) (ei->efi_systab | ((__u64)ei->efi_systab_hi << 32)); >> [...] >> #endif >> >> After review agian, I wonder what will happen if 32bit-efi boot 64bit >> OS. > >It is hard to find 32bit efi hardware, I can confirm all the laptop I >have are 64bit efi. > >In case 32bit efi EFI64_LOADER_SIGNATURE checking will be false. Yes, just when reviewing code, I notice this problem. Thanks, Chao Fan > >