From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 9B8473E2769 for ; Fri, 10 Apr 2026 17:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775843022; cv=none; b=MQnIqbS/d6aicQQiZeR2uTCA8b2U1fILFqlri2y7sIfrhP1Fnvp0TMJyo+/SijDMiJqCFfZ/U/Iecx4uXgzIzqAVkfRIXqai5L39GIF++aFLSsD7ngqnpSYS3r58fZO23cULHUOFcU9R8s1/nGnMAZ5frnhjNpeKsm/mjUEAiNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775843022; c=relaxed/simple; bh=yXMuCez+Y1TijpAtB8Z/VDNIXHswjBW8rCfBsl6YFmE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ezHX4NZaaMC567k4levFIdmk+y1D9cc+9faF97Jh+Q8pwQGrO7hD+hzbuGpvrFtzXuZ0ThMLP/2jrfeSUqCKPL1tLP1lQbTrMJAEv+MMrCVQHfWoj+SjpMewci/qf4hm2gBT2hcZ42vaPGsOZrKg1o33XMD+agRiNZsyzIZ/V+c= 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=ce+Q0Fvd; arc=none smtp.client-ip=209.85.219.50 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="ce+Q0Fvd" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-8a3342d301aso23456016d6.2 for ; Fri, 10 Apr 2026 10:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1775843020; x=1776447820; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Ihjmb9fqpNxu98y21D0TZBc6/21aqzIUurPov8MZIpU=; b=ce+Q0Fvd9p40M0Rqc5I1Nmi0sGPrbIKFmdl54Xa9fYd14OVvsUy2FOk9SEr850fVq8 YIXQ+TGbAgKHVuD+DptwPYd/0AIZDRPU5VQBxN911aeOOJfHdGac2PruNzBanuJL2Cox HUiBP/fvChVR7T4BYBtD6ebpMU6y5jmxmNKQAxffCn6kydK3DuTOD7DlZuq0L0hqcKZo usKY/SuG0NHBi5AHydnBS93oFMXWW3st56rXG+HULzIVzm4/UdF/u1xVRPj751pfp3Qq aWHHcW1UjXJVqQfCXb/b+DUBnVXIu2NAaoMm8Ti2GTsIhMskUEsWXDOPoa4SbcrDckVb +a1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775843020; x=1776447820; h=in-reply-to:content-transfer-encoding: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=Ihjmb9fqpNxu98y21D0TZBc6/21aqzIUurPov8MZIpU=; b=rjuoJjjViqe5KNRhvmt3ho+3zMPuRhSxYMYhomc+2LWntPDM+FSvjlDOJJE2C6SVZG Xc+PdJ16xOF0mC81LTgiJE9qjh99T8v7RIjSKBBccO7E3OK1RkvQ8r89CM98RDYzq0qd DqSdCl5F4WkAd/FYS/o5XO6JxqXmXsNZ/tjstqWzP3/iA68ApXxpYVgLp4zMTyYxOg4N AcSufM58JBlq+NFi+Fp4ZR1mNW13DElJLOTFE9Abg02JHLnNTnBc5b4QUDdNxcSW8eMl GD0S29bZtPFZ7zUt4k6iUiAUfXAfHHM7j/ShdfkGCi+3dVqzATPk3GDjLCu4XtvGdCau tuXw== X-Forwarded-Encrypted: i=1; AJvYcCULdISY+3RAfYq1J8csqsN8C/5gfoVG85Mov2wU2WlBG2fUKP+qwjb+Uhtn5m1QjbWXFxi8//qXBJBm+ZM=@vger.kernel.org X-Gm-Message-State: AOJu0YxKhg+S6a+dQc241uAlgeJbswAPNghzJUWEHCL1QhHFpVaH+T4V kZg455a8cgqIKMlmJ7hBSAepCI6wXVWW2/U6ZsxlYYsbxl7rJBYCL715KMpeOA0WRxCP9+3hYRI 7Gs9b X-Gm-Gg: AeBDievQX6tOdAEI5nlUQig0zM84UU/c2jzzYln0AJ0WTSBukqUxu5y+U5WAHcLlEWr briGOrBupXyal8s3FTyJNTeKVqt8y+f7YiCrzH13EHHFleJyxiOlKZlqhwiR9ssBN5A9Y0rSf4X xSgIUtsyAUnfuYCm0kj17io10aO4RQPRpNGzM0Tgozs2gjM8fOceSDvi4iNr9fPhHbQq8nGhb/z 7ylIbgdCQTDuRn0BgVNYjiXsGMYkXfzZIVjqlAmM1nZutEqq3nOkC5SUNw9A/ef3l70tAM+hZlo YXV3p66heuW/dT//h7SjZr8jpE1iP3HoqtlP8aYFhjLY5rD1Xm5Lo6A4SNuUhb2xmfm21SI8n8t eqN88UH9KqAI3Zup29aX/0/8sBQMWflqPh8be2b++bKBp9d3DHl0IJNOXzBBJw7n82DkTHYT1Vk 7tI80qqr557zBCYpjjqqDjZ5HWWbl8OB1352DOpbQsPidjFCEmpoLSvxAJl1LUiiXGyx3btg== X-Received: by 2002:ad4:4eaa:0:b0:8ab:4ab9:bb50 with SMTP id 6a1803df08f44-8ac8849104cmr54272066d6.37.1775843020363; Fri, 10 Apr 2026 10:43:40 -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 6a1803df08f44-8ac84d0c6d5sm28018806d6.49.2026.04.10.10.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 10:43:39 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wBFtK-0000000FIXi-47vO; Fri, 10 Apr 2026 14:43:38 -0300 Date: Fri, 10 Apr 2026 14:43:38 -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 v3 0/5] dma-mapping: Fixes for memory encryption Message-ID: <20260410174338.GC2551565@ziepe.ca> References: <20260408194750.2280873-1-smostafa@google.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260408194750.2280873-1-smostafa@google.com> On Wed, Apr 08, 2026 at 07:47:37PM +0000, Mostafa Saleh wrote: > Introduction > ============ > This is the third version of the fixes for direct-dma dealing with > memory encryption and restricted-dma. > > Changes in v3: > - Instead of extending the logic by using is_swiotlb_for_alloc(), > follow Jason’s suggestion and propagate the state of the memory > allocated. > - Remove checks out of dma_set_*() based on Jason suggestion > - Remove documentation for now until we are close to the final > proposal and add it later if needed. There are a number of Sashiko remarks that look plausible that should be investigated: https://sashiko.dev/#/patchset/20260408194750.2280873-1-smostafa%40google.com > Design > ====== > This series focuses mainly on dma-direct interaction with memory > encryption which is the complicated case. > At the moment memory encryption and dma-direct interacts in 2 ways: > 1) force_dma_direct(): if true, memory will be decrypted by default > on allocation. > 2) Restricted DMA: where memory is pre-decrypted and managed by > SWIOTLB. > > With a third possible usage on the way [1] where the DMA-API allows > an attr for decrypted memory. This [1] was merged now Jason