From patchwork Tue Jun 25 13:00:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13711112 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 8F724C2BBCA for ; Tue, 25 Jun 2024 13:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=6QWH++LT/k7/freJHEvAd9p8GGZ+KdQHt96yyiO0Puo=; b=TF5fi9G77k+wu2qh6H+IvA6ajz p7ubAR+2eylTmAbU74BiWexfnEWkMhkEbHto1Cjgl10V0vbaJoKaf/DSFVB8+P97zFIecZ8JxmzXA pbs3D2uYqdOg2Fm5payDsO+tn59Ul3mHytiix1FML7/QltB/YjVuicffM0GCzPW/M8alFf8ECAg1/ d/BYLkddbByhTZefRz5WNeP49UWxEnzwPn8tupfzfhiQG5fCazMdBL9+8UGT+eH4LNer1bOE3eGlT Ve/G4oQmYpdmjQUrFA0Jfd8WSBkQfKWgRa3xc3rkowyowD4X1xFv9I6ALcb5ApZeEbayNh/v98oS4 PfKS1hTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sM5nG-00000002tCn-3IeU; Tue, 25 Jun 2024 13:01:06 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sM5n1-00000002t5W-33JM for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 13:00:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 17AA9CE1ABC; Tue, 25 Jun 2024 13:00:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38FAAC32786; Tue, 25 Jun 2024 13:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719320449; bh=tW2UPTksFmsVW9kguIKpPtXZeO0+Rs1arm33m9xPMWA=; h=From:To:Cc:Subject:Date:From; b=eUZSAp+ycRnGJMiDSYC0XoN1/IsgOs4Lj+pSvlfTpwIAJlvi/qxaRInxcttaOafqN +ZkrRaFosyg7DLlrFDF4gWjprTa4LgKJPMUBvpx5zfLPnzdYVXUBphyruZGVxFEEMR r65FHUoJ50mOMrtC2EqFR5uYKCZq1b0P01lM/sJhI0NAJ1fG0m8Zm/Y4Bmhwu8MMhe 1KHEd2BfrPOx1Sv4Ie7wxtGfYwpWe7yG/qf4x6L5Z+eSqLoX3GN5GLDoIkQdZw3zPh 0iW+zzZgHDh9ySab04f3wxH4KLWBMyw/wXkA9hkK+o9Q0Vvceog92y7Bs3XQS30QmO bbyKAyaxTUc6A== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sM5mw-0079X4-SF; Tue, 25 Jun 2024 14:00:47 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Joey Gouly Subject: [PATCH 0/5] KVM: arm64: Fix handling of TCR2_EL1 Date: Tue, 25 Jun 2024 14:00:36 +0100 Message-Id: <20240625130042.259175-1-maz@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, joey.gouly@arm.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-20240625_060051_967461_1DC8EDB3 X-CRM114-Status: GOOD ( 10.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As I'm inching towards supporting FEAT_S1PIE in a NV guest (oh, the fun I'm having!), it has become obvious that we're missing the basics when it comes to: - VM configuration: HCRX_EL2.TCR2En is forced to 1, and we blindly save/restore stuff. - trap bit description and routing: none, obviously, since we make a point in not trapping. Given that these are prerequisites for the NV work and that we should have had that from the beginning, I would like to plug them before piling more patches on top. Marc Zyngier (5): KVM: arm64: Correctly honor the presence of FEAT_TCRX KVM: arm64: Get rid of HCRX_GUEST_FLAGS KVM: arm64: Make TCR2_EL1 save/restore dependent on the VM features KVM: arm64: Make PIR{,E0}_EL1 save/restore conditional on FEAT_TCRX KVM: arm64: Honor trap routing for TCR2_EL1 arch/arm64/include/asm/kvm_arm.h | 1 - arch/arm64/kvm/emulate-nested.c | 13 ++++++++ arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 35 +++++++++++++++------- arch/arm64/kvm/sys_regs.c | 17 ++++++++++- 4 files changed, 54 insertions(+), 12 deletions(-)