From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 8DB3D367F54 for ; Fri, 24 Apr 2026 08:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777021076; cv=none; b=KBl6uICYTzUbvZhiY3kJyUYSh1ZwwsNYZG4P+ra2nw6V23EtQ7MNapna+Gum3HeQ2zeDSQm11Ooxqf9stZE205OLC4RQ9JMOy72PntYsGNkXiBSo+5mHNvhqsWAyprBS+NjvO1oHQ0c7kXzn+lh7CSuDUwys0DJzYB/DyGE/4ik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777021076; c=relaxed/simple; bh=im9BpNo3HM0WXa7B46VITPQSYzn/y4+H/7Tp17gibD0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rFoqunJu07ZaBMCP1boJ0XbLLqAhGhuxVHPFKOuS0Uc8lMmJ4X3nAcGjIRUlJJ1bnqG1yJ2LztHcO8Mi8qHnlc9irnv+p6A55cXc2ZjR3mpng8yvEh4yAQwB6PcxUBvgsMnXazUAZ3dTjEwgftf/qVQguYZBt7Z3s+7zfPU0XEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GfyrmnYT; arc=none smtp.client-ip=209.85.216.74 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=flex--joonwonkang.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GfyrmnYT" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-35fc22424d9so15456009a91.2 for ; Fri, 24 Apr 2026 01:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777021075; x=1777625875; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fwFNTETipk2+0oOmAmumV4DtfgdBkUEEsoK+rKkQKqg=; b=GfyrmnYTDh5GvKZB9gI2w5FC4ltp2XUebYwYs9OTl/GLbPIQ1bEtBwclpFNXmE1K34 zpDK6qI1ee8nMmyPFvn8FZo4wdJi5S+VZy9CXnsdyMZdFZS7AQylQRf5q61weDx7itSc D65hGYzRkGegkkScAIt74DDC7VtM849pLL1/QGBTQ4RbcrOcC9wbLYWfzm+VhINYtehY LCZZIyMOd0dbxF4SSKGMiMfQ5r2TsjOgn8UGiFuBo8ic/rI94SABdZPgegiMLRVir/GX ANIgHiVOecoDGSDtE1LZcin4jfi5QNeg39lV4SfmEl8OZnA/kjp9QH/bc0E4/gaPqyZs VKsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777021075; x=1777625875; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fwFNTETipk2+0oOmAmumV4DtfgdBkUEEsoK+rKkQKqg=; b=GrrpwOE/e/ypDBOOgbqXuhTUIQHQgakY2npiIlF95gr/cFOJgEB6Q3k40AYYzlaJIR GA9TZ1JCBNO7E/Td1rVCTgA4xeKHxjPzJDt0rxrelKROrZyQxN7REcb3kZAUQyb3xFi7 HDHGlMiU/ONQvMSdqXFxtEWqkFbJzcaumSi1ZfiVK950kKMJ/GfUyqLQ11YypwDLN1kE TSNS2VYhd/vJjWlt+4Zd1fr+/b7B8D8KdiEqr4+06QhjYv1SNLav4MVzvnypWSRDM1Rt n4QW4/+qEyO64rrsp8HACqmFKyb15RBZI1Fp0qDgrjrKuklHnVRMnK8Kp6qieLiHCmj8 QbLw== X-Forwarded-Encrypted: i=1; AFNElJ/IPCC6nFgaz484qDeZ5UiOt3/RJCx15tj6j1tmTiA/4nQitteL/7U2i2XTaN5BYG5LykQRGygYiCrimRA=@vger.kernel.org X-Gm-Message-State: AOJu0YyAPJnRBilxTjuK3T0Htj5e+jYVj/Klnlx5Zvop0mkXFo0XWAZZ 7sc1RT9mJp0UjlL1gVdrkZI6LrOe0Kv6KqfCPixCJx813T4wWXmEYCZW8c23BxoXn+XWxJ89r7d XXwWg0BsdiEJshEzDQjMdQSvMsg== X-Received: from pfbfm15.prod.google.com ([2002:a05:6a00:2f8f:b0:82a:6ac2:2386]) (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:734c:b0:39b:c4cd:d854 with SMTP id adf61e73a8af0-3a08d8a876emr35407723637.30.1777021074747; Fri, 24 Apr 2026 01:57:54 -0700 (PDT) Date: Fri, 24 Apr 2026 08:57:53 +0000 In-Reply-To: <20260424085011.3502295-1-joonwonkang@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260424085011.3502295-1-joonwonkang@google.com> X-Mailer: git-send-email 2.54.0.545.g6539524ca2-goog Message-ID: <20260424085753.3505585-1-joonwonkang@google.com> Subject: Re: [PATCH RFC] iommu: Enable per-device SSID space for SVA From: Joonwon Kang To: joonwonkang@google.com Cc: Alexander.Grest@microsoft.com, amhetre@nvidia.com, baolu.lu@linux.intel.com, iommu@lists.linux.dev, jgg@ziepe.ca, joro@8bytes.org, kees@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nicolinc@nvidia.com, praan@google.com, robin.murphy@arm.com, smostafa@google.com, will@kernel.org Content-Type: text/plain; charset="UTF-8" > For SVA, the IOMMU core always allocates PASID from the global PASID > space. The use of this global PASID space comes from the limitation of > the ENQCMD instruction in Intel CPUs that it fetches its PASID operand > from IA32_PASID, which is per-task. > > Due to this nature, SVA with ARM SMMU v3 has been found not working in > our environment when other modules/devices compete for PASID. The > environment looks as follows: > > - The device is not a PCIe device. > - The device is to use SVA. > - The supported SSID/PASID space is very small for the device; only 1 to > 3 SSIDs are supported. > - There is a custom way of transmitting the SSID from the kernel to the > device. > > With this setup, when other modules have allocated all the PASIDs that > our device is expected to use from the global PASID space via APIs like > iommu_alloc_global_pasid() or iommu_sva_bind_device(), SVA binding to > our device fails due to the lack of available PASIDs. > > Since SSID/PASID is supported per-SID in ARM SMMU v3, this commit > leverages the fact and lifts the use of the global PASID space if > possible. What it does includes: > > - Introduce a new IOMMU capability IOMMU_CAP_PER_DEV_PASID_SPACE, which > represents whether the IOMMU supports an independent PASID space per- > device, not shared across devices. ARM SMMU v3 is the case. > - Open a new API iommu_attach_device_pasid_any() to allocate any > available PASID and attach an IOMMU domain to it. > - Opt out the use of the global PASID space for SVA if the IOMMU has > that capability, and use the new API to allocate a PASID in that case. > > Signed-off-by: Joonwon Kang Please disregard this RFC as I have sent a new one with more recipients. Thanks, Joonwon Kang