From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 8E89B2E65D for ; Mon, 5 Jan 2026 17:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767635607; cv=none; b=qrXgt34u742THbt4yWSoq/AOCt/umbCTLG4oqOnx+fi348QF1PZ3jslXlskXie/HlQE3G7DAP21c0LoPIOua0Nmmhq0yMEBQcea0Nuij9hoYbHi+yi+YXlDWvLYFo8Ye8NiTBRHQZGw06axvU28u9E92LwurTKROwV4tFjMWtaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767635607; c=relaxed/simple; bh=6oExjFrcLVcafthRfmrHDyoj1J0W9+IDJveHTTU+UM8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ml/gRy08dB3Lioba7BV22vGFSMu7V6UvYTCiXzGXzvUzy4FCo4gxkT6OdWSB0DHiiWKjE2IlXLwvfV2ooJtrSvInLpGuZ3evcaQQaYpuffJXcXUKtIt70kZTKD1nPuUBZPDgp5kBjVG6cIZhClEhQ7ScM3K/qoT1daG+/LBQv8E= 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=jAf+YnwM; arc=none smtp.client-ip=209.85.222.169 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="jAf+YnwM" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8b23b6d9f11so14951085a.3 for ; Mon, 05 Jan 2026 09:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1767635604; x=1768240404; 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=6oExjFrcLVcafthRfmrHDyoj1J0W9+IDJveHTTU+UM8=; b=jAf+YnwMyhpn5/ewjTgreqnn6Llp/uKJOTX9mblOaO+DZ7GMGFZeSG/3p1CllCTag7 4O9HpF9tf8QzjKPMHbocaosOMLwZVCbk7B48aUirzl7gAivukGlgHlwAUWrtnBs6KGgW rqhozxZ9tTBHFzmETbAByNwIpzlLWCjL5lHzCFu5tplGMRrv5D5baLenvsIEo9aW4HwW +NLsa4+8OVT4Fmd8lHnroZ4YuNv4Uqe0veCes1lfsH410yKZyQw2tw07T1RQra1ZzHUd KV0l6r14AGDDHsTcwhQl4o3uWVVA3N8cwn/U+9hCLk/ECmLcLvN3BZyeh+SRYruhvFhM sG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767635604; x=1768240404; 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=6oExjFrcLVcafthRfmrHDyoj1J0W9+IDJveHTTU+UM8=; b=FtusH8/wHVqFpNhcb4TbEmeCnM/uejLaCb/8ADwQ57Az2/KZB5pK2SWEj7rrvzHitl jxXy4hyiZU0WHbVNA8KgWBn7R5SyeWMeLN6XBKNl/TRK3cRpN2K3x0gbPGsflhwgzZn3 STgHy/g75DQSvUOdgCfv4Icr5LrgF2+Uglu5FtQDVjK6Pclvmv4stiLfduLVTFRxiVte /dls1dmCbaXWRZKap1mLX5zfskTgr8jhHdezlaIcOzV6ZRaz/eyXOEAEsJrn4g01yBeX qeaq3jBFIpXgmSLqbxOrigTipeIIaA5mzaZv9qc4ov6ARSlGgZgxRXTyvt108nLcUxww JCEg== X-Forwarded-Encrypted: i=1; AJvYcCXE9dkAXiUnB+T3GunlNIlYXYPjq0m2h4s8Wu0h5JAvxf4M/rF2WBbJI3ol/5t8HZQ5QyEZvRJgY9uER+k=@vger.kernel.org X-Gm-Message-State: AOJu0Ywu1JCNCRJBGlH6dH8M2GogDmS6w1Ej2D2FWsWmTRDoRzgoDKBj LcossO8Lz7eK2DLEEj7ZsUFYmO4NTmcayk+6V4LuzWRzozbRCN5FfZsDX7dY3Utqj4M= X-Gm-Gg: AY/fxX65g1L/tmUcN41TI5D3LXwtURBax2YVGRsqW3axFgr3cwj2/0pzVK9vi7oMLXf E35VmAxaKc0M9T/dGiorwnzCQtgodiXnG5Hg+7SK7qmXrPr8SebSeCsQpit3TmCr9AW8CaKw0H3 3W+7GhJLxPd6aKITlPNSJ+tzWpscRmISFkHQaef0qOIPeSdyUYB63PpXeyW9lfd0uJ57QaxNxRR GBmJztfMojtK3ayVDzopSC0mgnA20mRVA20rZPPWO/80q2ArLn9a9LgJ92mZBwplcIj1i8izxgg bBrJJl2zZpGPbok07r6AfAhjKS/tDcj7UE/8sm0juqe+qRj12nFBcXD479wxlFw/6CVMqSMyudL YuEvF9XCcWm3CEbTvytSj1FQBFXRl2Ia5cKxffGjjJt7WCZrHSnfN9UZQtCKlWVhlIylGj0mqv7 JDOPYIxvUMtsXq1o8Atr7WyXwiwJFAEkMn1y5XuPEsqyWOJrrpM0p9g3bzJjNeNnX96pM= X-Google-Smtp-Source: AGHT+IESZ3ULwHuALvq/u4YvHXFCCMVmARAtgn9Kh85N0zEp0zd2NOjJk/m0lLMQOwoGO1mknCPiIw== X-Received: by 2002:a05:620a:2952:b0:891:d993:1bdb with SMTP id af79cd13be357-8c37ebe9cd4mr51644085a.86.1767635604411; Mon, 05 Jan 2026 09:53:24 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-890755326easm3346286d6.32.2026.01.05.09.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 09:53:23 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vcolf-00000001Bae-1S4A; Mon, 05 Jan 2026 13:53:23 -0400 Date: Mon, 5 Jan 2026 13:53:23 -0400 From: Jason Gunthorpe To: "Aneesh Kumar K.V (Arm)" Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Marek Szyprowski , Robin Murphy , Arnd Bergmann , Linus Walleij , Matthew Wilcox , Suzuki K Poulose Subject: Re: [PATCH v2] dma-direct: set decrypted flag for remapped DMA allocations Message-ID: <20260105175323.GF125261@ziepe.ca> References: <20260102155037.2551524-1-aneesh.kumar@kernel.org> 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: <20260102155037.2551524-1-aneesh.kumar@kernel.org> On Fri, Jan 02, 2026 at 09:20:37PM +0530, Aneesh Kumar K.V (Arm) wrote: > Devices that are DMA non-coherent and require a remap were skipping > dma_set_decrypted(), leaving DMA buffers encrypted even when the device > requires unencrypted access. Move the call after the if (remap) branch > so that both the direct and remapped allocation paths correctly mark the > allocation as decrypted (or fail cleanly) before use. This is probably fine, but IMHO, we should be excluding the combination of highmem and CC at the kconfig level :\ Jason