| e5070810 | 01-Apr-2026 |
Joachim Foerster <joachim.foerster@missinglinkelectronics.com> |
drivers: versal_net: pki: Enhance status and error checking; be verbose if needed
Mapping all PKI Engine status bits to TEE_ERROR_GENERIC is not suitable in all cases. Especially SIGNATURENOTVALID s
drivers: versal_net: pki: Enhance status and error checking; be verbose if needed
Mapping all PKI Engine status bits to TEE_ERROR_GENERIC is not suitable in all cases. Especially SIGNATURENOTVALID shall be mapped to TEE_ERROR_SIGNATURE_INVALID. TEE_AsymmetricVerifyDigest() requires this to work properly.
Moreover, this commit tries to introduce reasonable reporting of errors and unexpected values, in case something goes wrong.
Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com> Reviewed-by: Nathan Menhorn <nathan.menhorn@amd.com> Reviewed-by: Sean McGinn <sean.mcginn@amd.com> Reviewed-by: Lucas Kiker <lucas.kiker@amd.com> Reviewed-by: Sindhu Raveendra <Sindhu.Raveendra@amd.com> Reviewed-by: Clemens Nasenberg <clemens.nasenberg@amd.com> Reviewed-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
show more ...
|
| bec3cc95 | 09-Feb-2026 |
Joachim Foerster <joachim.foerster@missinglinkelectronics.com> |
drivers: versal_net: pki: Fix queue alignment and DMA setup
The DMA part of the PKI Accelerator seems to support up to 4 equally sized buffers to fetch requests and data from, and to return data to
drivers: versal_net: pki: Fix queue alignment and DMA setup
The DMA part of the PKI Accelerator seems to support up to 4 equally sized buffers to fetch requests and data from, and to return data to (RequestQueue). Such a buffer, also primarily called a "page", needs to be aligned to a certain boundary which is NOT the cache line length!
Experiments showed that natural alignment does work. Thus, since the driver uses a fixed size of 4 KiB (PKI_QUEUE_BUF_SIZE) for these "pages", we enforce alignment to 4 KiB. It remains unknown whether smaller (but bigger than cache line length) alignments do work or not.
Furthermore the DMA setup assumed a "page" size of 64 KiB, defined by the very misleading symbol PKI_RQ_CFG_PAGE_SIZE_1024 with value 0x10, which represents ln2(64KiB). In concert with this, the offset to write data back to (5th descriptor word), also assumed the size of 64 KiB of a page. Since only 4 KiB "pages" have been allocated in the first place, this setup is rather dangerous, since the PKI Accelerator is under the impression that the actual page size is bigger. So, this commit makes the code consistent by using 4 KiB as "page" size in all relevant places.
Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com> Reviewed-by: Nathan Menhorn <nathan.menhorn@amd.com> Tested-by: Nathan Menhorn <nathan.menhorn@amd.com> Reviewed-by: Sean McGinn <sean.mcginn@amd.com> Reviewed-by: Lucas Kiker <lucas.kiker@amd.com> Reviewed-by: Sindhu Raveendra <Sindhu.Raveendra@amd.com> Reviewed-by: Clemens Nasenberg <clemens.nasenberg@amd.com> Reviewed-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
show more ...
|