From patchwork Tue Apr 2 11:41:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tangnianyao X-Patchwork-Id: 13613791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2148ECD1284 for ; Tue, 2 Apr 2024 11:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NbPfABqBqrQq5fzdif8Tbe/4Nv4xWVLMuqzGlk1iHEM=; b=UcQ3t7fiND2rqP z6DHKpfmRK1bWQkRXsM9Fw8u5oYpnxRPZwy/+jDj6rpGh+jCL14lsBjAnSBycNhlY/VTTGYmR7HcX G+f64e8C4QBIbw3+dgKU1m2FLwBrvs9SXLcgx3QYbrwLxACPSMU7YGU9FO3I4raehwz1lFjDth+kB 94phrNcXmAitSWO+zl25Z+tGRpO596xKknGofXs3tAGDV5WDINm2II26YUBQx7bk+E4NzIHt79Oxd tL5IwLvyV2mUiApuURqCK/tgxCJU3pUMCELkkZ/iHhf1GWBRrraZ/rtCDhw2N3DiCG2l9VcB2tV72 Nuqkd9lN8OsHWaxWRx8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrcWz-0000000AuU8-2hWv; Tue, 02 Apr 2024 11:42:21 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrcWv-0000000AuQp-1zuz for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2024 11:42:19 +0000 Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V85WW56tpz1h2SR; Tue, 2 Apr 2024 19:39:19 +0800 (CST) Received: from kwepemd500014.china.huawei.com (unknown [7.221.188.63]) by mail.maildlp.com (Postfix) with ESMTPS id 641441403D5; Tue, 2 Apr 2024 19:42:04 +0800 (CST) Received: from 228-1616.huawei.com (10.67.246.68) by kwepemd500014.china.huawei.com (7.221.188.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 2 Apr 2024 19:42:03 +0800 From: t00849498 To: , , , CC: , , Subject: [PATCH] irqchip/gic-v3-its: Don't need VSYNC if VMAPP with {V, Alloc}=={0, x} Date: Tue, 2 Apr 2024 11:41:47 +0000 Message-ID: <20240402114147.3788881-1-tangnianyao@huawei.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Originating-IP: [10.67.246.68] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd500014.china.huawei.com (7.221.188.63) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_044217_736995_9DB06D3B X-CRM114-Status: UNSURE ( 8.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From GIC spec, a VMAPP with {V, Alloc}=={0, x} is self-synchronizing, This means the ITS command queue does not show the command as consumed until all of its effects are completed. A VSYNC with unmapped vpeid is not needed. Signed-off-by: t00849498 --- drivers/irqchip/irq-gic-v3-its.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index fca888b36680..a0ca5dcbb245 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -789,6 +789,7 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, unsigned long vpt_addr, vconf_addr; u64 target; bool alloc; + bool unmap_v4_1 = !desc->its_vmapp_cmd.valid && is_v4_1(its); its_encode_cmd(cmd, GITS_CMD_VMAPP); its_encode_vpeid(cmd, desc->its_vmapp_cmd.vpe->vpe_id); @@ -832,6 +833,9 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, out: its_fixup_cmd(cmd); + if (unmap_v4_1) + return NULL; + return valid_vpe(its, desc->its_vmapp_cmd.vpe); }