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 39E47C433EF for ; Tue, 25 Jan 2022 13:24:04 +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=55Kwog8tWrb79ipuaSGfp6xle7ezIkhEZ8tu4orWiMY=; b=jeZrBTM58Yf9qM uEOR0jpJvoVpHLJahYsddd75VpkJtGhGdDl0tdFBR/p5M1Kc+et1SBp+85uYvAZADx3eF8n2/aLT3 b83nMSnxA2eZmQGkcYrRJcQEf8ohXQzPyUWjXioOLC/2Qq8F8xHpPs/PJYaYBtfHVYt7wqYOb6wq7 MXzC+rrU6N8HnYG5YQ2kD/Fodi8WC09u1W9J04sM6njlLyI8d+nxJoIe/MRZa0BiNq52joXd8ahrR ysCmMOMRndC0ahg5zPACaEHr3jjQhkgsDJ+0GFK487b1cwxrDbaodjT96VQdIHNoyP/un9Bkz6BSD qBailaZ4hnHz+gFQu31A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCLmk-007uCF-Kj; Tue, 25 Jan 2022 13:22:58 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCLmg-007uAz-Nq for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 13:22:56 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 1DC6661496; Tue, 25 Jan 2022 13:22:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81985C340E0; Tue, 25 Jan 2022 13:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643116973; bh=dNsSh+nbek24LHzPtQ2vR4sDkfPRZ8rLrT05Kvxr+O0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tXJOw07i0kYCGhxDK+raTLRGqqmTHjSxtHCen4PMVpxWYSAkIiF+OVZerP21Cw5Ot YPoso29oqpdaqvJ7zguk+IO+MKsXd7v1V7E8Exgh/h8WnovQcKdk2tl1WCQDSFBcxN 5qCgMNTQmeTAXd/lL+ecwA4KTvHjiDwisXOpWQaL48JyMa8dMfnNixnGnMM9krbPER NAgmOWhMRCDUmSKMeRPvC6pNsn/NUA9sGHIt/nUO46YQERj6TedyK1UpWTZ9m6qJj6 Yg4mUyY26mrsPAahCUkE2XCfwIYsQC/2q6mrl6iKwk/2bjlBzKXkd3BboejDVK/kT2 gipsR4vxebwlQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nCLmd-002uen-LS; Tue, 25 Jan 2022 13:22:51 +0000 Date: Tue, 25 Jan 2022 13:22:51 +0000 Message-ID: <87tuds6jbo.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Catalin Marinas , Will Deacon , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v8 26/38] KVM: arm64: Handle SME host state when running guests In-Reply-To: References: <20220125001114.193425-1-broonie@kernel.org> <20220125001114.193425-27-broonie@kernel.org> <87wnio6n7d.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.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, skhan@linuxfoundation.org, shuah@kernel.org, alan.hayward@arm.com, luis.machado@arm.com, Salil.Akerkar@arm.com, Basant.KumarDwivedi@arm.com, szabolcs.nagy@arm.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu 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-20220125_052254_887504_377F62E0 X-CRM114-Status: GOOD ( 29.58 ) 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 Tue, 25 Jan 2022 12:52:18 +0000, Mark Brown wrote: > > [1 ] > On Tue, Jan 25, 2022 at 11:59:02AM +0000, Marc Zyngier wrote: > > Mark Brown wrote: > > > > + if (has_vhe()) { > > > + if (system_supports_sme()) { > > > nit: if (has_vhe() && system_supports_sme()) { > > > saves you one level of indentation. > > Yes, for now. IIRC there was some other stuff there when I had some of > the code for doing the register switching properly. > > > > + /* Also restore EL0 state seen on entry */ > > > + if (vcpu->arch.flags & KVM_ARM64_HOST_SME_ENABLED) > > > + sysreg_clear_set(CPACR_EL1, 0, > > > + CPACR_EL1_SMEN_EL0EN | > > > + CPACR_EL1_SMEN_EL1EN); > > > + else > > > + sysreg_clear_set(CPACR_EL1, > > > + CPACR_EL1_SMEN_EL0EN, > > > + CPACR_EL1_SMEN_EL1EN); > > > I find the use of CPACR_EL1_SMEN in some cases and its individual bits > > in some others pretty confusing. I understand that you have modelled > > it after the SVE code, but maybe this is a mistake we don't need to > > repeat. I'd be in favour of directly exposing the individual bits in > > all cases. > > OK, it is just the KVM code that uses the plain ZEN. I'll add a cleanup > patch for that at the start of the series for ZEN I guess otherwise it > looks worse, though that will inflate the size of the series a bit. I'm happy to merge such a patch early if that helps. 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