Received: by 10.213.65.68 with SMTP id h4csp1166416imn; Wed, 14 Mar 2018 11:32:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELviLuXuRgHNN12FYZHYt32LmCxuK9hMF+WwQGAOxqr07d+PTwtnsL6fogbCnhe8vqDaifLR X-Received: by 2002:a17:902:be16:: with SMTP id r22-v6mr4867941pls.268.1521052376337; Wed, 14 Mar 2018 11:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521052376; cv=none; d=google.com; s=arc-20160816; b=h9r+r34fkIcQzv24VMLqvWs9QHa6Yn15q9n5TpzJKES/is6Rmv/iBapSahqPDgtMRj 2raMlksTJNZzeIVMfmQ+UdK3xjA7/AvKpeRB71nPLVGuCHpQ0IKAp61cuaSGvHdU7jCo tofTSLSkxrKVESfJkXcKIbiQu4dF4FXVW8L7M65G9y6y7COdqxw5usBCsbNkRM4b9dwt PWQmFiSLCxR0REq3xEGyCUWI01U5z4ABbX/b+TIGLHBrn2OZ53Q4JEaRkULGaBY7paWA w9jQKBlvs3w+GnMUFpe/eLcB25vnp2RFjhFgr3gbHHRwdjuUPFS8nnrudFM0kdzCEe69 IgEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=0lxp9EdjMb74oJo7yh/ERGSNTUYE8oI1jkqTjEDt3O4=; b=yUBpbboVlyp3Qxq6dcY7+vjTIr4JTF9DuxKk0Kit0zf2Op85yRuf3MtS/QU2RLY8Sl +6tXprTZNRpD0gX6iNQGkjSOpjxnP0BF03NPK5+LgTJbhUHbbXRhuy0AHferZ8RQvZQV u52dNwjutsUgHKuU/fSbp28egBCPj8rG+M1Rx8HtWp9HMMn9V8vOi08+Czq1k0zhLsAz GkhQr+9kUxMFwGvHT0nheDDU0CE5MjGW/D/It6Z9Wp1U5+3NQWFkZNccYKntSmPscCvX TF0HawkkdJ+ghUtPUA7jl64mDZx8z4QRqE+Tkyz8ELi8y7dgsFVxFY3dMMz/11H6nxRJ 1+FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si2265189pgd.290.2018.03.14.11.32.40; Wed, 14 Mar 2018 11:32:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbeCNS0W (ORCPT + 99 others); Wed, 14 Mar 2018 14:26:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49738 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752381AbeCNS0R (ORCPT ); Wed, 14 Mar 2018 14:26:17 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2EIKKql050770 for ; Wed, 14 Mar 2018 14:26:16 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gq5awtwa9-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 14 Mar 2018 14:26:16 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Mar 2018 12:26:15 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Mar 2018 12:26:11 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2EIQ9hX12386780; Wed, 14 Mar 2018 11:26:09 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0743136048; Wed, 14 Mar 2018 12:26:09 -0600 (MDT) Received: from localhost.localdomain (unknown [9.85.151.171]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTPS id 3A167136044; Wed, 14 Mar 2018 12:26:07 -0600 (MDT) From: Tony Krowiak To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com, berrange@redhat.com, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com, akrowiak@linux.vnet.ibm.com Subject: [PATCH v3 02/14] s390: zcrypt: externalize AP instructions available function Date: Wed, 14 Mar 2018 14:25:42 -0400 X-Mailer: git-send-email 1.7.1 In-Reply-To: <1521051954-25715-1-git-send-email-akrowiak@linux.vnet.ibm.com> References: <1521051954-25715-1-git-send-email-akrowiak@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031418-0024-0000-0000-0000181452CD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008674; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01003025; UDB=6.00510424; IPR=6.00782355; MB=3.00020035; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-14 18:26:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031418-0025-0000-0000-00004F1A9EE6 Message-Id: <1521051954-25715-3-git-send-email-akrowiak@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-14_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803140201 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the AP instructions are not available on the linux host, then AP devices can not be interpreted by the SIE. The AP bus has a function it uses to determine if the AP instructions are available. This patch provides a new function that wraps the AP bus's function to externalize it for use by KVM. Signed-off-by: Tony Krowiak Reviewed-by: Pierre Morel Reviewed-by: Harald Freudenberger --- arch/s390/include/asm/ap.h | 7 +++++++ drivers/s390/crypto/ap_bus.c | 6 ++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/s390/include/asm/ap.h b/arch/s390/include/asm/ap.h index cfce683..1df6b59 100644 --- a/arch/s390/include/asm/ap.h +++ b/arch/s390/include/asm/ap.h @@ -120,4 +120,11 @@ struct ap_queue_status ap_queue_irq_ctrl(ap_qid_t qid, struct ap_qirq_ctrl qirqctrl, void *ind); +/** + * ap_instructions_installed() - Tests whether AP instructions are installed + * + * Returns 1 if the AP instructions are installed, otherwise; returns 0 + */ +int ap_instructions_installed(void); + #endif /* _ASM_S390_AP_H_ */ diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 48d55dc..089b1cf 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -211,6 +211,12 @@ int ap_query_configuration(struct ap_config_info *info) } EXPORT_SYMBOL(ap_query_configuration); +int ap_instructions_installed(void) +{ + return (ap_instructions_available() == 0); +} +EXPORT_SYMBOL(ap_instructions_installed); + /** * ap_init_configuration(): Allocate and query configuration array. */ -- 1.7.1