From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8763B7B for ; Sun, 30 Oct 2022 17:44:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4C79C433C1; Sun, 30 Oct 2022 17:44:42 +0000 (UTC) Date: Sun, 30 Oct 2022 17:44:39 +0000 From: Catalin Marinas To: Marc Zyngier Cc: Mark Brown , Will Deacon , Peter Maydell , Richard Henderson , Vincent Donnefort , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v1 0/2] KVM: arm: Refuse to enable KVM on systems with SME but not FGT Message-ID: References: <20221027205246.812586-1-broonie@kernel.org> <8735b6hmxo.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8735b6hmxo.wl-maz@kernel.org> On Sat, Oct 29, 2022 at 12:46:43PM +0100, Marc Zyngier wrote: > On Thu, 27 Oct 2022 21:52:44 +0100, > Mark Brown wrote: > > > > The architecture requires that any system which implements SME also has > > fine grained traps since SME is a v9.2 feature, meaning that v8.7 must be > > implemented, and FGT is mandatory from v8.6. SME relies on fine grained > > traps to control access to SMPRI_EL1 and in nVHE mode to TPIDR2_EL0, > > without traps SMPRI_EL1.Priority and TPIDR2_EL0 can be used as side > > channels. > > > > This series adds support for detecting FGT and refuses to allow KVM to > > be used in architecturally invalid configurations which have SME but not > > FGT, without detection the issue presents as faults due to EL2 > > attempting to access the FGT registers which isn't obvious to users. > > Currently fine grained traps are only used in nVHE but but a series > > "arm64/sme: Fix SMPRI_EL1 traps for KVM guests" sent along with this > > will add usage for VHE mode too making the issue more pressing. > > I think this goes the wrong way around. SME without FGT is invalid, > and yet you keep SME around and device to kill virtualisation support. > > I'd rather it is SME that gets disabled when the kernel boots at EL2. I agree, I rather we did it the other way around. -- Catalin 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 01EC9ECAAA1 for ; Sun, 30 Oct 2022 17:46:00 +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=K2lHpfBzvU/VeQbhVqfwJ2sBBChjyRYUYehRtjE/MLw=; b=mpMKYjXZB8cQKJ iFCKfG1n0/BaletrVHCAiC81LFtdzgvtfd/PWQVrwD/mdmL/QmTJPscebIQvYvdOaawi/c0xipYZo KydopCLs1uUeAvmM9rhwxXBrL0Mr1ImQKESWygNvMlLgKr33nxWSUp0Sx0gHbzQ9n6QIz7YmTbPXv MrG9J56emZvJvou7mNDtDraWwRBL0qOUiJxWGhTlPbYjb2L//BRss3IiT15gzrNTiH09swZLfTHiv VlgHXanUTNQndbzRONB8AUCp2cuILHmaXvhk9Qnm6lWKH9SPVbaMCJViWMNGVHgfyFM4u0EFj+oDq pnEkuneqjVuKMrS3zi6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opCMf-001LCW-57; Sun, 30 Oct 2022 17:44:53 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opCMb-001L8e-2Q for linux-arm-kernel@lists.infradead.org; Sun, 30 Oct 2022 17:44:50 +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 ams.source.kernel.org (Postfix) with ESMTPS id A6FF5B80E86; Sun, 30 Oct 2022 17:44:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4C79C433C1; Sun, 30 Oct 2022 17:44:42 +0000 (UTC) Date: Sun, 30 Oct 2022 17:44:39 +0000 From: Catalin Marinas To: Marc Zyngier Cc: Mark Brown , Will Deacon , Peter Maydell , Richard Henderson , Vincent Donnefort , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v1 0/2] KVM: arm: Refuse to enable KVM on systems with SME but not FGT Message-ID: References: <20221027205246.812586-1-broonie@kernel.org> <8735b6hmxo.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8735b6hmxo.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221030_104449_328460_AE2BE985 X-CRM114-Status: GOOD ( 21.18 ) 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 Sat, Oct 29, 2022 at 12:46:43PM +0100, Marc Zyngier wrote: > On Thu, 27 Oct 2022 21:52:44 +0100, > Mark Brown wrote: > > > > The architecture requires that any system which implements SME also has > > fine grained traps since SME is a v9.2 feature, meaning that v8.7 must be > > implemented, and FGT is mandatory from v8.6. SME relies on fine grained > > traps to control access to SMPRI_EL1 and in nVHE mode to TPIDR2_EL0, > > without traps SMPRI_EL1.Priority and TPIDR2_EL0 can be used as side > > channels. > > > > This series adds support for detecting FGT and refuses to allow KVM to > > be used in architecturally invalid configurations which have SME but not > > FGT, without detection the issue presents as faults due to EL2 > > attempting to access the FGT registers which isn't obvious to users. > > Currently fine grained traps are only used in nVHE but but a series > > "arm64/sme: Fix SMPRI_EL1 traps for KVM guests" sent along with this > > will add usage for VHE mode too making the issue more pressing. > > I think this goes the wrong way around. SME without FGT is invalid, > and yet you keep SME around and device to kill virtualisation support. > > I'd rather it is SME that gets disabled when the kernel boots at EL2. I agree, I rather we did it the other way around. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel