Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3797573imm; Mon, 18 Jun 2018 04:21:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLwytmOWKGFFyEOXFlOUnGE1PeFlWMZJmA+s73znr6HfInmrRZLpTNWoc6zksO/4A1jVwwQ X-Received: by 2002:a63:70a:: with SMTP id 10-v6mr10946488pgh.216.1529320886582; Mon, 18 Jun 2018 04:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320886; cv=none; d=google.com; s=arc-20160816; b=MNz5ecmNbF4aUMw5ESYJl3+hRCl7K9DOXUDr1QbrYOpo+JYiXpDJleBa7vMWHmWj1L 4XUbb0nUlT2f0Ng1tzmub3eh6jzckp5pENtEbumcu+RI8ca6d8Ron9c/6gMrOKAbomAK Hnvj+YXzX7dZ5Suko/nIG5TtCquaCnH6gT/lM1MsvR3eiZJGtEqWZLE3zDGB5v9g0jkA qw559mqY+AFoRky6Xy0Ioux9ebZm8hoEHqkxS8zMW8VLjgcdnHEgTn/bhfJ8lJ0S3TCA D0P+2xI3JZJaaufesr9FPervVp5ekXebwkuHS6/tt5YXRULXleUJI6uA62MAT4PYqH+4 23+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mNBXpjK8geABDIexi4/bNeIwFoc357/INPyJo8EC0BE=; b=WZr6vL6kuVFiO2461hWMQPgge55KG4yUbIbQISTpdjFH5FZodDPDLpKfVZNqi5oiqd 3mmn3ucdRYu3X0w+0z5Nm7VxTs4M8k7AWbHgPEIDlN5aigUr/CCceTvEEQuSxOvOsgmd yriPCRH5/KLnY6I8GiQh6Is/SBJK0tAKHekNcgULvZ4ZCbx5JS8m4QHPL6N3hvDzmarD 3qVP+StXOnmsvI+vZ1tJZ0HrJuJEHBZrHdncAEvVWHobp75AxOxrZNdvmO4zKr7JzKyt vDF96CaGM5FHrgDumnHx0+DSxTNGisr+7NHG3f3TimxmJ/PzOOz+IhSJlrdIIUQBaLtw rKxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si14561889pld.167.2018.06.18.04.21.13; Mon, 18 Jun 2018 04:21:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936827AbeFRKOg (ORCPT + 99 others); Mon, 18 Jun 2018 06:14:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53024 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934368AbeFRIQW (ORCPT ); Mon, 18 Jun 2018 04:16:22 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BB08CC50; Mon, 18 Jun 2018 08:16:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefano Stabellini , Christoffer Dall , Andre Przywara , Marc Zyngier , Sasha Levin Subject: [PATCH 4.16 036/279] KVM: arm/arm64: vgic: Kick new VCPU on interrupt migration Date: Mon, 18 Jun 2018 10:10:21 +0200 Message-Id: <20180618080610.305984616@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andre Przywara [ Upstream commit bf9a41377d14f565764022470e14aae72559589a ] When vgic_prune_ap_list() finds an interrupt that needs to be migrated to a new VCPU, we should notify this VCPU of the pending interrupt, since it requires immediate action. Kick this VCPU once we have added the new IRQ to the list, but only after dropping the locks. Reported-by: Stefano Stabellini Reviewed-by: Christoffer Dall Signed-off-by: Andre Przywara Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- virt/kvm/arm/vgic/vgic.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -599,6 +599,7 @@ retry: list_for_each_entry_safe(irq, tmp, &vgic_cpu->ap_list_head, ap_list) { struct kvm_vcpu *target_vcpu, *vcpuA, *vcpuB; + bool target_vcpu_needs_kick = false; spin_lock(&irq->irq_lock); @@ -669,11 +670,18 @@ retry: list_del(&irq->ap_list); irq->vcpu = target_vcpu; list_add_tail(&irq->ap_list, &new_cpu->ap_list_head); + target_vcpu_needs_kick = true; } spin_unlock(&irq->irq_lock); spin_unlock(&vcpuB->arch.vgic_cpu.ap_list_lock); spin_unlock_irqrestore(&vcpuA->arch.vgic_cpu.ap_list_lock, flags); + + if (target_vcpu_needs_kick) { + kvm_make_request(KVM_REQ_IRQ_PENDING, target_vcpu); + kvm_vcpu_kick(target_vcpu); + } + goto retry; }