Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Jan Glauber <jang@linux.vnet.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto <linux-crypto@vger.kernel.org>
Subject: [PATCH] check for s390 crypto facility availablility
Date: Thu, 10 Jul 2008 15:00:43 +0000	[thread overview]
Message-ID: <1215702043.12011.6.camel@localhost.localdomain> (raw)

Hi Herbert,

here is a small patch for the s390 crypto detection.

[PATCH] respect STFL bit for s390 crypto

From: <jang@linux.vnet.ibm.com>

For all s390 in-kernel crypto algorithms we check at module
load time whether the CPACF facility bit is on. If the facility
is not enabled we bail out.

Signed-off-by: <jang@linux.vnet.ibm.com>

--- ./arch/s390/crypto/crypt_s390.h.stfle
+++ ./arch/s390/crypto/crypt_s390.h
@@ -294,6 +294,10 @@ static inline int crypt_s390_func_availa
 	unsigned char status[16];
 	int ret;
 
+	/* check if CPACF facility (bit 17) is available */
+	if (!(stfl() & 1ULL << (31 - 17)))
+		return 0;
+
 	switch (func & CRYPT_S390_OP_MASK) {
 	case CRYPT_S390_KM:
 		ret = crypt_s390_km(KM_QUERY, &status, NULL, NULL, 0);



             reply	other threads:[~2008-07-10 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10 15:00 Jan Glauber [this message]
2008-07-11 12:29 ` [PATCH] check for s390 crypto facility availablility Herbert Xu
2008-07-11 18:34   ` Jan Glauber
2008-07-11 18:34   ` Jan Glauber
2008-07-12  7:42     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1215702043.12011.6.camel@localhost.localdomain \
    --to=jang@linux.vnet.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox