Received: by 10.223.164.221 with SMTP id h29csp2493276wrb; Thu, 2 Nov 2017 11:51:36 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SoX+0L5dZLtYlUnKzAqEe5ikXDFqPSW5ZiOUgVuXg0jCyS47/WoZ7MVUi7rFslPwKjcaeD X-Received: by 10.101.97.167 with SMTP id i7mr4547923pgv.449.1509648696242; Thu, 02 Nov 2017 11:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509648696; cv=none; d=google.com; s=arc-20160816; b=DfpBWzkz8kSRTRkB8LtJy4vY3t7yCnGt8Xm6fdC9QYOjJ+kufRNfqwRUPvwbST2Wr1 Zc9JSx3yMbvFa8RUQKO/ane9UoNpe2oSTLTtDKUXlH4Uve+Be2ME7JWramjFYV6E/OnG LWLG+WAqp4KJMgPaQPgoapDITNdp/ioQ9IIGwjAn2I27Jt0oEjbH3JolvlltzzgbthkW 4b3LgZwqcRWFExoFqB1/Nv2MNKE1CeeL0CdK27ISE01NvUaFcqruC98GOXOJtn6vDf7k 0t9N7RZDhH0QYBDvgBih46avyUuTqKPL+GvaPgeZ3cEtdIiOgjRWI7CbrCo/Czjr9kaq x3Aw== 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=TiekXmMPK4mGMs/FddFJazdA4Mnj+fL4EA0mbbo8FnA=; b=HzdTJAQtwYyRBBwcqo9zjpHJnqPFjc2U6BxhpyNAOpPhjZUd7mLTnYd7xnAxjInWb1 Hfp1RtvNFMUu9Qite2EMa4TmBCWlEcWWUMKbxKo6Va/87CgIvt5FLkpXJi5mQyTGzlHR 6U/p8+DDw6RlAzRIO5yRjREayIBLP4KlMe+0JRyAlXTQge+d6h8rwGclcBlNOcMuSjYc incOD3KtDgi3NQRIDhUSZCvtC/UKYE3JLhq+D6uatNmRJ0Zj1dyZ3OOYHGt401NU+BIX oqky4hX9YH8i4TgMb97C/dUKFcTq71G8yq7kh77v/I9j5PhWghETU41WZFIVOD86GsSI tBKQ== 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 f1si4008004pgc.255.2017.11.02.11.51.22; Thu, 02 Nov 2017 11:51:36 -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 S934207AbdKBStY (ORCPT + 97 others); Thu, 2 Nov 2017 14:49:24 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40302 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932571AbdKBStW (ORCPT ); Thu, 2 Nov 2017 14:49:22 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA2ImYG6139078 for ; Thu, 2 Nov 2017 14:49:21 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e08rv0nfw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 02 Nov 2017 14:49:21 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Nov 2017 12:49:20 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Nov 2017 12:49:18 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA2InGPp56229904; Thu, 2 Nov 2017 11:49:16 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 761E66A045; Thu, 2 Nov 2017 12:49:16 -0600 (MDT) Received: from oc8043147753.ibm.com (unknown [9.85.135.39]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 8272F6A03B; Thu, 2 Nov 2017 12:49:13 -0600 (MDT) Subject: Re: [RFC 19/19] s390/facilities: enable AP facilities needed by guest To: Christian Borntraeger , Martin Schwidefsky , freude@de.ibm.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, heiko.carstens@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, qemu-s390x@nongnu.org, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com References: <1507916344-3896-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1507916344-3896-20-git-send-email-akrowiak@linux.vnet.ibm.com> <20171016112510.39e9c330@mschwideX1> <3e836f59-3ef1-57d8-d6df-b66011c173c4@de.ibm.com> <6d9ae0c1-6f64-1562-bf10-864cf66e3a08@de.ibm.com> From: Tony Krowiak Date: Thu, 2 Nov 2017 14:49:12 -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: <6d9ae0c1-6f64-1562-bf10-864cf66e3a08@de.ibm.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: 17110218-0020-0000-0000-00000CF0849C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008000; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00940185; UDB=6.00474076; IPR=6.00720441; BA=6.00005668; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017838; XFM=3.00000015; UTC=2017-11-02 18:49:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110218-0021-0000-0000-00005EC104DC Message-Id: <40cdab64-9eeb-02bd-f260-80e9da8c9034@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-02_07:,, 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711020228 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/2017 11:53 AM, Christian Borntraeger wrote: > > On 11/02/2017 04:36 PM, Tony Krowiak wrote: >> On 11/02/2017 08:08 AM, Christian Borntraeger wrote: >>> On 10/16/2017 11:25 AM, Martin Schwidefsky wrote: >>>> On Fri, 13 Oct 2017 13:39:04 -0400 >>>> Tony Krowiak wrote: >>>> >>>>> Sets up the following facilities bits to enable the specified AP >>>>> facilities for the guest VM: >>>>> * STFLE.12: Enables the AP Query Configuration Information >>>>> facility. The AP bus running in the guest uses >>>>> the information returned from this instruction >>>>> to configure AP adapters and domains for the >>>>> guest machine. >>>>> * STFLE.15: Indicates the AP facilities test is available. >>>>> The AP bus running in the guest uses the >>>>> information. >>>>> >>>>> Signed-off-by: Tony Krowiak >>>>> --- >>>>> arch/s390/tools/gen_facilities.c | 2 ++ >>>>> 1 files changed, 2 insertions(+), 0 deletions(-) >>>>> >>>>> diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c >>>>> index 70dd8f1..eeaa7db 100644 >>>>> --- a/arch/s390/tools/gen_facilities.c >>>>> +++ b/arch/s390/tools/gen_facilities.c >>>>> @@ -74,8 +74,10 @@ struct facility_def { >>>>> 8, /* enhanced-DAT 1 */ >>>>> 9, /* sense-running-status */ >>>>> 10, /* conditional sske */ >>>>> + 12, /* AP query configuration */ >>>>> 13, /* ipte-range */ >>>>> 14, /* nonquiescing key-setting */ >>>>> + 15, /* AP special-command facility */ >>>>> 73, /* transactional execution */ >>>>> 75, /* access-exception-fetch/store indication */ >>>>> 76, /* msa extension 3 */ >>>> With this all KVM guests will always have the AP instructions available, no? >>>> In principles I like this approach, but it differs from the way z/VM does things, >>>> there the guest will get an exception if it tries to execute an AP instruction >>>> if there are no AP devices assigned to the guest. I wonder if there is a reason >>>> why z/VM does it the way it does. >>> A good question. For LPAR it seems that you have AP instructions even if you have >>> no crypto cards. >>> >> I don't believe these facilities control whether or not AP instructions will be available >> >> to the guest. > This is actually handled by your patch2 enabling the ECA bit. > I think we must decide if we want to be able to disable these instructions > via the cpu model. If yes we must then couple the facilities with the enablement. The ECA.28 bit controls whether instructions are intercepted or interpreted - i.e., handled via hardware virtualization. If set, as is done in patch2, then instructions will be interpreted. I don't see how that affects enabling or disabling AP instructions, unless we don't set ECA.28, intercept every instruction and program check. Am I missing something here? > From 1582970234355743654@xxx Thu Nov 02 15:54:16 +0000 2017 X-GM-THRID: 1581165030002785789 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread