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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 BAB94C2D0A3 for ; Thu, 29 Oct 2020 19:48:28 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id DBAB6207DE for ; Thu, 29 Oct 2020 19:48:27 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 DBAB6207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2078C4B646; Thu, 29 Oct 2020 15:48:27 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QNpAPR+n5k71; Thu, 29 Oct 2020 15:48:26 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 032364B647; Thu, 29 Oct 2020 15:48:26 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AE70E4B647 for ; Thu, 29 Oct 2020 15:48:24 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N4VYXWFF-iB0 for ; Thu, 29 Oct 2020 15:48:23 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 974C44B646 for ; Thu, 29 Oct 2020 15:48:23 -0400 (EDT) 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 Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu [+ 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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm