From patchwork Tue Nov 24 17:35:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 57267 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2239209lbb; Tue, 24 Nov 2015 09:40:04 -0800 (PST) X-Received: by 10.67.2.73 with SMTP id bm9mr18076813pad.94.1448386804435; Tue, 24 Nov 2015 09:40:04 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id a10si27895265pfj.46.2015.11.24.09.40.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2015 09:40:04 -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 1a1HYB-000728-MK; Tue, 24 Nov 2015 17:38:43 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1HVF-0004wk-4h for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2015 17:35:42 +0000 Received: by wmww144 with SMTP id w144so36431234wmw.0 for ; Tue, 24 Nov 2015 09:35:22 -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=6ULtNGe75MwA0MSA22v6wXs9FC8ckRH+aqqlf5GYkkU=; b=bwwbxhLMgA9QxUIjdIOwitsSmHfVuK+21akAmDjy05AfS/KrsAMtLKsln/CUfZ2lI9 nCsfOrmwRcWda+Fm7HSsPGm37u2yTE2+UAvn1/w/UU8mfdxB78CERl5Fh4DViATDl2b4 hDetqKsNTVMFJZ3O6u8R3S8s9No+x3RipddqRCQsf24PQ9Y9VTT2FEHlYCA9eefaxnYr qReYwqQ1KniEub5iTMYNAhvLnIwX2Jr0jkyjFEEXWgVrYTui5+5RAzIOkhwZKfwULMlP 7ESbTug9rCEkig9ElB7FNKom905a+A6LvI22QGMmje2AqnUzF/4VLZPVTA7dA8hxK+KZ MCuQ== 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=6ULtNGe75MwA0MSA22v6wXs9FC8ckRH+aqqlf5GYkkU=; b=YWAesLYQVmG5YF18Nzs8PdXu/9PyRK1tBsYX3OdOMNnfgqY4gzBo/IpXPOUj67gvSi qU1qOF1hzYk7WHx2/kn2z8V7UCfzZ6A+WlPde1t3H0xLklNBhN+mBVNID+XTZByYfsRz m+LQJy2F8oaFNKEWn/VG5uMpqpP0jVk4ywkL1B9h8mJllnS8FTZw1YW0lT5ir2qKZjTS xiF32Nb4vzUjs2zeVzD0eKKe7JpZD9pRr7lmtX829iBpdklCkdwRme8pbEAiJpF1D0fY JEQzQHnYeNCja4oNqFzjFDdlMoS/GtCzYo60RV3lhAalsg3Yp3gO0vjkYhB6D/f/xZOj zmzQ== X-Gm-Message-State: ALoCoQna6UPSPP0AMwFVxFjUwi+wMZPlXD5lIQxnAd8anPbKCHyZ7QmvAKBJuX+4S68TExhz84l+ X-Received: by 10.195.13.43 with SMTP id ev11mr11637548wjd.20.1448386522843; Tue, 24 Nov 2015 09:35:22 -0800 (PST) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id jo6sm19283805wjb.48.2015.11.24.09.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 09:35:22 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini Subject: [PULL 6/8] KVM: arm/arm64: vgic: Trust the LR state for HW IRQs Date: Tue, 24 Nov 2015 18:35:34 +0100 Message-Id: <1448386536-30118-7-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1448386536-30118-1-git-send-email-christoffer.dall@linaro.org> References: <1448386536-30118-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_093541_486053_0277DF1F X-CRM114-Status: GOOD ( 13.08 ) 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:233 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: Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org 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. Reviewed-by: Marc Zyngier 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 97e2c08..65461f8 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1417,25 +1417,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);