From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 3FC623E3C5B for ; Mon, 30 Mar 2026 22:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909737; cv=none; b=jKxA+29gVNNA9fSfUuh5ftTh83Vij6bmYkiwKWTBC2CsCcyaDLKaFsAKHr2DdLSxA81V4gaBK9uoGIuACD+e+41LCViljeIiumyU0GnTLtKlv24s9j2yV1zKre9+V4emj83QYRTm1IBQoZAatnHozqVmfp0wJYj54y6AlO/vq+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909737; c=relaxed/simple; bh=p+8Uupnt4d/+fum8lNUjSILa9EMDBoZzvWnUvrHfUyw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NKu3FYZ56aGB0Sxz5TBBu2f+U7QUO8u+XuILc2Gb4q4NQIiBpbUFexiXTlGqhGGOl5WX2+oYzH2TnEZQwfXLmIsewSZa6G5hSYMD+L/NYKJEC7YIM/8qk5YLNITaqgywOZj/KK2hcOYfiL/i1XH3mLfMoBxl3iaeiEXT12gNABs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=n+jxZWvx; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="n+jxZWvx" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-506362ac5f7so44689601cf.1 for ; Mon, 30 Mar 2026 15:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1774909726; x=1775514526; 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=0UUV3PEcejCNm1YkzvFVS2EpjraVSJNH9BjQE9qLyas=; b=n+jxZWvxIklu/ewwikrfO3th5dYd4Pc2r0ZbfcLnHofbPyEU7g5gh4A4R6I3ZFqkPS MlcOfvbDx1bNKeJo92Z7aS6sROdG7clNrwTRUkiK891ZMi3pT82lerSMHWVWRg0hbBH6 V8X/wMsyvmhRxz6gnk1Yr/1VeGzrmMxRbQnAH5Yrm6TlE+1exWM4EEIZiJSIsxDxblXg PSnyZs6OgDzef3zy7w8IdBn39fzTpRr9gi3Vzb40aq/k3pSpw+px7Xkt9SZV30OB/waa A6UjCPMuEnyycOcKzWEunFSyRpPvfA/FknyR/KAYA7k9fiZ6sMc3HeqjuLStgVAMh8F6 BAWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774909726; x=1775514526; 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=0UUV3PEcejCNm1YkzvFVS2EpjraVSJNH9BjQE9qLyas=; b=s0vPMSJOmZjh6GxSrtXBsjKg9AsMFdkokbUg0TVLpRGvygEv6XZsH+GZmsHF6YPVw8 P17ExOLl3g2sPkWg32rzY9ynhEVFYBFfqPZNEq1/AoaQQ3lXeP8nsn6J44faUAxTfqBi G7ohKtxvhm6ucvgcr2z/1NwvIqBtxnLXbYjKOY253vuABpWIq0SMejeLxCPzkMo6IAC/ xH/GOxiM+lb0q9M083Cre4Ilm5qiVG1VWzdQlPsWtuHssZuR/xo/ZGHZUMs6/PPaGgFn 3giGyyTRtcvVzX2GD7d5wmQf67q608B4sq9uUm0p2GklLMIDiP1colXpP9q0LFvUXwFe D5tg== X-Forwarded-Encrypted: i=1; AJvYcCWqwUMIGYxLk0kT3l53K7dffjAvNidKpXVOaLbSRY2iQvBDeys34ZbwcZQdIZZs9CXcqDtVxKpzO9Ssyjc=@vger.kernel.org X-Gm-Message-State: AOJu0YxRQZLN/0jky4Vs9TI4yeQr7SJkAg21v/OQK8VYpDrxgy3+SAYK y9MFKRpStPihqP1prbRu73KPKRGACni09wcd6kp0GTpo0AAW2v6VC63kbpvy5RFJu1A= X-Gm-Gg: ATEYQzz745MZhUIzjQ/fJSlzQTkSImbMfABSDtYm19+ebwh5xKOcGGz8PI2LP8lIoOo 9zaAnwQNbtD18MJs0lDWTxeQ1lfwlyyKOLYc0o0MAGZpDd3euK6bdy8mylqS7KvArJ+SlLE8Crp HFyQVOvAPQSFRj9stsDMlJSPA/hbR1CtGZ1RXsVqfzRYtTgyYoCoz/GkOK5EBph3IrhQh+v8jH9 er/BIl9C9xMjnecGoXxe2NF/52II4jJYYMJFmgDF1shGAUBPar+OXjX8o+P/CfSZtZzRHo1fUOW jFaOIi41OZgfkmcLbwWgKmokkVfg2hFBB213u0bVM6JmIOYQtgUzUph5lXxpPVZDFS9BO/MNpgT WwLEl4YGLHQZcOLm4QkVVtoUuVsIKnv1xUKkLjUI1nfmV2DbkrsJFqEbPxbf+mdeIL3Zb6q7TSq iib314sEEsRMVTXgV66A/y3XzRb61ChD3v1MXxKFEwwm6bsdk4cAdJLdI181ASiHuvyoIZt+F7q xn+k32g X-Received: by 2002:ac8:7d04:0:b0:509:20de:4acc with SMTP id d75a77b69052e-50ba38b218emr197186911cf.47.1774909726005; Mon, 30 Mar 2026 15:28:46 -0700 (PDT) Received: from ziepe.ca (mctnnbsa70w-159-2-73-22.dhcp-dynamic.fibreop.nb.bellaliant.net. [159.2.73.22]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-50bb2ddb083sm73544731cf.15.2026.03.30.15.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 15:28:45 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1w7L6C-00000005Hhd-0RZG; Mon, 30 Mar 2026 19:28:44 -0300 Date: Mon, 30 Mar 2026 19:28:44 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, robin.murphy@arm.com, m.szyprowski@samsung.com, will@kernel.org, maz@kernel.org, suzuki.poulose@arm.com, catalin.marinas@arm.com, jiri@resnulli.us, aneesh.kumar@kernel.org Subject: Re: [RFC PATCH v2 2/5] dma-mapping: Use the correct phys_to_dma() for DMA_RESTRICTED_POOL Message-ID: <20260330222844.GG246076@ziepe.ca> References: <20260330145043.1586623-1-smostafa@google.com> <20260330145043.1586623-3-smostafa@google.com> <20260330150903.GB809900@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 Content-Disposition: inline In-Reply-To: On Mon, Mar 30, 2026 at 08:47:41PM +0000, Mostafa Saleh wrote: > > The force_dma_unencrypted() should only be done way up the call chain > > where we decide to get a phys that is decrypted. Once we have a > > decrypted phys it should be carried with an annotation throughout all > > the other places. > > Can you please clarify what you mean by annotation in this context? > As I believe any tracking in the vmemmap is a big NO. It would have to be a flag pass along the phys, or phys & flag in a struct or some kind of approach like that. > As replied to the first patch I can attempt to implement this approach > (by passing a flag around) and see how intrusive it would be. I'm less concerned about intrusive and more about making this understandable. When we reach a function with a phys it should know what that phys is, not call a bunch of random helpers to hopefully correctly guess what it is, that's unmaintainable spaghetti even if it is fewer changes. Jason