]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
s390/zcrypt: Fix ap_max_domain_id for older machine types
authorIngo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Wed, 2 Nov 2016 09:23:24 +0000 (10:23 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 14 Dec 2016 15:33:39 +0000 (16:33 +0100)
According to the system architecture the current implementation
requires the presence of the N bit in GR2 in the TAPQ response
field to validate the max. number of domains (Nd).
Older machine types don't have this N bit, hence the max. domain
field was ignored.

Before the N bit was introduced the maximum number of domain was
a constant value of 15. So set this value in case of N bit absence.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/ap_bus.c

index b15013234c77a230c8775ac050e7d56a3048ab85..78c99ae42b1f9081ec3c0a165bb6a494dbdb6e51 100644 (file)
@@ -271,8 +271,11 @@ static int ap_query_queue(ap_qid_t qid, int *queue_depth, int *device_type,
                *facilities = (unsigned int)(info >> 32);
                /* Update maximum domain id */
                nd = (info >> 16) & 0xff;
+               /* if N bit is available, z13 and newer */
                if ((info & (1UL << 57)) && nd > 0)
                        ap_max_domain_id = nd;
+               else /* older machine types */
+                       ap_max_domain_id = 15;
                switch (*device_type) {
                        /* For CEX2 and CEX3 the available functions
                         * are not refrected by the facilities bits.