mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
s390/zcrypt: rework length information for dqap
The inline ap_dqap function does not return the number of bytes actually written into the message buffer. The calling code inspects the AP message header to figure out what kind of AP message has been received and pulls the length information from this header. This processing may not work correctly in cases where only a fragment of the reply is received. With this patch the ap_dqap inline function now returns the number of actually written bytes in the *length parameter. So the calling function has a chance to compare the number of received bytes against what the AP message header length field states. This is especially useful in cases where a message could only get partially received. The low level reply processing functions needed some rework to be able to catch this new length information and compare it the right way. The rework also deals with some situations where until now the reply length was not correctly calculated and/or set. All this has been heavily tested as the modifications on the reply length information may affect crypto load. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Holger Dengler <dengler@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
committed by
Heiko Carstens
parent
003d248fee
commit
8794c59613
@@ -244,8 +244,8 @@ struct ap_message {
|
||||
struct list_head list; /* Request queueing. */
|
||||
unsigned long psmid; /* Message id. */
|
||||
void *msg; /* Pointer to message buffer. */
|
||||
unsigned int len; /* actual msg len in msg buffer */
|
||||
unsigned int bufsize; /* allocated msg buffer size */
|
||||
size_t len; /* actual msg len in msg buffer */
|
||||
size_t bufsize; /* allocated msg buffer size */
|
||||
u16 flags; /* Flags, see AP_MSG_FLAG_xxx */
|
||||
struct ap_fi fi; /* Failure Injection cmd */
|
||||
int rc; /* Return code for this message */
|
||||
@@ -285,8 +285,8 @@ static inline void ap_release_message(struct ap_message *ap_msg)
|
||||
* for the first time. Otherwise the ap message queue will get
|
||||
* confused.
|
||||
*/
|
||||
int ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t length);
|
||||
int ap_recv(ap_qid_t qid, unsigned long *psmid, void *msg, size_t length);
|
||||
int ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t msglen);
|
||||
int ap_recv(ap_qid_t qid, unsigned long *psmid, void *msg, size_t msglen);
|
||||
|
||||
enum ap_sm_wait ap_sm_event(struct ap_queue *aq, enum ap_sm_event event);
|
||||
enum ap_sm_wait ap_sm_event_loop(struct ap_queue *aq, enum ap_sm_event event);
|
||||
|
||||
Reference in New Issue
Block a user