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 040BB35FF5F for ; Tue, 17 Feb 2026 13:09:08 +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=1771333755; cv=none; b=G2ebYMZQC4Hes8XZTyOwJ/tuT/BwbJZk/og+5Obrac9I4jlHL7nAVXHVb7KUr7oldgSkyAtWZ07o9t5AKRbfL9+LPl107VQXyegXR/Py3crfXd9nJP6cskXwiZ5r2KFZun0+5+f3Q6sJwfJrcwOU/b6spyrBh7VcEX9TAKcpUnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771333755; c=relaxed/simple; bh=08/3OoJXMaNcdEliZZW5uDgDHXHc6I9x7HTVt6Q4+tk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=e42P+Gv/Yx4LmHG84KrvA/X2A10ACntpEJgaMTntOG0huyehYEVdBD7aZsvj8OZLlxlgBevR4QzslqIsIMByGXL+8nXmqeDILNKvM7rXUREyWPTQKFCYNN0yiOGLZEOHvKKXOr+LTZ+yGktMvvNNwyRHb46Wpl+BYP9mBAjT6PA= 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=dybNB+Ib; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TOKRIHVg; 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="dybNB+Ib"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TOKRIHVg" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61H9nRO92802096 for ; Tue, 17 Feb 2026 13:09:07 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= ifylqg/fOmpo0N2XrSn2luRh1AIgqY3MN7R1u/QkYd0=; b=dybNB+IbtgzBOO1s 5Ya+F27i4OYAhp00K5Nedr2c1YK6zn4RDOMh2HYVCMvKoCPIc1kVHtYFj2AithNB djKxZ36SQnZ/GAt863XAz/2t5WJBaETfSdfd7+dKTZpddSOuli7g0CBpvt0a/ejD /bBWPzAqwSiWtQU+7byN+qViBbf26rgFJP8rZLa/07PrvCfpJ0kPaJjEVqZvdUbr DTA3QBDrh3FdsSlr/uHlpeMzfcvmePnBfB4koG5AVrgCJQMOhQb9a7Cr3PFMnVoh DT91N87XyUEwrFadIBvh9lv5jzSawKrmlTpIJhEegajfTDbFOi+5RV9kPsvTzymD 2HaXbA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cbyxukj6f-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 17 Feb 2026 13:09:07 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-3562bdba6f7so19607289a91.2 for ; Tue, 17 Feb 2026 05:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771333747; x=1771938547; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ifylqg/fOmpo0N2XrSn2luRh1AIgqY3MN7R1u/QkYd0=; b=TOKRIHVgZptTuinGdQWrmypgW3t4hSYJc04fhn6Er32fmUGLfCEYNQYDK4J1qLpNi+ GeqNtNPvbzOrQ0igIVbGB/v4lf993zNMVsgxLjMasNi3mmLhuohLV11odQtqVGSQCNtz RVvmk5WLeF+z8Iy+FXc3BUGlgvnQYR52ReGOGvy0gR+WQS2MosmmDTs0uhaZGNhrnk8P iFGgDUrcWkhasVuUnDhbUcfV6Bae+v/BPIjy5DVYpse7fze+Tj4ijez8mOQTX1ANYWiP kLqPqDi70G/RHAcU8Avr7C0FEvneLuIXJ0ZePT7CKMco67AIKb1Nvwomt+sArO/EswBG 6BUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771333747; x=1771938547; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to: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=ifylqg/fOmpo0N2XrSn2luRh1AIgqY3MN7R1u/QkYd0=; b=D5OUjaidTqKdoHsiV1NSngfK8rD6lIOs7u1zrmLAenfgDeQUHGxD934XVtX5G7lBX+ Q73PWruKurKib0aKMY2moGaLyja6f4pnarKaW6gC3Oxx5vTJyuNtj+IaNDDnO8PlkIa2 XoRakkm6S+IRhFzzV/SLurU7+leESHZth+geiwW99WTydsymddcxOeziszs9k5210BwM EG5BPrsU6mSEnJ+1XvbdLSgrDktdsxg2Y0cH0ryE8Dl+tLYloIC+VQRiB+vTGg97XjcB Nr/2kTwbIJlbqO6SPXB2nN+alULUtIVW74QUXKkrytTsu/EBPwKPWAuTLnce/N1FUwAn rOjg== X-Forwarded-Encrypted: i=1; AJvYcCUzEn6qF8cbtoXJU3+yGtlb0/HWF3gLyOl7/AEhIMzl0QExAKOJLPmevbiqewf1hobd/5Csouz9bgB3jk4=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz7vOk8hV/b4GcISKuQvvyHpAqFac18sQh/k9XR99pay+m9ao5 GZ4zCKSerTuCSSQtIFLX/I7cn2QD6ph6aDOCNMDbljjbFsnUyKVoGqYMyahiiCLmm61shUsvGis rgJIm9P7SAPq3nCGztolu5Os9bJ+XyHGku4XNnQvaFlg0IHSl9YB3rDFj5b7wTQWayDM= X-Gm-Gg: AZuq6aK8xrniBLRIMyB9GHN2FaRIkgQ7jKHzr1AWRIwjNwS/y+TRNDtq85/CnAtbyGc uDQvoxwZAtD7HJneBe0khc952Lfo3ej3o9mhmjpvPXZx/2lCyb/JrVUj8Lt1GxjBtWcFhJtRoWS qYx3T018WgIwFigmUGi/dFtEk+glbNUf8PvbcIlF/QDPQuanzOy+7CmKGibH4I+6YXnROkXZoTP KwVLxVJzvawVT6L/Tx68b747GcSRxRAYFYD7SUe0ogjLuIqCbdtPpbRrD57UMTO8geyWdmyyRQD EN4/k7MXeFWVzI4MTo3dEHthNDqwxVl1eH8asyPkadhQ12Mh1NwbmIK5mdKRChWLvyzEbqhYXG8 bFJO+HtHVngh2FV7jUt1qF5LgH+nuFBpSVqt1J7YdIe7hFVonGquaBA== X-Received: by 2002:a05:6a21:b98:b0:38f:df47:87a0 with SMTP id adf61e73a8af0-3946733d9b8mr13246203637.61.1771333746650; Tue, 17 Feb 2026 05:09:06 -0800 (PST) X-Received: by 2002:a05:6a21:b98:b0:38f:df47:87a0 with SMTP id adf61e73a8af0-3946733d9b8mr13246155637.61.1771333746130; Tue, 17 Feb 2026 05:09:06 -0800 (PST) Received: from [10.204.100.45] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c6e5332e0d1sm9782405a12.31.2026.02.17.05.08.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Feb 2026 05:09:05 -0800 (PST) Message-ID: <1c3c36b9-7367-462f-8280-16477d3ad20d@oss.qualcomm.com> Date: Tue, 17 Feb 2026 18:38:56 +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 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> Content-Language: en-US From: Vikash Garodia In-Reply-To: <78ffd1ce-5408-4bf5-a782-0c4ca14017b1@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: -BhSq2oG2Hd0zUHlYI53-Q77b-Y4NjGG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE3MDEwNiBTYWx0ZWRfXyA/avbLVrie+ +7vh9HPBj2GBeRm3xYAF2nVb1mql0eWKmfHwfULZUMthTyxXgFNipF1a+HpnPzHvchpFQYl23Nj rS5wG+bcqyMHayICvh1VMP7h42uT8mA594HJjfBKLZQPR7k4odG3efl7fhtp7sxgyHqJgnCBvNr m86ySTOuJGLrInettmXQZq+VF3H2qxNuiyHidO8p4NUNpN0H4jNyX6/VfSIPO9E2SD+K/qhyBlQ FvmqzBxpTnQwldKoAd4tMqwlRgShKDqCMB3cKaEkoZ563nfNW5f7Ht5HNmWOsXc/VliFRi/i25I GEs05MOujNdCB1Dp1FtccmLQIFqQ4mcrkutHU6UEI5a7GjbyjkjUiTlJqCthRUqw33PeKaldhQz 0LSpHU44JAVvTfvgKX0ATiz+YvMVvtYEthwFSGYgl25d0rl+Spw2x9uySPF7vbLW8JXg3qVl7Qz rTUesb6f2hkiHd7WROQ== X-Authority-Analysis: v=2.4 cv=BpuQAIX5 c=1 sm=1 tr=0 ts=69946873 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=EUspDBNiAAAA:8 a=pTTk568K-quJkV0nBCAA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-ORIG-GUID: -BhSq2oG2Hd0zUHlYI53-Q77b-Y4NjGG 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-02-17_01,2026-02-16_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602170106 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) Regards, Vikash > > Thanks, > Robin.