qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Farhan Ali <alifm@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
	linux-s390@vger.kernel.org, Eric Farman <farman@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Pierre Morel <pmorel@linux.ibm.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org,
	qemu-s390x@nongnu.org, "Jason J . Herne" <jjherne@linux.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 0/3] vfio-ccw: support hsch/csch (kernel part)
Date: Thu, 6 Dec 2018 10:26:12 -0500	[thread overview]
Message-ID: <bb6c992e-ac03-ce3e-fba8-283e392f1543@linux.ibm.com> (raw)
In-Reply-To: <20181206153917.59e8e291.cohuck@redhat.com>



On 12/06/2018 09:39 AM, Cornelia Huck wrote:
> On Wed, 5 Dec 2018 13:34:11 -0500
> Farhan Ali <alifm@linux.ibm.com> wrote:
> 
>> On 12/05/2018 07:54 AM, Cornelia Huck wrote:
>>>> Yeah, that is perfectly clear, but it ain't the complete story. E.g.
>>>> are subsequent commands blocking until the preceding command finishes
>>>> is part of the interface. And what is good implementation depends on the
>>>> answer. What I mean, I first need to understand how things are supposed
>>>> to work (together) so I can double check that against the
>>>> implementation. Otherwise all I can do is nitpicking.
>>>>
>>>> To get more tangible: we are in the middle of processing an SSCH request
>>>> (e.g. doing the translation) when a HSCH comes in. What should happen?
>>>> Should we start processing HSCH after he instruction part of SSCH is
>>>> done -- which currently includes translation? Or should we -EBUSY? Or do
>>>> we abort START related activities and do the HALT stuff?
>>> I think most of the sorting-out-the-operations stuff should be done by
>>> the hardware itself, and we should not really try to enforce anything
>>> special in our vfio code.
>>>
>>> For your example, it might be best if a hsch is always accepted and
>>> send on towards the hardware. Probably best to reflect back -EAGAIN if
>>> we're currently processing another instruction from another vcpu, so
>>> that the user space caller can retry. Same for ssch, if another ssch is
>>> already being processed. We*could*  reflect cc 2 if the fctl bit is
>>> already set, but that won't do for csch, so it is probably best to have
>>> the hardware figure that out in any case.
>>>
>>> If I read the code correctly, we currently reflect -EBUSY and not
>>> -EAGAIN if we get a ssch request while already processing another one.
>>> QEMU hands that back to the guest as a cc 2, which is not 100% correct.
>>> In practice, we don't see this with Linux guests due to locking.
>>>    
>>
>> If we have a ssch and a csch immediately afterwards from userspace, will
>> we end up issuing csch first and then ssch to the hardware?
>>
>> If I understand correctly, the ccw translation as part of the ssch can
>> be a slow operation so it might be possible we issue the csch first?
>> In that case we won't actually clear the original start function as
>> intended.
> 
> When we start processing the ssch request (translation and so on), we
> set the state to BUSY. This means that any csch request will get a
> -EBUSY, no overtaking possible. (I think maybe I'll need to check what
> this series looks like if I rebase it on top of Pierre's rework, as he
> did some changes in the state machine.)

I think you meant the state is set to BOXED? otherwise the patch 3 says 
if state is BUSY and CLEAR event request comes in, we issue the clear 
instruction, no?


> 
> My idea above was to return -EAGAIN instead of -EBUSY, so that user
> space can retry the operation.
> 
> 

  reply	other threads:[~2018-12-06 15:26 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 16:54 [Qemu-devel] [PATCH 0/3] vfio-ccw: support hsch/csch (kernel part) Cornelia Huck
2018-11-22 16:54 ` [Qemu-devel] [PATCH 1/3] vfio-ccw: add capabilities chain Cornelia Huck
2018-11-23 12:28   ` Pierre Morel
2018-11-23 12:45     ` Cornelia Huck
2018-11-23 13:26       ` Pierre Morel
2018-11-27 19:04   ` Farhan Ali
2018-11-28  9:05     ` Cornelia Huck
2018-12-17 21:53   ` Eric Farman
2018-12-18 17:24     ` Cornelia Huck
2018-12-18 17:56       ` Eric Farman
2018-12-19 16:28       ` Alex Williamson
2018-12-21 11:12         ` Cornelia Huck
2018-11-22 16:54 ` [Qemu-devel] [PATCH 2/3] s390/cio: export hsch to modules Cornelia Huck
2018-11-23 12:30   ` Pierre Morel
2018-11-22 16:54 ` [Qemu-devel] [PATCH 3/3] vfio-ccw: add handling for asnyc channel instructions Cornelia Huck
2018-11-23 13:08   ` Pierre Morel
2018-11-26  9:47     ` Cornelia Huck
2018-11-27 19:09   ` Farhan Ali
2018-11-28  9:02     ` Cornelia Huck
2018-11-28 14:31       ` Farhan Ali
2018-11-28 14:52         ` Cornelia Huck
2018-11-28 15:00           ` Farhan Ali
2018-11-28 15:35             ` Cornelia Huck
2018-11-28 15:55               ` Farhan Ali
2019-01-18 13:53                 ` Cornelia Huck
2018-11-27 19:57   ` Farhan Ali
2018-11-28  8:41     ` Cornelia Huck
2018-11-28 16:36   ` [Qemu-devel] [qemu-s390x] " Halil Pasic
2018-11-29 16:52     ` Cornelia Huck
2018-11-29 17:24       ` Halil Pasic
2018-12-17 21:54   ` [Qemu-devel] " Eric Farman
2018-12-18 16:45     ` Cornelia Huck
2018-11-24 21:07 ` [Qemu-devel] [qemu-s390x] [PATCH 0/3] vfio-ccw: support hsch/csch (kernel part) Halil Pasic
2018-11-26  9:26   ` Cornelia Huck
2018-11-26 18:57 ` [Qemu-devel] " Farhan Ali
2018-11-26 19:00   ` Cornelia Huck
2018-12-04 12:38 ` Halil Pasic
2018-12-04 13:11   ` Cornelia Huck
2018-12-04 15:02     ` Halil Pasic
2018-12-05 12:54       ` Cornelia Huck
2018-12-05 18:34         ` Farhan Ali
2018-12-06 14:39           ` Cornelia Huck
2018-12-06 15:26             ` Farhan Ali [this message]
2018-12-06 16:21               ` Cornelia Huck
2018-12-06 17:50                 ` Farhan Ali
2018-12-07  9:34                   ` Cornelia Huck
2018-12-06 18:47         ` Halil Pasic
2018-12-07 10:05           ` Cornelia Huck
2018-12-07 15:49             ` Halil Pasic
2018-12-07 16:54             ` Halil Pasic
2018-12-19 11:54               ` Cornelia Huck
2018-12-19 14:17                 ` Halil Pasic
2018-12-21 11:23                   ` Cornelia Huck
2018-12-21 12:42                     ` Halil Pasic

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=bb6c992e-ac03-ce3e-fba8-283e392f1543@linux.ibm.com \
    --to=alifm@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    /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).