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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2206EC05027 for ; Fri, 20 Jan 2023 10:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yUlQRaoXTrFsIJt4aTiE+YQhoL6MO78TwIXcqUtE5A4=; b=ErXxb6qSD8wvSb vZ+Y9IGUKo4knEgwg4Ha+B5SMpxukG2C95f5S5WKpl4mhUuqR07lQ8cvb5KvwdgFE52Mnhbm5XSzH mmHcFQWPpSp+7e+Zj3a3pbQt87Jnx5MI8NWn8qj9uMRBM5J76r+pCS53wXbjeLA/ERTD6k2+ZFR5J dVULTeVwmcTcC1KpPb8j/DTojDOiotahtYEJb4/9qUEmhk9hbMPQExtyBZx43r2928rs8A7tDRMgb DhKn+LTuFUImB5Pu9oPcKaNARPDv5E5/AP7oudpCUBxXFyzp4X9FdNnHUYyKF4JADy1dqvVCbZge4 nkbCXxsG2dWW5qIeIznA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIoRb-009jgl-5p; Fri, 20 Jan 2023 10:16:23 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIoPj-009ipT-R5 for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 10:14:29 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 794F3CE2707; Fri, 20 Jan 2023 10:14:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E184EC433D2; Fri, 20 Jan 2023 10:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674209661; bh=8coKsEGNOLVnML+qzF/cIjseg/P2bFDNfepu0vc5CHc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jtc/Lu/Am8c4uVLCAKluT/KlboKnPU98ZUzaj4diA4eURXvZlRnakfAQjwEhUyv9N xxxUi/2bQzrIn9y37fhMtOvNTo4g2QiQy+Bq7Kc4k5OY+C+isMgYIJFOfH5DnfdSBz pFlGxHbfvpTPeTbYI2LQHNybWeIQhN1v0mUNYdIrZYQyxzYu7ZR4tGP1PFuM3U2/St 4BQd1WnxJIsTZldWfhkY7NQ3bgyAHOwdBYNZYgANuMNYtzcWPX8toc0xOUs5l+pfet KQdG+TS49OeCDrmep/qNFw9ojv4C9jmRd4edEP8KYRN9wNiRJtSNA+yQFvA7H4+2MH bth0iY00R8QIg== Date: Fri, 20 Jan 2023 10:14:16 +0000 From: Will Deacon To: Marc Zyngier Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Catalin Marinas , Mark Rutland , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: Re: [PATCH 1/2] KVM: arm64: Disable KVM on systems with a VPIPT i-cache Message-ID: <20230120101415.GA21784@willie-the-truck> References: <20230113172523.2063867-1-maz@kernel.org> <20230113172523.2063867-2-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230113172523.2063867-2-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_021428_141292_D31FA50D X-CRM114-Status: GOOD ( 21.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Fri, Jan 13, 2023 at 05:25:22PM +0000, Marc Zyngier wrote: > Systems with a VMID-tagged PIPT i-cache have been supported for > a while by Linux and KVM. However, these systems never appeared > on our side of the multiverse. > > Refuse to initialise KVM on such a machine, should then ever appear. > Following changes will drop the support from the hypervisor. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/arm.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 9c5573bc4614..508deed213a2 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -2195,6 +2195,11 @@ int kvm_arch_init(void *opaque) > int err; > bool in_hyp_mode; > > + if (icache_is_vpipt()) { > + kvm_info("Incompatible VPIPT I-Cache policy\n"); > + return -ENODEV; > + } Hmm, does this work properly with late CPU onlining? For example, if my set of boot CPUs are all friendly PIPT and KVM initialises happily, but then I late online a CPU with a horrible VPIPT policy, I worry that we'll quietly do the wrong thing wrt maintenance. If that's the case, then arguably we already have a bug in the cases where we trap and emulate accesses to CTR_EL0 from userspace because I _think_ we'll change the L1Ip field at runtime after userspace could've already read it. Is there something that stops us from ended up in this situation? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel