linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Pierre Morel <pmorel@linux.vnet.ibm.com>
Cc: Tony Krowiak <akrowiak@linux.vnet.ibm.com>,
	Harald Freudenberger <freude@linux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	freude@de.ibm.com, mjrosato@linux.vnet.ibm.com,
	pasic@linux.vnet.ibm.com,
	Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, heiko.carstens@de.ibm.com,
	kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com,
	pbonzini@redhat.com, alex.williamson@redhat.com,
	alifm@linux.vnet.ibm.com, qemu-s390x@nongnu.org,
	jjherne@linux.vnet.ibm.com, thuth@redhat.com
Subject: Re: [RFC 19/19] s390/facilities: enable AP facilities needed by guest
Date: Wed, 6 Dec 2017 11:15:46 +0100	[thread overview]
Message-ID: <20171206111546.2db47aaa.cohuck@redhat.com> (raw)
In-Reply-To: <1cc6019b-bb3a-83fb-fa65-c013c435d206@linux.vnet.ibm.com>

On Wed, 6 Dec 2017 10:15:51 +0100
Pierre Morel <pmorel@linux.vnet.ibm.com> wrote:

> On 05/12/2017 16:01, Tony Krowiak wrote:
> > On 12/05/2017 09:04 AM, Cornelia Huck wrote:  
> >> On Tue, 5 Dec 2017 08:52:57 +0100
> >> Harald Freudenberger <freude@linux.vnet.ibm.com> wrote:
> >>  
> >>> On 12/02/2017 02:30 AM, Tony Krowiak wrote:  
> >>>> I agree with your suggestion that defining a new CPU model feature 
> >>>> is probably
> >>>> the best way to resolve this issue. The question is, should we 
> >>>> define a single
> >>>> feature indicating whether AP instructions are installed and set 
> >>>> features bits
> >>>> for the guest based on whether or not they are set in the linux 
> >>>> host, or should
> >>>> we define additional CPU model features for turning features bits on 
> >>>> and off?
> >>>> I guess it boils down to what behavior is expected for the AP bus 
> >>>> running on
> >>>> the linux guest. Here is a rundown of the facilities bits associated 
> >>>> with AP
> >>>> and how they affect the behavior of the AP bus:
> >>>>
> >>>> * STFLE.12 indicates whether the AP query function is available. If 
> >>>> this bit
> >>>>    is not set, then the AP bus scan will only test domains 0-15. For 
> >>>> example,
> >>>>    if adapters 4, 5, and 6 and domains 12 and 71 (0x47) are 
> >>>> installed, then AP
> >>>>    queues 04.0047, 05.0047 and 06.0047 will not be made available.  
> >>> STFLE 12 is the indication for Query AP Configuration Information 
> >>> (QCI) available.  
> >>>> * STFLE.15 indicates whether the AP facilities test function is 
> >>>> available. If
> >>>>    this bit is not set, then the CEX4, CEX5 and CEX6 device drivers 
> >>>> discovered
> >>>>    by the AP bus scan will not get bound to any AP device drivers. 
> >>>> Since the
> >>>>    AP matrix model supports only CEX4 and greater, no devices will 
> >>>> be bound
> >>>>    to any driver for a guest.  
> >>> This T-Bit extension to the TAPQ subfunction is a must have. When kvm 
> >>> only
> >>> supports CEX4 and upper then this bit could also act as the indicator 
> >>> for
> >>> AP instructions available. Of course if you want to implement pure 
> >>> virtual
> >>> full simulated AP without any real AP hardware on the host this bit 
> >>> can't
> >>> be the indicator.  
> >> It would probably make sense to group these two together. Or is there
> >> any advantage in supporting only a part of it?  
> > After thinking about this a little more, I've come to the conclusion that
> > all of this might be moot for the following reasons:
> > 
> > * If STFLE.12 is not set for the linux host, then AP bus scan running on
> >    the host will not detect any domains with a domain number higher than 
> > 15,
> >    so no AP queues with a queue index higher than 15 will be available to
> >    bind to the vfio_ap_matrix driver. Consequently, no domain higher than
> >    15 can be assigned to any guest. In this case, the AP bus scan 
> > running on
> >    the guest will never detect a domain higher than 15, regardless of the
> >    setting of STFLE.12 for the guest.
> > 
> > * If STFLE.15 is not set for the linux host, then then there will be no
> >    CEX4, CEX5 or CEX6 queues available to bind to the vfio_ap_matrix
> >    driver, so no AP adapters or domains can be assigned to any KVM guest.
> > 
> > The bottom line is the STFLE bit settings for the linux host will control
> > what APs are available to the KVM guest. Since STFLE.15 controls whether
> > any CEX4,5 or 6 devices are even available, I think this bit can be
> > combined into the feature that indicates whether AP is available. As long
> > as AP instructions are available on the linux host, I'm not sure whether
> > STFLE.12 needs a feature at all.  
> 
> We are implementing VFIO with SIE interpretation.
> 
> 1) Providing more:
> The simple way is to provide to the guest only features existing on the 
> host.
> If we do provide features not existing on the host we need to be able to 
> emulate them.
> Even it is possible, it could be done in a future enhancement, but AFAIK 
> it is not the goal of the current development.

Yes. I think we currently want to provide a subset of what the SIE can
do. Any emulation would be icing on top.

> 
> 2) Providing less:
> On the other hand we can mask to the guest some of the features provided 
> by the host if we can intercept the scanning of the features.

Yes. I think that applies to bit 65 (interrupts) for now.

> 
> 
> What I understand from this is that we need all these features being 
> separately toggled to be able to be compatible with an older system even 
> if we have a 1:1 host:guest features match in a first version.

This seems to be the case for the mentioned bits if I followed the
discussion correctly.

> 
> If several features where introduced together in a new architecture and 
> are available on all systems issued from this architecture we can then 
> gather them in a set. (But I will wonder why we have several features then)

You're expecting that all architecture is making sense ;)

> 
> 
> >>  
> >>>> * STFLE.65 indicates whether AP interrupts are available. If this 
> >>>> bit is not
> >>>>    set, then the AP bus will use polling instead of using interrupt 
> >>>> handlers
> >>>>    to process AP events.  
> >> So, does this indicate "adapter interrupts for AP" only? If so, we
> >> should keep this separate and only enable it when we have the gisa etc.
> >> ready.  
> > Yes, this indicates AP interrupts only. The plan is to enable this when
> > GISA is available and we can implement interrupt processing.  
> 
> If we want to be able to work on system where STFLE.65 is not available, 
> even if GISA is available I think it would be interesting to have a 
> Matrix implementation with only polling.

Agreed.

So, it seems what we want is:

- A feature for STFLE 12. This seems to be a z13 or later facility, so
  it probably makes sense to indicate it in the guest for z13 or newer
  if the host supports it and for older machines if it is explicitly
  specified (and the host supports it).
- A feature for STFLE 15. Similar to the one above, but starting with a
  different generation (when was this introduced?)
- A feature for STFLE 65. Can be deferred to when GISA is implemented
  (and exploited by vfio-ap). Same as above (I think this has existed
  for a long time, probably for any of the machines we support?)

Thoughts?

  reply	other threads:[~2017-12-06 10:16 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 17:38 [RFC 00/19] KVM: s390/crypto/vfio: guest dedicated crypto adapters Tony Krowiak
2017-10-13 17:38 ` [RFC 01/19] KVM: s390: SIE considerations for AP Queue virtualization Tony Krowiak
2017-11-02 11:54   ` Christian Borntraeger
2017-11-02 19:53     ` Tony Krowiak
2017-10-13 17:38 ` [RFC 02/19] KVM: s390: refactor crypto initialization Tony Krowiak
2017-11-02 12:41   ` Christian Borntraeger
2017-11-14 11:50     ` Cornelia Huck
2017-11-14 15:53       ` Tony Krowiak
2017-10-13 17:38 ` [RFC 03/19] s390/zcrypt: new AP matrix bus Tony Krowiak
2017-10-16  8:47   ` Martin Schwidefsky
2017-10-16 15:02     ` Tony Krowiak
2017-11-14 11:58   ` Cornelia Huck
2017-11-14 13:19     ` Tony Krowiak
2017-11-14 15:54     ` Tony Krowiak
2017-11-14 16:07     ` Tony Krowiak
2017-10-13 17:38 ` [RFC 04/19] s390/zcrypt: create an AP matrix device on the " Tony Krowiak
2017-10-18 16:20   ` Cornelia Huck
2017-10-18 17:54     ` Tony Krowiak
2017-10-13 17:38 ` [RFC 05/19] s390/zcrypt: base implementation of AP matrix device driver Tony Krowiak
2017-10-16  8:59   ` Martin Schwidefsky
2017-10-16 15:56     ` Tony Krowiak
2017-11-14 12:40   ` Cornelia Huck
2017-11-14 16:37     ` Tony Krowiak
2017-11-14 17:00       ` Cornelia Huck
2017-11-14 18:15         ` Tony Krowiak
2017-11-15 10:31           ` Cornelia Huck
2017-11-16 12:02       ` Pierre Morel
2017-11-16 12:35         ` Cornelia Huck
2017-11-16 14:25           ` Tony Krowiak
2017-11-16 16:47             ` Cornelia Huck
2017-11-17 21:13               ` Tony Krowiak
2017-11-20 17:15                 ` Cornelia Huck
2017-11-16 14:25           ` Pierre Morel
2017-10-13 17:38 ` [RFC 06/19] s390/zcrypt: register matrix device with VFIO mediated device framework Tony Krowiak
2017-10-16  9:03   ` Martin Schwidefsky
2017-10-16 16:09     ` Tony Krowiak
2017-11-14 13:14   ` Cornelia Huck
2017-11-16 15:37     ` Tony Krowiak
2017-10-13 17:38 ` [RFC 07/19] KVM: s390: introduce AP matrix configuration interface Tony Krowiak
2017-10-16  9:10   ` Martin Schwidefsky
2017-10-16 16:26     ` Tony Krowiak
2017-11-14 13:16   ` Cornelia Huck
2017-11-16 15:41     ` Tony Krowiak
2017-10-13 17:38 ` [RFC 08/19] s390/zcrypt: support for assigning adapters to matrix mdev Tony Krowiak
2017-11-14 13:22   ` Cornelia Huck
2017-11-16 23:53     ` Tony Krowiak
2017-11-17  9:50       ` Cornelia Huck
2017-10-13 17:38 ` [RFC 09/19] s390/zcrypt: validate adapter assignment Tony Krowiak
2017-10-13 17:38 ` [RFC 10/19] s390/zcrypt: sysfs interfaces supporting AP domain assignment Tony Krowiak
2017-10-13 17:38 ` [RFC 11/19] s390/zcrypt: validate " Tony Krowiak
2017-10-13 17:38 ` [RFC 12/19] s390/zcrypt: sysfs support for control " Tony Krowiak
2017-10-13 17:38 ` [RFC 13/19] s390/zcrypt: validate " Tony Krowiak
2017-10-16  9:13   ` Martin Schwidefsky
2017-10-13 17:38 ` [RFC 14/19] KVM: s390: Connect the AP mediated matrix device to KVM Tony Krowiak
2017-10-13 17:39 ` [RFC 15/19] s390/zcrypt: introduce ioctl access to VFIO AP Matrix driver Tony Krowiak
2017-10-13 17:39 ` [RFC 16/19] KVM: s390: interface to configure KVM guest's AP matrix Tony Krowiak
2017-10-16 20:22   ` Tony Krowiak
2017-11-14 13:46   ` Cornelia Huck
2017-10-13 17:39 ` [RFC 17/19] KVM: s390: validate input to AP matrix config interface Tony Krowiak
2017-10-13 17:39 ` [RFC 18/19] KVM: s390: New ioctl to configure KVM guest's AP matrix Tony Krowiak
2017-11-02 18:55   ` Tony Krowiak
2017-10-13 17:39 ` [RFC 19/19] s390/facilities: enable AP facilities needed by guest Tony Krowiak
2017-10-16  9:25   ` Martin Schwidefsky
2017-11-02 12:08     ` Christian Borntraeger
2017-11-02 12:23       ` Halil Pasic
     [not found]       ` <af1bb867-f9a0-458b-b7b2-c0bb9456eb7f@linux.vnet.ibm.com>
2017-11-02 15:53         ` Christian Borntraeger
2017-11-02 18:49           ` Tony Krowiak
2017-11-03  8:47             ` Christian Borntraeger
2017-12-02  1:30               ` Tony Krowiak
2017-12-05  7:52                 ` Harald Freudenberger
2017-12-05 14:04                   ` Cornelia Huck
2017-12-05 14:23                     ` Pierre Morel
2017-12-05 14:30                       ` Cornelia Huck
2017-12-05 14:47                         ` Pierre Morel
2017-12-05 15:14                       ` Tony Krowiak
2017-12-05 15:01                     ` Tony Krowiak
2017-12-06  9:15                       ` Pierre Morel
2017-12-06 10:15                         ` Cornelia Huck [this message]
2017-12-05 14:14                   ` Tony Krowiak
     [not found]         ` <OF182217F7.6A47A64E-ON002581CD.002BCF58-C12581CD.002D4127@notes.na.collabserv.com>
2017-11-03  8:49           ` Christian Borntraeger
2017-10-16  9:27 ` [RFC 00/19] KVM: s390/crypto/vfio: guest dedicated crypto adapters Martin Schwidefsky
2017-10-16 10:06   ` Christian Borntraeger
2017-10-16 16:30     ` Tony Krowiak
2017-10-16 10:05 ` Cornelia Huck
2017-10-16 16:27   ` Tony Krowiak
2017-10-18 16:43 ` Christian Borntraeger
2017-10-29 11:11 ` Cornelia Huck
2017-10-30  8:57   ` Christian Borntraeger
2017-10-30 19:04     ` Tony Krowiak
2017-10-31 19:39 ` Tony Krowiak
2017-11-14 13:57   ` Cornelia Huck
2017-11-16 15:23     ` Tony Krowiak
2017-11-16 16:06       ` Pierre Morel
2017-11-16 17:03         ` Cornelia Huck
2017-11-16 20:25           ` Pierre Morel
2017-11-16 23:35             ` Tony Krowiak
2017-11-17  7:07               ` Pierre Morel
2017-11-17 10:07                 ` Cornelia Huck
2017-11-17 20:28                   ` Tony Krowiak
2017-11-20 17:13                     ` Cornelia Huck
2017-11-21 16:08                       ` Tony Krowiak
2017-11-22 13:47                         ` Cornelia Huck
2017-11-28  0:39                           ` Tony Krowiak
2017-12-05 14:06                             ` Cornelia Huck
2017-12-05 15:09                               ` Tony Krowiak
2017-11-16 16:49       ` Cornelia Huck
2017-11-16 23:41         ` Tony Krowiak
2017-11-17  9:49           ` Cornelia Huck

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=20171206111546.2db47aaa.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=akrowiak@linux.vnet.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=alifm@linux.vnet.ibm.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=fiuczy@linux.vnet.ibm.com \
    --cc=freude@de.ibm.com \
    --cc=freude@linux.vnet.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pmorel@linux.vnet.ibm.com \
    --cc=qemu-s390x@nongnu.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=thuth@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).