From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F28B3C433F5 for ; Sun, 10 Oct 2021 15:12:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BA93860F22 for ; Sun, 10 Oct 2021 15:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA93860F22 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=ERkb30yqcKR7NBTfqPY/uCpWejX8PWvr9ZPTg3RqWhY=; b=MAiTWcYJlTtVRM MVqf9CJ4SjS07CZ9lFOGo/x3+ILuXNvnfpfu8Bpz5r/YXHHVSvwGvsfn/JXOckS2kS+BX1TpJbblJ Puil2f9VUBZJP3bFLaTJZejMZCq/pgc9AMbZQaf9O3kxc+IT691SRTpKBr14arI0X9iaut565xDy4 gtR75cDhn+Gy51wpeQvpV2AOkm7wDnLb1K+aZ20K9tgh0n6140Gg7e7pFcLf9immgZClTP+kwcQqf s6uEUGrefy76b13KafKExY6EWFvZgGV0EFzzR+Y4WD58hEr/UTjMcLOC/mquuyqRfqo078iuOnqv8 ARAPdNIRFZIGz+HtZ/4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZaSd-00731D-Ly; Sun, 10 Oct 2021 15:09:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZaS5-0072wb-4V for linux-arm-kernel@lists.infradead.org; Sun, 10 Oct 2021 15:09:28 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD94760ED4; Sun, 10 Oct 2021 15:09:24 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mZaS2-00FrmD-Eu; Sun, 10 Oct 2021 16:09:22 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Alexandru Elisei , Eric Auger , Joey Gouly , kernel-team@android.com Subject: [PATCH v2 0/5] KVM: arm64: Assorted vgic-v3 fixes Date: Sun, 10 Oct 2021 16:09:05 +0100 Message-Id: <20211010150910.2911495-1-maz@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, eric.auger@redhat.com, joey.gouly@arm.com, kernel-team@android.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-20211010_080925_219054_E9017302 X-CRM114-Status: GOOD ( 19.17 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Here's a bunch of vgic-v3 fixes I have been sitting on for some time. None of them are critical, though some are rather entertaining. The first one is a leftover from the initial Apple-M1 enablement, which doesn't advertise the GIC support via ID_AA64PFR0_EL1 (which is expected, as it only has half a GIC...). We address it by forcefully advertising the feature if the guest has a GICv3. The second patch is really fun, and shows how things can go wrong when they are badly specified. The gist of it is that on systems that advertise ICH_VTR_EL2.SEIS, we need to fallback to the full GICv3 cpuif emulation. The third patch is an good optimisation on the previous one, and the fourth a direct consequence of the whole thing. The last patch are more of a harmless oddity: virtual LPIs happen to have an active state buried into the pseudocode (and only there). Fun! Nothing goes wrong with that, but we need to align the emulation to match the pseudocode. All of this is only targeting 5.16, and I don't plan to backport any of it. * From v1 [1]: - Dropped the patch that tried to optimise what to do with an active LPI. There is unfortunately a bad corner case in the pseudocode that prevents it. Oh well. - Added an extra patch to help in the case where ICH_HCR_EL2.TDS is supported, and that we can use that instead of ICH_HCR_EL2.TC to trap only ICC_DIR_EL1. Given the performance improvement, it was too hard to ignore it. [1] https://lore.kernel.org/r/20210924082542.2766170-1-maz@kernel.org Marc Zyngier (5): KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3 KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors KVM: arm64: vgic-v3: Reduce common group trapping to ICV_DIR_EL1 when possible KVM: arm64: vgic-v3: Don't advertise ICC_CTLR_EL1.SEIS KVM: arm64: vgic-v3: Align emulated cpuif LPI state machine with the pseudocode arch/arm64/include/asm/sysreg.h | 3 +++ arch/arm64/kvm/hyp/vgic-v3-sr.c | 22 ++++++++-------------- arch/arm64/kvm/sys_regs.c | 5 +++++ arch/arm64/kvm/vgic/vgic-v3.c | 21 ++++++++++++++++++--- 4 files changed, 34 insertions(+), 17 deletions(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel