mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: qat - add bank save and restore flows
Add logic to save, restore, quiesce and drain a ring bank for QAT GEN4 devices. This allows to save and restore the state of a Virtual Function (VF) and will be used to implement VM live migration. Signed-off-by: Siming Wan <siming.wan@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Xin Zeng <xin.zeng@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -140,6 +140,40 @@ struct admin_info {
|
||||
u32 mailbox_offset;
|
||||
};
|
||||
|
||||
struct ring_config {
|
||||
u64 base;
|
||||
u32 config;
|
||||
u32 head;
|
||||
u32 tail;
|
||||
u32 reserved0;
|
||||
};
|
||||
|
||||
struct bank_state {
|
||||
u32 ringstat0;
|
||||
u32 ringstat1;
|
||||
u32 ringuostat;
|
||||
u32 ringestat;
|
||||
u32 ringnestat;
|
||||
u32 ringnfstat;
|
||||
u32 ringfstat;
|
||||
u32 ringcstat0;
|
||||
u32 ringcstat1;
|
||||
u32 ringcstat2;
|
||||
u32 ringcstat3;
|
||||
u32 iaintflagen;
|
||||
u32 iaintflagreg;
|
||||
u32 iaintflagsrcsel0;
|
||||
u32 iaintflagsrcsel1;
|
||||
u32 iaintcolen;
|
||||
u32 iaintcolctl;
|
||||
u32 iaintflagandcolen;
|
||||
u32 ringexpstat;
|
||||
u32 ringexpintenable;
|
||||
u32 ringsrvarben;
|
||||
u32 reserved0;
|
||||
struct ring_config rings[ADF_ETR_MAX_RINGS_PER_BANK];
|
||||
};
|
||||
|
||||
struct adf_hw_csr_ops {
|
||||
u64 (*build_csr_ring_base_addr)(dma_addr_t addr, u32 size);
|
||||
u32 (*read_csr_ring_head)(void __iomem *csr_base_addr, u32 bank,
|
||||
@@ -271,6 +305,10 @@ struct adf_hw_device_data {
|
||||
void (*enable_ints)(struct adf_accel_dev *accel_dev);
|
||||
void (*set_ssm_wdtimer)(struct adf_accel_dev *accel_dev);
|
||||
int (*ring_pair_reset)(struct adf_accel_dev *accel_dev, u32 bank_nr);
|
||||
int (*bank_state_save)(struct adf_accel_dev *accel_dev, u32 bank_number,
|
||||
struct bank_state *state);
|
||||
int (*bank_state_restore)(struct adf_accel_dev *accel_dev,
|
||||
u32 bank_number, struct bank_state *state);
|
||||
void (*reset_device)(struct adf_accel_dev *accel_dev);
|
||||
void (*set_msix_rttable)(struct adf_accel_dev *accel_dev);
|
||||
const char *(*uof_get_name)(struct adf_accel_dev *accel_dev, u32 obj_num);
|
||||
|
||||
Reference in New Issue
Block a user