From patchwork Tue Nov 24 15:44:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 57261 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2169306lbb; Tue, 24 Nov 2015 07:46:02 -0800 (PST) X-Received: by 10.98.8.211 with SMTP id 80mr24114983pfi.136.1448379961994; Tue, 24 Nov 2015 07:46:01 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 12si27363638pfa.14.2015.11.24.07.46.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2015 07:46:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1Flh-0001Ov-Sr; Tue, 24 Nov 2015 15:44:33 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1FlH-0001Go-NF for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2015 15:44:08 +0000 Received: by wmww144 with SMTP id w144so31848498wmw.0 for ; Tue, 24 Nov 2015 07:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4jiwvHfJUbAEjszdFCONgd8N0l0ycHupjJapM/UnLJI=; b=0c8+7zK1xxOnQCLpqspKqqnv0r1vRqJhbo/PK9ajxDtb4JAV9NuslkDt+3VaO8FX5O YkLkqW5FDfQeYciEfisawLL2ankOW3RfKUSwDW5KMTNAhE83i/Pc93wM6+gRLHSUEOEd bX+uo94FI8rtRRiDGdbYnGGcXjX3fbl7Ks5y3yjY8MQkHnX3mAMDQKHI8E4xRdh28uYy VkHIohL06LIVrnHSgqVxpTsCOd/r5GRm+RLyuCkM8o4zZsxk6aOli3a/snOgMDTs92/l g3VfQ/80UvPzCzBUCueM3NwWXC2K+RKwuGv7SocO5KfOsAmD3/z53gMxie9lNwCRtRkq SrMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4jiwvHfJUbAEjszdFCONgd8N0l0ycHupjJapM/UnLJI=; b=j9M17EcH85SH9+xfMvFzgegM/Jozvssj0T2Pew5GYL8OaJQeH1HTxIzH5hFpXMkax+ Y1lHtSk8DW5eDkrBHB/6pd+GzMD7dK/ZnUtyT0+oG34L8kZuo2dPqaXQxQF3Pekn8LPD Ted50bpsIvtN5Nj4EjONy5mRWwaC2XEKPrguXvdqweGAbaT5p+vDdlSpQQEgycBU8lMu TD9cXSurxTNi7r3FWinz/DMUTcmNStqIHtVEQ1tMXwCuv4gHRpT4BZIYR/4TPbHVUQxZ sWPiWtvjeFXI+SICGiqQyLvb+nsFbew4y49nE2xy6Z5IM1VyishgRXzuumH/Zb3ERS7w liIQ== X-Gm-Message-State: ALoCoQns67c1m+0toLWVU1UAM2AeWkBJG1ohhXgpKBB5jTW/tBM4mXGgfVWBk+vS1bSfJNeGL5nA X-Received: by 10.194.184.104 with SMTP id et8mr33715090wjc.87.1448379826769; Tue, 24 Nov 2015 07:43:46 -0800 (PST) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id t64sm18816464wmf.23.2015.11.24.07.43.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 07:43:46 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] KVM: arm/arm64: vgic: Trust the LR state for HW IRQs Date: Tue, 24 Nov 2015 16:44:00 +0100 Message-Id: <1448379840-17516-4-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1448379840-17516-1-git-send-email-christoffer.dall@linaro.org> References: <1448379840-17516-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151124_074407_997733_2B0E1C67 X-CRM114-Status: GOOD ( 13.42 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Andre Przywara , Christoffer Dall , kvm@vger.kernel.org, Eric Auger MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org We were probing the physial distributor state for the active state of a HW virtual IRQ, because we had seen evidence that the LR state was not cleared when the guest deactivated a virtual interrupted. However, this issue turned out to be a software bug in the GIC, which was solved by: 84aab5e68c2a5e1e18d81ae8308c3ce25d501b29 (KVM: arm/arm64: arch_timer: Preserve physical dist. active state on LR.active, 2015-11-24) Therefore, get rid of the complexities and just look at the LR. Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.1.2.330.g565301e.dirty _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 9002f0d..55cd7e3 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1420,25 +1420,13 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) static bool vgic_sync_hwirq(struct kvm_vcpu *vcpu, int lr, struct vgic_lr vlr) { struct vgic_dist *dist = &vcpu->kvm->arch.vgic; - struct irq_phys_map *map; - bool phys_active; bool level_pending; - int ret; if (!(vlr.state & LR_HW)) return false; - map = vgic_irq_map_search(vcpu, vlr.irq); - BUG_ON(!map); - - ret = irq_get_irqchip_state(map->irq, - IRQCHIP_STATE_ACTIVE, - &phys_active); - - WARN_ON(ret); - - if (phys_active) - return 0; + if (vlr.state & LR_STATE_ACTIVE) + return false; spin_lock(&dist->lock); level_pending = process_queued_irq(vcpu, lr, vlr);