Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13658415pxu; Mon, 4 Jan 2021 00:19:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYEe7VOjrYQvFWfw9MNJ2x8/kQi6WvBxmYnV3W6tu67pdV3IRspUaD5fOd19GZhcgUtBG6 X-Received: by 2002:a05:6402:40e:: with SMTP id q14mr69638032edv.85.1609748389830; Mon, 04 Jan 2021 00:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609748389; cv=none; d=google.com; s=arc-20160816; b=tpNHvFj6VGm3j9ryrplOPJd1804MSkXsh0feOjs5b81oHSiaXqBZKsrtyOZhvrnWBE HFLXFijKEY8KURciZlOUQWN1SFY6g7TYyxX1swMmO8Ro3I+Kv7wSEoEGS9AkE7kWenyH Lbo1cItU5rSrqY6nbzABz/iGOBzCXYjjSlNBgU6THAbUBmMA58YoPVJQ349B3Z29NI1W mL0KMljt+XaWF/sAJorPAKvADeykhYsZZa3ubqw+8RN1MVRHhajKNRj6GVvprXqdQnOC knL6O+ZUBhs03wgNXNM2cFyeTcKe0rSHaK5nel/tBYQyWqEUy6qJEFFiPiR+cR0aiuPq B8Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KEGrcKFO1O3kiom1VCpNCN8TZS7LIliP/qmsxiu4/u4=; b=NnOWtLRASoj4OUQ4KWzVbrxGxD+isidOJ7fbj+Ctdwato+ayNQMUVZneA1na5sUFlZ JDuNb0rjJ/HKr7eKGBb32+5EsAjaDkzMgOd+WUWKjy8KCoGD8DyjgkM0PszIM85qr9Ck Cq/CpMpo/R30nlxiu/r/8i7V5SDiM4CI1sCCq8KiGKr5MAqunidYmZw5MThlQlIsTIp6 difYvFQ4d4qjP9FlepGBoMRF0Ijt+04VylTKuYv9cG6GsGQXhx85SZhnXiIQjQWGVO6c VzJg3HTjx3Ts2qfupGYNzpjXIrDnzxvI+8UlPSDakI6IGOiZxVBRGnyvY1l1hp3Vjf5z kcjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o60si33333451eda.61.2021.01.04.00.19.26; Mon, 04 Jan 2021 00:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbhADIRp (ORCPT + 99 others); Mon, 4 Jan 2021 03:17:45 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10104 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbhADIRo (ORCPT ); Mon, 4 Jan 2021 03:17:44 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D8T3G2fdKzMF8b; Mon, 4 Jan 2021 16:15:54 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.196) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Mon, 4 Jan 2021 16:16:54 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [RFC PATCH v2 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side Date: Mon, 4 Jan 2021 16:16:12 +0800 Message-ID: <20210104081613.100-4-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210104081613.100-1-lushenming@huawei.com> References: <20210104081613.100-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.184.196] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zenghui Yu When setting the forwarding path of a VLPI (switch to the HW mode), we could also transfer the pending state from irq->pending_latch to VPT (especially in migration, the pending states of VLPIs are restored into kvm’s vgic first). And we currently send "INT+VSYNC" to trigger a VLPI to pending. Signed-off-by: Zenghui Yu Signed-off-by: Shenming Lu --- arch/arm64/kvm/vgic/vgic-v4.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c index f211a7c32704..7945d6d09cdd 100644 --- a/arch/arm64/kvm/vgic/vgic-v4.c +++ b/arch/arm64/kvm/vgic/vgic-v4.c @@ -454,6 +454,18 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq, irq->host_irq = virq; atomic_inc(&map.vpe->vlpi_count); + /* Transfer pending state */ + ret = irq_set_irqchip_state(irq->host_irq, + IRQCHIP_STATE_PENDING, + irq->pending_latch); + WARN_RATELIMIT(ret, "IRQ %d", irq->host_irq); + + /* + * Let it be pruned from ap_list later and don't bother + * the List Register. + */ + irq->pending_latch = false; + out: mutex_unlock(&its->its_lock); return ret; -- 2.19.1