Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2208424rwp; Fri, 14 Jul 2023 02:32:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlGrW1GBoZL4Dlx9VsMfOcgVERR79JJc1Ns+e0anPIAZOlx08JCW8+IZ3uIMgGuQM/FHG0C3 X-Received: by 2002:a17:906:5185:b0:993:d617:bdc5 with SMTP id y5-20020a170906518500b00993d617bdc5mr3954045ejk.37.1689327138352; Fri, 14 Jul 2023 02:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689327138; cv=none; d=google.com; s=arc-20160816; b=1AnvuuoVuqEKLKDYOpbMY63T/OCTPfzWCuIDtGUnhTj7IMQ615xvYDSNfzep5YPOSF Gdt6CSOGYInyXGlMX3AKgEBLn3oXn3tWXVASRm1c3ygak3znYP8X5gxUXqht0FxZ1HCR JsHRQw3HPDiVT67Q5w0RFZNJXb0qF6/PLAkETAM+iXWCnOHcC4s3xv1GTw81YOlfGuiY 8U61XlIq/cOFqVyWzYu/138yUX6RkB7p3TfVVwGYmfOoqtWPIls7lrdnbQZ+f+utopbc +RkNPK90A1ReT7e+kPucQOgn6wISFJlngOrxBKLgYAds6bHkHpNwmy8ieTzAl1BRVq5/ QWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CXXFs1U0EQirANF72vGzE97gcx0mGEeOxn7yBPDJD4A=; fh=28pnMUvw4uJ9IekexNFzZ0T1Av+aOf60KWToIrKsF5c=; b=UvZZz800QMv8kdsrAIi5Ad6Q/G0AcuLVg8zDYG0UTa1nFLRFKp2ZirrOfj3yLmwB2h RdCymyGMyDiOjfBGrFc1vcBHJAaWVpatBv6zXfg/m2qZTIBL5BzL1H13MVBeQGdor42S 19g8brrNsGK3qdBT30Bc5l8+d5rofEUwpCDsNN5S5uikLvtZFBCf1ZlEL/Jd8vTxiBav wZiythH4DQc2fuqjh3J4JXUbOQJ+6My+PTeJkhbRLyUEP5rYBiokJeHjqHXPLgREtm+R NvnmSeRPrLXJlZHN+hVbH6O4IJikSvk1gR1ZAyKTs+e5OZhpwjZ5RSxoIn1sdO/cYGuL H5PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=B2Qy7FEq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a170906a39600b0099279b2cdd5si8828824ejz.825.2023.07.14.02.31.54; Fri, 14 Jul 2023 02:32:18 -0700 (PDT) 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=@google.com header.s=20221208 header.b=B2Qy7FEq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235751AbjGNJNQ (ORCPT + 99 others); Fri, 14 Jul 2023 05:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235596AbjGNJNP (ORCPT ); Fri, 14 Jul 2023 05:13:15 -0400 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112692710 for ; Fri, 14 Jul 2023 02:13:14 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-403b622101bso209701cf.1 for ; Fri, 14 Jul 2023 02:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689325993; x=1691917993; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CXXFs1U0EQirANF72vGzE97gcx0mGEeOxn7yBPDJD4A=; b=B2Qy7FEqZ7cpvpNr/7I7YyMWCRE03jyN3Wx391rY6FsqZwmNbHkQyghsyfh0t/C9Ge bNH5jHKznr5cb3VD1TAhKhrL4671zDAJLKeC+OPeWd/F6i+htAtjtQUYfDqbvrdDYLqo 7vsPeYv+0QwctoFSm6VMY49JcvLwU1JLAgN/b/kA4AJhd1YIpApVBScBnozL5Bo4+WY8 v1QXeO4C/lsCfryAivvaIQfQY1/ASdrsLClpld1HKvJ5tOWHPoG1IjECl+8aadEHVcKH AOgRaI2pdsc3Kqu9KJUpKkO22y5lIvgEgQOrrQmZD6tY5SXDT1qHxQofIVTIO6FPPVux T0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689325993; x=1691917993; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CXXFs1U0EQirANF72vGzE97gcx0mGEeOxn7yBPDJD4A=; b=IXmkxP/OZjYOCH7UKQjnlCnL7Lo90zc4rEdENZ3/QLuinudKuqZWFwbrKSKZRut3af GWufpWwRp1tps/9HGyY60igs0vmO4cNXi4xVBFW1IRo9FD+lVD0jWXvRjsq8C1JUeLNH rVfxYb7d3aKO3jz30ngj6ZUh9GSwh7CayBpC6fABkPbc3ny6e7ulvxz4If+KVLOnonq+ 2AH9x+MUD0YsdU78ESnhsATW818SkJQ5VRb/ktAAgoiTqcfKI6tD6/UDSoaTRqxP//lu sQnnw+FTwKS5dB+7dXFa3aZAGdbn5nVcvEgdCr+8BOfkCw763rc1O6KQl6PWudHAXdc7 thJA== X-Gm-Message-State: ABy/qLYbLvItnknzP/cTlufeJ6TT7+1UMXl4a0ZznpH9+Szx0GB7l+2B xukf8AaNF8JjX8oEcAYTPm+GmI37QSy5N/zokpW5gw== X-Received: by 2002:ac8:7f8a:0:b0:403:aee3:64f7 with SMTP id z10-20020ac87f8a000000b00403aee364f7mr794692qtj.6.1689325993037; Fri, 14 Jul 2023 02:13:13 -0700 (PDT) MIME-Version: 1.0 References: <20230621063825.268890-1-mshavit@google.com> <20230621063825.268890-3-mshavit@google.com> In-Reply-To: From: Michael Shavit Date: Fri, 14 Jul 2023 17:12:35 +0800 Message-ID: Subject: Re: [PATCH v4 02/13] iommu/arm-smmu-v3: Add smmu_s1_cfg to smmu_master To: Nicolin Chen Cc: Jason Gunthorpe , Will Deacon , Robin Murphy , Joerg Roedel , jean-philippe@linaro.org, baolu.lu@linux.intel.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Fri, Jul 14, 2023 at 9:14=E2=80=AFAM Nicolin Chen = wrote: > @Michael, > Would it be possible for you to update a v5, following Jason's > suggestion overall? And I think we can have a smaller refactor > series first without set_dev_pasid, to have a common codeline > sooner for us to add new features, such as set_dev_pasid, the > use case of IDENTITY default substream, and the nesting series. > I will help testing with some pasid/non-pasid use cases too. Want to make sure I fully understand these last few messages first. At a high level, we want: 1. arm_smmu_master is allowed to own a CD table, but not an STE-precursor (s1_cfg/s2_cfg). The s1_cfg is practically already that, and we can probably get there with minimal changes. 2. arm_smmu_master shouldn't point to the currently active CD table (which may or may not be the one it owns) or STE-precursor as a shortcut. All code should figure it out by looking at the master's currently attached domain (functionality could be provided by helper). 3. arm_smmu_domain shouldn't pre-generate any STE-precursors. The STE/CD for a domain should either be computed right when it is written, or computed ahead of time and stored as a copy in the smmu-domain. Is that right?