From: Harald Freudenberger <freude@linux.ibm.com>
Subject: s390/zcrypt: Add ZAPQ inline function.
Patch-mainline: v4.19-rc1
Git-commit: ea3c4185efb34e3157caf0529be8f1a68acc0550
References: FATE#325689, LTC#167899, bsc#1113520
Summary: zcrypt: AP bus support for alternate driver(s)
Description: AP bus support for alternate driver(s) and deterministic
driver binding. For details please read the patch header
for commit 7e0bdbe5c21cb8316a694e46ad5aad339f6894a6
Upstream-Description:
s390/zcrypt: Add ZAPQ inline function.
Added new inline function ap_pqap_zapq()
which is a C inline function wrapper for
the AP PQAP(ZAPQ) instruction.
Signed-off-by: Harald Freudenberger <freude@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/s390/crypto/ap_asm.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
--- a/drivers/s390/crypto/ap_asm.h
+++ b/drivers/s390/crypto/ap_asm.h
@@ -69,6 +69,25 @@ static inline struct ap_queue_status ap_
}
/**
+ * ap_pqap_zapq(): Reset and zeroize adjunct processor queue.
+ * @qid: The AP queue number
+ *
+ * Returns AP queue status structure.
+ */
+static inline struct ap_queue_status ap_zapq(ap_qid_t qid)
+{
+ register unsigned long reg0 asm ("0") = qid | (2UL << 24);
+ register struct ap_queue_status reg1 asm ("1");
+
+ asm volatile(
+ ".long 0xb2af0000" /* PQAP(ZAPQ) */
+ : "=d" (reg1)
+ : "d" (reg0)
+ : "cc");
+ return reg1;
+}
+
+/**
* ap_aqic(): Control interruption for a specific AP.
* @qid: The AP queue number
* @qirqctrl: struct ap_qirq_ctrl (64 bit value)