From patchwork Mon Nov 13 09:17:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10055393 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 5046E60586 for ; Mon, 13 Nov 2017 09:26:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 462BA29333 for ; Mon, 13 Nov 2017 09:26:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39BED2933C; Mon, 13 Nov 2017 09:26:00 +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 E746D29333 for ; Mon, 13 Nov 2017 09:25:59 +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=l4+aWDmAKM9EduZkssSInR2JUSw8qkTYNIQUg7M5u4c=; b=tagBqYwH3V+SNXRMKp/JEKk8eb zPTBDdVIbxJ9ITYgOEwo2grTOmSn6dD98K5r7ULSTf2YjavGuKBZwOIRf5XFtz/2I3PhUOeW/h+n/ K+L81YftqQG21T1mK5p4cu4s4QBk8Pu2mdgUZqv/yqlPkeHHywNfEqnuPpMGJ8fhn2XzK1ggx8EN4 gnE3EBEDOL1NCVy7Jfu3ivoVtm5GcMUiFDHE8cnQb6/hlwdfoKMMD5cqTVvYThT4BjqVItte1PKgP zTxaZcZ6ZdJ96vHtVJmRQ8mvEX1qnk9zLMlQWW7LtSonQdXGoiAJ6UYd70/I8ZsvAz0YLN3klA2+p fj36EfkQ==; 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 1eEB07-0002nL-KN; Mon, 13 Nov 2017 09:25:55 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEAsv-00025G-Md for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2017 09:18:40 +0000 Received: by mail-wm0-x241.google.com with SMTP id l8so7820190wmg.4 for ; Mon, 13 Nov 2017 01:18:10 -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=FHvy9eAfpSuXjy0a7aFiBDmmQEoZDNMXTQL3ntGscE8=; b=UmxE8oxJ2Mm4LN+WH0yQ7w53uwJeAKugku9CLXDzfuGM1p6HEFJoUUFXKzi47f1Y/F INvqgA/RlYd4nCQDQpvCemDj/BgAsek/MC/0jHLZB2Csn0Asp4oRni1fgCa0xap/QIxj 9vg75afB+NQbxMRY3AuRq7YNdptqZfJ1b/EBQ= 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=FHvy9eAfpSuXjy0a7aFiBDmmQEoZDNMXTQL3ntGscE8=; b=D/KKnZxjjekVhrwVqH1gHjJ+CBptqK+xxZWhPoT1CinWDboDyCFrJg3sk7fJXcFMgx MajQ56B10Y9SEi8w9oOuPDx8ukrZKoHViVQshzZ50LDlXvrgBNyBXE+gC+bUDeWlZiJR HX7f+NMmHdj/0rr97MBPhKsr2Bdiifoi45v6FM0es8lBrEpoGmD370bZAmJhf1vDoYwe l5eWk53tAz1euD6yh7o1+AuazALUDj96QgjO37hOCBZuv2gzxPkqFvfUr0x6Y8MP+ECF btSf1D4dlGqIyf+kzslTRDSa3kX5OpCP++Ce0Q0aIxK5brwcNVRcEo2hf7mqbwfbV9Pc Zecg== X-Gm-Message-State: AJaThX5yZhldPIirCGPMMIwsglI04uP+CgxkYwFxLFlzcIUHkGtv+XpZ LYNrYF1qecPdqIjfGcghdtQsZw== X-Google-Smtp-Source: AGs4zMY5Bt8M/9MTBKzbhF16Y9pjcLHtLPQ7VfvOymcUO1gHKDfGQbu7ncb+rZxl9joMwC1G9TF3dQ== X-Received: by 10.28.168.88 with SMTP id r85mr3345362wme.63.1510564689427; Mon, 13 Nov 2017 01:18:09 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Nov 2017 01:18:08 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 11/27] KVM: arm/arm64: GICv4: Unmap VLPI when freeing an LPI Date: Mon, 13 Nov 2017 10:17:36 +0100 Message-Id: <20171113091752.10663-12-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_011830_482936_97DD4E61 X-CRM114-Status: GOOD ( 10.85 ) 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 freeing an LPI (on a DISCARD command, for example), we need to unmap the VLPI down to the physical ITS level. Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-its.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 590f794b7330..ad14af8a4412 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -631,8 +631,12 @@ static void its_free_ite(struct kvm *kvm, struct its_ite *ite) list_del(&ite->ite_list); /* This put matches the get in vgic_add_lpi. */ - if (ite->irq) + if (ite->irq) { + if (ite->irq->hw) + WARN_ON(its_unmap_vlpi(ite->irq->host_irq)); + vgic_put_irq(kvm, ite->irq); + } kfree(ite); }