From mboxrd@z Thu Jan 1 00:00:00 1970 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 38F90CD1284 for ; Tue, 2 Apr 2024 13:43:30 +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:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6VwoWBU8SwNLo4Bzs2WyMyT+TB8owXsItM3gMZZN9Pg=; b=s6KWnAF7ddiL6/ lf1Ez3FmtivhWqFoCkcyKaeKh2F1N1JSm9nG4hyYvW2IiC6SwcTCp/06MOgwLSu9o3ZRW4jF6NOMd nNwA7H88FtzozFs5NgVSDzlmnUor/Qse8GEoQBzqoHxMH7gORsUspykHhsklj3ZBSemURTLJueUEF RYVnb3F4i6VKH90JQNYTb8LSP74lpTeewzIP0x9CwVW6fPg94NySUrZUzUzLDidubis26r/P5B6Ft jzjTsWdEycjy3GLHgT/VY1s5qP01ug1iKFLdXu2r3hk6oIuGDyjzJQcAb175qSQTs5QWzUSWk9puo 97fQA1XkBq8Ryrx1RtSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrePz-0000000BPDV-1SLi; Tue, 02 Apr 2024 13:43:15 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrePv-0000000BPBY-3GU4 for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2024 13:43:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A64BFCE1750; Tue, 2 Apr 2024 13:43:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D64C7C433C7; Tue, 2 Apr 2024 13:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712065388; bh=lHAIMJbRpkpZnFYxuHbp5mo0756mPGZYrjOw83NTj+A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bsmWv/1V++OheJjcDWeNNUReX6C0aCmibGVpEJA9U5yN6WoRvBC6oL1On5ITORUsx 1Un5hVt/w7qqraTdyo69oy8Elv+a5KIX7+4AD3S2dZdMqpgyryEYXcnISg84V0iG/S CFApnSqsDWE/TSqcKIEXlShoTNNOCOU8kF3KvMIUNZCgwaVVHuLX7DvQZ4ZihKO4pl tJX14xWWz2wJKDJIkOndvzGJIlJFA9IEKosWUYXxnLZVCL6KgnG06nOAPdqYBsuZU/ 6f+gKeWIP6G4iashmZ+JTLy56P6mwP9/vqq0L5LmcsyraEJ5AqyVUPkhF3rn7OgzhQ 7dfe7s3umVdYg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rrePq-000jmk-HR; Tue, 02 Apr 2024 14:43:06 +0100 Date: Tue, 02 Apr 2024 14:43:06 +0100 Message-ID: <86il0zubh1.wl-maz@kernel.org> From: Marc Zyngier To: Tangnianyao Cc: , , , , Subject: Re: [PATCH] irqchip/gic-v3-its: Don't need VSYNC if VMAPP with {V, Alloc}=={0, x} In-Reply-To: <8532b19b-361e-2234-92db-83f4d56bae19@huawei.com> References: <20240402114147.3788881-1-tangnianyao@huawei.com> <86jzlgt014.wl-maz@kernel.org> <8532b19b-361e-2234-92db-83f4d56bae19@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: tangnianyao@huawei.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, guoyang2@huawei.com, wangwudi@hisilicon.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_064312_270958_70CA5205 X-CRM114-Status: GOOD ( 29.77 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 02 Apr 2024 14:32:40 +0100, Tangnianyao wrote: > > > > On 4/2/2024 20:35, Marc Zyngier wrote: > > On Tue, 02 Apr 2024 12:41:47 +0100, > > t00849498 wrote: > >> From GIC spec, a VMAPP with {V, Alloc}=={0, x} is self-synchronizing, > > It'd be nice to quote the part of the spec (5.3.19). > yes, that's quote from GIC spec. > >> 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 > > Previous contributions with the same email address had the name > > "Nianyao Tang" associated with it. Was it wrong in the past? Or is the > > above wrong? > Sorry, the above name is wrong, should be "Nianyao Tang". > > > >> --- > >> 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); > >> } > >> > > This is a bit ugly. We already have a whole block dedicated to > > handling VMAPP with V=0 and GICv4.1, and it'd be more readable to keep > > all that code together. Something like the untested patch below. > > Thank you for quick fix, it would be great to remove this VSYNC. ITS handling VSYNC unmap > vpeid may waste some time, trigger exception and needed to be > handled. Do you actually see an exception being delivered from this? In any case, feel free to respin the patch after having tested this diff, with the commit message fixed and a Fixes: tag attached to it. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel