From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28E48353EFC for ; Fri, 23 Jan 2026 09:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162023; cv=none; b=ONukOR0N68u3rEEuZ15gPmbgiZ1iSHQG1JwTU6DtM7DWEkluddM17RwYEYAOs1ZKJxUjUhu8DulKuNNJidO8/dEk2TRDt+dJEdkY9+Q5nKXJfSgHsprzu1X2GYtuqQER2dUrruLfod71AwgvkPAEAQS5jQgv8XJNPumucCX21jM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162023; c=relaxed/simple; bh=fbHAXtMgNBpKPLxNGOFiSceLUQjlHsjSTYzbd3h/6Gg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A6TiVilBzinM4wHfNNj182hM9DOpacjNdm1xHdZfdRCBsJP+su0mtDi6JQq9JgehuEAOc4lt/5c5KmrqUU1JkjfDsxXPLmA8ZaE/PCRQZsrVWjohtw12XaxtxCfxPgg+VpmjGstGZ3Irt9cq0sAfXukYelq8bOjVhbEj513gniA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Fz8J4hRU; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Fz8J4hRU" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2a1462573caso102115ad.0 for ; Fri, 23 Jan 2026 01:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769162015; x=1769766815; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ePKEQ0GejUBw1iTzV1iSOFdxHwY73KC0ci9l7qDVv0U=; b=Fz8J4hRUhrrDyREoIkGrwghlRuiWjDyHGXE6kbF8GE6ldq743f8n8dZ5bFhla9Gx2s e2N1lXkoP0i3hfaTefdzxxosxIM8Qk17CuZqYtgHNhwPg8NwDJzF+xYWAMeQ29Y/uadR CfLees4Jd4ENM/N33naTiNdZ2VloZ8Z1H1nDhklVV1PbDGOg6YqZLOYxADWTECRvt17D RoJZiWWSprCtoqEFSCk/MeN5dOzpJw8U7gWi4CT10mU9KqwWxVWXuNOoTpR3lYUY/fOj O9HFU4bA62CnilaJHBZLREXC5jWv3XRrJN7yW+9bMt7IzXmhzdWfHcIldLB7Oft6n1XY 8vEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769162015; x=1769766815; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ePKEQ0GejUBw1iTzV1iSOFdxHwY73KC0ci9l7qDVv0U=; b=OxMeEJPzvdUyt897uZFhIYvq9ut2WMHI/+ZNjuM661Cjuw6stIQ1klzhO0HZvacY44 cd/swz7ZsqYkiFUufukzx04cQt+wZs7u2UBEA2/fLZfUwbOhyXFww+jaZqqw0vAlkr92 GRTObSkZ9mQPhdsP/QYUd0haHudNpFHKzEGr7WrdhyV0Bxe/adxCLQwtae5nlMMMrzEy eC3xEKGejBrQH+Beben+33navLqU6Zbk/U1imZKDYepGFKRqTEhd31LxIQ8qPl2xzeVP BzBZMqEaThYf5hClStHzpjH5HpLc5Sa5gUWwSPHQtT3XPxDSHBZwXS88CBP575BWJhv9 PYjw== X-Forwarded-Encrypted: i=1; AJvYcCVuYhZNzmf5lHwVJ3BYjblZGl71rQJ2ELdwMQMAZNwWUc0FtAcASkgDmTIGWDGeQ5EJqxxs+PDDPmQj0YY=@vger.kernel.org X-Gm-Message-State: AOJu0YwmSosxQQb4N0B2guLHbUqZTwE3xlYyTLhNVuon9y3af9MQrf6H 0J0iF0R9Ks7rJchxiNn4HTuBJeG4Jn3WgcNXlS40thTL7E+qRtkFm+PLHt3Pc7y0WA== X-Gm-Gg: AZuq6aJ1eLaNJ6S0/YlRa3CZkkS0pVA4tUxPHllsIx7uWItWaY/H74eC1D4Z6GJf/DQ E1Z+2oMLQi4vKOIGM/IPZxEjDrVQjxiL1jQN0UJXEV1vNrMQN8xzxgdUQ7xeOQh/kNIpkWVJdKt BRDBRLnNnWkEblGmhDRG/GGWsuQixyrxPJO0v6mQTVFxlhRdnfuEeGHTHaT1l5ILdevxTj+eEz/ ku3fGaRgUtbEgoDgJVbxZGJbBMGL+rcJD9qYR4Y8NLILQNYpHk2Q2JgnY2TvfC7EKwX4dB+XT/W GGCE5btas4Ztp6HK4u9FSOGB0UYgmX7+TLxD8BPgf1Z84wfZmjUob0e1JAKRpRBfw70PqjSQcof 2TFiN4VZ/Oln+dqEXmGeFD2r8o0MC0gnUek9QCyqpv+9+j8UFJgy5F41OWmlkTiwFQMipiN3zAJ 53WR/981jGKE7LXc8oNZU8ILsxKqJLDKQgFSWUbFFxER027E+s X-Received: by 2002:a17:903:40cc:b0:2a3:cd98:f07 with SMTP id d9443c01a7336-2a805c91485mr1873745ad.3.1769162014172; Fri, 23 Jan 2026 01:53:34 -0800 (PST) Received: from google.com (222.245.187.35.bc.googleusercontent.com. [35.187.245.222]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802f97a81sm15301165ad.47.2026.01.23.01.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jan 2026 01:53:33 -0800 (PST) Date: Fri, 23 Jan 2026 09:53:28 +0000 From: Pranjal Shrivastava To: Nicolin Chen Cc: will@kernel.org, jean-philippe@linaro.org, robin.murphy@arm.com, joro@8bytes.org, jgg@nvidia.com, balbirs@nvidia.com, miko.lenczewski@arm.com, peterz@infradead.org, kevin.tian@intel.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 3/7] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array Message-ID: References: <8c94c5194871ee1a0f3a6b49e18818b88f51226d.1766174731.git.nicolinc@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8c94c5194871ee1a0f3a6b49e18818b88f51226d.1766174731.git.nicolinc@nvidia.com> On Fri, Dec 19, 2025 at 12:11:25PM -0800, Nicolin Chen wrote: > From: Jason Gunthorpe > > Create a new data structure to hold an array of invalidations that need to > be performed for the domain based on what masters are attached, to replace > the single smmu pointer and linked list of masters in the current design. > > Each array entry holds one of the invalidation actions - S1_ASID, S2_VMID, > ATS or their variant with information to feed invalidation commands to HW. > It is structured so that multiple SMMUs can participate in the same array, > removing one key limitation of the current system. > > To maximize performance, a sorted array is used as the data structure. It > allows grouping SYNCs together to parallelize invalidations. For instance, > it will group all the ATS entries after the ASID/VMID entry, so they will > all be pushed to the PCI devices in parallel with one SYNC. > > To minimize the locking cost on the invalidation fast path (reader of the > invalidation array), the array is managed with RCU. > > Provide a set of APIs to add/delete entries to/from an array, which cover > cannot-fail attach cases, e.g. attaching to arm_smmu_blocked_domain. Also > add kunit coverage for those APIs. > > Signed-off-by: Jason Gunthorpe > Reviewed-by: Jason Gunthorpe > Co-developed-by: Nicolin Chen > Signed-off-by: Nicolin Chen > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 98 +++++++ > .../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 92 +++++++ > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 258 ++++++++++++++++++ > 3 files changed, 448 insertions(+) > Reviewed-by: Pranjal Shrivastava Thanks, Praan