Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2543022pxb; Sun, 24 Jan 2021 10:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgvg/RfHqeqqRWNSwL23yeALFGPp/h3K9d5pNhqOj/U2FemCW02TsDUUATiazUGsvUjAwE X-Received: by 2002:a17:906:e0cd:: with SMTP id gl13mr19784ejb.17.1611513824814; Sun, 24 Jan 2021 10:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611513824; cv=none; d=google.com; s=arc-20160816; b=R2amRfhLPg0LSLP4OXYs7DX9lfNmJyTX0xJrfzXKz6CvIrPIgrzwl1JKZg32LrzDUg FEk806kGyJui2JK47WMfweaqz/5DAe8OqdOBrWKQ1zeKb/VZQ86vU9MQWaeQbjtS96/u yqNRSwO/O58aVnENpiWIZIlMrj/dKVy+r3doD2Pih30K1AbE02Ndj8PY0c9rpgYsl++M DMaXdWId4gT7yFgj0Oput9bpze1YE70o/JqrMgI9Uf+sgG9QC6UNxg8WzU3S76ehO3SJ C6FJPZT2E0fRkdk7La+Sk/CzxmV7aSesQ4aqOb6xkk7k1Um/LEHZBqWTMDyaonS6lmGd l3uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=onfVUkRvkPzif4nLdDhxc3P8mXsZ/hJ6HWrThh428O4=; b=TKsSLq7mXU0ZsUQqh2gtcWhkEweoYKezqr6rZNrTdbI/9ucKfN1NIuihjXe7vpgHp/ nsG+bEM8VUxsNXCBysosWAcufhoY1UfTzT4LbKN6gUQ4lZOO/GvXC6xQaj6kjvN9iiNx 2GESPbQE92brc5TXOv2iM7v6FRHZTyPC5Tfr/2mxW3rsdPufI9ngWKYfAMKt19mtAXy3 bwXhpzOmTfFmxMLgJbLeyzNOILRIF5QsuUNGhTUHvhAU+J5I0U/6Oaklrw0Jg4Djh55n FbON3o0VjZlF04cH7b6wQHNB5hsxyV+Q4fZSRyQtOEa1XlI0ZyiuSyfNnwwZct3s7Ts4 vVJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si770152ejb.250.2021.01.24.10.43.21; Sun, 24 Jan 2021 10:43:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbhAXSmE (ORCPT + 99 others); Sun, 24 Jan 2021 13:42:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:35692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbhAXSmE (ORCPT ); Sun, 24 Jan 2021 13:42:04 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40E8A22C9F; Sun, 24 Jan 2021 18:41:23 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l3kK9-009lag-3K; Sun, 24 Jan 2021 18:41:21 +0000 Date: Sun, 24 Jan 2021 18:41:19 +0000 Message-ID: <87tur6jhyo.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Alexandru Elisei , Ard Biesheuvel , Jing Zhang , Ajay Patil , Prasad Sodagudi , Srinivas Ramana , James Morse , Julien Thierry , Suzuki K Poulose , kernel-team@android.com Subject: Re: [PATCH v4 18/21] arm64: Move "nokaslr" over to the early cpufeature infrastructure In-Reply-To: <20210118144636.kysdvnmcdm7it5zp@google.com> References: <20210118094533.2874082-1-maz@kernel.org> <20210118094533.2874082-19-maz@kernel.org> <20210118144636.kysdvnmcdm7it5zp@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alexandru.elisei@arm.com, ardb@kernel.org, jingzhangos@google.com, pajay@qti.qualcomm.com, psodagud@codeaurora.org, sramana@codeaurora.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jan 2021 14:46:36 +0000, David Brazdil wrote: > > On Mon, Jan 18, 2021 at 09:45:30AM +0000, Marc Zyngier wrote: > > Given that the early cpufeature infrastructure has borrowed quite > > a lot of code from the kaslr implementation, let's reimplement > > the matching of the "nokaslr" option with it. > > > > Signed-off-by: Marc Zyngier > Acked-by: David Brazdil [...] > > @@ -126,7 +95,7 @@ u64 __init kaslr_early_init(void) > > * Check if 'nokaslr' appears on the command line, and > > * return 0 if that is the case. > > */ > > - if (is_kaslr_disabled_cmdline(fdt)) { > > + if (kaslr_feature_val & kaslr_feature_mask & 0xf) { > > nit: Isn't the 0xf redundant here? You don't re-mask for VH either. Actually, I do. See the two back to back ubfx that extract both the mask and the feature. The "& 0xf" here serves the same purpose. Is it redundant? At the moment, quite possibly. But since we have space for 16 "features", this is an indication that we are only using the first one. I expect that eventually, we'll use it for other things. Thanks, M. -- Without deviation from the norm, progress is not possible.