From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17E8C79DD4 for ; Tue, 2 Apr 2024 13:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712065390; cv=none; b=oOtOsaxR6TkIxWnlPW+wb3zqk1oH4ZTLj4rHactg/2OlpTzH/8A6wFEb/Pwh0jC2A+I76LHi6YQz9DO6Dehb/RW1bHgSXAGBMW6+vHHWcEZJ1oCE6/tlkP8L3TC4bCKwYBfxov/9qL3fmhXDPYEooSbgehSPxZtO1wboVqfy3kk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712065390; c=relaxed/simple; bh=lHAIMJbRpkpZnFYxuHbp5mo0756mPGZYrjOw83NTj+A=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=cQ60SsWpjBgTn8BakXs0twLpTACK5ibvpuL7m/Q0OatwSuIlO0+uvs4hMNRQl/WjUVZ9uFId4pJmtVNp6tcWBmvK8smaSlXIuoXoIaCRxuhkIye2OWejjKueGee6ep1B8NxWUYkdhNF4xfAySniHr4BSKolXOxZUW0y93cgMIYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bsmWv/1V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bsmWv/1V" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII 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 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.