Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 0AB3E3E6DF5 for ; Tue, 14 Apr 2026 13:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776174826; cv=none; b=KO46uDJH3ikl+QFL3qHSyd7VaPj6vCwBOoY2T6x16C3jqNbjLCits1GkI8juR1foTnKlup8e4NXs5rHBi7xXKgOZDDDFanL8FQ8fDaDYENmVP657Z8jRX5h6yB8VqXVcZpcNTuE3qSwqtsE8dEhaZJYiJ29B98HB1EFTzyXrS4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776174826; c=relaxed/simple; bh=agaeRtwkMA9kaPGKqOXGTWRQI0ciOIvM/jSTFUjl92g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tT9zWk9jOAzwNUXCj9c/ZTGoXyDlDEnJpZNuCx/L4oF2h4q3zfqwkZ8fN1hKYMMvcfYSc6k7M1lxc9pb69pUFICJEzJF1heaxv6db9vF+HfP2vD9+Xa+dmavKt9y1+tAjXc5eTWiJdq+KSeTjj5+Q0Pj3VrR7EB+ChjyKUQyhSQ= 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=ouUQ/1/e; arc=none smtp.client-ip=209.85.222.170 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="ouUQ/1/e" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8d933da14f0so611587485a.2 for ; Tue, 14 Apr 2026 06:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1776174822; x=1776779622; 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=7axfg4tAJWa7PpDSpQhlxF21z1bYy4oCdCdcYbJBzTg=; b=ouUQ/1/ew5Cbvo1qErkeVKVwYeGHgaXytq6QbmTz02QjxOv4P5QoKcVmuanD4kovKm 59YUIAvnHSRcudFEcV3UsaIyjbIM10mwXi8exrOAxra0mkJXGohuD8U4ZTA7SLfDbunV yqYAiSlYiduECfVYt/Mc8byCmG4fNBxS3WJlh9BoZkrMRR7NH6JHPUprF+OkcbBez0HF AGfwjMxJ7lTJ3zhPtj7c6syLJMzKCGJokBvV1EMm41myrUURn46xOB0DejbXQfMRB7zh jGKEx/6v20nIkPf/4VvdO0pwQESWWLghlwFFyd1YpSay7H9+gD6ZpwQeaIgh9C/rAc59 jyPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776174822; x=1776779622; 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=7axfg4tAJWa7PpDSpQhlxF21z1bYy4oCdCdcYbJBzTg=; b=k0LPuOaqNHbho5fxjhLNfi4hg1xaLiTKBLbnYTT69tob4MsPJLGNAUSrTd+fYdIC9z gdlJVY29iGlzpnfKg8zucXdlaTEaeSzk+uU1L+rqNC3vmCKPUBeOOCmx3vOM5C17rhk4 DDRbZFvNUKG569Dwu+bjYqCn4iyHR3QrKVU1yIpt4oMMszaT6tQpWDSOqHQv8mQE8XBf KvkiP8TY98kshceNLbKqy/egK+ye8PDAvxWJYQUlOz0SgEfumV46a2PFwhzKkj02376K fQX7nlIAHIxLT1X99lsks1Fj0xAU7BpoZeYadyBwMlAa6xllbeix0Z7Rq5CrRa+ePEOe UxpA== X-Forwarded-Encrypted: i=1; AFNElJ9itRyVKNSQWix/jbnrUFRoSvjasZSzhc9juaQVo3aEh21ieIF4NPdYRSuwyWQc5LpUmSMg0IVqVPOl4AI=@vger.kernel.org X-Gm-Message-State: AOJu0YwvVMx/gcN8GaTt6RJRFeiI+QgOQJWHiVgotO00WJyja8aIivqf Ch3UW2gX5M4spGgXPdOAhBLlLxZHEVfWfgM65yG5lIGFzKQLAdhSPPeDtovehZm4k27cCfdXLeW HTFXQ X-Gm-Gg: AeBDieuJrJznJ+OfIGFPbpbCbKeQ4yARHr2OXC0YcLP3wrqrdv8p+lqAhYbvQO9hQED T0eX5zUftjTHyq0OCE9dQR2Pyt4Y199vHnHvi23eUaOn22n4q9YV60AKsCyGqJ7B6Z5UqjsuL3p flxAFIl9+tkqEzSSLVImVr/m1YDJpRZpRJvOrN2PAmWjomJJv75zn0AXXcB2A9dxo/+Uknk7rUp XttMsGQdqsswZJkfgOfRE9d7RNY5EihY/44aBMM5Zv/TjDjntG+mNXu9HJ0k6db4uQKmTLj9rvg zcgBCM+TqWpsKX76/HEbXb9Rif4sEcm1XPsptlk/9tqsdH0qAbvnpP+modkmzDzc4AGpLBqPi+i FXZA8+utvdTsCWJ9WWbHMZyE2bSzIDdtfhGj7EHp2ZAn1kXQqnGar0/Fu4lUNX2ms5UTSRU4Yhq JHP1qBAOcd3MM3zO9CN4cG1MseCHVuYLW6HuOYraWij5vXx0CNQbB1gYH2AI4ipMcLyMoguxS0S 2H1Xj3p7oWGj1VJ X-Received: by 2002:a05:620a:4588:b0:8cd:9665:9ef3 with SMTP id af79cd13be357-8ddcd8f3ce7mr2452245185a.19.1776174822349; Tue, 14 Apr 2026 06:53:42 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8ddb6562409sm1117411785a.17.2026.04.14.06.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2026 06:53:40 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wCeCx-0000000B2yS-341Q; Tue, 14 Apr 2026 10:53:39 -0300 Date: Tue, 14 Apr 2026 10:53:39 -0300 From: Jason Gunthorpe To: "Aneesh Kumar K.V" Cc: Mostafa Saleh , 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 Subject: Re: [RFC PATCH v3 3/5] dma-mapping: Decrypt memory on remap Message-ID: <20260414135339.GB2577880@ziepe.ca> References: <20260408194750.2280873-1-smostafa@google.com> <20260408194750.2280873-4-smostafa@google.com> <20260414122208.GV3694781@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 Tue, Apr 14, 2026 at 06:43:49PM +0530, Aneesh Kumar K.V wrote: > Jason Gunthorpe writes: > > > On Tue, Apr 14, 2026 at 03:01:15PM +0530, Aneesh Kumar K.V wrote: > >> Mostafa Saleh writes: > >> > >> > In case memory needs to be remapped on systems with > >> > force_dma_unencrypted(), where this memory is not allocated > >> > from a restricted-dma pool, this was currently ignored, while only > >> > setting the decrypted pgprot in the remapped alias. > >> > > >> > The memory still needs to be decrypted in that case. > >> > > >> > >> For ARM CCA, we cannot mark a vmap address as decrypted. > > > > Why not? pgprot_decrypted is passed to vmap, why can't it work? > > > > > I might have confused you in my previous reply. What I meant is that, if > we do not have a linear map, we currently cannot change the page > attributes. I'm not sure that is really a CCA issue.. We have an API design problem with set_memory_decrypted(), it needs three flavours to accommodate all the different users kva void * cpu memory struct page * physical mmio phys_addr_t Currently these are all being muddled up with quite some creative mis-use of APIs. The DMA API should just call the page * version and not invoke page address. I guess this became extra complex because Intel needs to track down the KVAs and wipe them out. > What I am suggesting here is that we should document this, or perhaps > handle it as a separate patch as done in [1] by explicitly stating the > challenges It should be centralized.. If we had a struct page argument version it could do the page highmem check and fail with an appropriate comment. This shouldn't be sprinkled all over. I suspect it could all be made to work even with highmem without alot of trouble. Jason