linux/drivers/crypto/intel/qat/qat_common/adf_kpt.h
Junyuan Wang fb98254a5e crypto: qat - add KPT support for GEN6 devices
Add support for Intel Key Protection Technology (KPT) on QAT GEN6
devices.

KPT protects private keys from exposure by keeping them wrapped
(encrypted) while in use, in-flight, and at rest. Keys remain in wrapped
form and are not exposed in plaintext in host memory. This feature
operates outside of the Linux crypto framework and kernel keyring.

Extend the firmware admin interface to enable and configure KPT. During
device initialisation, if KPT is enabled, the driver sends an admin
message to firmware to enable KPT mode and configure parameters such as
the maximum number of SWK (Symmetric Wrapping Key) slots and the SWK
time-to-live (TTL).

Expose KPT configuration via a new sysfs attribute group, "qat_kpt", and
add ABI documentation.

Co-developed-by: Nitesh Venkatesh <nitesh.venkatesh@intel.com>
Signed-off-by: Nitesh Venkatesh <nitesh.venkatesh@intel.com>
Signed-off-by: Junyuan Wang <junyuan.wang@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Ahsan Atta <ahsan.atta@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2026-06-05 19:36:36 +08:00

30 lines
706 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright(c) 2026 Intel Corporation */
#ifndef ADF_KPT_H_
#define ADF_KPT_H_
#include <linux/types.h>
#define GET_KPT_CFG_DATA(accel_dev) (&(accel_dev)->hw_device->kpt_data)
#define GET_KPT_USER_DATA(accel_dev) (&(accel_dev)->hw_device->kpt_data.user_input)
struct adf_accel_dev;
struct adf_kpt_interface_data {
bool enable;
bool swk_shared;
unsigned int swk_cnt_per_fn;
unsigned int swk_cnt_per_pasid;
unsigned int swk_max_ttl;
};
struct adf_kpt_hw_data {
unsigned int max_swk_cnt_per_fn_pasid;
unsigned int max_swk_ttl;
struct adf_kpt_interface_data user_input;
};
int adf_enable_kpt(struct adf_accel_dev *accel_dev);
#endif /* ADF_KPT_H_ */