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: Re: [PATCH] check for s390 crypto facility availablility
Date: Fri, 11 Jul 2008 18:34:40 +0000	[thread overview]
Message-ID: <1215801280.9088.12.camel@localhost.localdomain> (raw)
In-Reply-To: <20080711122938.GA4140@gondor.apana.org.au>

[PATCH] respect STFL bit for s390 crypto

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

Bevore issuing any s390 crypto operation check whether the
CPACF facility is enabled in the facility list. That way a
virtualization layer can prevent usage of the CPACF facility
regardless of the availability of the crypto instructions.

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);



  parent reply	other threads:[~2008-07-11 16:40 UTC|newest]

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