aboutsummaryrefslogtreecommitdiff
path: root/drivers/crypto/ccp/ccp-dev-v3.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-11crypto: ccp - set max RSA modulus size for v3 platform devices as wellArd Biesheuvel1-0/+1
AMD Seattle incorporates a non-PCI version of the v3 CCP crypto accelerator, and this version was left behind when the maximum RSA modulus size was parameterized in order to support v5 hardware which supports larger moduli than v3 hardware does. Due to this oversight, RSA acceleration no longer works at all on these systems. Fix this by setting the .rsamax property to the appropriate value for v3 platform hardware. Fixes: e28c190db66830c0 ("csrypto: ccp - Expand RSA support for a v5 ccp") Cc: Gary R Hook <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-08-09crypto: ccp - Remove unnecessary linux/pci.h includeBjorn Helgaas1-1/+0
Remove unused includes of linux/pci.h. Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-07-26crypto: ccp - Add a module parameter to specify a queue countHook, Gary1-1/+1
Add a module parameter to limit the number of queues per CCP. The default value (nqueues=0) is to set up every available queue on each device. The count of queues starts from the first one found on the device (which varies based on the device ID). Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-28csrypto: ccp - Expand RSA support for a v5 ccpGary R Hook1-0/+1
A version 5 CCP can handle an RSA modulus up to 16k bits. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: ccp - Update copyright dates for 2017.Gary R Hook1-1/+1
Some updates this year have not had copyright dates changed in modified files. Correct this for 2017. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Abstract interrupt registerationBrijesh Singh1-3/+3
The CCP and PSP devices part of AMD Secure Procesor may share the same interrupt. Hence we expand the SP device to register a common interrupt handler and provide functions to CCP and PSP devices to register their interrupt callback which will be invoked upon interrupt. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Introduce the AMD Secure Processor deviceBrijesh Singh1-3/+1
The CCP device is part of the AMD Secure Processor. In order to expand the usage of the AMD Secure Processor, create a framework that allows functional components of the AMD Secure Processor to be initialized and handled appropriately. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Use devres interface to allocate PCI/iomap and cleanupBrijesh Singh1-0/+7
Update pci and platform files to use devres interface to allocate the PCI and iomap resources. Also add helper functions to consolicate module init, exit and power mangagement code duplication. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-04-24crypto: ccp - Change ISR handler method for a v3 CCPGary R Hook1-50/+70
The CCP has the ability to perform several operations simultaneously, but only one interrupt. When implemented as a PCI device and using MSI-X/MSI interrupts, use a tasklet model to service interrupts. By disabling and enabling interrupts from the CCP, coupled with the queuing that tasklets provide, we can ensure that all events (occurring on the device) are recognized and serviced. This change fixes a problem wherein 2 or more busy queues can cause notification bits to change state while a (CCP) interrupt is being serviced, but after the queue state has been evaluated. This results in the event being 'lost' and the queue hanging, waiting to be serviced. Since the status bits are never fully de-asserted, the CCP never generates another interrupt (all bits zero -> one or more bits one), and no further CCP operations will be executed. Cc: <[email protected]> # 4.9.x+ Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-03-24crypto: ccp - Enable 3DES function on v5 CCPsGary R Hook1-0/+1
Wire up support for Triple DES in ECB mode. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-10-25crypto: ccp - Clean up the LSB slot allocation codeGary R Hook1-4/+0
Fix a few problems revealed by testing: verify consistent units, especially in public slot allocation. Percolate some common initialization code up to a common routine. Add some comments. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-10-02crypto: ccp - Make syslog errors human-readableGary R Hook1-0/+3
Add human-readable strings to log messages about CCP errors Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-10-02crypto: ccp - clean up data structureGary R Hook1-1/+1
Change names of data structure instances. Add const keyword where appropriate. Add error handling path. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Add support for the RNG in a version 5 CCPGary R Hook1-9/+4
Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Let a v5 CCP provide the same function as v3Gary R Hook1-12/+16
Enable equivalent function on a v5 CCP. Add support for a version 5 CCP which enables AES/XTS/SHA services. Also, more work on the data structures to virtualize functionality. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Refactor code to enable checks for queue space.Gary R Hook1-1/+7
Available queue space is used to decide (by counting free slots) if we have to put a command on hold or if it can be sent to the engine immediately. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Refactor code supporting the CCP's RNGGary R Hook1-40/+11
Make the RNG support code common (where possible) in preparation for adding a v5 device. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Refactor the storage block allocation codeGary R Hook1-0/+52
Move the KSB access/management functions to the v3 device file, and add function pointers to the actions structure. At the operations layer all of the references to the storage block will be generic (virtual). This is in preparation for a version 5 device, in which the private storage block is managed differently. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Refactoring: symbol cleanupGary R Hook1-16/+16
Form and use of the local storage block in the CCP is particular to the device version. Much of the code that accesses the storage block can treat it as a virtual resource, and will under go some renaming. Device-specific access to the memory will be moved into device file. Service functions will be added to the actions structure. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Shorten the fields of the action structureGary R Hook1-6/+6
Use more concise field names; "perform_" is too verbose. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-08-09crypto: ccp - Abstract PCI info for the CCPGary R Hook1-0/+3
Device-specific values for the BAR and offset should be found in the version data structure. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-05-03crypto: ccp - constify ccp_actions structureJulia Lawall1-1/+1
The ccp_actions structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Gary Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-04-20crypto: ccp - Register the CCP as a DMA resourceGary R Hook1-0/+11
The CCP has the ability to provide DMA services to the kernel using pass-through mode of the device. Register these services as general purpose DMA channels. Changes since v2: - Add a Signed-off-by Changes since v1: - Allocate memory for a string in ccp_dmaengine_register - Ensure register/unregister calls are properly ordered - Verified all changed files are listed in the diffstat - Undo some superfluous changes - Added a cc: Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-03-11crypto: ccp - Add abstraction for device-specific callsGary R Hook1-0/+533
Support for different generations of the coprocessor requires that an abstraction layer be implemented for interacting with the hardware. This patch splits out version-specific functions to a separate file and populates the version structure (acting as a driver) with function pointers. Signed-off-by: Gary R Hook <[email protected]> Acked-by: Tom Lendacky <[email protected]> Signed-off-by: Herbert Xu <[email protected]>