Re: `AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=y` causes AMDGPU to fail on Ryzen: amdgpu: SME is not compatible with RAVEN

From: Christian König
Date: Thu Oct 07 2021 - 02:14:40 EST


Am 06.10.21 um 21:32 schrieb Borislav Petkov:
On Wed, Oct 06, 2021 at 02:21:40PM -0400, Alex Deucher wrote:
And just another general comment, swiotlb + bounce buffers isn't
really useful on GPUs. You may have 10-100s of MBs of memory mapped
long term into the GPU's address space for random access. E.g., you
may have buffers in system memory that the display hardware is
actively scanning out of. For GPUs you should really only enable SME
if IOMMU is enabled in remapping mode. But that is probably beyond
the discussion here.
Right, but insights into how these things work (or don't work) together
are always welcome. And yes, as 2cc13bb4f59f says:

"... The bounce buffer
code has an upper limit of 256kb for the size of DMA
allocations, which is too small for certain devices and
causes them to fail."

To make the matter even worse, bounce buffers don't work with APIs like Vulkan and some OpenGL/OpenCL extensions.

In those APIs or extensions the assumption is that you can malloc() memory in userspace, give the pointer to the kernel driver and have coherent access with your device and the CPU at the same time.

In other words you don't even get the chance to bounce the buffers between CPU and device access because they are accessed by both at the same time.

Regards,
Christian.