From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 486FF3D75A9 for ; Fri, 24 Apr 2026 13:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037996; cv=none; b=sml6Y7Heg23lApd07mNkajphzaFYpTopkutNHfZXt13VI7KnNZY6+7WqybXmPlxw4mE5MhkZrw0y8AKVG3OKppAmwjpRKYWz/piMP4JiyjdA8ilkHCGA5MqrKGHVmxd4rgt0vw9cUvjoyYicQ1R9x9Oh0HTur6gy/PUj83Slink= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037996; c=relaxed/simple; bh=j3+lKywoBxbZH7+FkX2AlRZXpnpN3o4ZxFlVxcBmwLI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=apTFVFRQDjOIpC5ryN/z5iGKz4JTqVwjzelde4sH6oVit1QjDIWRxbnpL85BEQFNg8i2aPhmd5M0IY92EYFddfEThHnfttuTomD0GPEYm9O14nnlWiYRXV9gIDEXVRfG1xkNLP2kWRy7+IArlQarIkFAXVBpPSDE4iRl8HF42pY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=iC9OCXx7; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iC9OCXx7" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-8dbbc6c16b2so981320885a.0 for ; Fri, 24 Apr 2026 06:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1777037994; x=1777642794; 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=rPjCFMFqi8QLuboc2zZPARuZC0PwzjGUIbdAh+rlNHU=; b=iC9OCXx7asIKWFuoPejIjwE0z33O2EIo6zpCsBsyH0oWmdfiYUpBu+2EP9VP6n86km lGy3m7x5PVs6RDvbkiqJKltz30s5ZSdgnV3zOpEHsp0asgk6w5rV6DPKXXXrhOzNUn+1 ycwlMPHvnOjE9o5sI05yKJIvMMm7AODPmIgH/CNgp8bc/AlvII+Fzp9bdwAdVM1xcMe8 ANoTj0xOAtAuJ1JTZW1yMRKNPYiH7kuvU3wf5DYFacvzzMisueN14W7Gn2nCNV34oxkc ox/1IEwKeRVLBFZ1w8CSyTlN6Ken9QeDDf/pJrdhPpRoEPA5DiS6OHQMT5+cVJLMoY1r JpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777037994; x=1777642794; 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=rPjCFMFqi8QLuboc2zZPARuZC0PwzjGUIbdAh+rlNHU=; b=Q4HiwRM7pvezBVMyacggt2mDe4GRMlA+iL8Wpos4mxbvp/DpmbNhjVDVqkLzZJRdbF 2HLgjSCeq9lrUkM0tW4ErP2AWjA8zypQ7KABDA24tkiCLhmiwtEqucThEBRxEEfoiVvY VU/N24XV9mNgnHnkrd/4yKjzvQk57vTKF3wJl7/AoBvm6qEvE4W2BrW1aQ0y2pfEBb5H cHBgog3iqGcRzTc9EeDA9zH/9c9/bRU4nIBqkfmz2FCquxU8lk0qOmjo4CM9Q8LWtbTY sfJQm2BNcd91iuHQsJDoVUDSDnto93m8rrLxlTUfFZPaBWdlwT8yhcs06hH1BcYa/lE+ g31Q== X-Forwarded-Encrypted: i=1; AFNElJ9tV4aPc4YyfbbyL3bVVxxMCAgMcDVdCzUb5NzcacdfqkvZ9x2eZOGHJ/hDNfMJfilZw0JJPfHwRZpUHH4=@vger.kernel.org X-Gm-Message-State: AOJu0YzrPMyAQvrmIwQaQvJFAC9d/KGg67+40YsVJx+fWrrDT3zbWBRd FjLdtr63qzaqt6k4xPAU/6Glc+67UWWKAb1QYmj8fxNo526SdUi9B/sIgyqCMYv6/8o= X-Gm-Gg: AeBDiesmBN6TNQwGBs1+A/HqlkwC3QqQaCKLET/U4T6APjm66nVaTNh/YBhtoIfBgoC d8NGxifgeBnoQL+Z0fs1TaGqoQr+Vq8upmXkUIW24t/x5FO6Rj8owyktmThQc5hJyOcw0Sf5+wG LLes5TvL7jvfFmZGRYHKrRXnrlJnbRaQhyU0RKLh4GNDpeJ0wALPIE2vcLy3jZfUGczuBXz6xSc y21UMgM2zYDziptjawJQ00/g6/7pGzs7X5PccxHQoe1t0nlpa33QyGL1QnZW3x8kHk1Q3prG680 wiCGYWKHPP5ZMNhBm+ztHhnW5W+RFNyrggJVpOF46yMnMgweUVXprsm/ju8N3nN0ZNuJu3FE/mq Th+eBBQliwLBPJ44D/IIAn9SlAQKU5QDa1nmT+/+EBYBUWWVazVt4SMMbDYFXi7pfOI0kfZWzFF y1s4GwDB8EY8jzo0YxuJqABgnkvbxtpcQq8DwgQmoWun5odnunXyYSiFp2VMYuHVg8glHH+InYA cuK7hUrk/7RSr9h X-Received: by 2002:a05:620a:40c1:b0:8cd:9281:6be9 with SMTP id af79cd13be357-8e78c5c256amr3549840385a.31.1777037994254; Fri, 24 Apr 2026 06:39:54 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e7d5fe9638sm1898047285a.1.2026.04.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 06:39:53 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wGGl7-00000002Yhv-0Ex0; Fri, 24 Apr 2026 10:39:53 -0300 Date: Fri, 24 Apr 2026 10:39:53 -0300 From: Jason Gunthorpe To: Joonwon Kang Cc: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, jpb@kernel.org, nicolinc@nvidia.com, praan@google.com, kees@kernel.org, amhetre@nvidia.com, Alexander.Grest@microsoft.com, baolu.lu@linux.intel.com, smostafa@google.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] iommu: Enable per-device SSID space for SVA Message-ID: <20260424133953.GY3611611@ziepe.ca> References: <20260424085339.3503582-1-joonwonkang@google.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: <20260424085339.3503582-1-joonwonkang@google.com> On Fri, Apr 24, 2026 at 08:53:39AM +0000, Joonwon Kang wrote: > 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. That's right, and all the iommu drivers should have no issue with per-device pasid or they are not following the API contract.. I believe that has been taking care of already. So, I don't think this is an iommu driver capability. Instead, you have to decide if the PASID is per device or not based on if the system will use ENQCMD or any similar instruction. I understand ARM has introduced a similar instruction. So you may be better off with some kind of 'arch has enqcmd like instruction' to control this instead of involving the iommu driver. > - 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. Yuk > 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. So you have multiple SVA using devices as well? Or multiple instances of the same device? Jason