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 ED566C4708D for ; Wed, 7 Dec 2022 19:06:26 +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:MIME-Version:References:In-Reply-To: Subject:Cc: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=pyq5iBx3K+Xr6uy88xv89c6PVxW8PXHgq7QfYY66q9w=; b=wDllltJ0XaH1rh KAl2sY2sPiPo+TSr/59NTAGNRNUi/bbG8v20iD0rWq0cNy4oocbNwgJj2VLwAvWEaXAerHnSp5sTI zC/LohTtvCzzaqOzmwqJ8csdtkGyj+QvXs3+fHF4+8dUkkrO2gS+NBaPeSmQiAPoOwmr3qVommPLU PDAVG3VN8bUSCSgziaMePGvCtGnzIaxRLGHpMUvjbaZcnS8ha9a4U06HUTaz2MwhCWJJjroz0KJnW HJf8atX9Yq0YwQFIbLz/PsV/3dQ9YB3l4d6oGLfCIVCUAaY+B8EVc0wy8e614VygQqgNP/YdWQ68o hscfJnmRslyI+OZ+On7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2zjI-00AFRn-Om; Wed, 07 Dec 2022 19:05:16 +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 1p2zjF-00AFNq-Qf for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2022 19:05:15 +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 44A48B81FDC; Wed, 7 Dec 2022 19:05:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1579C433D6; Wed, 7 Dec 2022 19:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670439910; bh=4pRrfPHrYBe6IY9OjvKZNVGDF905GBv+j6LDFko/JLQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pSG/dnMStZz1/XKIcLTjSwv0GcAw2//GNdYc1v84roDJmCWcoAwELDGrpYlmy7q4H FWDi/1BzI2c3Bz2pKl8HiKfoh4sZti//rNCKHbEQYpXQ+BjLLp3VzMXO+kk0bCgkBS E1d02JPs/xFOFhCczlBjVlxoiwvwPgrpdQ1BzOE0LpW03dCSD9/P3RjlvkYZCCWIZe obt2jZSQ/UJ/dfOtBGzzbVHX6+iN7Ul4JHk9nb3jzR0ihxbYBGjynyci/Vfcb586AM BQut5fK/Kf4uU5q+ZenPuoN8NcxKzFe6GV/3BInjvqau9Ve6zvp+dLjyUBDtbhfCRL sD8HTHVRmYhHQ== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] 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.95) (envelope-from ) id 1p2zjA-00BBiW-F5; Wed, 07 Dec 2022 19:05:08 +0000 Date: Wed, 07 Dec 2022 19:03:28 +0000 Message-ID: <87y1rjrq7z.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Catalin Marinas , Will Deacon , Lorenzo Pieralisi , Mark Rutland , Sami Mujawar , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v2 09/14] KVM: arm64: Hide FEAT_NMI from guests In-Reply-To: References: <20221112151708.175147-1-broonie@kernel.org> <20221112151708.175147-10-broonie@kernel.org> <86pmcxlo7z.wl-maz@kernel.org> 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") X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, lpieralisi@kernel.org, mark.rutland@arm.com, Sami.Mujawar@arm.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev 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-20221207_110514_174122_0B22FD42 X-CRM114-Status: GOOD ( 28.09 ) 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 Mon, 05 Dec 2022 19:03:50 +0000, Mark Brown wrote: > > [1 ] > On Mon, Dec 05, 2022 at 06:06:24PM +0000, Marc Zyngier wrote: > > Mark Brown wrote: > > > > FEAT_NMI is not yet useful to guests pending implementation of vGIC > > > support. Mask out the feature from the ID register and prevent guests > > > creating state in ALLINT.ALLINT by activating the trap on write provided > > > in HCRX_EL2.TALLINT when they are running. There is no trap available > > > for reads from ALLINT. > > > > We do not need to check for FEAT_HCRX since it is mandatory since v8.7 > > > and FEAT_NMI is a v8.8 feature. > > > And yet you check for it in hyp-stub.S after having checked for > > FEAT_NMI. What gives? > > Being aware that you have a strong preference for not having safety > checks for mandatory features I didn't add any here but noted it so > people could see why they were omitted. The checks in hyp-stub.S were > probably written before I'd checked the dependency situation out. > > I can remove those checks if preferred but TBH given that the failure > mode in hyp-stub.S is typically going to be to die with no output if > something goes wrong it does feel like it's worth the extra couple of > instructions to double check things just in case, especially with the > virtual platforms being so easy to misconfigure. I'm not hell bent on it, and if we can spot the issue early, that's fine by me. But let's then disable the feature if the implementation lacks some essential dependencies. A simple check on ID_AA64MMFR1_EL1.HCX when detecting FEAT_NMI should do the trick. 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