Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1893274pxf; Sat, 13 Mar 2021 00:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzv2d7s2xa4Uhzb+fqlNifG6/xMlr5RGdAfh3bSBO8Yv2ROlaXn+WPqjNsz/s+X+OZw+6hI X-Received: by 2002:aa7:c550:: with SMTP id s16mr18923680edr.98.1615625073100; Sat, 13 Mar 2021 00:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615625073; cv=none; d=google.com; s=arc-20160816; b=y9jTD7lhbcpPoMlhpF4jcqCBFfX+wbd8T9bT3ubym2NeATFXb4f5nwgoSAE9ubrmJr c5zOGKIXXwONprbAeL7pEI8bK9tSGPVJdBGCEQ6knemyQ2QD6Po//p/WqHReSVEQJp0O mRnGXDzwACcT2YwlCo2vDiNr66/JDjpJrnDxJWisSfCDrHa7u5Tfr9ArN1sf+anB+TwK cUZhjjlsoSyjzVlvxa2Cr8rFE15vclmdsVDPR/cSUjTNEYFezgpz4tRB1f3RHcxwuxr8 XCUJ8yVgbKFGVYufSdFwamg6zU1qxbzwHIGgNCC3btzFPpkqpht82OxJ/gZVHhITKeTA FrqA== 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=pOGhS6BwLrYNWKbLKZwDiT+ZpC7i/oml0D+8SwpQGIQ=; b=e9Wpba96WUgcPcVlLzVpDBbvSstEzZDgdI6ZCnq7M+jQqNe8kArV/Yk9znv7xLt92z 53l/m7xTwl4kGULUBwJ+c5nERlgagvY4ACOyl1ZIsomR3MAO/WdZsyHzQF+Rmf1fjBUS qbg5FOsQIr/lOZNJGYCrBro5EZn6/GpJoaAQNtrOQp8APSGQforttaEkIxiMx6TM1l4E R4+siz3rEVB5TljfnnVRM+EP/7f3DRFyQ81PQOQFZIM+g8zH/v3NxNUWRXXptDAMe5AY aXljLWDAVgwyyiJBIoWcwBG12lSGRNH019bFEl8OyJnQ1D7Ps4OsEDsBR+sMtY+GeALU 1JfQ== 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 a23si6279247ejx.146.2021.03.13.00.44.10; Sat, 13 Mar 2021 00:44:33 -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 S233233AbhCMIj7 (ORCPT + 99 others); Sat, 13 Mar 2021 03:39:59 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13162 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbhCMIjr (ORCPT ); Sat, 13 Mar 2021 03:39:47 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DyGJk0R9YzmWBR; Sat, 13 Mar 2021 16:37:26 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.135) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Mar 2021 16:39:38 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [PATCH v4 1/6] irqchip/gic-v3-its: Add a cache invalidation right after vPE unmapping Date: Sat, 13 Mar 2021 16:38:55 +0800 Message-ID: <20210313083900.234-2-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210313083900.234-1-lushenming@huawei.com> References: <20210313083900.234-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.184.135] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier Since there may be a direct read from the CPU side to the VPT after unmapping the vPE, we add a cache coherency maintenance at the end of its_vpe_irq_domain_deactivate() to ensure the validity of the VPT read later. Signed-off-by: Marc Zyngier Signed-off-by: Shenming Lu --- drivers/irqchip/irq-gic-v3-its.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ed46e6057e33..4eb907f65bd0 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4554,6 +4554,15 @@ static void its_vpe_irq_domain_deactivate(struct irq_domain *domain, its_send_vmapp(its, vpe, false); } + + /* + * There may be a direct read to the VPT after unmapping the + * vPE, to guarantee the validity of this, we make the VPT + * memory coherent with the CPU caches here. + */ + if (find_4_1_its() && !atomic_read(&vpe->vmapp_count)) + gic_flush_dcache_to_poc(page_address(vpe->vpt_page), + LPI_PENDBASE_SZ); } static const struct irq_domain_ops its_vpe_domain_ops = { -- 2.19.1