linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.ibm.com>
To: pmorel@linux.ibm.com, Cornelia Huck <cohuck@redhat.com>
Cc: Dong Jia Shi <bjsdjshi@linux.ibm.com>,
	linux-s390@vger.kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, qemu-s390x@nongnu.org,
	qemu-devel@nongnu.org
Subject: Re: [PATCH RFC 2/2] vfio-ccw: support for halt/clear subchannel
Date: Tue, 12 Jun 2018 16:08:42 +0200	[thread overview]
Message-ID: <e4fc9a67-f3df-c040-8188-37eb3091db1a@linux.ibm.com> (raw)
In-Reply-To: <d5416c61-252a-5bb8-aebe-46d883e5822e@linux.ibm.com>



On 06/12/2018 03:56 PM, Pierre Morel wrote:
>> So, what are you proposing? Being more specific and stating that the
>> scsw is not necessarily a real scsw, but merely a vehicle for sending a
>> command? Or keeping it as it is now for ssch, and adding a second
>> interface for hsch/csch (and maybe rsch, msch, ...)?
>>
> 
> 
> I said no radical surgery, but after thinking more about it...
> I am not sure.
> 
> Let's explain this:
> 
> I see 2 ways to proceed but my favorite is definitively to introduce versioning.
> 
> 
> Way 1)
> 
> This was the way I first thought about.
> We keep the existing IO Regionand structures, and are more
> specific by stating that the io_region is a command region during write
> entry and a status region during interrupt handling:
> This allow us to use the 3 bits of the FCTL field of the SCSW to pass
> commands to the kernel and stay backward compatible.
> The FCTL field has 3 bits => we can have 8 commands.
> 
> PRO: small change
> 
> CONTRA: This is still confusing, we do not really solve this
>          unclarity problem since QEMU view / documentation and
>          Linux view / documentation differ or we update QEMU.
>          Moreover this does not allow for long term extensions
>          and/or re-design.
> 
> 

I'm not really in favor of way 1. Conie's point with RSCH is a good one.
And IMHO it speaks for a new interface for commands. Squeezing the RSCH
command into the SCSW does not seem to be a good idea. Considering your
proposal with the 3 bits, we could do something like: if in FCTL the
start and the clear and the halt bits are set then we postulate that is
request for a resume. But that would be quite confusing, and we would end
up re-defining the semantic of the scsw_area -- in respect to what is
documented Documentation/s390/vfio-ccw.txt, and also what is intuitive
based on the uapi header.

> 
> Way 2)
> 
> We use the device VFIO versioning using the capability chain to advertise
> a new interface.
> 
> This the preferred way, it is sane, allows for the userland backward
> compatibility and allows to have a new command interface, extensible
> for future use.
> 
> In this case we can extend the interface to be any kind we want
> in a next version, pwrite with new io_region, mmap on new
> IO regions, status region...
> 
> PRO: Extensible and also goes in the VFIO INFO extension direction
>       proposed by Alex
> 


Sounds much better. I imagine the coexistence of old and new like this.
Both the old and the new QEMU would supply the the SCSW area with the old
documented semantics -- the SCSW of the virtual subchannel. But with the
new version an explicit command would be supplied via the command region
(also for  SSCH). Maybe the SCSW can still end up being useful for
something in the kernel module too (maybe there are some  optimization
that can be done based on the QEMU SCSW).


> CONTRA: I see none outer more work to do (but is it a problem?)
> 
> 
The problem I see is that designing a good interface usually hard.
I could help with review, but I don't have the resources to commit
to more than that.

> ====================
> 
> Extra argumentation for versioning support
> 
> 
> Suppose a future implementation with 4 mapped regions like
> the following:
> 
> - A Status region (RO updated as result of command and IRQ)
> 
> - A command region (WO where the user send its commands)
>    userland write here to trigger IO (quite as currently)
> 
> - A CCW program region (RW where the CCW chain is handled)
>    most handling done from userspace, last translations in kernel,
>    double buffering...
> 
> - A performance / measurement / statistics region (RO)
>    This is updated asynchronously by hardware and/or driver
> 
> This is purely theoretical and we do not need to do all at once
> but if we want to extend the implementation without problems
> and continue backward compatibility the versioning and capability
> handling is a must.

I'm not sure about this.


Regards,
Halil
[..]


  reply	other threads:[~2018-06-12 14:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 15:48 [PATCH RFC 0/2] vfio-ccw: support for {halt,clear} subchannel Cornelia Huck
2018-05-09 15:48 ` [PATCH RFC 1/2] s390/cio: export hsch to modules Cornelia Huck
2018-05-11  9:36   ` Pierre Morel
2018-05-09 15:48 ` [PATCH RFC 2/2] vfio-ccw: support for halt/clear subchannel Cornelia Huck
2018-05-11  9:33   ` Pierre Morel
2018-05-15 16:10     ` Cornelia Huck
2018-05-16 13:32       ` Pierre Morel
2018-05-22 12:52         ` Cornelia Huck
2018-05-22 15:10           ` Pierre Morel
2018-06-05 13:14             ` Cornelia Huck
2018-06-05 15:23               ` Pierre Morel
2018-06-05 15:36                 ` Cornelia Huck
2018-06-06 12:21                 ` Cornelia Huck
2018-06-06 14:15                   ` Pierre Morel
2018-06-07  9:54                     ` Cornelia Huck
2018-06-07 16:17                       ` [qemu-s390x] " Halil Pasic
2018-06-07 16:34                         ` Cornelia Huck
2018-06-08 20:40                           ` Halil Pasic
2018-06-11 11:12                             ` Cornelia Huck
2018-06-11 16:00                             ` Cornelia Huck
2018-06-07 16:37                       ` Pierre Morel
2018-06-08 12:20                         ` Cornelia Huck
2018-06-08 13:13                           ` Halil Pasic
2018-06-08 14:45                             ` Cornelia Huck
2018-06-08 15:51                               ` Pierre Morel
2018-06-12  9:59                                 ` Cornelia Huck
2018-06-12 13:56                                   ` Pierre Morel
2018-06-12 14:08                                     ` Halil Pasic [this message]
2018-06-12 15:25                                       ` Cornelia Huck
2018-06-08 21:10                               ` [Qemu-devel] " 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=e4fc9a67-f3df-c040-8188-37eb3091db1a@linux.ibm.com \
    --to=pasic@linux.ibm.com \
    --cc=bjsdjshi@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --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).