From patchwork Mon Nov 13 09:17:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10055369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D03D60586 for ; Mon, 13 Nov 2017 09:21:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E74828EA4 for ; Mon, 13 Nov 2017 09:21:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23297291E6; Mon, 13 Nov 2017 09:21:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 98F5C28EA4 for ; Mon, 13 Nov 2017 09:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EvMk9vKv8S849QU6mOcws4/39UJ+fZmSWbl2P9tRAig=; b=P736rBsi+WlWxpNIK97pgBHu5m 2X1Jt8qABRe3JWWVFxDiwyc7uM8i2Wc3iGfabXamRqtes0PIPu4PC9Q6StwHyREPQv+bBkiDGN3Vg dxCHw99SzitLh6AYKaotq8Qj6PCMQzrxepsxq+8clpMq6FADU1ZZApFytLsEbIzwhByUqVWfTUqaT VsPnbW4C0jSuSX7hTrGfxtmai5y7fEjKiG81Yz8UoowWxlZfI4ReXCk3A/Bny9wGMOc3sVBqwvlDW F/PH/uAirTsPJ/3miz1M0NxQS/5DpzuCgMI/p0EN2Hn8uUBgRbKlYiVY8/Oia4rzLgNN9RCKW5z34 15xZEDVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eEAvb-000626-JU; Mon, 13 Nov 2017 09:21:15 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEAt5-0002Fw-PY for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2017 09:18:46 +0000 Received: by mail-wr0-x241.google.com with SMTP id p96so13755757wrb.7 for ; Mon, 13 Nov 2017 01:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N3W4XC1qPyhI2fHM288Qtj61VVfe3QcN3OpJCvsrTa4=; b=ahzQWThNWLxoKiw6n34iCuiMnIpEWWwz4gzaI9oRSeoPmw/1X14EWltmopv4Sn0/3W Mmh04VspEOiOnZ/E71axhlGHkUe8fQ1+JZ7jJtGRI8ew/s+qD+uXGoyhSvA4niP097YS oKYSb7XJhkCiyOVkzpDS2siEnRnQTjnRWUa8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N3W4XC1qPyhI2fHM288Qtj61VVfe3QcN3OpJCvsrTa4=; b=rCar+nOJ+L5mLjBL23/9zSWZ8JGI2QQZr6DNMkfvxUCZKOolhkDExMpicKA9MYgbWs xRAtnz9rK2IVatmwwc0BkzkReRbN7CWFTvErwB4kC/FBrW03yy37QNHlmcrA4s8X5r18 mNX9oWU/OlCh8z1ejNVJ5GTxIgd7umb2z7p565vE5PwsR1pNiMyhbA6p8jXeG4wZMIDK EnXJGIN4Tq0xh47A3TRI5rFgZu+4lmL8pKfzYY28ZpJNOp+V9ziEmAI4hf4IAGRkmGt6 yJ/lqkciDunzUQWg9kI3TlGvveSRiCP6kfDs1zh+7Zu3LcY9X2T/1ZEBLxvb1YA7yEZn ph1w== X-Gm-Message-State: AJaThX7/ZecAenMaU3k5NYz6ZDwMw2qjKQG9zGuRiBEmImBn9Qs3QSEf plg3e+Mi+j+U/8WcMJaS9AX+8g== X-Google-Smtp-Source: AGs4zMaDRl0rCrJohynwx4Wnhx+FQY2w4HYSZfq3lRFguKvFzjOCXuEEJfhoubjnvzXT1VGMf5n/Kw== X-Received: by 10.223.152.149 with SMTP id w21mr6541416wrb.274.1510564698498; Mon, 13 Nov 2017 01:18:18 -0800 (PST) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id x63sm9651399wma.39.2017.11.13.01.18.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Nov 2017 01:18:17 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 17/27] KVM: arm/arm64: GICv4: Use pending_last as a scheduling hint Date: Mon, 13 Nov 2017 10:17:42 +0100 Message-Id: <20171113091752.10663-18-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171113091752.10663-1-christoffer.dall@linaro.org> References: <20171113091752.10663-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171113_011840_597273_008DC4DF X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier When a vPE exits, the pending_last flag is set when there are pending VLPIs stored in the pending table. Similarily, this flag will be set when a doorbell interrupt fires, as it indicates the same condition. Let's update kvm_vgic_vcpu_pending_irq() to account for that flag as well, making a vcpu runnable when set. Acked-by: Christoffer Dall Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index a05a5700910b..d29e91215366 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -781,6 +781,9 @@ int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu) if (!vcpu->kvm->arch.vgic.enabled) return false; + if (vcpu->arch.vgic_cpu.vgic_v3.its_vpe.pending_last) + return true; + spin_lock_irqsave(&vgic_cpu->ap_list_lock, flags); list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {