Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp625706rwl; Thu, 5 Jan 2023 02:09:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXvsyaFAUbvEW2t/XkBffxpdrAtQw1akVFbNRhKh+VmBokbBI3jayBbsLDUI+tWBqUU0H9UT X-Received: by 2002:a05:6a20:d692:b0:ac:29b4:11bc with SMTP id it18-20020a056a20d69200b000ac29b411bcmr68078233pzb.21.1672913371626; Thu, 05 Jan 2023 02:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672913371; cv=none; d=google.com; s=arc-20160816; b=XSVc1czEbXRkdWchpIjEvP5kLODT5ND2dQq194aK+tDMVoy7n2WKGbzB8blxtTCIS6 cOrXM9Wi4+7WjtBzsZUwNVBczTZS4Bj3Axnp7FZQ2QX5Q9BnjrakstaHb9GJM9RN3tmh ibD9+aocXakShZjr736xzmamPdnYkd9wnQ9MNYLdjc9LVi+RXcAS5updmvUfb0h8Pg9V zx3KLToi47YWlEzTSoitW1v1Zj5T78f/L5qw7v1L4qkFWJKYSlWVdDdbB2AsT9ZFmg7C yvyPVBMCzVy4nKHXehHXzJHlnTYhi5CaaGsJe6vJC+fJM6/UAkYaI3y5UcT2kQEcc3lT NNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=fxRgFMFJkcfqXAuf9yZKddG/6gTkmyvw+JYOIZcIs6Y=; b=R3tsi2nKr0wFlItvsRiQaGKnTJhCLpJEK6ECsCwpzsSW+biQdHXPbtKYXH9glu5OTW +iC3TNfOH1eRWLVq+ttPxUr569XsBsQLvMmsAkUd4lu5uSS+VeV8bB6+rAPXxDiKePG4 6bHGmzxLf4YUFUg5htiiFD6KipSWFOBkiHHuGH9nLi5yRlzjRsEvnRBWqtXiztgAeWce LJ2kHPmkz2aSkKNA1kW2el7UondHTlSIeVPTTLJ+5UllmbJfDUE2sn44QxxZEgPaezMy ocAQnFZ3TrW3dqgHNxHHMR3LhU8nn7QIWoJk+hoX+r9bdeIH/PQa6fqpBy8mGcnYmHAQ bmyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=HUzOxVzi; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=PuNY1tKr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a6555c7000000b00487fa650674si37917458pgs.788.2023.01.05.02.09.23; Thu, 05 Jan 2023 02:09:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=HUzOxVzi; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=PuNY1tKr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231955AbjAEJsb (ORCPT + 55 others); Thu, 5 Jan 2023 04:48:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbjAEJsM (ORCPT ); Thu, 5 Jan 2023 04:48:12 -0500 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A265254726; Thu, 5 Jan 2023 01:48:11 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1ED213200A49; Thu, 5 Jan 2023 04:48:10 -0500 (EST) Received: from imap47 ([10.202.2.97]) by compute5.internal (MEProxy); Thu, 05 Jan 2023 04:48:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1672912089; x=1672998489; bh=fx RgFMFJkcfqXAuf9yZKddG/6gTkmyvw+JYOIZcIs6Y=; b=HUzOxVzi8SPiFZ+jm4 ZPDcF9rrI5dUTEUDRToWj4YCk/L3GWo5Kiel48b0qHBa4wHEXFRN05qIYhIQg4Sv KkgQoU43LDTrvPsvRfY0bkMSaoVjHtQyEH+wuZcKtrAOvqWiY9FVM/SmpzEl7kqW tlxMXZg2nuSZ2EPCV5oDWCYnQrzMCAuISfe+w4CvPDsr9jf1YOB4t7eSsuCB1/KT vwFs0Z/rZUNLGvDYvn072/IottGCP941pTrVhqcksymhPB14Xyzwq4uhDd3xfzpL HfKPvjC5cOHUtKgHC2dhvhiGFmdiW7M3wJLhBdvrz7dLPxMyMG9zkBADvmagsAPx rTkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1672912089; x=1672998489; bh=fxRgFMFJkcfqXAuf9yZKddG/6gTk myvw+JYOIZcIs6Y=; b=PuNY1tKr2WSwgtb7gL5tb1jgzhb2sarZFEBSzF5ZgcjV lkVRDU4tD/ZYO3E/nBYiRqW0znTxcDTHd33xjclOZ2AiAEOPon411jk2o1xzEnOo Nfx03L3zhS0Lwm/DY8kF26DjYWXgDSxafHacSOHcbT1LPSlMO1zvvq1f4zTbDeon hJudUmDC030QeHk9OXnYvuwCWpQ9T5ntkiZJKPxZ6LpwvuQ5QKytea6boBr5/dra PvltiSSz4iWIXKSxW2tootZOa7UGh/fMBLk/A9kozpf9/qm0w73z7hV3PMWAFNRQ 0BAJ1vwzR6LnohcTOAOQsfS7XMzdA9LxIQxW4BP/+g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeekgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfuvhgv nhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtffrrg htthgvrhhnpeelvefggeffheevtdeivefhkeehfeettdejteduveeiheevveeilefghfei veeiueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 41F2EA6007C; Thu, 5 Jan 2023 04:48:09 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: <7ecde27b-05e9-4727-8441-e17916df237a@app.fastmail.com> In-Reply-To: <3af091e9-09b4-53a0-da2d-5b2640040b9d@marcan.st> References: <20230104110013.24738-1-marcan@marcan.st> <20230104110013.24738-4-marcan@marcan.st> <71bffbd4-f8b0-4201-b2eb-7a15847ac2c6@app.fastmail.com> <3af091e9-09b4-53a0-da2d-5b2640040b9d@marcan.st> Date: Thu, 05 Jan 2023 10:47:39 +0100 From: "Sven Peter" To: "Hector Martin" , "Joerg Roedel" , "Will Deacon" , "Robin Murphy" Cc: "Alyssa Rosenzweig" , "Janne Grunau" , "Rob Herring" , "Krzysztof Kozlowski" , devicetree@vger.kernel.org, iommu@lists.linux.dev, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] iommu: dart: Support >64 stream IDs Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jan 5, 2023, at 05:43, Hector Martin wrote: > On 2023/01/04 22:37, Sven Peter wrote: >>> #include "dma-iommu.h" >>> >>> -#define DART_MAX_STREAMS 16 >>> +#define DART_MAX_STREAMS 256 >> >> Feels a bit wasteful to allocate 256-wide sid2group and save_{tcr,ttbr} >> arrays even for the M1 where 16 are enough. But then again, that's still <100 KiB >> for all DARTs combined and these machine have >8 GiB of RAM so it probably won't >> make a difference > > Yeah, I don't think this is worth the extra fumbling around with dynamic > allocation. > >>> /* enable all streams globally since TCR is used to control isolation */ >>> - writel(DART_STREAM_ALL, dart->regs + DART_STREAMS_ENABLE); >>> + for (i = 0; i < BITS_TO_U32(dart->num_streams); i++) >>> + writel(U32_MAX, dart->regs + DART_STREAMS_ENABLE); >> >> This seems weird: this code writes U32_MAX to the same register >> again and again. > > Whoops, that was supposed to have a `+ 4 * i` in there. Fixed for v2. Great! Feel free to also add Reviewed-by: Sven Peter then. Best, Sven