Re: [PATCH v2 08/11] coco: guest: arm64: Add support for fetching and verifying device info
From: Aneesh Kumar K . V
Date: Mon Nov 24 2025 - 03:28:58 EST
Jonathan Cameron <jonathan.cameron@xxxxxxxxxx> writes:
> On Mon, 17 Nov 2025 19:30:04 +0530
> "Aneesh Kumar K.V (Arm)" <aneesh.kumar@xxxxxxxxxx> wrote:
>
...
>
>> + return -EIO;
>> + }
>> +
>> + dsc->dev_info.cert_id = dev_info->cert_id;
>> + dsc->dev_info.hash_algo = dev_info->hash_algo;
>> + dsc->dev_info.lock_nonce = dev_info->lock_nonce;
>> + dsc->dev_info.meas_nonce = dev_info->meas_nonce;
>> + dsc->dev_info.report_nonce = dev_info->report_nonce;
>> + memcpy(dsc->dev_info.cert_digest, dev_info->cert_digest, SHA512_DIGEST_SIZE);
>> + memcpy(dsc->dev_info.meas_digest, dev_info->meas_digest, SHA512_DIGEST_SIZE);
>> + memcpy(dsc->dev_info.report_digest, dev_info->report_digest, SHA512_DIGEST_SIZE);
>
> So copy everything other than flags. Any reason why not flags?
>
The flags field currently carries p2p_enabled and p2p_bound, but these
aren’t used yet. I’ll drop flags from dsc->dev_info for now and
reintroduce it once there’s an actual user.
>> +
>> + kfree(dev_info);
>> + /*
>> + * Verify that the digests of the provided reports match with the
>> + * digests from RMM
>> + */
>> + ret = verify_digests(dsc);
>> + if (ret) {
>> + pci_err(pdev, "device digest validation failed (%d)\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = cca_apply_interface_report_mappings(pdev, true);
>> + if (ret) {
>> + pci_err(pdev, "failed to validate the interface report\n");
>> + return -EIO;
>> + }
>> +
>> + return 0;
>> +}