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 E5636C433F5 for ; Tue, 23 Nov 2021 14:25:48 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=nAF0epgsjgHlunc2+rUw9I4APbRAE09ctlnXkoqb4Kc=; b=J61U2JODbdZZIn k8q96roKMG7Nr0lOkKpnVgRziCX21cxIM+Eiv6uPSz4QbnSMhKIG1HPxsQ3prHWgCJSnTvrRTkQAy cTFDUocO90tewbUlsmqXO7NIujjiban8qF0wdWpnf5fsUvRRuDiLaxmfgRZu0gxTk4DMUmKAWcgC9 ADWkwhVEmWU9gdhkRsJzP99ssFUOU8GP4Kskyj/Kws+0F7hQ1sDs7z3CJD3/sTDMCJoJcLWjTKdqi KeeLK9EMcR3a88OPUCnugd2XRnaS3N+0RZL9JE/ORqh9lu/fuLNIEH82oaxqK0tsoYdrO8f9m6+qG a/YmUklzXj3skDj7uglA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpWiT-002aZI-9a; Tue, 23 Nov 2021 14:24:13 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpWhH-002a3S-3Z for linux-arm-kernel@lists.infradead.org; Tue, 23 Nov 2021 14:23:01 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67E976052B; Tue, 23 Nov 2021 14:22:58 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) 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 1mpWhE-007Ijf-9C; Tue, 23 Nov 2021 14:22:56 +0000 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Alexandru Elisei , Will Deacon , Quentin Perret , Fuad Tabba , kernel-team@android.com Subject: [PATCH 0/2] KVM/arm64: Early PSTATE evaluation fixes Date: Tue, 23 Nov 2021 14:22:45 +0000 Message-Id: <20211123142247.62532-1-maz@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, will@kernel.org, qperret@google.com, tabba@google.com, kernel-team@android.com 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-20211123_062259_219954_BF926BC4 X-CRM114-Status: GOOD ( 12.34 ) 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 There are a number of cases where we evaluate PSTATE early on guest exit. Nothing wrong with that. Except that we actually synchronise KVM's view of PSTATE pretty late, way after we needed it. Oopsie boo. Thankfully, there are only two paths that require it: GICv3 emulation for 32bit guests, and trap handling of 32bit guests in protected mode. There is no known need of the former (though you could enable it on the command line), and the latter is still a work in progress. In any case, this needs fixing. Funnily enough, this is something that I had already solved on NV, so the solution isn't that different from what I have there. Unless someone shouts, I intend to merge these as fixes. Marc Zyngier (2): KVM: arm64: Save PSTATE early on exit KVM: arm64: Move pkvm's special 32bit handling into a generic infrastructure arch/arm64/kvm/hyp/include/hyp/switch.h | 14 ++++++++++++++ arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 7 ++++++- arch/arm64/kvm/hyp/nvhe/switch.c | 8 +------- arch/arm64/kvm/hyp/vhe/switch.c | 4 ++++ 4 files changed, 25 insertions(+), 8 deletions(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel