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 BFB04C4332F for ; Tue, 20 Dec 2022 10:25:44 +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=DPgCiaeOgvStDMTWHcDtFnHpnmNdJ/hQ0E/YJMKZaRE=; b=jDukyHq1d++LlD omWOdAu79ldVeMRMXDLKJNmpIfzbvUUcyi8y3JAYwUPX7XtTwtWEZud+GMtkasJHPohiIcNY9SM5A fX4TTc4izwV7kaWgi7i+BJDkjcofMZWEC0Ntt3kK0hZUT3ZFY0MYgkujsur/NeCdF2lgthqlsCBWW ddclLhtqYZVQERBY5UdwiSAXFjgIey47mE6TPQQltn8Yg5qbtvy6CaOqIfWNnahbfQus3zax8USY+ zBeR/NjAg6RCBKkYvcOkAJA72G3iy9vGzTUCEHHn+4rDRPxvlYw+n/yNOjnbkz248pMHLlEVFVpK2 ueatysSlIV/yRcp/PltQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Zn7-00DGoG-RI; Tue, 20 Dec 2022 10:24:10 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Zej-00DDmb-07 for linux-arm-kernel@lists.infradead.org; Tue, 20 Dec 2022 10:15:31 +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 270E8B81103; Tue, 20 Dec 2022 10:15:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6DCAC433EF; Tue, 20 Dec 2022 10:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671531325; bh=28o3C2KADlOFeNzK3Jd2QioJksowl6HsKCCJsoj0JNc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hTHocmiee6gvKVzLZV5/t6IWCbeDwMvUf3a0u8WqPfC+l5PFsyKkoiSCjLAi9qN0G eagZrygJHAMqKsrmDlnhWGcdCClwZYodO4umxU4tnQeTNlGPTx3o9PEPvdVM8RWWL6 Z1Tgs6G7hACSwJvTfnji5T75CmH2OoaWVbp2M7myeGl2GBj6aqVRGCekDTCdR9ZYNo V2pbsbjfe14fsHkcQc/DjU9k/6c77BfsH4pnYDqZlgLfDzq/RLhG+WjFaTDeBrCygx 99U89QIo3t0zqUfekkGdveis/HHqh1VerBZWyHpwCutmjj90BfevPsNkAps8YwyiiL lBSSkK1KtqMog== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1p7Zed-00DsnV-FZ; Tue, 20 Dec 2022 10:15:23 +0000 Date: Tue, 20 Dec 2022 10:15:18 +0000 Message-ID: <86v8m6bcuh.wl-maz@kernel.org> From: Marc Zyngier To: Dong Bo Cc: , , , , Nianyao Tang , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Catalin Marinas , Will Deacon , Mark Brown Subject: Re: [PATCH] KVM: arm64: Synchronize SMEN on vcpu schedule out In-Reply-To: <20221220105024.13484-1-dongbo4@huawei.com> References: <20221220105024.13484-1-dongbo4@huawei.com> 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 (aarch64-unknown-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: dongbo4@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, tangnianyao@huawei.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org 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-20221220_021529_619210_E3A1D635 X-CRM114-Status: GOOD ( 22.57 ) 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 + Mark On Tue, 20 Dec 2022 10:50:24 +0000, Dong Bo wrote: > > From: Nianyao Tang > > If we have VHE and need to reenable SME for host in > kvm_arch_vcpu_put_fp, CPACR.SMEN is modified from 0 to 1. Trap > control for reading SVCR is modified from enable to disable. > Synchronization is needed before reading SVCR later in > fpsimd_save, or it may cause sync exception which can not be > handled by host. > > Cc: Marc Zyngier > Cc: James Morse > Cc: Alexandru Elisei > Cc: Suzuki K Poulose > Cc: Oliver Upton > Cc: Catalin Marinas > Cc: Will Deacon > Signed-off-by: Nianyao Tang > --- > arch/arm64/kvm/fpsimd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c > index 02dd7e9ebd39..f5799f571317 100644 > --- a/arch/arm64/kvm/fpsimd.c > +++ b/arch/arm64/kvm/fpsimd.c > @@ -184,6 +184,7 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) > sysreg_clear_set(CPACR_EL1, > CPACR_EL1_SMEN_EL0EN, > CPACR_EL1_SMEN_EL1EN); > + isb(); > } > > if (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED) { > -- > 1.8.3.1 > > -- 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