From patchwork Fri Oct 11 13:27:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13832574 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 6B942D0D791 for ; Fri, 11 Oct 2024 13:43:51 +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=fkXVVZ/NDTT9y9BEGlAMsXQBDkxWBH48X0EUZPmPGHs=; b=TJB51n01b6y4Q/ksCnUsYgISWq 843tLuVrhChKnEyF0FgSxg+opo01OJcXn7IN/7DiWZJeW3KjT0k9mfk/Mz93bPPdw46pWliBxwt5F 3bXN+SGpAD5yuTzLIBxYrtA4tFXBpib5gpbQM3DxxUy+IBohMCpwGW2e9l5g9Jt5pvzipIThwxCqi OWFRDpK608q65wHUOKOW0RGWXV11RjfpXhYPoa1AqLZk95FeX4rrTO/APqN0MP6fqX1DKW8i+MJWA fLO0cFJ4QGmY+r9jxcLeP0NbYj4w2ktsXRGymv0MXm8Qkwr11JUZo5+DnhM9GWSCF8/Wa7aSZ0n5f 28EcCpNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szFvf-0000000GUZ9-3S2t; Fri, 11 Oct 2024 13:43:39 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szFh4-0000000GRyd-2mXU for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 13:28:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id EE9E6A44521; Fri, 11 Oct 2024 13:28:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52242C4CEC3; Fri, 11 Oct 2024 13:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728653313; bh=XnQ3OWZmFFbbEbN0nuRCP99ploKH8REo3FMrNxhzftk=; h=From:To:Cc:Subject:Date:From; b=HMYFhmhESzKOcwvBG48mNXHKBp3jSeryZBYdzFM5birAyAQdVuaZ7nqkACztUEiV6 7Q40Zqq85bhWldnpkCKsllSU97Vumzk4iL9+uY3ek0lKO29SGdrzHaZlxw7eHaQ/5G 2EowimbnmHdyOonqP6U6m160fXtirsrh1JwXBT9C1IZQLe+ftG6N6272/YbsKvoRuG HnyEQfXn6eSTBrtUE1g9nvegSUktEjq9fEocRrp1HQSByM8rGjDx/B0Lce4VOdmMeH gTtOf4NhbO6/Xv7j0CYPPdSEuui2XONFFyUSwroCiWL5T5F5XS+IEOJOvOxRyF+XeH m4IQTxxrYlkow== 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 1szFh1-002Z8g-Dg; Fri, 11 Oct 2024 14:28:31 +0100 From: Marc Zyngier To: Paolo Bonzini Cc: Alexander Potapenko , Joey Gouly , Mark Brown , Oliver Upton , Shameer Kolothum , Shaoqin Huang , 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.12, take #2 Date: Fri, 11 Oct 2024 14:27:56 +0100 Message-Id: <20241011132756.3793137-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, glider@google.com, joey.gouly@arm.com, broonie@kernel.org, oliver.upton@linux.dev, shameerali.kolothum.thodi@huawei.com, shahuang@redhat.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-20241011_062834_858778_2B92AB1F X-CRM114-Status: GOOD ( 13.35 ) 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 the second set of fixes for 6.12. We have a handful of fixes for the ID register configuration (I had originally queued them for -rc1, and somehow managed to accidentally drop the branch on the floor), our NV shadow page tables, the vgic, and a fix for a regression introduced in -rc1. As usual, details in the tag. Please pull, M. The following changes since commit a1d402abf8e3ff1d821e88993fc5331784fac0da: KVM: arm64: Fix kvm_has_feat*() handling of negative features (2024-10-03 19:35:27 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-6.12-2 for you to fetch changes up to df5fd75ee305cb5927e0b1a0b46cc988ad8db2b1: KVM: arm64: Don't eagerly teardown the vgic on init error (2024-10-11 13:40:25 +0100) ---------------------------------------------------------------- KVM/arm64 fixes for 6.12, take #2 - Fix the guest view of the ID registers, making the relevant fields writable from userspace (affecting ID_AA64DFR0_EL1 and ID_AA64PFR1_EL1) - Correcly expose S1PIE to guests, fixing a regression introduced in 6.12-rc1 with the S1POE support - Fix the recycling of stage-2 shadow MMUs by tracking the context (are we allowed to block or not) as well as the recycling state - Address a couple of issues with the vgic when userspace misconfigures the emulation, resulting in various splats. Headaches courtesy of our Syzkaller friends ---------------------------------------------------------------- Marc Zyngier (2): Merge branch kvm-arm64/idregs-6.12 into kvmarm/fixes KVM: arm64: Don't eagerly teardown the vgic on init error Mark Brown (1): KVM: arm64: Expose S1PIE to guests Oliver Upton (5): KVM: arm64: Unregister redistributor for failed vCPU creation KVM: arm64: nv: Keep reference on stage-2 MMU when scheduled out KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed KVM: arm64: nv: Punt stage-2 recycling to a vCPU request KVM: arm64: nv: Clarify safety of allowing TLBI unmaps to reschedule Shameer Kolothum (1): KVM: arm64: Make the exposed feature bits in AA64DFR0_EL1 writable from userspace Shaoqin Huang (4): KVM: arm64: Disable fields that KVM doesn't know how to handle in ID_AA64PFR1_EL1 KVM: arm64: Use kvm_has_feat() to check if FEAT_SSBS is advertised to the guest KVM: arm64: Allow userspace to change ID_AA64PFR1_EL1 KVM: selftests: aarch64: Add writable test for ID_AA64PFR1_EL1 arch/arm64/include/asm/kvm_host.h | 7 +++ arch/arm64/include/asm/kvm_mmu.h | 3 +- arch/arm64/include/asm/kvm_nested.h | 4 +- arch/arm64/kvm/arm.c | 5 ++ arch/arm64/kvm/hypercalls.c | 12 ++-- arch/arm64/kvm/mmu.c | 15 ++--- arch/arm64/kvm/nested.c | 53 +++++++++++++--- arch/arm64/kvm/sys_regs.c | 75 +++++++++++++++++++++-- arch/arm64/kvm/vgic/vgic-init.c | 28 +++++++-- tools/testing/selftests/kvm/aarch64/set_id_regs.c | 16 ++++- 10 files changed, 183 insertions(+), 35 deletions(-)