Message ID | 20230112191927.1814989-52-maz@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 C1686C54EBE for <linux-arm-kernel@archiver.kernel.org>; Thu, 12 Jan 2023 21:01:52 +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:References:In-Reply-To: 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: List-Owner; bh=H8Y/Rx8mSM0jgMea5v3cFdRBZQaVmFHPqkVWVf8W0bQ=; b=ykXjCVG3bYsYUV B6TcG0PwPOjGWV5FXU4r1qPuBIFhnN5as70ABnvU27pJhnuyGM795Nw/PtA9qNU0hLYaSja99V8k1 VhKSryyvygPu//atzL0pxFenUaHC/O2FW86Kmz7AbgGF8PF9sCBm6FkNJ1IJr+1SC8WYbVSa+iZZR AlPgy5yjmw2RdOpdAb1TO+PwSOxK6BsrWvnq2JkXjRAC92/klWb7ftmIRcfEkTId+qFA3KMmK7/85 52ImyyoGOuLix6Y+NNmCxG05RjIZvN0BSo+i2o8A18QLluFF34k6Pg893oOEq+S6hjhUzrxNAyXEV 7rSqxzM4Fe5iouLSqFdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG4hC-00H4Aj-Iy; Thu, 12 Jan 2023 21:01:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG39m-00GRte-UB for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 19:22:39 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4DFE7620DC; Thu, 12 Jan 2023 19:22:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2A6CC433D2; Thu, 12 Jan 2023 19:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673551353; bh=HzXSsUwByW2jAR2hO6nb9l7RS/h2EPWpRifFw83LriQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G2d7YVIrWajomx4U9sTFi/IMLXHiL66QkuOXaBXk2knZdkAIB5VGpZaE4rhp/w69M XHyg9FmPiHCkxeqdvABLQ6goqk8Kh5aMGllwGe7r1z0eoE2YPjZ2sddN4U5wLsLRKJ zJasenOyS7HHvePpwMtJQmSm0xmdgStSnxjsimtQUevh/DOW4cC7G41dCzr6bs5+8F yEtEyyPGyPBVnwTOrbDu3+vNPDLl5e6EEttW7ZnXTkE6VmK0wNVqGbtlTq8Evqvxa6 yF/ZjgXROwsprG1dpOrCLjUtSG00y6iHCC6i1JkXZzO334ibA/EqAfQtU7waE3F+NB h1FIyh1DMbCog== 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 <maz@kernel.org>) id 1pG37Q-001IWu-D8; Thu, 12 Jan 2023 19:20:08 +0000 From: Marc Zyngier <maz@kernel.org> To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Alexandru Elisei <alexandru.elisei@arm.com>, Andre Przywara <andre.przywara@arm.com>, Chase Conklin <chase.conklin@arm.com>, Christoffer Dall <christoffer.dall@arm.com>, Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>, Jintack Lim <jintack@cs.columbia.edu>, Russell King <rmk+kernel@armlinux.org.uk>, James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Zenghui Yu <yuzenghui@huawei.com> Subject: [PATCH v7 51/68] KVM: arm64: nv: Deal with broken VGIC on maintenance interrupt delivery Date: Thu, 12 Jan 2023 19:19:10 +0000 Message-Id: <20230112191927.1814989-52-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112191927.1814989-1-maz@kernel.org> References: <20230112191927.1814989-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alexandru.elisei@arm.com, andre.przywara@arm.com, chase.conklin@arm.com, christoffer.dall@arm.com, gankulkarni@os.amperecomputing.com, jintack@cs.columbia.edu, rmk+kernel@armlinux.org.uk, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.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-20230112_112235_099359_453CB039 X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: arm64: ARMv8.3/8.4 Nested Virtualization support
|
expand
|
diff --git a/arch/arm64/kvm/vgic/vgic-v3-nested.c b/arch/arm64/kvm/vgic/vgic-v3-nested.c index 755e4819603a..919275b94625 100644 --- a/arch/arm64/kvm/vgic/vgic-v3-nested.c +++ b/arch/arm64/kvm/vgic/vgic-v3-nested.c @@ -225,4 +225,7 @@ void vgic_v3_handle_nested_maint_irq(struct kvm_vcpu *vcpu) kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, vcpu->kvm->arch.vgic.maint_irq, state, vcpu); } + + if (unlikely(kvm_vgic_global_state.no_hw_deactivation)) + sysreg_clear_set_s(SYS_ICH_HCR_EL2, ICH_HCR_EN, 0); }
Normal, non-nesting KVM deals with maintenance interrupt in a very simple way: we don't even try to handle it and just turn it off as soon as we exit, long before the kernel can handle it. However, with NV, we rely on the actual handling of the interrupt to leave it active and pass it down to the L1 guest hypervisor (we effectively treat it as an assigned interrupt, just like the timer). This doesn't work with something like the Apple M2, which doesn't have an active state that allows the interrupt to be masked. Instead, just disable the vgic after having taken the interrupt and injected a virtual interrupt. This is enough for the guest to make forward progress, but will limit its ability to handle further interrupts until it next exits (IAR will always report "spurious"). Oh well. Signed-off-by: Marc Zyngier <maz@kernel.org> --- arch/arm64/kvm/vgic/vgic-v3-nested.c | 3 +++ 1 file changed, 3 insertions(+)