Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2390499imj; Mon, 11 Feb 2019 01:56:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IaH+F/rgpUpGU2OAhP/5rDQiaRJ1DkY0nV/1CnbioI6d8w2n/ajL7rfWmd4MOAWPSWJwwFR X-Received: by 2002:a62:5b44:: with SMTP id p65mr35387596pfb.47.1549878975665; Mon, 11 Feb 2019 01:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549878975; cv=none; d=google.com; s=arc-20160816; b=IhM0KR/+cj2VMhpDz4/clkvxpELvygcbndI/rq+ZBic3c2fSU5jgMsb48ZWEP54CWm lgiadbMdMPZfFdpF+ZrXLnI2ODF+Z279fyoHLTmIFce0JQKYse+AcQo+VIemygYyNi9r mjm+cH7UIaSp8WYWXfClZiDIn0h1P/fhVpguSbr9qNKu2lRO9uLX0UUQ8jneAiTzJQNB EnDJd5ujQeftTlpfr/Wdp1wiUXyM/QP6VyyXQt+7YdFBUIuxXsFoIepG1a7GFz/eZ7W8 Nm623NBgkmNRbzycgPo4/QCSdok/ybIXWct358H9hqfEwNqRWAswcfwqKkKYrkI8XWAS MgYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=SRGMiX4BisMsZwfW11LNhXADnyz/poW/UmEH4oEwa3w=; b=yeUdF/xZj1EioYOwMUXbRnRY7MKgn1rq9mitZnG1JFaDAKUFOBe4VvSMIGB7kb/iqe hxoR6z8ZIa+MnyCyzJ8qs3BgktGOQCR2q8xCAMS/Qgep/29SsiGPeI3yULEuk8lNQkpm e3Erc9QFpEwP0EX8PMBjJhwTYW2q1Zd0HHsWZ6A7BobE5E2p/9lnBkbvoyAG9Q5R3x5B Owhn8SMjOKC8VxMezffnfWbaQGObxYSYWRs1xah4yjI0fd2R+o8rbwfiow9+YO8wV5mS HLUG/RzyfeT4enMkzH0gz3FHe9t7XrtCaZLiH/CWvOvet6uTIIVjLfdZqkqme95+rQNu n63Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=WWeelDSn; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si8775481pgq.163.2019.02.11.01.55.59; Mon, 11 Feb 2019 01:56:15 -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=@amazon.de header.s=amazon201209 header.b=WWeelDSn; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfBKJyw (ORCPT + 99 others); Mon, 11 Feb 2019 04:54:52 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:34804 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbfBKJyv (ORCPT ); Mon, 11 Feb 2019 04:54:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1549878890; x=1581414890; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=SRGMiX4BisMsZwfW11LNhXADnyz/poW/UmEH4oEwa3w=; b=WWeelDSnY2HkW41EjQIu059OlYhfZzT5eP1VzjX+OQlwCRKtHcvIBNNH yTqoTaKeeAifJ0k2+qkGQKrW8EH80VsJdR4r9NYgXZQBySRBo1PPcX+I1 GDTI35fqeYWxV7mUE4BEYSr+h4UPm6i52bZp4//rBfM66jP64eGfCVJeO E=; X-IronPort-AV: E=Sophos;i="5.58,358,1544486400"; d="scan'208";a="717209159" Received: from iad6-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2b-55156cd4.us-west-2.amazon.com) ([10.124.125.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Feb 2019 09:54:47 +0000 Received: from u54ee758033e858cfa736.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2b-55156cd4.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id x1B9sdEG077869 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 11 Feb 2019 09:54:41 GMT From: Julian Stecklina To: Baoquan He Cc: Julian Stecklina , , Thomas Gleixner , Ingo Molnar , Borislav Petkov , , , Subject: Re: [PATCH 1/2] x86/boot: fix KASL when memmap range manipulation is used References: <1548866403-13390-1-git-send-email-js@alien8.de> <20190211090931.GA2501@localhost> Date: Mon, 11 Feb 2019 10:54:39 +0100 In-Reply-To: <20190211090931.GA2501@localhost> (Baoquan He's message of "Mon, 11 Feb 2019 17:09:31 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Baoquan He writes: > On 01/30/19 at 05:40pm, Julian Stecklina wrote: >> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c >> index 9ed9709..5657e34 100644 >> --- a/arch/x86/boot/compressed/kaslr.c >> +++ b/arch/x86/boot/compressed/kaslr.c >> @@ -155,6 +155,12 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size) >> case '#': >> case '$': >> case '!': >> + /* >> + * % would need some more complex parsing, because regions might >> + * actually become usable for KASLR, but the simple way of >> + * ignoring anything that is mentioned in % works for now. >> + */ > > This seems to make thing more complicated even though have to. One > concern is whether we need to check the oldtype|newtype , e.g > oldtype=reserverd, newtype=RAM, is it possible to set like that? With the above patch the boot code will avoid using any region targeted by % for KASLR. This does mean regions that are changed to be usable via % are not taken into account. Julian