Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2449993rwd; Wed, 14 Jun 2023 03:04:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5r3jat2QIRZVzQ7cldtAvppfkUOzGGFW/JU4rA1RZCbRX07+mq6OJ1nHky9yw2XSyp0zja X-Received: by 2002:a05:6830:18e5:b0:6b2:ab63:6e6 with SMTP id d5-20020a05683018e500b006b2ab6306e6mr11711956otf.26.1686737049430; Wed, 14 Jun 2023 03:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686737049; cv=none; d=google.com; s=arc-20160816; b=aZRORL913DCB9z5hDy6HTEE6jnTByHaHyz0WTqAfOysGePxONkH0Jn/zzfMHaeVaJq yJtaC6Jl3xAe8QsJoB2jaqIb388B4lOjZppv5Id4ly0HcBBPM5xcN0qGME58RwzyRo94 ScQsGQg//fxazpOcGWipABUP8o99aGI4vriqfFvvwPOdSXmVnxkGP3HD+rXF0TPyezLe OVFRtAvyGFMDH9ANml7Y4eWQ3FxnCqzg+H8vcGG3V8GkN3ftqWU/cmlY21d/C34mvDlj uoMFSr/3XqWWckETE/j8c6FRebQKJn1R5rvYm2qNWd0LZxS4fATqSyT8mHIyVnM2+6i8 DtMQ== 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=3qu3MImrtsoFSQo9D12BQh0F1vRw24uhJW9sO5eRWsw=; b=IdcGM91eYZ8FVCiwWyhm/6mvPScSX2rTUm8I6TaPwIb3gWT7urvCINzs/DHTsCQJ2t Xs4dHFJ/cSzBsjSjyI1dElmKjrfHLRBeVA9Hv5LJwxKvqXryeVHwn15x+WOW7VOrW6vP rtZ8EYmiUZyJ5DNjD2mxD4u6e/msv4/YPk14FD/SHcr8XjAPEmzxTGcdB9VGIXkSEXXj Zoq0th2yiQUCoOE/hnNjl7dp1umBy5VsFJHeWAWtDEHjVKm+bnjKd3ByNkSKnMKf8Ql2 6R4b95a27AuFnmNgZyZgf7PG1DOYXiwt1+bD5MsQyMYmJgjtYPDD71SN2Rr3RaQOhyxL NOFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Ke9sBRa+; 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 b73-20020a63344c000000b0051b47fe799fsi6504127pga.557.2023.06.14.03.03.55; Wed, 14 Jun 2023 03:04:09 -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=Ke9sBRa+; 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 S243477AbjFNJpt (ORCPT + 99 others); Wed, 14 Jun 2023 05:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244296AbjFNJoq (ORCPT ); Wed, 14 Jun 2023 05:44:46 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C13326A9 for ; Wed, 14 Jun 2023 02:43:45 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-3f9d619103dso136891cf.1 for ; Wed, 14 Jun 2023 02:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686735824; x=1689327824; 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=3qu3MImrtsoFSQo9D12BQh0F1vRw24uhJW9sO5eRWsw=; b=Ke9sBRa+YAXRQkgGZB2BAtw/UiC0JslVzSUE6ilG43GOBfoOB7pSJjAHngj0d/zn92 7TGRmOW/rZ4LBKRoJDeu5so6xf6mGwfmGxFgRnbI+wEUraGpS8VRPTs+gkeeWluhpRYR DfaIpb92Q7Kclt87Mt8B8LRFPLbkn61Lq+XuzonNHPiUPS+fopUx2iwzGb924Ojd+AFv V93dzyIcA1bWc52Y+EJyxgDVa+2QqFjMWH/E1m9dfr1fY12yI9cPOgaIbzzSsqjl3Dit V+dhuLogegraNawK2JGcK/0D8DZhDdm9NPnpXj7PU7Yo0qdJIBzVUoxlRZBD+BI1DrJT QFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686735824; x=1689327824; 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=3qu3MImrtsoFSQo9D12BQh0F1vRw24uhJW9sO5eRWsw=; b=ez2uPBD/6u03JX7VVEjw/5QTPNGNJNqXCN+Lbskuy4scj0MrRrUbMIz8g+AsWpq6hU 7Qw5vmRI56rNTsOxk/0X0g7SmrcPkEMSU6CjtsX+uHoWYWnf1zxjhEgo7p4N5hPUPWTq XlgC7Ju3wtzBzOjcRlfXkCY9LhROAxUHbSzn3snwduZe1O/K1EudrlJOfX3I3OVCGP4o bsisK2wPOBwcgV8evXNXdmEpq6IaQZEZgnBVQNUXuvy7PeKa9j2fKeYEd7HTJ82XAZod uVNs65APJaEuU1AudBRMv2YNByY2zV0gfInBZuAXxVj8KALygZGjg86Y+8Ti+4OqiTVI HHJQ== X-Gm-Message-State: AC+VfDyvJ1GyK/zNqvpI49IKkQaoMxcX8HiBCq4UhznNBIxdsFgyfA1Y KpE/aIn3nPpCqETezzvXgnOmYAukP+SsUX7M78XQ+A== X-Received: by 2002:a05:622a:188b:b0:3ef:2f55:2204 with SMTP id v11-20020a05622a188b00b003ef2f552204mr202066qtc.6.1686735824346; Wed, 14 Jun 2023 02:43:44 -0700 (PDT) MIME-Version: 1.0 References: <20230606120854.4170244-1-mshavit@google.com> <20230606120854.4170244-15-mshavit@google.com> In-Reply-To: From: Michael Shavit Date: Wed, 14 Jun 2023 17:43:08 +0800 Message-ID: Subject: Re: [PATCH v2 14/18] iommu/arm-smmu-v3: Support domains with shared CDs To: Jason Gunthorpe Cc: Will Deacon , Robin Murphy , Joerg Roedel , jean-philippe@linaro.org, nicolinc@nvidia.com, 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 Wed, Jun 14, 2023 at 5:17=E2=80=AFPM Michael Shavit = wrote: > The arm-smmu-v3-sva.c implementation avoids all these problems because it > doesn't need to allocate an io_pgtable; the shared arm_smmu_ctx_desc's > TTBR is set to the MM's TTBR. One possible solution would be to make > the changes proposed in 1., but only allowing SVA domains to attach to > multiple devices: > 1. Domain functions only accessed by arm-smmu-v3.c (such as > arm_smmu_iova_to_phys) can assume there's a single > arm_smmu_device_domain per arm_smmu_domain. > 2. Domain functions also accessed by arm-smmu-v3-sva.c (such as > invalidations commands) must iterate over all arm_smmu_device_domains. Or rather, arm_smmu_domain would hold a list of attached smmu devices, but only SVA domains would be allowed to have multiple entries in that list since the other arm_smmu_domain fields are tied to a single SMMU device for other domain types.