From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61494C2D0A3 for ; Thu, 29 Oct 2020 19:50:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC023207DE for ; Thu, 29 Oct 2020 19:50:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S/1FAjNu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BhXr7JY4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC023207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=07ZbsVE7tdMr6CTmBMMilLu3QNPOauhmLM19hTdgYvo=; b=S/1FAjNuKOTwhdDlgxRsA1nEo gaN8IXyZAY5Azns7nfci2mzPeWqEPpywS4n7IKyvNZR7k9hOM7zMWGHNUWhRXmHL281auNH+7XW9q kk2bdaqirghzjYKIJYPBzHfOJ2N1bZkRnh3lcGGFm16tHvD3UUNeOKhgQbzzBniB8Ft623OXF+8/i 5P0PKSuEYGZ0ugFPJzVAhq2vPAP/h9KKqR/r8jxambBHL0Yzg4G4G39R/+qPzVTAKe8k3W8evId8k KVyDgcwwD9l7z/poIbjwyCd9kMfpbg7pfyxrTcB4cggve2VRyawpYM7vJVBniHhmTHWJ9/J1FzoKQ yGP8Ba3+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYDvW-0007yn-HX; Thu, 29 Oct 2020 19:49:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYDuJ-0007Ro-LA for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2020 19:48:38 +0000 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 3A0F420782; Thu, 29 Oct 2020 19:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604000902; bh=Gyd6eXG74BPu+fVtrjSu2bLsnfDj5UYA7WSAamk71T0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BhXr7JY4araNqqHPBbR4B74L2tB5+G57BSRmnYKc4EIz800sbsXjEk8X3HZCHb6SZ InQ3YCN+yJTRtBD2XhOoEKZvCHB1ESJ8zcCu8DjnPnPv3MIItUdSPIciWqDSqU3Uyw trD071OX8MEkTIMs01UIvNy6CI7uPLT7kYFzFXdc= 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 1kYDuF-005XKA-PT; Thu, 29 Oct 2020 19:48:20 +0000 Date: Thu, 29 Oct 2020 19:48:16 +0000 Message-ID: <87ft5werun.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland , will@kernel.org, Catalin Marinas Subject: Re: [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp In-Reply-To: <20201026134931.28246-1-mark.rutland@arm.com> References: <20201026134931.28246-1-mark.rutland@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, dbrazdil@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201029_154823_866835_0F90A3B4 X-CRM114-Status: GOOD ( 22.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [+ Catalin] On Mon, 26 Oct 2020 13:49:28 +0000, Mark Rutland wrote: > > In a few places we use cpus_have_const_cap() in hyp code, usually > because this is hidden within a helper that's also used in regular > kernel context. As cpus_have_const_cap() generates code to read the > cpu_hwcaps array before capabilities are finalized, this means we > generate some potentially-unsound references to regular kernel VAs, but > this these are redundant as capabilities are finalized before we > initialize the kvm hyp code. > > This series gets rid of the redundant code by automatically upgrading > cpust_have_const_cap() to cpus_have_final_cap() when used in hyp code. > This allows us to avoid creating an NVHE alias for the cpu_hwcaps array, > so we can catch if we accidentally introduce an runtime reference to > this (e.g. via cpus_have_cap()). > > Since v1 [1]: > * Trivial rebase to v5.10-rc1 > > [1] https://lore.kernel.org/r/20201007125211.30043-1-mark.rutland@arm.com > > Mark Rutland (3): > arm64: kvm: factor out is_{vhe,nvhe}_hyp_code() > arm64: cpufeature: reorder cpus_have_{const,final}_cap() > arm64: cpufeature: upgrade hyp caps to final > > arch/arm64/include/asm/cpufeature.h | 40 ++++++++++++++++++++++++++++--------- > arch/arm64/include/asm/virt.h | 9 ++++----- > arch/arm64/kernel/image-vars.h | 1 - > 3 files changed, 35 insertions(+), 15 deletions(-) Catalin, Will: can I get an Ack for patches 2 and 3? I'd be quite happy to drop yet another reference from the nVHE object... Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel