Commit 1c178ccb authored by Giovanni Cabiddu's avatar Giovanni Cabiddu Committed by Greg Kroah-Hartman
Browse files

crypto: qat - fix DMA direction for compression on GEN2 devices



[ Upstream commit d41d75fe ]

QAT devices perform an additional integrity check during compression by
decompressing the output. Starting from QAT GEN4, this verification is
done in-line by the hardware. However, on GEN2 devices, the hardware
reads back the compressed output from the destination buffer and performs
a decompression operation using it as the source.

In the current QAT driver, destination buffers are always marked as
write-only. This is incorrect for QAT GEN2 compression, where the buffer
is also read during verification. Since commit 6f5dc765
("iommu/vt-d: Restore WO permissions on second-level paging entries"),
merged in v6.16-rc1, write-only permissions are strictly enforced, leading
to DMAR errors when using QAT GEN2 devices for compression, if VT-d is
enabled.

Mark the destination buffers as DMA_BIDIRECTIONAL. This ensures
compatibility with GEN2 devices, even though it is not required for
QAT GEN4 and later.

Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Fixes: cf5bb835 ("crypto: qat - fix DMA transfer direction")
Reviewed-by: default avatarAhsan Atta <ahsan.atta@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9ff4de5b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment