[SRU,X,1/1] UBUNTU: SAUCE: s390/zcrypt: CEX7 toleration support
diff mbox series

Message ID 1571225634-5526-2-git-send-email-frank.heimes@canonical.com
State New
Headers show
Series
  • Shared CEX7C cards defined in z/VM guest not established by zcrypt device driver
Related show

Commit Message

Frank Heimes Oct. 16, 2019, 11:33 a.m. UTC
From: Harald Freudenberger <freude@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1848173

With the new z15 machine also came a new crypto card CEX7
which is backward compatible to CEX6 and CEX5. The newer
kernel code covers this with a QACT instruction which
automatically enables 'unknown' new crypto cards when
QACT tells that these are backward compatible.

However, the older kernels need at least some lines
of code mapping the CEX7 crypto hardware type back
to a known and compatible type ('toleration'). And
this is done with the patch here.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
---
 drivers/s390/crypto/ap_bus.c | 5 +++--
 drivers/s390/crypto/ap_bus.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Kleber Souza Oct. 17, 2019, 4:08 p.m. UTC | #1
On 16.10.19 13:33, frank.heimes@canonical.com wrote:
> From: Harald Freudenberger <freude@linux.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1848173
> 
> With the new z15 machine also came a new crypto card CEX7
> which is backward compatible to CEX6 and CEX5. The newer
> kernel code covers this with a QACT instruction which
> automatically enables 'unknown' new crypto cards when
> QACT tells that these are backward compatible.
> 
> However, the older kernels need at least some lines
> of code mapping the CEX7 crypto hardware type back
> to a known and compatible type ('toleration'). And
> this is done with the patch here.
> 
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
> Signed-off-by: Frank Heimes <frank.heimes@canonical.com>

Specific to s390x, good test results.

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  drivers/s390/crypto/ap_bus.c | 5 +++--
>  drivers/s390/crypto/ap_bus.h | 1 +
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
> index 7c3b8d3..b2c8cfa 100644
> --- a/drivers/s390/crypto/ap_bus.c
> +++ b/drivers/s390/crypto/ap_bus.c
> @@ -1651,8 +1651,9 @@ static void ap_scan_bus(struct work_struct *unused)
>  		ap_dev->queue_depth = queue_depth;
>  		ap_dev->raw_hwtype = device_type;
>  		ap_dev->device_type = device_type;
> -		/* CEX6 toleration: map to CEX5 */
> -		if (device_type == AP_DEVICE_TYPE_CEX6)
> +		/* CEX6/CEX7 toleration: map to CEX5 */
> +		if (device_type == AP_DEVICE_TYPE_CEX6 ||
> +		    device_type == AP_DEVICE_TYPE_CEX7)
>  			ap_dev->device_type = AP_DEVICE_TYPE_CEX5;
>  		ap_dev->functions = device_functions;
>  		spin_lock_init(&ap_dev->lock);
> diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
> index cc741e9..ac1a3b1 100644
> --- a/drivers/s390/crypto/ap_bus.h
> +++ b/drivers/s390/crypto/ap_bus.h
> @@ -106,6 +106,7 @@ static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
>  #define AP_DEVICE_TYPE_CEX4	10
>  #define AP_DEVICE_TYPE_CEX5	11
>  #define AP_DEVICE_TYPE_CEX6	12
> +#define AP_DEVICE_TYPE_CEX7	13
>  
>  /*
>   * Known function facilities
>

Patch
diff mbox series

diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 7c3b8d3..b2c8cfa 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1651,8 +1651,9 @@  static void ap_scan_bus(struct work_struct *unused)
 		ap_dev->queue_depth = queue_depth;
 		ap_dev->raw_hwtype = device_type;
 		ap_dev->device_type = device_type;
-		/* CEX6 toleration: map to CEX5 */
-		if (device_type == AP_DEVICE_TYPE_CEX6)
+		/* CEX6/CEX7 toleration: map to CEX5 */
+		if (device_type == AP_DEVICE_TYPE_CEX6 ||
+		    device_type == AP_DEVICE_TYPE_CEX7)
 			ap_dev->device_type = AP_DEVICE_TYPE_CEX5;
 		ap_dev->functions = device_functions;
 		spin_lock_init(&ap_dev->lock);
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
index cc741e9..ac1a3b1 100644
--- a/drivers/s390/crypto/ap_bus.h
+++ b/drivers/s390/crypto/ap_bus.h
@@ -106,6 +106,7 @@  static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
 #define AP_DEVICE_TYPE_CEX4	10
 #define AP_DEVICE_TYPE_CEX5	11
 #define AP_DEVICE_TYPE_CEX6	12
+#define AP_DEVICE_TYPE_CEX7	13
 
 /*
  * Known function facilities