Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp31946imu; Thu, 10 Jan 2019 17:20:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN4YHtJ/E2Z1aCverS03iSiq2d610I1hs6ynTU1oeNQWwD0VQ+8Z1RVVN/9GtfGisndFT4qy X-Received: by 2002:a17:902:b40d:: with SMTP id x13mr12806463plr.237.1547169613441; Thu, 10 Jan 2019 17:20:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547169613; cv=none; d=google.com; s=arc-20160816; b=QdpVN1kCqPalbpGRym+tHq8e9Yp8ARk2QC7t18eVZPyWRsW8qMN7WawhiAJCujb9FR TrS6cgYj+GI73Eg78sEPcTR4PLWQQs3bEcmRvmJIQQldFfilELBKqwJTGywYKD8MlZhM NgadPQ4gUMgHIzP/LEpD174oe9TuFXtrOnCwxx8rRrPeaOu88t91MLNbS+lX8Rh7TKNr SfrCofdQh/gh+3++fAds4xVPUq4eExhyPtTt4eLinQGPCYFnybSe/KzRJhAxjGwHWz3e sbeZGh3+pgIkSBYmwb0zGu8j8yn2XBdQrirY0H2Z54QHCn0N56yJH5+xEhOLya3sXhtX 1fIw== 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=79Riitp8fh/L+tjU/6UbQBd2PP2pg9ohFj1JaIwe9U4=; b=zgWQMxWPHXUuuyOd+Ga81F47uAOAj3rm4QH2f6J0eaRPw0MNsOQRNTeSNGZRXrKSnS 4XBvdg8IzwZnMQcc/6p5JsuqFNhNUf6wrMQhKCu6v1rMB9/4xCLIdjLD81eiZpNw4QFS 8IQ7XbMRr95q74qtP96101CPt55hl54PrEweyKLy3O9IRrrZBbgOjc8rraNKkaCX4M3r Xet2IKQNBib89198Xu0fwkkLXymJFxXuTmvmWhQ2A5xlUX94uT52sh0koloL+Y7lyzSt +VuE2XxHo/PnQ50UJbOsVEl3bKAFw8msoqRsLlkOfpHV5+YqjDb1r2EsAao3Bkvneu2/ a5PQ== 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 k38si19935308pgi.235.2019.01.10.17.19.58; Thu, 10 Jan 2019 17:20:13 -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 S1729216AbfAKBSe (ORCPT + 99 others); Thu, 10 Jan 2019 20:18:34 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:36724 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726369AbfAKBSd (ORCPT ); Thu, 10 Jan 2019 20:18:33 -0500 X-IronPort-AV: E=Sophos;i="5.56,463,1539619200"; d="scan'208";a="51751907" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Jan 2019 09:18:32 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id A4B154BAD7CC; Fri, 11 Jan 2019 09:18:32 +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:18:32 +0800 Date: Fri, 11 Jan 2019 09:17:36 +0800 From: Chao Fan To: Borislav Petkov CC: , , , , , , , , , Subject: Re: [PATCH v15 2/6] x86/boot: Introduce get_acpi_rsdp() to parse RSDP in cmdline from KEXEC Message-ID: <20190111011736.GC2216@localhost.localdomain> References: <20190107032243.25324-1-fanc.fnst@cn.fujitsu.com> <20190107032243.25324-3-fanc.fnst@cn.fujitsu.com> <20190110170103.GF17621@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190110170103.GF17621@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: A4B154BAD7CC.ADA73 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 06:01:03PM +0100, Borislav Petkov wrote: >On Mon, Jan 07, 2019 at 11:22:39AM +0800, Chao Fan wrote: >> KASLR may randomly choose some positions which are located in movable >> memory regions. This will make the movable memory chosen by KASLR >> can't be removed. >> >> Memory information in SRAT is necessary to fix the conflict between >> KASLR and memory-hotremove. >> >> ACPI SRAT (System/Static Resource Affinity Table) shows the details >> about memory ranges, including ranges of memory provided by hot-added >> memory devices. SRAT is introduced by Root System Description >> Pointer(RSDP). So RSDP should be found firstly. >> >> When booting form KEXEC/EFI/BIOS, the methods to find RSDP >> are different. When booting from KEXEC, 'acpi_rsdp=' may have been >> added to cmdline, so parse cmdline to find RSDP. >> >> Signed-off-by: Chao Fan >> --- >> arch/x86/boot/compressed/acpi.c | 30 ++++++++++++++++++++++++++++++ >> 1 file changed, 30 insertions(+) >> create mode 100644 arch/x86/boot/compressed/acpi.c >> >> diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c >> new file mode 100644 >> index 000000000000..7ca5001d7639 >> --- /dev/null >> +++ b/arch/x86/boot/compressed/acpi.c >> @@ -0,0 +1,30 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +#define BOOT_CTYPE_H >> +#include "misc.h" >> +#include "error.h" >> +#include "../string.h" >> + >> +#include > >Ok, I corrected it to this, please replace in your version: > >/* > * Max length of 64-bit hex address string is 19, prefix "0x" + 16 hex > * digits, and '\0' for termination. > */ >#define MAX_ADDR_LEN 19 > >static acpi_physical_address get_acpi_rsdp(void) >{ > acpi_physical_address addr = 0; > >#ifdef CONFIG_KEXEC > char val[MAX_ADDR_LEN] = { }; > int ret; > > ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN); > if (ret < 0) > return 0; > > if (kstrtoull(val, 16, &addr)) > return 0; >#endif > return addr; >} > Thanks for your suggestion, will change it. Thanks, Chao Fan > >-- >Regards/Gruss, > Boris. > >Good mailing practices for 400: avoid top-posting and trim the reply. > >