Unverified Commit 40c3b22a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8058 Intel: Backport QuickAssist Technology(QAT) live migration support for in-tree driver

Merge Pull Request from: @allen-shi 
 
Intel® QuickAssist Technology (Intel® QAT) provides hardware acceleration for offloading security, authentication and compression services from the CPU, thus significantly increasing the performance and efficiency of standard platform solutions.

Intel QAT in-driver supports in [PR5526](https://gitee.com/openeuler/kernel/pulls/5526)

This PR is to support Intel QAT live migration for QAT in-tree driver.

**Upstream commit list for QAT live migration from kernel v6.10(totally 10 commits):**
bb208810b1abf1c84870cfbe1cc9cf1a1d35c607 vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices
f0bbfc391aa7eaa796f09ee40dd1cd78c6c81960 crypto: qat - implement interface for live migration
0fce55e5334d380d8a09f80ba9c9b68eeea6971d crypto: qat - add interface for live migration
bbfdde7d195ffc9c10598055c449b24c50a0cd25 crypto: qat - add bank save and restore flows
3fa1057e35474c715608635a0bf7452397580bfd crypto: qat - expand CSR operations for QAT GEN4 devices
84058ffb919bf6a6aac24d2baf7fce442d24f390 crypto: qat - rename get_sla_arr_of_type()
680302d191b043cf3abe4076794de10171a4ca93 crypto: qat - relocate CSR access code
867e801005e9e76f7ae2d143fed0da440150c64d crypto: qat - move PFVF compat checker to a function
1f8d6a163c20751629801c737a8cfd06f2002b4c crypto: qat - relocate and rename 4xxx PF2VM definitions
1894cb1de656cfde345c3b2690e379be1eb9db96 crypto: qat - adf_get_etr_base() helper

 **Upstream commit list for QAT bug fix from kernel v6.10(totally 8 commits):** 
d3b17c6d9dddc2db3670bc9be628b122416a3d26 crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
a3dc1f2b6b932a13f139d3be3c765155542c1070 crypto: qat - specify firmware files for 402xx
483fd65ce29317044d1d00757e3fd23503b6b04c crypto: qat - validate slices count returned by FW
d281a28bd2a94d72c440457e05a2f04a52f15947 crypto: qat - improve error logging to be consistent across features
4a4fc6c0c7fe29f2538013a57ebd7813ec6c12a8 crypto: qat - improve error message in adf_get_arbiter_mapping()
5d5bd24f415516b212d56e8a66fffd40cdaeab30 crypto: qat - implement dh fallback for primes > 4K
f5c2cf9d14be283e5240c04d03ad96577d55f9f4 crypto: qat - Fix spelling mistake "Invalide" -> "Invalid"
140e4c85d54045ecd67f1d50fdad0fe2ecc088eb crypto: qat - Avoid -Wflex-array-member-not-at-end warnings

 **One commit to enable QAT live migration kernel config:** 
8bc5168b Enable QAT_VFIO_PCI as kernel module to support Intel QAT live migration


### Test
Test is PASS on SPR, EMR, GNR & SRF platforms:
Live migration succeeds with cpa_sample_code in qatlib running on guest.


### Configs
CONFIG_QAT_VFIO_PCI=m

https://gitee.com/openeuler/intel-kernel/issues/I9SBWE 
 
Link:https://gitee.com/openeuler/kernel/pulls/8058

 

Reviewed-by: default avatarJason Zeng <jason.zeng@intel.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents f186c1d4 8bc5168b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -22708,6 +22708,14 @@ L: kvm@vger.kernel.org
S:	Maintained
F:	drivers/vfio/platform/
VFIO QAT PCI DRIVER
M:	Xin Zeng <xin.zeng@intel.com>
M:	Giovanni Cabiddu <giovanni.cabiddu@intel.com>
L:	kvm@vger.kernel.org
L:	qat-linux@intel.com
S:	Supported
F:	drivers/vfio/pci/qat/
VGA_SWITCHEROO
R:	Lukas Wunner <lukas@wunner.de>
S:	Maintained
+1 −0
Original line number Diff line number Diff line
@@ -6419,6 +6419,7 @@ CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=m
# CONFIG_MLX5_VFIO_PCI is not set
CONFIG_HISI_ACC_VFIO_PCI=m
# CONFIG_QAT_VFIO_PCI is not set
# end of VFIO support for PCI devices

#
+1 −0
Original line number Diff line number Diff line
@@ -7097,6 +7097,7 @@ CONFIG_VFIO_PCI=m
# CONFIG_VFIO_PCI_VGA is not set
# CONFIG_VFIO_PCI_IGD is not set
# CONFIG_MLX5_VFIO_PCI is not set
CONFIG_QAT_VFIO_PCI=m
# end of VFIO support for PCI devices

CONFIG_VFIO_MDEV=m
+4 −1
Original line number Diff line number Diff line
@@ -10,12 +10,14 @@
#include <adf_fw_config.h>
#include <adf_gen4_config.h>
#include <adf_gen4_dc.h>
#include <adf_gen4_hw_csr_data.h>
#include <adf_gen4_hw_data.h>
#include <adf_gen4_pfvf.h>
#include <adf_gen4_pm.h>
#include <adf_gen4_ras.h>
#include <adf_gen4_timer.h>
#include <adf_gen4_tl.h>
#include <adf_gen4_vf_mig.h>
#include "adf_420xx_hw_data.h"
#include "icp_qat_hw.h"

@@ -296,7 +298,7 @@ static const u32 *adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev)
{
	if (adf_gen4_init_thd2arb_map(accel_dev))
		dev_warn(&GET_DEV(accel_dev),
			 "Generate of the thread to arbiter map failed");
			 "Failed to generate thread to arbiter mapping");

	return GET_HW_DATA(accel_dev)->thd_to_arb_map;
}
@@ -487,6 +489,7 @@ void adf_init_hw_data_420xx(struct adf_hw_device_data *hw_data, u32 dev_id)
	adf_gen4_init_dc_ops(&hw_data->dc_ops);
	adf_gen4_init_ras_ops(&hw_data->ras_ops);
	adf_gen4_init_tl_data(&hw_data->tl_data);
	adf_gen4_init_vf_mig_ops(&hw_data->vfmig_ops);
	adf_init_rl_data(&hw_data->rl_data);
}

+6 −1
Original line number Diff line number Diff line
@@ -10,12 +10,14 @@
#include <adf_fw_config.h>
#include <adf_gen4_config.h>
#include <adf_gen4_dc.h>
#include <adf_gen4_hw_csr_data.h>
#include <adf_gen4_hw_data.h>
#include <adf_gen4_pfvf.h>
#include <adf_gen4_pm.h>
#include "adf_gen4_ras.h"
#include <adf_gen4_timer.h>
#include <adf_gen4_tl.h>
#include <adf_gen4_vf_mig.h>
#include "adf_4xxx_hw_data.h"
#include "icp_qat_hw.h"

@@ -208,7 +210,7 @@ static const u32 *adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev)
{
	if (adf_gen4_init_thd2arb_map(accel_dev))
		dev_warn(&GET_DEV(accel_dev),
			 "Generate of the thread to arbiter map failed");
			 "Failed to generate thread to arbiter mapping");

	return GET_HW_DATA(accel_dev)->thd_to_arb_map;
}
@@ -454,6 +456,8 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
	hw_data->get_ring_to_svc_map = adf_gen4_get_ring_to_svc_map;
	hw_data->disable_iov = adf_disable_sriov;
	hw_data->ring_pair_reset = adf_gen4_ring_pair_reset;
	hw_data->bank_state_save = adf_gen4_bank_state_save;
	hw_data->bank_state_restore = adf_gen4_bank_state_restore;
	hw_data->enable_pm = adf_gen4_enable_pm;
	hw_data->handle_pm_interrupt = adf_gen4_handle_pm_interrupt;
	hw_data->dev_config = adf_gen4_dev_config;
@@ -469,6 +473,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
	adf_gen4_init_dc_ops(&hw_data->dc_ops);
	adf_gen4_init_ras_ops(&hw_data->ras_ops);
	adf_gen4_init_tl_data(&hw_data->tl_data);
	adf_gen4_init_vf_mig_ops(&hw_data->vfmig_ops);
	adf_init_rl_data(&hw_data->rl_data);
}

Loading