From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755048AbdKBMX7 (ORCPT ); Thu, 2 Nov 2017 08:23:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54924 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754830AbdKBMXw (ORCPT ); Thu, 2 Nov 2017 08:23:52 -0400 Subject: Re: [RFC 19/19] s390/facilities: enable AP facilities needed by guest To: Christian Borntraeger , Martin Schwidefsky , Tony Krowiak Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@de.ibm.com, 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 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> From: Halil Pasic Date: Thu, 2 Nov 2017 13:23:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <3e836f59-3ef1-57d8-d6df-b66011c173c4@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17110212-0040-0000-0000-00000409BDDF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110212-0041-0000-0000-000020AC49F8 Message-Id: <8517636b-f95f-7747-e161-92abf1b244e1@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-02_04:,, 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-1711020158 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/2017 01:08 PM, 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've tried to figure these things out last week but I've failed. Right at the beginning of AR-10334-03-POK we have this text: "An adjunct processor (AP) facility consists of the three AP instructions, and one to sixty-four APs.". This reads like if we have AP facility we have to have at least one AP. But when I've tried to get a better understanding how the presence/absence of the AP facility is indicated and what facility bits do we have in this context I got confused. Tony, could you please give us a detailed summary on this (best with references, and focusing on the (guest) program perspective)? Regards, Halil