From patchwork Tue Aug 13 14:47:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13762169 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 3EFA8C52D7C for ; Tue, 13 Aug 2024 14:48:49 +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=T2MGndvEH1ZUUHv7EUJGmwpQW9nLf+Wde6qIm7MIdpI=; b=xU9vEmRRWiwB6lnzkzFg7ueVa7 Fg+3b5IOnmznHCGch4/0ei6XvAAv1WhOp9hmLYq9D5AJrS4RSxryx/kwPppP00ALjq7Zbfdj6e1Jm FjYOBlGB11UZSChJ7YpRNenXJvQApleaiyTQ1rc30qnO7HAVQ0wz5OEjC1cDKbg5dNjSONe4cLcHW dUoc1o1GUHlgCQlft7yyeBFqCZLyvwtsLKXAdEm1zYdKrgBLLQObgMajlKlT/0Ot5+H3aXgchOOQs YM41TNQE+sCLLWH9MGUE2BSe78C6u0OQKqGuTjXSX2PR/Fhx2kjl3tt8M5SH/AFQ3hgb8Cgypwmtw 7KK89Afg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdspB-000000044nc-1w7v; Tue, 13 Aug 2024 14:48:37 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdsoY-000000044bI-2sYg for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 14:48:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 82A3261705; Tue, 13 Aug 2024 14:47:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35E37C4AF09; Tue, 13 Aug 2024 14:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723560477; bh=ybweyFTPZIsemP1mTBqOWgja4nvW2VxgY6ZJsmy/cTo=; h=From:To:Cc:Subject:Date:From; b=BiM73EWECVBgrpxuBT4Klb7KylyZpjAXyuaCSBn/PAMJnktoOJ8RyTEl3cEoQLMEX HgKfgtXkMmqVzrIDV8cH2CWEJM1zqoc5MazXnuv39+55day0+NydDykBuDZa2LWMVO 29TwmrKNwwcranLM/J1GAEHy7K/CPucYpWUR2XcFvSsv7YgtEs4KnfpdASLIOuU3ys AfqaOsUk3a8iKsCB8e1s6PxIbkkBzSWKvCGtDL+5VNEEKE/Z3luRwsLiGJBlfelwl0 rrGgOCvY9xDQDwbCLl1UWk4nthStTOWUfVTcJpVI9QsS/PO5BXdYURqC4exLm/DVdJ l8DDG4U4MfztQ== 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 1sdsoV-003O27-5X; Tue, 13 Aug 2024 15:47:55 +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 , Alexandru Elisei Subject: [PATCH 00/10] KVM: arm64: Add EL2 support to FEAT_S1PIE Date: Tue, 13 Aug 2024 15:47:28 +0100 Message-Id: <20240813144738.2048302-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, alexandru.elisei@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-20240813_074758_816775_476EB40A X-CRM114-Status: GOOD ( 10.48 ) 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 This series serves a few purposes: - Complete the S1PIE support to include EL2 - Sneak in the EL2 system register world switch As this is a parallel series to the one implementing Address Translation, the S1PIE part of AT is not in any of the two. Depending on which series goes in first, I'll add whatever is needed on top. As mentioned in few of the patches, this implementation relies on a very recent fix to the architecture (D22677 in [1]). [1] https://developer.arm.com/documentation/102105/ka-04/ Marc Zyngier (10): KVM: arm64: nv: Handle CNTHCTL_EL2 specially KVM: arm64: nv: Save/Restore vEL2 sysregs KVM: arm64: Add TCR2_EL2 to the sysreg arrays KVM: arm64: Add save/restore for TCR2_EL2 arm64: Add encoding for PIRE0_EL2 arm64: Remove VNCR definition for PIRE0_EL2 KVM: arm64: Add PIR{,E0}_EL2 to the sysreg arrays KVM: arm64: Add save/restore for PIR{,E0}_EL2 KVM: arm64: Handle PIR{,E0}_EL2 traps KVM: arm64: Sanitise ID_AA64MMFR3_EL1 arch/arm64/include/asm/kvm_host.h | 3 + arch/arm64/include/asm/vncr_mapping.h | 1 - arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 5 +- arch/arm64/kvm/hyp/nvhe/sysreg-sr.c | 2 +- arch/arm64/kvm/hyp/vhe/sysreg-sr.c | 155 ++++++++++++++++++++- arch/arm64/kvm/sys_regs.c | 61 +++++++- arch/arm64/tools/sysreg | 4 + include/kvm/arm_arch_timer.h | 3 + 8 files changed, 227 insertions(+), 7 deletions(-)