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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18384C433E0 for ; Fri, 31 Jul 2020 12:45:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9360206DA for ; Fri, 31 Jul 2020 12:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N1hHNwCB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="TGGoPa3F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9360206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DfixRJCVFRP04k5UY2beAR7vkl3Zwe0g3oT+OtGbIHM=; b=N1hHNwCB8A0AQ40cTPxgaG6p6 +EsfItk7KalJuArsOUtf2NMy2xhC9iOB/xkbSB+jiH74XXtwtteiEmuAnvCm1ySfXLm6FHIBWQK7x MAqhLzFd6rp4+VMGwdBRHKyS5AejIE+Hwf0VrB1dBzKHEKGis2DdwQjRoQxEqeVitv0AuaK9NrUGf xryVLlDtwWM0aHXGSPC59I9lUlYN4Z/psrlhC2z+Wtxo/fbZCCQA99RfZfy9/wwnjuZeUIGI+0hCl M+hbNaUAdwFs1E1JtTOhzN3MuibMePX+v4lim1fD8ud5M0mIbcOS5ln50ebi2kegRA0uaWC9CFuoE XjtekL8ug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1UOF-0007zC-Os; Fri, 31 Jul 2020 12:43:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1UOD-0007yq-J2 for linux-arm-kernel@lists.infradead.org; Fri, 31 Jul 2020 12:43:58 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 563B821744; Fri, 31 Jul 2020 12:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596199436; bh=b5/U1wgoIEPrdzMA84HkS4OihCc1YAbTQnQ8sQla5qo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TGGoPa3FxkRdtMK/f/PzpAV8qgydfvN+CZpjMwMMxC81tqLtHZ+BUo7AK97f77XMy VMotX5EhFMJ2IAnM+AYie7MEGfR55Oi45K48InpniY0VQ6LwCANR6uLiUTtMHMzNmC WWYR3i+AF5dICfdDJXeEkAWvqglLwxDEp0h1YsNY= Date: Fri, 31 Jul 2020 13:43:52 +0100 From: Will Deacon To: "Song Bao Hua (Barry Song)" Subject: Re: [PATCH v2] iommu/arm-smmu-v3: disable MSI polling if SEV polling is faster Message-ID: <20200731124351.GC26817@willie-the-truck> References: <20200731083343.18152-1-song.bao.hua@hisilicon.com> <20200731122149.GA26817@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200731_084357_994667_5820DC97 X-CRM114-Status: GOOD ( 21.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "joro@8bytes.org" , John Garry , Linuxarm , "iommu@lists.linux-foundation.org" , "Zengtao \(B\)" , "robin.murphy@arm.com" , "linux-arm-kernel@lists.infradead.org" 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 Fri, Jul 31, 2020 at 12:30:27PM +0000, Song Bao Hua (Barry Song) wrote: > Thanks for your comment. I had a patch with command line option as below. > If it is what you prefer, I'd refine this one and send. > > [PATCH] iommu/arm-smmu-v3: permit users to disable msi polling > --- > drivers/iommu/arm-smmu-v3.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c > index f578677a5c41..4fb1681308e4 100644 > --- a/drivers/iommu/arm-smmu-v3.c > +++ b/drivers/iommu/arm-smmu-v3.c > @@ -418,6 +418,11 @@ module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); > MODULE_PARM_DESC(disable_bypass, > "Disable bypass streams such that incoming transactions from devices that are not attached to an iommu domain will report an abort back to the device and will not be allowed to pass through the SMMU."); > > +static bool disable_msipolling = 1; > +module_param_named(disable_msipolling, disable_msipolling, bool, S_IRUGO); > +MODULE_PARM_DESC(disable_msipolling, > + "Don't use MSI to poll the completion of CMD_SYNC if it is slower than SEV"); Reword this to "Disable MSI-based polling for CMD_SYNC completion." > + > enum pri_resp { > PRI_RESP_DENY = 0, > PRI_RESP_FAIL = 1, > @@ -992,7 +997,7 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu, > * Beware that Hi16xx adds an extra 32 bits of goodness to its MSI > * payload, so the write will zero the entire command on that platform. > */ > - if (smmu->features & ARM_SMMU_FEAT_MSI && > + if (!disable_msipolling && smmu->features & ARM_SMMU_FEAT_MSI && > smmu->features & ARM_SMMU_FEAT_COHERENCY) { Probably now cleaner to wrap this up into a helper: static bool arm_smmu_use_msipolling(struct arm_smmu_device *smmu) { return !disable_msipolling && smmu->features & ARM_SMMU_FEAT_COHERENCY && smmu->features & ARM_SMMU_FEAT_MSI; } > ent.sync.msiaddr = q->base_dma + Q_IDX(&q->llq, prod) * > q->ent_dwords * 8; > @@ -1332,7 +1337,7 @@ static int __arm_smmu_cmdq_poll_until_consumed(struct arm_smmu_device *smmu, > static int arm_smmu_cmdq_poll_until_sync(struct arm_smmu_device *smmu, > struct arm_smmu_ll_queue *llq) > { > - if (smmu->features & ARM_SMMU_FEAT_MSI && > + if (!disable_msipolling && smmu->features & ARM_SMMU_FEAT_MSI && > smmu->features & ARM_SMMU_FEAT_COHERENCY) Then you can use the new helper here too. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel