From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 AEDB03AEF4B for ; Thu, 23 Apr 2026 18:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776969827; cv=none; b=NlNo8O7OGE49lUL7YN22Ci/7+wH9nlwTYxShRwXyG9xk182SZe+xN6JSzAxcu0RyZ5035VXWdzb0p0A5GZ2j8h1p9MUbUhamv44tBwhFafRSvKYaLRwbQiHA8+LmqLcweNt09tpbX3HwhETjm5PvKGHWopcr5wjZe1+k9aa/jW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776969827; c=relaxed/simple; bh=0Lc2Z4djP+OFSIRCIs7YQs/PaAF5gbi+2NFb1IXfdPM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OJ084y4Xa3dFMwjq3n1RbGnOsGyjSZlc0smD8IFCXeNGdnwLWkeK+em6gyGUiFGBJS1Z8cXpu/MFo8bK7klbTyn8QC1/fR6RvcRjY1YDrbAzgCl7bzhxs8CzUO2iKfysetkrPl8SK5NZ9maus9rUO46r0QPUmD7e54VaAiY0jWA= 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=nvUNWJGd; arc=none smtp.client-ip=209.85.214.176 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="nvUNWJGd" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2b2591757fbso152845ad.0 for ; Thu, 23 Apr 2026 11:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776969825; x=1777574625; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0Lc2Z4djP+OFSIRCIs7YQs/PaAF5gbi+2NFb1IXfdPM=; b=nvUNWJGdZsTsqZeEfT9e3VnWkKQKBI4mEO1Dqh2cdNYlg6DbwYGnERUzP9cbeCS3PY tGx8tcZuZOxi/MBEUwPSScpmSa0misV1hAqpPoMujZke9QUhOXEf93KDekeNjp7j2LND HK34q+/8xm+s28sF2VgWM6B286kck/MdKF0EOvUCInbz3fC493GDxJxRvG5epnpog4cx Xr8HCimPrveV7JtPR40eq6/vJSAcKMpzr1HPNjwh47/6MKE86pqlkLdpfe0WNn0PxthS MicM46LgHOyIVmKvpjAR94ppK2dk+AUnyOM7Nm4vVEHIFbZZXRLvA612pdpOvFX0ANU5 uRuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776969825; x=1777574625; h=in-reply-to:content-disposition: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; bh=0Lc2Z4djP+OFSIRCIs7YQs/PaAF5gbi+2NFb1IXfdPM=; b=Tf0KsB0edhD5SJ9CStvPvZMnIO+mNS+bZxWo6yDF76coeGLGuTGB+B890Bq3eSTdhJ SeRwaYbA81T9wyd/VZskIXtlvi85sohh7lsoc0mmRejZyAIIaZI/JyKJpW0SG5fFNwrp vKIKvZBTvv4JUy5sW1/hDK5oYf/N1WF9N+MGXFbIfBXy0mSoaPu/UEkOqyvf+ntUG1+R /aoUK7J/tjqR9LCPim6rTuviQWkQs4V3ji+UGHIIev5JRdsf/m+hlKrOnVSDUem5XFKh hMNd+ptAb8kv5O9fNkHHSnnDr3+uH49EAQD08sNQNgZw21o6HoF/Y1AnambOUBNLObc2 3RuQ== X-Forwarded-Encrypted: i=1; AFNElJ8fpd28cT7jpPhr6EOR89FZxU8ItlvL1bv6PojlZ0RNx6aVvbV1e3mBUlytIgu6THBgxJKwDun/7AYXBl4=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3fbbKD60u0hf/6/bCUfmbFFNcFpAE9q1WVihjnewm37PUYjoY WRmI/SJnmf02EnFLXOO2Re6eeMDXT4OsmfFu0c+8hsGNICdE8qG4mYgZgrkxuadJQQ== X-Gm-Gg: AeBDiesVH2jNtyzPBCJQbwSBabcXhuy64dbjdQ+a6Sl8cTfPXTmoNfO3V1V4LZthae6 RFnSU7ze89R/+SqKJFPBmtCL1HC/FZukySxMyEWkv5psdnHpQ5Gx8Y+XwBNI2hrdHolyKjELc+4 FDzZvMTB0n7YgK0t9ruSpq1TjrYAkWKQlxzO5haGtJNM4EIQyQC+7c2NqhQ9aX2FTWI3o6emdql 9ZtxawqBgpSIsZoGc8ZX4tg/V62ZW1Sph8EdWTPvU9tzYNykKLi7QzwrbEzNWpxe2op5BmkTkmm 8EPJ2UBy3fsE/D6QuyOmSOgJ0ga5hdwwQ3U6gaT04+5GwRFhJ/tfSppSvgN6+/332G3duWzKKZh QWxsgUl20uAJmtqw8zX203NQ4HR4ltTblrmq5AqYltGaFFNlE/teLwrXfkO4WDjsjAx/uXMuehm sqU0IM0FymF/M9a5YJY0EnxBBLTwUFvrVk7m1kcn5RSUkGv53u626pKDLUsQnHoskDAiJhkJxah Mc+q7eLr8c= X-Received: by 2002:a17:902:ef52:b0:2b0:d1f4:f601 with SMTP id d9443c01a7336-2b603f688efmr1861455ad.15.1776969824338; Thu, 23 Apr 2026 11:43:44 -0700 (PDT) Received: from google.com (195.236.83.34.bc.googleusercontent.com. [34.83.236.195]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3614195a9f0sm20471832a91.9.2026.04.23.11.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2026 11:43:42 -0700 (PDT) Date: Thu, 23 Apr 2026 18:43:37 +0000 From: Samiullah Khawaja To: Will Deacon Cc: Jason Gunthorpe , Evangelos Petrongonas , Robin Murphy , Joerg Roedel , Nicolin Chen , Pranjal Shrivastava , Lu Baolu , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, nh-open-source@amazon.com, Zeev Zilberman , dmatlack@google.com, pasha.tatashin@soleen.com Subject: Re: [PATCH] iommu/arm-smmu-v3: Allow disabling Stage 1 translation Message-ID: References: <20260420123221.20801-1-epetron@amazon.de> <20260420124032.GO2577880@ziepe.ca> <20260422064431.GA49867@dev-dsk-epetron-1c-1d4d9719.eu-west-1.amazon.com> <20260422162351.GK3611611@ziepe.ca> <20260423142326.GP3611611@ziepe.ca> 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; format=flowed Content-Disposition: inline In-Reply-To: On Thu, Apr 23, 2026 at 06:07:23PM +0100, Will Deacon wrote: >On Thu, Apr 23, 2026 at 11:23:26AM -0300, Jason Gunthorpe wrote: >> On Thu, Apr 23, 2026 at 10:47:49AM +0100, Will Deacon wrote: >> > > Does iommu-pages provide a mechanism to map the memory as non-cacheable >> > > if the SMMU isn't coherent? >> >> No, it has to use CMOs today. >> >> It looks like all the stuff dma_alloc_coherent does to make a >> non-cached mapping are pretty arch specific. I don't know if there is >> a way we could make more general code get a struct page into an >> uncached KVA and meet all the arch rules? >> >> I also think dma_alloc_coherent is far to complex, with pools and >> more, to support KHO. Agreed. dma_alloc_* is too complex with pools, CMAs and what not to support fully in KHO. > >I wonder if there's scope for supporting just some subset of it? We have been experimenting with something like this. We have a usecase where memory needs to be preserved but we want to avoid invasive changes in the driver. If it's not a crazy idea, maybe we can start with a very limited scope of providing preservation for a subset of allocations done through the DMA API? I can send out my proof of concept as an RFC after I'm done with the next revision of my IOMMU persistence series. WDYT? Sami