From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 0A542376475 for ; Sat, 18 Jul 2026 20:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784405505; cv=none; b=AX1AHauSVSlbk8WcDbFiS0QdRGh7sIbJGzoAwsJbvGp6da6ZSwakzFeOeHpNh2iJLftHVcBEGG/UQo4f54kVcvJrakGet+YVNN/IenBxk7Mr7WSvNbzxg/VYob6AJbNhOWFr5d0ZJ2svRIa78JjJuvC8ZI2ZnM6ZmEahR9kKPX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784405505; c=relaxed/simple; bh=rsYCqbczMV4w4qUMEvfd3jp4oJxT0/vk7KoPV4tloAg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hX8KI82pgygY1wxAkZfMxhPSpHl2GUgijgQuI63XKCWlTTc1NbNbY+fTN9CaDGwcAD0hbUyoMoXM8iLeMZAHixVEZmMo4XrGQZj56MwYQjgA5UxK1Ehq6mfDBSxeOIBMrh8WLpRw6XbTEPiXvysyLSfJz+gs1dvYjKJmOQXVse0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KkN/NQyZ; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KkN/NQyZ" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-493be0fbcc5so109665e9.0 for ; Sat, 18 Jul 2026 13:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784405502; x=1785010302; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yHFeM/dPfGA4sFtsC9fMsOxlubs1dV+bQ3yag0vQkBw=; b=KkN/NQyZiOYbimWC4FOBB1vZznZHInMAqOtZW83iooIyaXU2ngEqTwkTGsfdNiNl9w kZUpyOcbcLNcjvnEyaRAkjHbZSEugXfHC+fNAzZLQJ0GkAx4C/tiYWAI5q9aE93TdijD EmxGQ7CJ4TdQC7iFvhvipWp1uky1QAyELAYoa654BRwk7OP+bB5GTXSqzMOcOlyWRvWe bKQP31cTa+X5UoCfcK6pgplOxw/wAjJgoY3PUOQfgK5XjnRDr/l1Tt++M8nzfkIFqgYP 7VQshEWrwns0TjRe9qmBCOEvms+VEE0juIc1J05TSiUpL+tibHfsrG2zK9+MtIZh/LCm KTUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784405502; x=1785010302; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=yHFeM/dPfGA4sFtsC9fMsOxlubs1dV+bQ3yag0vQkBw=; b=VBlHPwW+0lY7jbhldn6LUjd4fgsfVxeLQ+hMupRZc7WJfdtfo2wpUlUFZCQCiobw6j ka3/1Nz28BuO5oumrrvLsAyFCAikjp8hsNCEXlQcYvAOX1t/1TzLvo7DwdQD29YATsHo OeHzm9WzWFb/0EMDofpRyPYVkLTpzAdq+G+IFSiFsHEAa3cCbdZJHOiokgkcdSlpUf0d oER//68FYC7GdYjVN2SCJ7AaM8Jj1CWJloSgyMgQTJVZYficII0Wz6MJ1EIAxbmnTkTN q8ToQy1maYewpJNUnn9pdJGP+Qlv/i45EspDKII7puaHlqqWJt6nGmCF3ccCVgJ5cS+d 8GwA== X-Forwarded-Encrypted: i=1; AHgh+Ro97tLl+/yWxSxymWVln4NxLtX2pONEO+aYEEg4hOyiAcLegKH+5k8bf34YVJpupRqz4M1MkCMq89qT61Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+8per4KLWhQp3eOdo4imHLtzWqevDxoeb6a1xqptRqW2ksz5V 0k58O57USw/qk7rr1N5cdwEBaqkbIr8QL2qfmNZ6uUG/GaXp5mTE5lElErpxTaTQ+A== X-Gm-Gg: AfdE7cmC/RDUwXc1nL0N5TzIQRhitLjDUSTR+k2yzThVcrbN5h5b2aMWUgbyGWSfQtY qR42Q2xDHaiXwnBH7hxmnA5QlRyLm/xvQOBjkW2GRPsbmdsU7iB2cr2WN+WtY8CkDzVa9EDSt/x LflO0QNkrYhbqJs4LFayjWqu6L8Fu8XnbNFsYpAKCJ7z2ihd2CGRkzIC5F5xs/8crg/kUqlpYT5 4LwfG+3LLH0MqiRycNvGRCcwvB+iLOB63EuPTOrjdEX+qOITU9baBhukylw/nX0+jNDPQ0KA/kk XRZRNVTJmDiCTqb3SXpTelqVy7SZ0WNbG5QLiThYIWsZeGUxpW5j0V8BBQn2WQP7iC+8wYO9PQQ dKiX0niAJocrN7hbfNAhHnHIsTSbob06cnkRfLctCYL6J7nt1oe4yxf2LvYGn/mwEL4juyHEiew s5SGG3c0FSJyDfb1fUi7nH/PGfVt7ajDnZ4Yj1Ag== X-Received: by 2002:a05:600c:3f0b:b0:48a:623c:8859 with SMTP id 5b1f17b1804b1-49550691e94mr1258705e9.7.1784405501768; Sat, 18 Jul 2026 13:11:41 -0700 (PDT) Received: from google.com (220.60.76.34.bc.googleusercontent.com. [34.76.60.220]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49558cb8433sm3398395e9.2.2026.07.18.13.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jul 2026 13:11:40 -0700 (PDT) Date: Sat, 18 Jul 2026 20:11:35 +0000 From: Mostafa Saleh To: Jason Gunthorpe Cc: Will Deacon , Vijayanand Jitta , "Joerg Roedel (AMD)" , Robin Murphy , linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Prakash Gupta Subject: Re: [PATCH] iommu/io-pgtable-arm: Add support for contiguous hint bit Message-ID: References: <20260618-iommu_contig_hint-v1-1-4502a59e6388@oss.qualcomm.com> <20260703161228.GA1948451@nvidia.com> <20260715113913.GA3775915@nvidia.com> <20260715122830.GB3775915@nvidia.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: <20260715122830.GB3775915@nvidia.com> On Wed, Jul 15, 2026 at 09:28:30AM -0300, Jason Gunthorpe wrote: > On Wed, Jul 15, 2026 at 01:03:22PM +0100, Will Deacon wrote: > > > From what I can tell, the fiddly parts for iommupt will be: > > > > 1. Hardware bugs / quirks. Some of the simpler ones could probably be > > handled but for the more invasive stuff like the Mali format > > format, io-pgtable will probably need to hang around. Perhaps > > it becomes io-pgtable-mali.c? > > I briefly looked at Mali a while back and it didn't seem so bad, but > that was for a GPU driver not the iommu so a bit different > issue. Exactly what the GPU drivers should be doing is less clear to > me, they don't really fit well with the iommu focused interface (eg > the memory preload issues/etc). > > > 2. The pKVM work from Mostafa. We'll probably end up with something > > separate at EL2 for this (ideally, just reusing the CPU page-table > > code when it learns about BBML3). > > Yeah, I'm not sure here, it isn't great that is adding another user > and open coding some of the logic (eg smmu_pgsize_idmap). It would be > much better if it could just use all the existing flow more directly > somehow. I was under the impression that io-pgtable-arm will remain the same, but if it is going to be removed (or at least the LPAE format) I need to figure out an alternative for pKVM: - Compile iommupt for the hypervisor (similar to what we do with io-pgtable-arm in the SMMUv3 pKVM series which compiles in both) I am not sure how easy is that for iommupt, I have the SMMUv3 iommupt series on my review list, I will check that. - Support the hypervisor page table in the IOMMU, that requires some extra support changes, I recently posted BBM support, but there is more as avoiding lazy mapping when unmapping, TLB hooks...). There is another problem with that for android, as we still need stage-1 as some SMMUs only support single stage (used with pv) - Write a small IO page table implementation just for the hypervisor, that's not ideal as it would benefit also from features as CONTPTE. I will look more into this, solution 1) seems the best case if practical, otherwise, 2) might be reasonable for upstream. Thanks, Mostafa > > > 3. Non-coherent walkers, although I think this might actually be fine > > because x86 needs it anyway? > > This is done already, the smmuv3 conversion I've posted supports it. > > > So, for now, I wouldn't require new drivers to use iommupt but I'm > > The recently posted broadcom driver used iommupt and I thought it > turned out very clean, it actually seems like less work to do it this > way than try to write your own page table like that rockchip driver > did which required several review rounds. > > Jason