Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp37313imu; Thu, 10 Jan 2019 17:29:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ziaDnrONb0BQfm3eXmjSLtk6h+kg0eXvTmKHiPhZZIWJYtN486S46812vA43UvZGdQU4+ X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr12672961pls.167.1547170179594; Thu, 10 Jan 2019 17:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547170179; cv=none; d=google.com; s=arc-20160816; b=L/vsujF0I1ahAl88tg1xDmffXKFkgmPB+WKm8R0BGHvp1+Dn0WKfTLQU6k8oUdPf5a u96NB5SbCpVt/mG5tT4iPLvymdmMCVZFMJk5IRlPZNsOcXpxzFrRV3WYkAu9wjVdo0zu xWio3Lf8jCdxm+WwPa+juHdnjaj5AKprnXxzYzP4fZjZlSdOZcNhVmB6W3qk0wQwVq3M IqQCjp/9Yl0zOodCaH0Yv630YXziDOspnbQx2mXrmK8RnP9E9HYw2JnfiM+kHmYl+TVv teVG5SFDnbcfh9w3RwrkQG7BVrtN9J/wJB/dGXlaEIYviDwD/7DhGCUiNc20Oy1bAdRR wtTg== 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=L9FaOdKfuG/oI3ef44BvX+WbEcSkZsnm4fc83BkGWKA=; b=Y78BWgpQqZY++oBqKn2So4iO7MR1cpTl0Fm6hL5DJqkIe6vTCVF5vvbmF0BWnZpJ3B gS7xwAzhG1RWQA59gHFIuNCkmev26G3O+7eNhJIEmwdeTlJ2wv3YeFoQVa9AU8am4+xY zC3FRSldZMPRoZpp7q7N+3Bqf4ssxh5gazIexukSU7RcsM3251kd+eM0FQYHgagsvtIM WVfpVNjkyfg04R/i1CZ1gp+X8AlDNKxV1ps4yC7g3bU3qiBaH/LS1usjSwBnFj/k2kA1 kSYZsrWvEdcPsNVp3Xo2xFK2/vkGMQsVStdFantFzHS2yET3nRoMHK32v7CBuNDbw8B4 7QAg== 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 l8si29459445pfc.98.2019.01.10.17.29.24; Thu, 10 Jan 2019 17:29:39 -0800 (PST) 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 S1729336AbfAKB2R (ORCPT + 99 others); Thu, 10 Jan 2019 20:28:17 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:55175 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728834AbfAKB2R (ORCPT ); Thu, 10 Jan 2019 20:28:17 -0500 X-IronPort-AV: E=Sophos;i="5.56,463,1539619200"; d="scan'208";a="51752542" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Jan 2019 09:28:13 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 7E5984BAD909; Fri, 11 Jan 2019 09:28:14 +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.408.0; Fri, 11 Jan 2019 09:28:13 +0800 Date: Fri, 11 Jan 2019 09:27:18 +0800 From: Chao Fan To: Borislav Petkov CC: , , , , , , , , , Subject: Re: [PATCH v15 4/6] x86/boot: Introduce bios_get_rsdp_addr() to search RSDP in memory Message-ID: <20190111012718.GE2216@localhost.localdomain> References: <20190107032243.25324-1-fanc.fnst@cn.fujitsu.com> <20190107032243.25324-5-fanc.fnst@cn.fujitsu.com> <20190110212747.GH17621@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190110212747.GH17621@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: 7E5984BAD909.AB3F3 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, Jan 10, 2019 at 10:27:47PM +0100, Borislav Petkov wrote: >On Mon, Jan 07, 2019 at 11:22:41AM +0800, Chao Fan wrote: >> Memory information in SRAT table is necessary to fix the conflict >> between KASLR and memory-hotremove. So RSDP and SRAT should be parsed. >> >> When booting form KEXEC/EFI/BIOS, the methods to compute RSDP >> are different. When booting from BIOS, there is no variable who can >> point to RSDP directly, so scan memory for the RSDP and verify RSDP >> by signature and checksum. >> >> Signed-off-by: Chao Fan >> --- >> arch/x86/boot/compressed/acpi.c | 86 +++++++++++++++++++++++++++++++++ >> 1 file changed, 86 insertions(+) > >... > >> +/* Search RSDP address, based on acpi_find_root_pointer(). */ >> +static acpi_physical_address bios_get_rsdp_addr(void) >> +{ >> + u8 *table_ptr; >> + u32 address; >> + u8 *rsdp; > >But those u8's together: > > u8 *table_ptr, *rsdp; > u32 address; Thanks, will change that. > >> + >> + /* Get the location of the Extended BIOS Data Area (EBDA) */ >> + table_ptr = (u8 *)ACPI_EBDA_PTR_LOCATION; >> + address = *(u16 *)table_ptr; >> + address <<= 4; >> + table_ptr = (u8 *)(long)address; >> + >> + /* >> + * Search EBDA paragraphs (EBDA is required to be a minimum of >> + * 1K length) >> + */ >> + if (address > 0x400) { >> + rsdp = scan_mem_for_rsdp(table_ptr, ACPI_EBDA_WINDOW_SIZE); >> + if (rsdp) { >> + address += (u32)ACPI_PTR_DIFF(rsdp, table_ptr); >> + return address; >> + } >> + } >> + >> + /* Search upper memory: 16-byte boundaries in E0000h-FFFFFh */ >> + table_ptr = (u8 *)ACPI_HI_RSDP_WINDOW_BASE; >> + rsdp = scan_mem_for_rsdp(table_ptr, ACPI_HI_RSDP_WINDOW_SIZE); >> + > >Superfluous newline. Will drop it. Thanks, Chao Fan > >> + if (rsdp) { >> + address = (u32)(ACPI_HI_RSDP_WINDOW_BASE + >> + ACPI_PTR_DIFF(rsdp, table_ptr)); >> + return address; >> + } >> + return 0; >> +} > >-- >Regards/Gruss, > Boris. > >Good mailing practices for 400: avoid top-posting and trim the reply. > >