Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp631638pxu; Sun, 22 Nov 2020 22:59:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0DHp6IAWdGn+5Jo+cPHTsW4GE/Qb0CwBRc+/hxSuPxis4nQQdSu8QubGS+yuKRbTYqXt4 X-Received: by 2002:a17:906:60c8:: with SMTP id f8mr10983098ejk.14.1606114741969; Sun, 22 Nov 2020 22:59:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606114741; cv=none; d=google.com; s=arc-20160816; b=fHhwKEQX0zcJykvZnmgKwYCBJ4WnwQpBuY7mn7d2evauqDgs4rxXnyuSu82h0Ejftn O6OsY3kkAp7d90PIWn+JINoePwrOnr8PfImhJ/QLZx9uUyE5no4MSp/3nRZFd8A5SLxw 4n7XGXEKNB2weTAS4imBSvzvN6W6z4d2swuiA0rlX5eRwldkvFA5GSeRuN5LbPtUZmL1 Yjk5z96O4nJ5djMJvFIYFASTx7UEUe8w+Iiz1lkJ5W4Au79gvF4pNupCPgPxwGW8YHC3 ShTgd55c4NK5rv3h3sVfcQaxqHFhne6LJtqzMz1FjME7wtfZmd0cPqsayqlpJfMnZiS5 mQfA== 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=DmM4fjChSlVcVhS/QsSWeKImkHF2RMO88s0AdjzMko8=; b=sL9bJXBLNnryq31QQ7G/NdR8kdoRbtUwFqRz+KBMhHJ54CTNBp3V6YGKLRKzdPouhf gp879rJtXcdziU+Qbb2pJEnqk9LTFKDicMV7hL3aOwdIIP0aq/FwJ25lrqoXMI7pJa1d qVHY6AU+V8slO2fAPIq9wDIS/YmlMD3o/iyv9r5eVgbsTqowfjV0s+oiqx85O/OwcZkg dMfpNYixp+LXM9XrbzSOaP8YBATQOx/8HD4FP9s76wUhG7dG0XKVW2NcM1tHPQEE1N/L Capcl2z+UhxNMBpIycbHc2zzJYzWsru1Obw8av7o63jaUcftnfkwc7B2tPQCC4h7ijNQ ibcQ== 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 j24si6017153ejt.651.2020.11.22.22.58.39; Sun, 22 Nov 2020 22:59:01 -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 S1727976AbgKWGzD (ORCPT + 99 others); Mon, 23 Nov 2020 01:55:03 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8014 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbgKWGy7 (ORCPT ); Mon, 23 Nov 2020 01:54:59 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CfdDt1sSMzhg2x; Mon, 23 Nov 2020 14:54:38 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.187.74) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 23 Nov 2020 14:54:46 +0800 From: Shenming Lu To: Marc Zyngier , James Morse , "Julien Thierry" , Suzuki K Poulose , Eric Auger , , , , , Christoffer Dall CC: Alex Williamson , Kirti Wankhede , Cornelia Huck , Neo Jia , , , Subject: [RFC PATCH v1 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side Date: Mon, 23 Nov 2020 14:54:09 +0800 Message-ID: <20201123065410.1915-4-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201123065410.1915-1-lushenming@huawei.com> References: <20201123065410.1915-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.187.74] 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, it is more consistent to 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 b5fa73c9fd35..cc3ab9cea182 100644 --- a/arch/arm64/kvm/vgic/vgic-v4.c +++ b/arch/arm64/kvm/vgic/vgic-v4.c @@ -418,6 +418,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.23.0