From patchwork Wed Jun 5 07:28:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13686280 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 80B3DC25B76 for ; Wed, 5 Jun 2024 07:28:34 +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=jp/qo4M80jLA1u3n/vbCP3bcHLBvd9KsusnZG7hxqoI=; b=bHo7AqgQuZ+J0W EygIMLLbN8cidYZ/3sustu+K7CwdB8cyQnMFwqbTpBn5frKYkQOqwsKDc+cvD2Jot4O2H2c3mEPgp Fsk4uzka47vxrgUHE0gWn5+ijvdHMLf4alYwhmxtS6X0fz9wCJgIFBaU+umwiod2EaZZ2CB6t0RS9 16F1iqjlW4eqscsTiTqzd9qVmBdF/kGpSnl8+zmc4/iiP/9kfVQyy70pWG9sO9vm6A/WXcYEZGCQd vrvQyY5hDUNUhVhxAt9uleMFdlfZNWDxoZCkc0Ofz8JtkW/oUkGsTwh9biSVFBefVL02ytxFn1s7t qFCIkWY+FgrzPVI13J1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEl4I-000000050J8-41xO; Wed, 05 Jun 2024 07:28:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEl4G-000000050IQ-220v for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 07:28:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 90EEA61241; Wed, 5 Jun 2024 07:28:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D647C3277B; Wed, 5 Jun 2024 07:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717572499; bh=VDWaPe6jIhISipwILh3CKrMhwSHXzHUPVWVJ6g5hdkc=; h=From:To:Cc:Subject:Date:From; b=sWXaXjIavZKQUqRyDIy89bFWtJnv7GcdkwzYtb5+CacYataVZ8woCrSrU8vy+C74E KvUHhR2TvbsleAXUENV/QaDSp8n+MaxPr3a/X5SVefn76F1PCE0nr04YdNPtG34ooJ VPd3gZDVPxR8f5e3m0iMq95vTmRahmT+5JRty3Q7C8QWhx4kHA1SDgGKFMgHS8r0rY qX3ANPuknB1AnFy01z60ihAucAGh/r2fWMOW0Pb010g+V8rRen6yH4C49zeycSXnbY pbkfaIlbKfvgDtjkrhZgsLTMPuv7DAtSTcfXNVaMHkooDx1vqChM5Kl2+kTcGBfGrs WCf+HrYlFmy4g== 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 1sEl4C-000pgW-Ie; Wed, 05 Jun 2024 08:28:16 +0100 From: Marc Zyngier To: Paolo Bonzini Cc: Fuad Tabba , Joey Gouly , Mark Brown , Nina Schoetterl-Glausch , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [GIT PULL] KVM/arm64 fixes for 6.10, take #1 Date: Wed, 5 Jun 2024 08:28:08 +0100 Message-Id: <20240605072808.1039636-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: pbonzini@redhat.com, tabba@google.com, joey.gouly@arm.com, broonie@kernel.org, nsg@linux.ibm.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.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-20240605_002820_645276_9A758749 X-CRM114-Status: GOOD ( 14.80 ) 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 Paolo, Here's a large-ish set of fixes for 6.10, the bulk of it addressing the sorry state of pKVM's handling of FP/SVE (kudos to Fuad for sticking with it and getting the series in shape). The rest is a more esoteric set of AArch32 and NV fixes, details in the tag as usual. Please pull, M. The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-6.10-1 for you to fetch changes up to afb91f5f8ad7af172d993a34fde1947892408f53: KVM: arm64: Ensure that SME controls are disabled in protected mode (2024-06-04 15:06:33 +0100) ---------------------------------------------------------------- KVM/arm64 fixes for 6.10, take #1 - Large set of FP/SVE fixes for pKVM, addressing the fallout from the per-CPU data rework and making sure that the host is not involved in the FP/SVE switching any more - Allow FEAT_BTI to be enabled with NV now that FEAT_PAUTH is copletely supported - Fix for the respective priorities of Failed PAC, Illegal Execution state and Instruction Abort exceptions - Fix the handling of AArch32 instruction traps failing their condition code, which was broken by the introduction of ESR_EL2.ISS2 - Allow vpcus running in AArch32 state to be restored in System mode - Fix AArch32 GPR restore that would lose the 64 bit state under some conditions ---------------------------------------------------------------- Fuad Tabba (9): KVM: arm64: Reintroduce __sve_save_state KVM: arm64: Fix prototype for __sve_save_state/__sve_restore_state KVM: arm64: Abstract set/clear of CPTR_EL2 bits behind helper KVM: arm64: Specialize handling of host fpsimd state on trap KVM: arm64: Allocate memory mapped at hyp for host sve state in pKVM KVM: arm64: Eagerly restore host fpsimd/sve state in pKVM KVM: arm64: Consolidate initializing the host data's fpsimd_state/sve in pKVM KVM: arm64: Refactor CPACR trap bit setting/clearing to use ELx format KVM: arm64: Ensure that SME controls are disabled in protected mode Marc Zyngier (5): KVM: arm64: Fix AArch32 register narrowing on userspace write KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode KVM: arm64: AArch32: Fix spurious trapping of conditional instructions KVM: arm64: nv: Fix relative priorities of exceptions generated by ERETAx KVM: arm64: nv: Expose BTI and CSV_frac to a guest hypervisor arch/arm64/include/asm/el2_setup.h | 6 +-- arch/arm64/include/asm/kvm_arm.h | 6 +++ arch/arm64/include/asm/kvm_emulate.h | 71 ++++++++++++++++++++++++++-- arch/arm64/include/asm/kvm_host.h | 25 +++++++++- arch/arm64/include/asm/kvm_hyp.h | 4 +- arch/arm64/include/asm/kvm_pkvm.h | 9 ++++ arch/arm64/kvm/arm.c | 76 +++++++++++++++++++++++++++++ arch/arm64/kvm/emulate-nested.c | 21 +++++---- arch/arm64/kvm/fpsimd.c | 11 +++-- arch/arm64/kvm/guest.c | 3 +- arch/arm64/kvm/hyp/aarch32.c | 18 ++++++- arch/arm64/kvm/hyp/fpsimd.S | 6 +++ arch/arm64/kvm/hyp/include/hyp/switch.h | 36 +++++++------- arch/arm64/kvm/hyp/include/nvhe/pkvm.h | 1 - arch/arm64/kvm/hyp/nvhe/hyp-main.c | 84 +++++++++++++++++++++++++++++---- arch/arm64/kvm/hyp/nvhe/pkvm.c | 17 ++----- arch/arm64/kvm/hyp/nvhe/setup.c | 25 +++++++++- arch/arm64/kvm/hyp/nvhe/switch.c | 24 ++++++++-- arch/arm64/kvm/hyp/vhe/switch.c | 12 +++-- arch/arm64/kvm/nested.c | 6 ++- arch/arm64/kvm/reset.c | 3 ++ 21 files changed, 391 insertions(+), 73 deletions(-)