Received: by 10.192.165.156 with SMTP id m28csp356291imm; Tue, 17 Apr 2018 11:16:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48z9Cr4JewuWI+voif4cBbWt13D1s41sewTrg3mMvtNrdvDSfhEdXMWPUwgm1S57jCNzorl X-Received: by 10.98.27.13 with SMTP id b13mr2911881pfb.254.1523988992233; Tue, 17 Apr 2018 11:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523988992; cv=none; d=google.com; s=arc-20160816; b=H31Me+dTXN8DFFPHP1UXjd8GvjfITKL0tJP6/q+A+Wne28FWF2dK4dodwtrPcT0g2m uLbh5i09/C19Kt6GthXLjMI6daJSI6oYwMf6yABYrNtHXNsXOYF84D3CfV51LGzTRco2 FD2bYJl2IVzS4GYn3w41XNmzn8b76FP6l3SJLOX3itUogtSSbbwuAAXYcK2ljMbi0mjr Lv0B+pocs80D+iRA4yzE1/or220b0SYEC26B6ivV4ghT+Dq1zf5fjll/3uaSsa1gYQ/E yEWJ5ncjFS+52C/UIthFRFO2FKQDxzdTxHmRKBOSpWVkkppzcZWWJ0rp7zd0cXyf3i09 Viiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=cYXiYqUWDtSzcJ5pPojvePi+IXrCzpBYwEDkpIrpf2c=; b=Du/r8ACjwgQ7NkvkWan2BNwqHB0q1CapLrGfC8pBKqoAQzwVW7i39OgJpgjykD5i0e jfg5fT8o+G2vFlMv7DooeWXQQ1iy+STnwcAddUDV5m9w+Hvt6WZWvIfPfcmQrH0LSMBD Oy/IusrksRimMIFXXMikgL/g1FUQ9MpCxjb6eoJ5xqTvBOgqVNdS3mNrBkXIzsy1An+q YplGwjy+oSqidLWjq3GQTYDFhHkT9VXIv4ThZmoloAu0y0ourBUFI39dpDzZwBl5fjES jD8ZrC3SZ9l3YXS4eLxEOJcnCMpENU6Cxye5Y9u00XGf/bYo8UmBtr6uYDCqB4mg2irN Yp4A== 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 b59-v6si14586826plc.309.2018.04.17.11.16.18; Tue, 17 Apr 2018 11:16:32 -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 S1752810AbeDQSO6 (ORCPT + 99 others); Tue, 17 Apr 2018 14:14:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52318 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752732AbeDQSO5 (ORCPT ); Tue, 17 Apr 2018 14:14:57 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3HICi1J017731 for ; Tue, 17 Apr 2018 14:14:56 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hdnm4s94u-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 17 Apr 2018 14:14:55 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Apr 2018 14:14:55 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Apr 2018 14:14:52 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3HIEp0r57934050; Tue, 17 Apr 2018 18:14:51 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAEFD12403D; Tue, 17 Apr 2018 15:16:53 -0400 (EDT) Received: from oc8043147753.ibm.com (unknown [9.85.136.174]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id A7B5F124035; Tue, 17 Apr 2018 15:16:52 -0400 (EDT) Subject: Re: [PATCH v4 01/15] s390: zcrypt: externalize AP instructions available function To: Cornelia Huck Cc: Pierre Morel , freude@de.ibm.com, buendgen@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.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 References: <1523827345-11600-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1523827345-11600-2-git-send-email-akrowiak@linux.vnet.ibm.com> <77bbd4ca-8412-e59d-e1ca-9a114cf495a6@linux.vnet.ibm.com> <20180416141136.04be5558.cohuck@redhat.com> <20180417185646.5b43c911.cohuck@redhat.com> From: Tony Krowiak Date: Tue, 17 Apr 2018 14:14:49 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180417185646.5b43c911.cohuck@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18041718-0044-0000-0000-000004060EE1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008872; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01019322; UDB=6.00520008; IPR=6.00798563; MB=3.00020619; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-17 18:14:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041718-0045-0000-0000-000008381345 Message-Id: <812e4644-6315-7ec9-6eac-17bfd3b68f20@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-17_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-1804170157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/17/2018 12:56 PM, Cornelia Huck wrote: > On Tue, 17 Apr 2018 09:31:00 -0400 > Tony Krowiak wrote: > >> My preference would be one of the following: >> >> 1. All of the interfaces defined in arch/s390/include/asm/ap.h >> are implemented in a file that is built whether ZCRYPT is >> built or not. >> >> 2. The drivers/s390/crypto/ap_asm.h file containing the functions >> that execute the AP instructions are made available outside of >> the AP bus, for example; arch/s390/include/asm >> >> I requested this from the maintainer but was told we don't want to >> have any crypto adapter support when the host AP functionality is >> disabled (CONFIG_ZCRYPT=n). This makes sense, however; I think it is >> a bit confusing to have a header file (arch/s390/include/asm/ap.h) >> with interfaces that are conditionally built. >> >> This is why I chose the ifdeffery (as you call it) approach. The >> only other solution I can conjure is to duplicate the asm code for >> the AP instructions needed in KVM and bypass using the AP bus >> interfaces. > I think at the root of this is an unfortunate mixup in the > architecture: The format of the crycb changes depending on some ap > feature being installed. Providing the crycb does not have anything to > do with ap device usage in the host, but we need to issue an ap > instruction to get this right. [Correct me if I'm wrong; but that's > what I get without being able to consult the actual architecture.] That sums it up. > > So, exporting *all* of the interfaces is probably not needed anyway. I > think it boils down to either "export the interfaces where a mixup > happened, and keep the rest to zcrypt only", or "duplicate the > instructions for kvm usage". I only suggested exporting all of the interfaces because the others may be needed down the road when interception is implemented for full virtualization of AP devices. > > I hope we can find a solution here, as this seems to be one of the main > discussion points :/ (FWIW, I think the basic driver interface is sane.) I will work on coming up with something that attempts to take into consideration all of the comments thus far. In the meantime, I will keep my eyes on this space if anybody comes up with a better, concrete resolution. >