From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8691B18FC8E; Thu, 8 Aug 2024 16:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723135229; cv=none; b=ObcywE3wbFiQXPIbWLnL12AGv83tus5SO3WsSfhPiOWlVU/cc3gDK+3MhWVal2/5wifgQYlNUpj/DiAgdkVXUj6wihLhBrM5fWAGJybog/TGIOhKK3q1SXSYXd/KIqIwXHgcCGuCdrMYHA50Qq8FveIYBD+kw7lKmfJ7cN5+wj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723135229; c=relaxed/simple; bh=tJHROCF5FIFH333VZcXU5J5IzhpJm677qL7yxSNpeu4=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=uAuW/3Goq50WA8vRkQtln7p1UoihuuSuxGHXOJjMe0+aZLDar6KdTaHbJmErHSDzZHoOqFCGD5YT0JvGyAir6otVpJo2esNh7v0YUz8sVEBEl9O82s8v4KBv4uuuRNVq0VlNwUejF2/uH0m62sWHGVUCkTINF206KYxagWExXtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=PzG10cld; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="PzG10cld" Received: from [100.65.224.131] (unknown [20.236.10.163]) by linux.microsoft.com (Postfix) with ESMTPSA id 7F15220B7165; Thu, 8 Aug 2024 09:40:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7F15220B7165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1723135227; bh=pNSyKAAFSaByPF2gZY6jQTEMrj9M3d4OIOtRITHeq2M=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=PzG10cldv/Tk+MgEh4nS+eROzyXE6w8cgUoROcA4GmIs13++8agdcClHJjbxidRRy nkoLbnPDXPxTaCyWCFmNBbexGH1nWJtNJwXe1emvT9Q8Pka/vPOatVx7jRmy1v2nf/ XmiFwcy3ncserwcahCn4oKWurg9NWbyTkVFcVNEo= Message-ID: <7dfff1ba-44a6-465a-a47c-d344ef00c6d5@linux.microsoft.com> Date: Thu, 8 Aug 2024 09:40:25 -0700 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: eahariha@linux.microsoft.com, Tomasz Jeznach , Joerg Roedel , Will Deacon , Robin Murphy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Sunil V L , Nick Kossifidis , Sebastien Boeuf , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, iommu@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Lu Baolu , Zong Li Subject: Re: [PATCH v8 7/7] iommu/riscv: Paging domain support To: Jason Gunthorpe References: <389da90e-df78-4ea4-8453-ae2080a68956@linux.microsoft.com> <20240808131432.GB1985367@ziepe.ca> Content-Language: en-US From: Easwar Hariharan In-Reply-To: <20240808131432.GB1985367@ziepe.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/8/2024 6:14 AM, Jason Gunthorpe wrote: > On Tue, Aug 06, 2024 at 12:24:40PM -0700, Easwar Hariharan wrote: >> On 6/14/2024 10:27 PM, Tomasz Jeznach wrote: >> >>> @@ -856,7 +1473,7 @@ static struct iommu_domain riscv_iommu_identity_domain = { >>> >>> static int riscv_iommu_device_domain_type(struct device *dev) >>> { >>> - return IOMMU_DOMAIN_IDENTITY; >>> + return 0; >>> } >> >> >> Sorry for the drive by comment, I just happen to be in the nearby code >> context. >> >> Nit: It may be better to use IOMMU_DOMAIN_BLOCKED here for readability >> rather than the bare value. > > It is weird and confusing, but 0 means "I have nothing to add" not > BLOCKED. > > You can't return BLOCKED from this op right now.. > > Jason Ok, that's weird and confusing as you say. I went back and looked at the kerneldoc for iommu_ops and it IS called out, but it's confusing that a function named get_default_domain_type() can return a value that's a valid domain type but isn't treated as one. This was useful to fill in my mental model, thanks! Easwar