From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E85B635F199 for ; Tue, 3 Mar 2026 18:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772563853; cv=none; b=QC+9O21brF70O115ydvNNjWjd3LfP36Dr/PniMuD7oA7DDzFQie0GlZa0gvSyW2xgJBkN8DJnacG6dviGxwvKZiz951uyNTGpC4yNg1Hmay6d0CX3BFuU37yvQWfCQH6YWZsr3VlLY0XW3joZ7PTcNeN95pZEbJs8lSpVNxDMVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772563853; c=relaxed/simple; bh=p7D3XDbzE4LmwJD1gYeONBjA4tJgseuls8e8XyVdW/o=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=qW5jNcquWaIKWrgKS30gqaRS4CfbozLS/hczeqq87G9WZYS/i2t+aYo1iZwL3ZWzJ5vyKN/7hqDxLz4sehprQA2oY9o00YTZNERZjdsaf/XTR2gw9PoqqOAOX0CVo7udXeb8GGhCdwWISlm41OPMAviiSpxfhtEIdxfHi8P9Uxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=c2Hee6A/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eM81lAJ6; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="c2Hee6A/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eM81lAJ6" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 623H1Pqh3561040 for ; Tue, 3 Mar 2026 18:50:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 25shQvLHwOqK8bP7PBHIpLPvewVyW9weQjfHgjfIRuc=; b=c2Hee6A/xIkezOG6 p76Zk3LEZrO88pJWKEKNEyub1+Wgmp+cq65jzjvAqZk1WdowamH6fQEIP7DEIPtc 2lT2EDDV3BsEcjTGcfYM3ecuhynRNSPZ0k4n9IscvIAsvBrZfdKRbdjDmzLQ0bhx DGqyU65Hv1YQCJwawj20GxJGZHAC6dhWrg5ET+A/TL09uvIq1ANubG2OkHFVhXco ZjqdvCetiJ56bciEwM+FAyIwHjBww4HQ6RAOsjeKH23f05W1tzdmwUStTgRmg+Ve 1E+Hl+HYdkWXd9q31vl9D1oboVT2SOwuzoXKEkGZj46iujEgkz0LX3lejqQTG3Ez NoC6Eg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cnhx5c2h5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 03 Mar 2026 18:50:49 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-35980a994d6so15187049a91.1 for ; Tue, 03 Mar 2026 10:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772563849; x=1773168649; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=25shQvLHwOqK8bP7PBHIpLPvewVyW9weQjfHgjfIRuc=; b=eM81lAJ6h6MRl4ekwqONTqmxNlIh6oniZ5sr/M4LtYmjpRO60Nv8uQcbuGVQ67mVu5 CvWrVNbu8OmHFcU4niQvm3myB0UEj+ZfUIlc7qvh8CnwXQDbr8IoTCYGMtsWSUqfgoiJ ZLSpbXJC5qq8wcb/v4fEpOdaruAbD5HnZfcNyv1nz21mOYQXRPHCa7yiAusgvLuEtkQC ZZeRxlrOOyZFkx2LxOtb5tr9PiLtxzvp4DmuXb/gJpBtwlgVhp0vNqEJ60cOH/dQz+Bv NtXMLvM9H2I5zEfvXP2icBrCwnKp5WX9PJ1McpfDtDt5QHzfPYXyr7fFRwIOVZVkoaTk EM2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772563849; x=1773168649; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=25shQvLHwOqK8bP7PBHIpLPvewVyW9weQjfHgjfIRuc=; b=JKLix98TOjNfAxiR/HMOOe0uRGKopYS0AZIY4cFT28kkF9y3QigBHbF78vjA3bUZaK rlL19X/BvuxXxtiW7CyOGdleRi2zj5MWkVnqJYZbHlssPzN4EY9de+HtgkUmU8NFSc9Q 1f5bXe5gjCAc3P/ecvT4RMzSbug9rGdZ3o5BRomHWdSyiKDhywGpMdlioqm9CyTx9eyo AryjwIg4M1Pxhlhff1y69VNAhuYQ9lewJchZmnILKDUo8BJs/oDhKA7r9R67EGKcpHZe Yho0bCmL3SzckufDz8VtsmNsrk+Bhc37SrdKf2YPuLlgy28zy/93XGOspSMZhN7iq49X dnVw== X-Forwarded-Encrypted: i=1; AJvYcCWjCnnmSCG/cV3KEFN90r0dogETtv2O+XLh4cFlXPMnaBaAD0DzUwtBikW3/9w2txkCsUqeRzRikfxXk84=@vger.kernel.org X-Gm-Message-State: AOJu0YzHKhS/iyJSTZrCpPqL7fCILYAmjQZhnF2qcgX5M9HrFPVj/aJh xtoJGAWefMa2R9Fx0tuZsrfEzAZX3B68pfMoRXs8Tv/S3xqRMdDDvQH1J08pbauPWouUpI3aQ0+ nRUkz020MbToIzjL1OLOB8bJMOMXqa3HPXv+GyCAHfaK1Bj19/rgyzyC5TPEWjpCAO/8= X-Gm-Gg: ATEYQzyWXPzHu+CQqAwefURnw1Q4JgaMlqJHhrbrmYJHO3TPfi/FPxw336YD5QJlcZb bCtgiOh6evefbQ/iESIb+JDWIDKrb5PrZTCkFn++tRQl3PsvkNNJu8/lduSllE/H1gITfk7ht2F EvXGH5S1gaGuM8uvy/X1LAAqfezDcpWM8bymbuwNpwwutKC98d5ejKhu3g6q7YSR0Zh898KJy6f RETJSLk9tYHygrVRjZSuTWkDoqrDWm7zhb5Kske4gr/4mb82k1CCSkTQQgdwgnyPd2Ow9EIExKB sDNSvKBXIFtCIE9vOGecRlcvRfNZgwTE8zQ/CZ4io86lkI403xLmBOzmFzWGGELWyCru22YJxSo jaJDO/hqpBVF0109ibpSw45svlxUNQpwhMlWggnrPTrPMmuZOVoAr/e4= X-Received: by 2002:a17:90b:524b:b0:354:a284:3fff with SMTP id 98e67ed59e1d1-35965ceb27dmr14994954a91.25.1772563848383; Tue, 03 Mar 2026 10:50:48 -0800 (PST) X-Received: by 2002:a17:90b:524b:b0:354:a284:3fff with SMTP id 98e67ed59e1d1-35965ceb27dmr14994936a91.25.1772563847950; Tue, 03 Mar 2026 10:50:47 -0800 (PST) Received: from [192.168.0.172] ([49.205.248.49]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c70fa5e4aafsm15501836a12.4.2026.03.03.10.50.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Mar 2026 10:50:47 -0800 (PST) Message-ID: <21fda4d2-72e1-4e5b-aee0-a799886f53b7@oss.qualcomm.com> Date: Wed, 4 Mar 2026 00:20:38 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/7] of/iommu: add multi-map support From: Vikash Garodia To: Robin Murphy , Dmitry Baryshkov Cc: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan , Joerg Roedel , Will Deacon , Stefan Schmidt , Hans Verkuil , Krzysztof Kozlowski , Vishnu Reddy , Hans Verkuil , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Bryan O'Donoghue , Charan Teja Kalla , Vijayanand Jitta References: <20260126-kaanapali-iris-v1-0-e2646246bfc1@oss.qualcomm.com> <20260126-kaanapali-iris-v1-3-e2646246bfc1@oss.qualcomm.com> <78ffd1ce-5408-4bf5-a782-0c4ca14017b1@arm.com> <1c3c36b9-7367-462f-8280-16477d3ad20d@oss.qualcomm.com> Content-Language: en-US In-Reply-To: <1c3c36b9-7367-462f-8280-16477d3ad20d@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAzMDE1MiBTYWx0ZWRfXwDPY0YnEvqz4 XEO9EnSOULwzaIm6UZSdEeufq8BBSDiKNVXS7ju6EjiOQtL1a0uJKpwIfmnQek1dGGDGNIfwxbv vJg410sL5wZkGqzji19X+WP/s4wO48ekhEP/UagajF54g0Wvb2e85MZMA8jmzlpbFSotsfaLEd5 fsT/uGl4AGNlgyhDy1aU4FrNHOyy9wh3kc9wL4j3o4VNfA7yGCjy3Tng9SFi5l1PuNi6vd+doQB Le0v/lLhXW8uID/lpB9TEBzEI6m44ObkD9RmERLAUjqc1VXjXy7Nt2ey+Tr/AEeL90V6a0xy9SK sn+/I49PKEReu7zIy+jFPKoiKne3YzV0nu/bbT9YTlnRBGWRucHu7rMjQFHTyna6BJ7BNJDBxWV uOkbqlNV/TBLq9NriohNKL4Icnr1pdqeeRF+H0fQBCJR7/7cJbJfjAe9qYe2D7xHRYd9WsiXguD AbO2ssR/tReAYuJONLg== X-Authority-Analysis: v=2.4 cv=T9CBjvKQ c=1 sm=1 tr=0 ts=69a72d89 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=KPiuay1jFzAquJblYynD6w==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=r3fjQwxrIzP3dXeSYucA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-GUID: wlu9CNZhOn_GINwkZ0AQbAiZ3N4E_KSM X-Proofpoint-ORIG-GUID: wlu9CNZhOn_GINwkZ0AQbAiZ3N4E_KSM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-03_02,2026-03-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603030152 On 2/17/2026 6:38 PM, Vikash Garodia wrote: > > On 1/27/2026 7:50 PM, Robin Murphy wrote: >> On 2026-01-27 11:45 am, Dmitry Baryshkov wrote: >>> On Mon, Jan 26, 2026 at 05:55:46PM +0530, Vikash Garodia wrote: >>>> From: Charan Teja Kalla >>>> >>>> When multiple mappings are present for an input id, linux matches just >>>> the first one. There is a usecase[1] where all the mappings are to be >>>> maintained in parallel for an iommu-map entry of a same input id. >>> >>> This contradicts the IOMMU idealogy (at least as far as I understood it >>> fom the maintainers): the device (driver) doesn't control which IOMMUs >>> are getting used. Instead _all_ defined entries should get used. For >>> iommu-map it means that if the map defines several entries for a single >>> function, then all entries should always get mapped. >> >> Indeed there is no concept of "multi-map" - if a single input ID >> represents more than one thing then that notion of "input ID" is >> fundamentally wrong. A single *device* may have multiple IDs, as in >> the case of PCI bridge aliasing, but in that case there are multiple >> things to map. > > Let me take examples of kaanapali and sm8550 and describe the vpu stream > id generation part, > > kaanapali: > iommu-map = <0x100 &apps_smmu 0x1940 0x0 0x1>, >             <0x100 &apps_smmu 0x1a20 0x0 0x1>, >             .... > > sm8550: > iommus = <&apps_smmu 0x1940 0>, >      <&apps_smmu 0x1947 0>; > > In kaanapali, 0x1940 and 0x1a20 are the *resultant* stream-IDs. The > resultant stream-id is generated based on > c-SID --> generated by vpu hardware, controlled by video firmware > programming. > Topo ID --> port id, port at which vpu is connected to NOC, decided by > vpu hardware. > TBU - smmu translation buffer unit, decided at soc design time. > > Now if we take 0x1940 and 0x1a20, c-SID is same i.e 0. Within VPU, we > have video engine (vcodec) and processor, both have different TOPO ID in > kaanapali, whereas in sm8550, both have same TOPO ID. So vcodec and > processor may (sm8550) or may not (kaanapali) have same stream-id. > > There are some buffers, like internal buffers, are accessed by both, > which then need both the stream-ids to be mapped into single context bank. > > If you see sm8550, the requirement for both those hardware to access > internal buffer is still there, since they have same c-SID, same topo id > and tbu id, they have same stream id (0x1940) Robin, do you have any further comments on this ? > > Regards, > Vikash >> >> Thanks, >> Robin. >