Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2148892imu; Thu, 10 Jan 2019 09:05:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN6O392LraUq3Eg2tTNUsTVzijzDV8V0Ak9p53twwszCGrnjB2E3eV94zsTnPfdfELsGSCnu X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr11193111pld.8.1547139908051; Thu, 10 Jan 2019 09:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547139908; cv=none; d=google.com; s=arc-20160816; b=hYp8W2G9GNEi+Ppzl1XbUfYi9LpISqrQcBvjd3JdFgT0tATP3Z2Jdiklym0Q9WCa2U PI3sH4b5SYkRdITJk7aIxA26GHkR9vWpeEBQrcxQtbje3SkvvKb10wCUO2IR/hq3MUqc 8J4FNL9bOLAxf+VHgOeQQc31JhfpTLsS8T0Zx+aRgD4gqPBtkXIKYRpnDNb4qGc7X/SA mPaXc8j9XIeKcS4SwQxs97lM+rH9woySxpQNu0oPR7EkJY67tRq2IyIsTVb89p6e4Zdy uT3ynca4uP8uLhK88qDnIMvtjH6Wfgve8dg9FFcLDzX571TL5Fa6KxOnLQWbEauEDkOL JZ7w== 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:dkim-signature; bh=uTSCpUvBGNcb7la2cAU6MajSH8aykN1VCQ1VTxp1XVE=; b=dsGJn6N6i4IOIpWSjQiQZ9IhDCAzAQ9zUwvxaDTAn45T7x4iRo9nyoKzKj4tF7PAXG 2CMFy0lk3U2XLxqVjmtxQSGo265ys1GV+c4DOjC+Xh+aiOeaVArRUZXuv1LcGlaJ5ydn OpHJxJQazscpdArEqS4BkdEJgzeH/U4DtbC395hl+qwyUZsbBHX8ZpOzfESGjQ9m957R O4Zf/4K2hgX7YTDU/KCEOmiT2eWY2qZs72aHBJxKeENy7alYd/Bb9qfPZMF9zfIbh5s/ 01H8PW3IqFTpw+GgzbTEkUbBxGN4VHNg1ZiL3Lsog4gxuNwfOBjsxVZr0GX2inoyumpc KCgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eC1oJJPM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si16094231pga.506.2019.01.10.09.04.51; Thu, 10 Jan 2019 09:05:08 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=eC1oJJPM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729152AbfAJRBO (ORCPT + 99 others); Thu, 10 Jan 2019 12:01:14 -0500 Received: from mail.skyhub.de ([5.9.137.197]:58856 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbfAJRBN (ORCPT ); Thu, 10 Jan 2019 12:01:13 -0500 Received: from zn.tnic (p200300EC2BC5CF00F8565421A8111C7E.dip0.t-ipconnect.de [IPv6:2003:ec:2bc5:cf00:f856:5421:a811:1c7e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EE3A41EC035B; Thu, 10 Jan 2019 18:01:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1547139671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=uTSCpUvBGNcb7la2cAU6MajSH8aykN1VCQ1VTxp1XVE=; b=eC1oJJPMLuPZWyjYhBywAXwcCJU8TeoQuA8UK98PP/G4cdYZO1ysag4vhiO5OKi0ZXYPGx HHfRsKdvst2jiC/VkydxX86lHni2h9H7K+tqg5JWnF83zJd44PUQef9W6NI+kB1uPI+PaL 45UN79Ia6Nd1y53aw4XTHf3nI9gQBRo= Date: Thu, 10 Jan 2019 18:01:03 +0100 From: Borislav Petkov To: Chao Fan Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, keescook@chromium.org, bhe@redhat.com, msys.mizuma@gmail.com, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com Subject: Re: [PATCH v15 2/6] x86/boot: Introduce get_acpi_rsdp() to parse RSDP in cmdline from KEXEC Message-ID: <20190110170103.GF17621@zn.tnic> References: <20190107032243.25324-1-fanc.fnst@cn.fujitsu.com> <20190107032243.25324-3-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190107032243.25324-3-fanc.fnst@cn.fujitsu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.