From patchwork Thu Dec 10 21:46:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 7822471 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7E32BEEE1 for ; Thu, 10 Dec 2015 21:46:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFD4F204E7 for ; Thu, 10 Dec 2015 21:46:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BC6C205BE for ; Thu, 10 Dec 2015 21:46:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753683AbbLJVqJ (ORCPT ); Thu, 10 Dec 2015 16:46:09 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33114 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750834AbbLJVqI (ORCPT ); Thu, 10 Dec 2015 16:46:08 -0500 Received: by mail-wm0-f43.google.com with SMTP id c201so52870189wme.0 for ; Thu, 10 Dec 2015 13:46:07 -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; bh=4Dmnh71brplfxnXX4KTuTTFvBMgSVc/QB/tsZPQX6Iw=; b=cEN8Q69iTDscMEbDdDU35BRXKcqGi+1rrRhaX9e3FT+bi/hS+FPPkSBUjA6DiEta2h 5EbnTQOoBiSlGBN49rMhWKt/jKuVFpc/aKjXJxCfEsm1nPhE/YhoVizg3uC23B8MaHgd ZazUBu8fUAyvFN6wiIUYCbF/rebQ8GmsrtLUqECgkrTn+iy85IcyMrqPSWd8hjrSMnTu yHvUn/qxinQ+lOPzhTPZ8NQTn+XijtRGFL7fTgHrr3N3vlZtEFNvl1CaD3KCns10R2uQ Mm+20m5iNQnsQ1YaM5dx9604epVZtSROdjqzJdrfWAXJfd63SlTXWfnOCGBq72XMSc/V LcAQ== 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; bh=4Dmnh71brplfxnXX4KTuTTFvBMgSVc/QB/tsZPQX6Iw=; b=PFHa0Q1ajEQZAsA4IgXJmiKGSAHHQPQQZYDseLXp+HCbLofE/KW3j7vfp1Qw3khRde xzhaf8BK1tu9lVFzxIdjkAmwT1SvI8GbuqjPvjugEkk4Mq/R0H2f9WkVBjQFrpNXQv7J e8PGD8GQ9IkuHFVYY3cFnM/pvolog0nqSow8LBRWUBXLBLzeViomPBv9agfIY4zyLobT K67cqRxDM6tO9a1nY4GZJPe7un9dWB6VYQwl9b1Z3O1RbIiJ06T8PP3WcuRAdbkE5qgS bMV5N85p5KMAzR9vUL/4J07Twx+A5xn9gM6YyyAAR8QIq39YQj7eKXEIF5JnEzcXJ/JY kwiw== X-Gm-Message-State: ALoCoQksbDNIJmxasE/UNZRi8CIsWpzEMCXx+zIFm86jgtUdG0rjQcq1yDcQQl/AWn/m4fKE8nLfxZjSBoM5HgSLzzbGvaXTTA== X-Received: by 10.28.48.10 with SMTP id w10mr1355597wmw.39.1449783966702; Thu, 10 Dec 2015 13:46:06 -0800 (PST) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id 197sm579741wmt.19.2015.12.10.13.46.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Dec 2015 13:46:06 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, Eric Auger , Marc Zyngier , Andre Przywara , Christoffer Dall Subject: [PATCH] KVM: arm/arm64: vgic: Fix kvm_vgic_map_is_active's dist check Date: Thu, 10 Dec 2015 22:46:50 +0100 Message-Id: <1449784010-21761-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP External inputs to the vgic from time to time need to poke into the state of a virtual interrupt, the prime example is the architected timer code. Since the IRQ's active state can be represented in two places; the LR or the distributor, we first loop over the LRs but if not active in the LRs we just return if *any* IRQ is active on the VCPU in question. This is of course bogus, as we should check if the specific IRQ in quesiton is active on the distributor instead. Reported-by: Eric Auger Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- virt/kvm/arm/vgic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 65461f8..7a2f449 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1114,7 +1114,7 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, struct irq_phys_map *map) return true; } - return dist_active_irq(vcpu); + return vgic_irq_is_active(vcpu, map->virt_irq); } /*