From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796117675; b=3DlpTe13OoEE8Mhn6vzvxz+gKuSD9fVoErzer5xd0Ciq5LYkwOlbC0uNAYkNQJsbA2y1 IyLJ6t/6ENhXc36lsPgSbW0qEAGm8WL+j8zmLsjG3TcseANSlGYrIlsljhKnZ8wRLpxKg qh5fOiv8Se3A2lRLNTrAFqHYmtB5ouTwyRm4c0/jY0IzwQcEMBHZNd4qzge3jkA9NY8IL NqjBpMmjkisL42wda49Uxd8LZj/uWVmSSVS+u5TQToz1fLq9KbI1j1S+twYkTJRPh52KC fhVePWny3Hp+rjmRqYMMLUNCLK1N94+0b8umHDMAPO5zPziZED8qInRVSa73Mu7CQ0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796117675; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-GUID:X-Authority-Analysis: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=Sn0Pz8+Wxic8UvLElJ5g7oLLroP87CmRcsw2ltguTdc=; b=36YpiODvk1x+O5tdeASCtr78UQIeYOQATDiDxXSEEUEdku6SuEuWBik9Fmcz12naO/om DCSwVG6vNdv6FHwUQ+oDhO4R8KmI7cziEZ/M/CPGhESCpySUh4PhrwK2O+dBOZ+WhEWEw oOv39U90yJBEAoPoF35iXw74EaSaoyLcKTNgZ7CJXkRwR8oGY/M9fwS0nzgBhfOPHTrjx NxyAaapYeCxHTxTITI0ZAPoFxd095GRn2hw8ATJAiKS4VqSJ7USR7j2yxjwjjHC1+A1jj lgw2OZ/qgi3Bom0RNJ/OsHPengZOef13IbBoBJhGi807L2G/Ly1EE1LzHC3tEmOtcdQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=O0Jj48vt; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=H2UOECkM; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65491606A334 for ; Tue, 1 Dec 2026 09:34:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65491606A334 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=O0Jj48vt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=H2UOECkM 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 6B1896ZG2580257 for ; Tue, 1 Dec 2026 09:34:34 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= Sn0Pz8+Wxic8UvLElJ5g7oLLroP87CmRcsw2ltguTdc=; b=O0Jj48vt/kk/oRzm 8vNGOvE3U79amAQt0THVVc7LGMAySc40YlOWOcVyzi3dFXQf2eQoZQOLtvHtlyKy RiJPA2MaLpryO0GGcLyPolqBapiMOTEZGixW4x3EwY5+d+PWM3SNWtNcHNNYgqCX lZxSKwbYfpqSB3KOtRMFizQDo6Zmsc70Hvr01rcIdtGTEopT2FcXuPUSNrsxq/ap rFStwfyQ4iUe855c7R5WgC9hSqEEqMMWSwy9D7iy46HXMyRYPaioT5xDmbbVXh8z woa5lzkce+tDaj2hQFH0IODzXcjzeKwkeQUe/eLHELFm4T15rVKDj1VYTT8RUa/q DJEtAA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9cd3kqwd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 09:34:34 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ee2d612733so87195325ad.0 for ; Tue, 01 Dec 2026 01:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796117673; x=1796722473; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Sn0Pz8+Wxic8UvLElJ5g7oLLroP87CmRcsw2ltguTdc=; b=H2UOECkMwOgq0ScCl5YOa8C+oTxM8xvkXNGlIS1kL1tIhWaFUwG9WrQ1tXrlR7VgtN 0vsI/y3mPA9ku4YUp+kIysBNiZvf5qUkogOGjm5QODPHsU54QCancDIpL9wtqf6HISAF 3cIC+D6Ck3aiDYsJnoecBBLJHJGWmZLyJeHlO7TQ2lmt1koen02LahlbEjoHiguwkI6T i3Np6lpJKdvmWOnCTsCrMHlEjn+Ophywst0oWZwYZABPAm2z7fc0c2zbSR6iHQzXPomC 1kFZ4QFJ5RdoN0OWVJns7WmAO/zEgEQOadgYFUtA9QZtV26Z1pMcL3cPtbEh13gk3Crx MGZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796117673; x=1796722473; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Sn0Pz8+Wxic8UvLElJ5g7oLLroP87CmRcsw2ltguTdc=; b=ZIGd145e6KIi5UFCAdEoYmDfgTFXBpR8oGjAL9f4l5//Z2Wowx/TQJIITmUMTmU3jh GCAaoWnHXC94XuFxnwuzAmYMdYDeTFLKgR+aLYeS95C8aNrWXuWZQwaR4bdh0bvmOjHU 4a9QBH1700v92OBSsedS0NSqwQYpCPSKteMXNj9YC63NlaTrE81Dz+kzKdFR3DkdIDtz ccKf0R4pHtcUk2BqsGMAMgGj8uwrPTlTn6qDkOCo+dHqXVpo+En6fDkVuw7OVcyMXjtN Qiyoo4QARzPhl82PFRwi+RngDj9yXyvTSKE/Euf7yvUVU/PsP7QpKyY6ePRDHvn8SAQI MEVA== X-Forwarded-Encrypted: i=1; AL+hErFHa4dwrVpMbS5CLoauJX/ZoSVqTBgCbUrw41rYfgHPWCFu5W560icunPvPdRlfcAmoBu/pN9q1reopyMk=@vger.kernel.org X-Gm-Message-State: APuU4Z+8fhxMgZAocUFnavY7+5VsJYMM1OPfZNsybxLP9BuszlMpB8cI UQRIYSdhqTs3GfZasztYslV84ApyJJA9Rmjo5jOLDS1c6SU/xYs8t/rw2V2uIcnp/RdmPRozr77 anw03rxkDyBmc3mHFOwoTiWjfriMKOiv9tNTgjUKRUBnQnL+UFjZ6xSCTrONuhCyIaTM= X-Gm-Gg: AZFdTZfcaLnCNvBmd5aUJtG3rrTphC1CjhJstM6E6b7CGaXe99TIpmJV1o5+rgcaef2 rV2SgH/D1B7rBxbAE/NoC8U4BbsndPCu7Knr5B0FulvpUDCoyfoRDwGk+Bd9SLEKVcYvmzr0QAi PEkPGg2etVPDY8NWLaqUV9WlcxOclCBGuvk8VjeoinoYXP+miQPswrjBHJdOgmmoYq75LlxRXym 1X7uhuV8TBRnyk3ClwwTJ5t51tCYCat0t1ztpkyol9p3hRfWxMzpw0NuFLjU3UPseJq7qJsuqqv gJhRqsa/p/LJzXAsOthqa5nTERQZGqPhc7RNBJmEegLaFxNoQkCWTmKc/1X6kFnW9m26oLmKYCD ykTFg92hf5vZrhaoWyRumFJBdwB71Bv21nN/7rZx4Misi7bLXCIfbA9xKdBLPUXwXV5IbsMsP3P DJSaRl X-Received: by 2002:a17:902:ce8f:b0:2f0:ea79:1280 with SMTP id d9443c01a7336-2f0ea791333mr136149525ad.41.1796117673165; Tue, 01 Dec 2026 01:34:33 -0800 (PST) X-Received: by 2002:a17:902:ce8f:b0:2f0:ea79:1280 with SMTP id d9443c01a7336-2f0ea791333mr136149275ad.41.1796117672666; Tue, 01 Dec 2026 01:34:32 -0800 (PST) Received: from [10.218.39.50] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0fe7f9d1asm81205545ad.54.2026.12.01.01.34.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 01:34:32 -0800 (PST) Message-ID: <501b7274-601f-454d-829d-82b1d0dc8ae2@oss.qualcomm.com> Date: Tue, 1 Dec 2026 15:04:12 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Vijayanand Jitta Subject: Re: [PATCH v5] iommu/io-pgtable-arm: Add support for contiguous hint bit To: Jason Gunthorpe , Robin Murphy Cc: Daniel Mentz , Will Deacon , "Joerg Roedel (AMD)" , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Prakash Gupta References: <20260921-iommu_contig_hint-v5-1-e7fbd1c3774d@oss.qualcomm.com> <20260924001502.GO1540250@ziepe.ca> <20260924225340.GC16465@ziepe.ca> <7ab6eab6-ec6e-47dc-b387-eb380e2e365c@oss.qualcomm.com> <52ba8a64-2d3d-4c3f-ae8f-54ab4f0f164d@arm.com> <20261009163232.GB14213@ziepe.ca> Content-Language: en-US In-Reply-To: <20261009163232.GB14213@ziepe.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: A6TXxZFt6csborNK7TEpOgPyBbmxYneL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDAzNyBTYWx0ZWRfXycfv5m3/lyaw x5IxJD5LdazirbmSbV7mecBp+uiEtFU1EEXLgiJSK1zOj78lOI82Iya8HmzpcoAbsA9tGpcj8sp A7ns6j+//iHfIABKKoxjiodGUzAlwBVguMcr4DVP/Yp+QTiMQtO2hz4eBYq/B1v7j3P4PbImwvJ bn+ErhZGNDPJ7kdl6Na4tE08LqUaGdHwkzOOWzgmLjMmx+dZgmoPgu16UfQhVMRZ5AMZVXa8Ptq Gd6ORtoUs01RdL1VaDERhaSAtwoGiFMO9Z3jLe7hwcC2kialYlQ1PU4g/O7Dlg5g4KaCUXtEqVP wbtdBLOa0Fl0jyOmlMz0KNVfXvci7aqztVJ3xSWRyB3ChCEr05n0+zyqcSBxWsS1x8Ku4kz1Wik lmbHlUBMasfF4Ry1+0UUChH6NmDHU5JaQvIeQY8/bgSHYOsynSAN8OMcP10/V4+5dVg5FxFmJbB mGEzVzWTYK7OnNRkiKQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDAzNyBTYWx0ZWRfX0RTPcu8VyCHd uJ974b9dyti6Ayod56OcoaWA636P2aq6Y2v3ldRLRfpCvoKJHK53tCASkjdt/66nZbdHBcrecVB OmzW0NLXA0muuVq6mJj/VKYSPLkqj5M= X-Proofpoint-GUID: A6TXxZFt6csborNK7TEpOgPyBbmxYneL X-Authority-Analysis: v=2.4 cv=HIhWhYtv c=1 sm=1 tr=0 ts=6b0e94aa cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=sG_tVPOB0uitxx3Vbc4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_01,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010037 On 10/9/2026 10:02 PM, Jason Gunthorpe wrote: > On Fri, Oct 09, 2026 at 04:37:08PM +0100, Robin Murphy wrote: > >> range size being unmapped, so even if the total gathered size exceeds a >> single command, we still wouldn't split it _within_ any single one of those >> ranges, only at a boundary between two unrelated ones. > > The question revolves on when the iopgtable path flushes gathers. > > If the gather only holds a single page size and always starts aligned > to that size then the RIL splitting algorithm won't cause an issue. > > It isn't a question of allowing CONTs to be split, it is about when > consecutive unmaps can merge into a single gather. iommupt is very > general here so it can create gathers with mixed up page sizes and > trigger the problem. > > For iopgtable we have several layers of logic splitting and flushing > things. I keep forgetting about this bit in iommu_iotlb_gather_add_page(): > > /* > * If the new page is disjoint from the current range or is mapped at > * a different granularity, then sync the TLB so that the gather > * structure can be rewritten. > */ > if ((gather->pgsize && gather->pgsize != size) || > > I didn't try to do a full analysis that it really is enough for this > series, but if size here is the PTE size including the CONT effect > then it seems like it could be OK. The gather has to be aligned and > has to have a single CONT size within it. > > My original reply was mostly to be taken as 'RIL alone isn't enough', > meaning write an explanation someplace why it is safe under the > current system. The commit messages for the SVA and my later fixup for > iommupt explain the general concept and problem.. > > Regards, > Jason Thanks, I rechecked the current ARM LPAE path. Partial unmaps of a tagged CONT group are rejected before PTE changes; a complete unmap submits adjacent tlb_add_page() callbacks at the underlying PTE granule (16 × 4 KiB for a 64 KiB group). Thus iommu_iotlb_gather_add_page() cannot sync partway through the group: any granularity-change or disjoint-range sync occurs before adding its first callback. So, I see this errata is already handled in case of io-pgtable as Robin mentioned. Thanks, Vijay