From: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
To: Tony Krowiak <akrowiak@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Tony Krowiak <akrowiak@linux.vnet.ibm.com>,
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,
buendgen@de.ibm.com
Subject: Re: [PATCH v6 21/21] s390: doc: detailed specifications for AP virtualization
Date: Wed, 4 Jul 2018 18:31:05 +0200 [thread overview]
Message-ID: <f3818b46-1cb2-6f2c-ef22-b40233ccdca7@linux.vnet.ibm.com> (raw)
In-Reply-To: <0f082b9e-a28c-4354-65eb-3e52304c711e@linux.ibm.com>
On 07/03/2018 06:36 PM, Tony Krowiak wrote:
> On 07/02/2018 07:10 PM, Halil Pasic wrote:
>>
>>
>> On 06/29/2018 11:11 PM, Tony Krowiak wrote:
>>> This patch provides documentation describing the AP architecture and
>>> design concepts behind the virtualization of AP devices. It also
>>> includes an example of how to configure AP devices for exclusive
>>> use of KVM guests.
>>>
>>> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
>>
>> I don't like the design of external interfaces except for:
>> * cpu model features, and
>> * reset handling.
>>
>> In particular:
>>
>> 1) The architecture is such that authorizing access (via APM, AQM and
>> ADM)
>> to an AP queue that is currently not configured (e.g. the card not
>> physically
>> plugged, or just configured off). That seems to be a perfectly normal use
>> case.
>>
>> Your assign operations however enforce that the resource is bound to your
>> driver, and thus the existence of the resource in the host.
>>
>> It is clear: we need to avoid passing trough resources to guests that
>> are not
>> dedicated for this purpose (e.g. a queue utilized by zcrypt). But IMHO
>> we need a different mechanism.
>
> Interesting that you wait until v6 to bring this up. I agree, this is a
> normal
> use case, but there is currently no mechanism in the AP bus for drivers to
> reserve devices that are not yet configured. There is proposed solution
> in the
> works, but until such time that is available the only choice is to disallow
> assignment of AP queues to a guest that are not bound to the vfio_ap
> device driver.
>
>>
>>
>> 2) I see no benefit in deferring the exclusivity check to
>> vfio_ap_mdev_open().
>> The downside is however pretty obvious: management software is
>> notified about
>> a 'bad configuration' only at an attempted guest start-up. And your
>> current QEMU
>> patches are not very helpful in conveying this piece of information.
>
> It only becomes a 'bad configuration' if the two guests are started
> concurrently.
> Is there value in being able to configure two mediated devices with the
> same
> queue if the intent is to never run two guests using those mediated devices
> simultaneously? If so, then the only time the exclusivity check can be done
> is when the guest opens the mediated device. If not, then we can certainly
> prevent multiple mediated devices from being assigned the same queue.
>
> In my view, while a mediated device is used by a guest, it is not a
> guest and
> can be configured any way an administrator prefers. If we get concurrence
> that doing an exclusivity check when an adapter or domain is assigned to
> the mediated device, I'll make that change.
>
>>
>>
>> I've talked with Boris, and AFAIR he said this is not acceptable to
>> him (@Boris
>> can you confirm).
>
> Then I suggest Boris participate in the review and explain why.
[To make things a bit easier I am not going to address the aspect of
not-currently-exiting host resources.]
Your current implementation does provide active configurations that work
with existing host resources. These need to be bound to the vfio_ap driver.
Libvirt allows to define objects (e.g. domains or networks). These are
just definitions and do NOT bind any resources. The defined resources
are bound once the definition is started.
Currently I am assuming that an ap matrix device is defined in libvirt
outside of a libvirt domain (an ap definition). The mediated device of
the ap matrix device is used in a libvirt domain by referencing it via
its UID.
When a libvirt domain is started the mediated device should exist and be
configured correctly as every other host resource.
Therefore there needs to be something new in libvirt that allows one to
define, start, stop and undefine an ap matrix device. After a define the
ap definition for an ap matrix device would exist in libvirt only.
Once you start the ap definition the result should be a well configured
ready to be used mediated device representing the ap definition which
can be used configuration-error free by a libvirt domain. Please not
that the start of an ap definition is independent from the start of a
libvirt domain using the ap definition.
Can you explain to me how that can be accomplished?
>>
>>
>> 3) We indicate the reason for failure due to a configuration problem
>> (exclusivity
>> or resource allocation) via pr_err() that is via kernel messages. I
>> don't think
>> this is very tooling/management software friendly, and I hope we don't
>> expect admins
>> to work with the sysfs interface long term. I mean the effects of the
>> admin actions
>> are not very persistent. Thus if the interface is a painful one, we
>> are talking
>> about potentially frequent pain.
>
> We have multiple layers of software, each with its own logging
> facilities. Figuring
> out what went wrong when a guest fails to start is always a painful
> process IMHO.
> Typically, one has to view the log for each component in the stack to
> figure out
> what went wrong and often times, still can't figure it out. Of course,
> we can help
> out here by having QEMU put out a better message when this problem
> occurs. But the
> bottom line is, does the community think that allowing an administrator
> to configure
> multiple mediated devices with the same queues have value? In other
> words, are
> there potential use cases that would required this?
>
>>
>>
>> 4) If I were to act out the role of the administrator, I would prefer
>> to think of
>> specifying or changing the access controls of a guest in respect to AP
>> (that is
>> setting the AP matrix) as a single atomic operation -- which either
>> succeeds or fails.
>
> I don't understand what you are describing here. How would this be done?
> Are you
> suggesting the admin somehow provides the masks en masse?
>
>>
>>
>> The operation should succeed for any valid configuration, and fail for
>> any invalid
>> on.
>>
>> The current piecemeal approach seems even less fitting if we consider
>> changing the
>> access controls of a running guest. AFAIK changing access controls for
>> a running
>> guest is possible, and I don't see a reason why should we artificially
>> prohibit this.
>
> Setting and clearing bits in the APM/AQM/ADM of a guest's CRYCB is
> certainly possible,
> but there is a lot more to it than merely setting and clearing bits.
> What you seem
> to be describing here is hot plug/unplug which I stated in the cover
> letter is
> forthcoming. It is currently prohibited for good reason.
>
>>
>>
>> I think the current sysfs interface for manipulating the matrix is
>> good for
>> manual playing around, but I would prefer having an interface that is
>> better
>> suited for programs (e.g. ioctl).
>
> That wouldn't be a problem, but do we have a use case for it?
>
>>
>>
>> Regards,
>> Halil
>
>
--
Mit freundlichen Grüßen/Kind regards
Boris Fiuczynski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
next prev parent reply other threads:[~2018-07-04 16:31 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 21:11 [PATCH v6 00/21] s390: vfio-ap: guest dedicated crypto adapters Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 01/21] s390/zcrypt: Add ZAPQ inline function Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 02/21] s390/zcrypt: Review inline assembler constraints Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 03/21] s390/zcrypt: Show load of cards and queues in sysfs Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 04/21] s390/zcrypt: Integrate ap_asm.h into include/asm/ap.h Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 05/21] KVM: s390: CPU model support for AP virtualization Tony Krowiak
2018-07-02 14:38 ` Christian Borntraeger
2018-07-02 15:37 ` Tony Krowiak
2018-07-02 15:41 ` Cornelia Huck
2018-07-02 15:54 ` Tony Krowiak
2018-07-02 16:11 ` Cornelia Huck
2018-07-02 16:20 ` Halil Pasic
2018-07-02 16:28 ` Cornelia Huck
2018-07-03 14:44 ` Tony Krowiak
2018-07-02 16:04 ` Halil Pasic
2018-07-02 15:56 ` Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 06/21] KVM: s390: refactor crypto initialization Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 07/21] s390: vfio-ap: base implementation of VFIO AP device driver Tony Krowiak
2018-07-02 13:53 ` Halil Pasic
2018-07-02 15:39 ` Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 08/21] s390: vfio-ap: register matrix device with VFIO mdev framework Tony Krowiak
2018-07-09 14:17 ` Pierre Morel
2018-07-10 7:03 ` Harald Freudenberger
2018-07-12 7:32 ` Tony Krowiak
2018-07-09 15:44 ` Pierre Morel
2018-06-29 21:11 ` [PATCH v6 09/21] s390: vfio-ap: structure for storing mdev matrix Tony Krowiak
2018-07-06 14:26 ` Halil Pasic
2018-07-12 14:34 ` Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 10/21] s390: vfio-ap: sysfs interfaces to configure adapters Tony Krowiak
2018-07-09 12:11 ` Pierre Morel
2018-07-13 12:20 ` Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 11/21] s390: vfio-ap: sysfs interfaces to configure domains Tony Krowiak
2018-07-09 12:13 ` Pierre Morel
2018-06-29 21:11 ` [PATCH v6 12/21] s390: vfio-ap: sysfs interfaces to configure control domains Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 13/21] s390: vfio-ap: sysfs interface to view matrix mdev matrix Tony Krowiak
2018-07-09 12:20 ` Pierre Morel
2018-07-09 14:38 ` Pierre Morel
2018-07-13 12:24 ` Tony Krowiak
2018-07-13 16:38 ` Halil Pasic
2018-06-29 21:11 ` [PATCH v6 14/21] s390: vfio-ap: implement mediated device open callback Tony Krowiak
2018-07-12 12:47 ` Halil Pasic
2018-07-12 16:03 ` Tony Krowiak
2018-07-13 10:48 ` Halil Pasic
2018-06-29 21:11 ` [PATCH v6 15/21] s390: vfio-ap: configure the guest's AP matrix Tony Krowiak
2018-07-11 23:22 ` Halil Pasic
2018-07-12 14:36 ` Tony Krowiak
2018-07-12 13:28 ` Halil Pasic
2018-07-12 14:37 ` Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 16/21] s390: vfio-ap: sysfs interface to view guest matrix Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 17/21] s390: vfio-ap: implement VFIO_DEVICE_GET_INFO ioctl Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 18/21] s390: vfio-ap: zeroize the AP queues Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 19/21] s390: vfio-ap: implement VFIO_DEVICE_RESET ioctl Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 20/21] KVM: s390: Handling of Cypto control block in VSIE Tony Krowiak
2018-06-29 21:11 ` [PATCH v6 21/21] s390: doc: detailed specifications for AP virtualization Tony Krowiak
2018-07-02 16:28 ` Halil Pasic
2018-07-03 7:46 ` Harald Freudenberger
2018-07-03 9:22 ` Halil Pasic
2018-07-03 11:52 ` Cornelia Huck
2018-07-03 12:20 ` Halil Pasic
2018-07-03 13:25 ` Cornelia Huck
2018-07-03 13:58 ` Halil Pasic
2018-07-03 14:30 ` Cornelia Huck
2018-07-03 15:25 ` Tony Krowiak
2018-07-03 16:14 ` Halil Pasic
2018-07-03 15:20 ` Tony Krowiak
2018-07-03 15:17 ` Tony Krowiak
2018-07-03 15:00 ` Tony Krowiak
2018-07-03 14:56 ` Tony Krowiak
2018-07-04 8:31 ` Harald Freudenberger
2018-07-02 23:10 ` Halil Pasic
2018-07-03 16:36 ` Tony Krowiak
2018-07-04 16:31 ` Boris Fiuczynski [this message]
2018-07-05 13:29 ` Tony Krowiak
2018-07-09 9:21 ` Pierre Morel
2018-07-09 15:50 ` Halil Pasic
2018-07-10 8:49 ` Pierre Morel
2018-07-12 7:26 ` Tony Krowiak
2018-07-03 8:10 ` Harald Freudenberger
2018-07-09 9:02 ` Pierre Morel
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=f3818b46-1cb2-6f2c-ef22-b40233ccdca7@linux.vnet.ibm.com \
--to=fiuczy@linux.vnet.ibm.com \
--cc=akrowiak@linux.ibm.com \
--cc=akrowiak@linux.vnet.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=alifm@linux.vnet.ibm.com \
--cc=berrange@redhat.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=buendgen@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=freude@de.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.ibm.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pmorel@linux.vnet.ibm.com \
--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