Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by "Daniel Zahka"
Tue, 17 Nov 2026 20:40
Re: [PATCH iwl-next 07/15] idpf: psp: add support for fips compliance status
Author: "Daniel Zahka"
Date: Tue, 17 Nov 2026 20:40
Date: Tue, 17 Nov 2026 20:40
84 lines
14062 bytes
14062 bytes
On Tue Nov 17, 2026 at 9:55 AM EST, Stan Iliev wrote:
> Add support for querying the FIPS compliance status of the crypto
> offload:
> - Introduce VIRTCHNL2_OP_GET_FIPS_COMPLIANCE_STATUS (567) and
> struct virtchnl2_get_fips_compliance_status_resp.
> - Implement idpf_send_get_fips_compliance_status(), called from
> idpf_psp_init(), which logs the status as
> "compliant@cmvp_cert_<a>_and_<b>" or "noncompliant". The status is
> informational only: failing to read it doesn't disable PSP.
>
> Signed-off-by: Stan Iliev <stani@google.com>
> ---
[...]
> +
> +/**
> + * idpf_send_get_fips_compliance_status - Get the FIPS compliance status
> + * @adapter: Driver specific private structure
> + *
> + * Query the FIPS compliance status of the crypto offload with
> + * VIRTCHNL2_OP_GET_FIPS_COMPLIANCE_STATUS and log it in the legacy
> + * "compliant@cmvp_cert_<a>_and_<b>" form, or as "noncompliant".
> + *
> + * Return: 0 on success, negative on failure.
> + */
> +int idpf_send_get_fips_compliance_status(struct idpf_adapter *adapter)
> +{
> + struct libie_ctlq_xn_send_params xn_params = {
> + .chnl_opcode = VIRTCHNL2_OP_GET_FIPS_COMPLIANCE_STATUS,
> + .timeout_ms = IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC,
> + };
> + const struct virtchnl2_get_fips_compliance_status_resp *resp;
> + struct device *dev = &adapter->pdev->dev;
> + char status[128];
> + size_t reply_sz;
> + u32 num_certs;
> + int len, err;
> + /* The request has no payload, but libie can't send empty messages */
> + u8 dummy = 0;
> + u32 i;
> +
> + err = idpf_send_mb_msg(adapter, &xn_params, &dummy, sizeof(dummy));
> + if (err)
> + return err;
> +
> + reply_sz = xn_params.recv_mem.iov_len;
> + resp = xn_params.recv_mem.iov_base;
> + if (reply_sz < sizeof(*resp)) {
> + err = -EIO;
> + goto release_rx;
> + }
> +
> + num_certs = le32_to_cpu(resp->num_certs);
> + if (struct_size(resp, certs, num_certs) > reply_sz) {
> + err = -EIO;
> + goto release_rx;
> + }
> +
> + if (!num_certs) {
> + dev_info(dev, "PSP FIPS compliance: noncompliant\n");
> + goto release_rx;
> + }
> +
> + len = scnprintf(status, sizeof(status), "compliant@cmvp_cert_");
> + for (i = 0; i < num_certs; i++)
> + len += scnprintf(status + len, sizeof(status) - len, "%s%u",
> + i ? "_and_" : "", le32_to_cpu(resp->certs[i]));
> + dev_info(dev, "PSP FIPS compliance: %s\n", status);
> +
You should think about exposing this with a netlink uapi instead of
making userspace parse it from dmesg. Maybe PSP dev-get.
I would also suggest moving this to a series after the PSP
implementation. It doesn't make sense to have the PSP driver API
implemented over the span of two separate series when stuff like this is
in between.
> +release_rx:
> + libie_ctlq_release_rx_buf(&xn_params.recv_mem);
> + return err;
> +}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads