Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1120961ybb; Thu, 28 Mar 2019 20:36:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr9DrAPRAujvVwzjK+fwkdzRBzXjsAckkloWlWkM6aRPA//6Yn20jI5RrkJWnz4wFCT5uT X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr47020702plk.106.1553830566973; Thu, 28 Mar 2019 20:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553830566; cv=none; d=google.com; s=arc-20160816; b=XWU9ZCT6EHozxZC1Ah8qqyipVbV0nszAptr6bNUxjBF3L8mizfub8p9kF7s0RYSJis 2ooe6NDD4V/5gqyT6tN7sEb0q4uBWt+zDcgvhuBsZTq5Wt8Iq6JzTVHLXAycW2WEXlA/ oqnUh9W5fuFzIkNFLqovkaJInMApUYXi2bVLPgo/7Q2BE+Xrinq+DHEeYHxdtS/N02AK dvB7qrr4js0pPb80EX0JzuQIjVAuZAvGyjAuMHav7qgkKNgLDR+A6GU2p6cbrPUEVnNo hGUWwQH9bi0EN/DSnvrxNfuLZ96PvJgKcgVls/FLLDnkGIyHEwhXt3QMaLuvps1jbm5n udjA== 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=iQOx7I87epKirtW7wpohTliF8fA8936jL/VrRts5GqA=; b=HkcB9YpWrcXrDIU5Za+iJg0xHkeijH8s8g4aJ0iG7JTELmAsjsgXVXy34nBJj+HU8y A7ocme5Ab8AVh0/ElxCheQ+9Yyf78n0iceYlrNnmHiyUZ4QSk9r/N+PnnYHOnRkcE+sq 1M4dQr5xk/eJ+yreJG2o+uc5hKcNyqJyHH2REhgg+oqjt5LzJd60L0UPjeng6HJtG+Wm sBmsc0OksJjfx4RhK4OFuJEWhQzKaP+aRJu/BiyGwYrzNLaMlw4BY++6t8WvxfrHVKrp iRTHstoGa51uebcmkQuPSTOfxPbQgcjB21xrXdil9RUpX+M8kHzPoqdVepIllCNPI/3f 0kYA== 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 z73si892730pgd.345.2019.03.28.20.35.49; Thu, 28 Mar 2019 20:36: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728409AbfC2DfM convert rfc822-to-8bit (ORCPT + 99 others); Thu, 28 Mar 2019 23:35:12 -0400 Received: from tyo161.gate.nec.co.jp ([114.179.232.161]:55886 "EHLO tyo161.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbfC2DfM (ORCPT ); Thu, 28 Mar 2019 23:35:12 -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 x2T3YfHq003577 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Mar 2019 12:34:41 +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 x2T3YfBb004327; Fri, 29 Mar 2019 12:34:41 +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 x2T3Yedh026395; Fri, 29 Mar 2019 12:34:41 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.135] [10.38.151.135]) by mail01b.kamome.nec.co.jp with ESMTP id BT-MMP-3794402; Fri, 29 Mar 2019 12:34:25 +0900 Received: from BPXM12GP.gisp.nec.co.jp ([10.38.151.204]) by BPXC07GP.gisp.nec.co.jp ([10.38.151.135]) with mapi id 14.03.0319.002; Fri, 29 Mar 2019 12:34:24 +0900 From: Junichi Nomura To: "bhe@redhat.com" CC: Borislav Petkov , Dave Young , "fanc.fnst@cn.fujitsu.com" , "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 if provided Thread-Topic: [PATCH v2] x86/boot: Use EFI setup data if provided Thread-Index: AQHU5R0gSF49+PGwf02T2oxnk4CVXaYgAhGAgAAQvICAAQMcAIAASZeA Date: Fri, 29 Mar 2019 03:34:23 +0000 Message-ID: References: <701c8e69-e1d4-c653-1d87-1c41789d3d54@ce.jp.nec.com> <20190325120149.GI12016@zn.tnic> <20190325122302.GC13160@dhcp-128-65.nay.redhat.com> <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> <20190328231100.GC1877@MiWiFi-R3L-srv> In-Reply-To: <20190328231100.GC1877@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 On 3/29/19 8:11 AM, bhe@redhat.com wrote: > On 03/28/19 at 07:43am, Junichi Nomura wrote: >> /* Search EFI system tables for RSDP. */ >> -static acpi_physical_address efi_get_rsdp_addr(void) >> +static acpi_physical_address __efi_get_rsdp_addr(unsigned long config_tables, unsigned int nr_tables, int size, bool efi_64) > > Here parameter 'size' and 'efi_64' seems a little duplicated on > functionality. Only passing efi_64 can deduce the size? Personal > opinion. Yes. But I'm not sure which is preferred. The current code is: __efi_get_rsdp_addr() { for (i = 0; i < nr_tables; i++) { config_tables += size; if (efi_64) { efi_config_table_64_t *tbl = (efi_config_table_64_t *)config_tables; // get guid and table } else { efi_config_table_32_t *tbl = (efi_config_table_32_t *)config_tables; // get guid and table } // check guid and return table if it's valid } } If we remove "size" parameter, that will become: __efi_get_rsdp_addr() { for (i = 0; i < nr_tables; i++) { if (efi_64) { efi_config_table_64_t *tbl; config_tables += sizeof(efi_config_table_64_t); tbl = (efi_config_table_64_t *)config_tables; // get guid and table } else { efi_config_table_32_t *tbl; config_tables += sizeof(efi_config_table_32_t); tbl = (efi_config_table_32_t *)config_tables; // get guid and table } // check guid and return table if it's valid } } Or we could create 2 functions, __efi_get_rsdp_addr32() and __efi_get_rsdp_addr64(), and let efi_get_rsdp_addr() to choose which one to use based on signature. > It might be worth adding code comments here to tell why we only care > about 64bit kexec booting? I think so. I'll add a comment. -- Jun'ichi Nomura, NEC Corporation / NEC Solution Innovators, Ltd.