Re: [RFC PATCH kernel 10/17] x86, dma: Allow accepted devices to map private memory

From: Jason Gunthorpe

Date: Wed Sep 16 2026 - 08:54:27 EST


On Wed, Sep 16, 2026 at 09:51:50PM +1000, Alexey Kardashevskiy wrote:
> bool force_dma_unencrypted(struct device *dev)
> {
> /*
> - * For SEV, all DMA must be to unencrypted addresses.
> + * Require unencrypted DMA unless the device has been "accepted",
> + * enabled by a TSM driver to DMA to private encrypted memory.
> */
> if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
> - return true;
> + return !__device_cc_accepted(dev);

I want this out of arch code, after Aneesh's recent rework Nicolin is trying
this approach:

https://lore.kernel.org/all/abddd433493324a6bfdf8ba9710e96d90f0d1ccc.1789010941.git.nicolinc@xxxxxxxxxx/

Jason