]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hisi_acc_vfio_pci: fix XQE dma address error
authorLongfang Liu <liulongfang@huawei.com>
Sat, 10 May 2025 08:11:50 +0000 (16:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:11 +0000 (11:07 +0100)
commit809a9c10274e1bcf6d05f1c0341459a425a4f05f
treed948c90f65ea1d70590087d3709d5c3d4496dddf
parent9543f79fe3acc19a658e9d6d6f4584c0228b6c76
hisi_acc_vfio_pci: fix XQE dma address error

[ Upstream commit 8bb7170c5a055ea17c6857c256ee73c10ff872eb ]

The dma addresses of EQE and AEQE are wrong after migration and
results in guest kernel-mode encryption services  failure.
Comparing the definition of hardware registers, we found that
there was an error when the data read from the register was
combined into an address. Therefore, the address combination
sequence needs to be corrected.

Even after fixing the above problem, we still have an issue
where the Guest from an old kernel can get migrated to
new kernel and may result in wrong data.

In order to ensure that the address is correct after migration,
if an old magic number is detected, the dma address needs to be
updated.

Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Link: https://lore.kernel.org/r/20250510081155.55840-2-liulongfang@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h