From: Gleb Natapov <gleb@redhat.com>
To: Jens Freimann <jfrei@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
KVM <kvm@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>
Subject: Re: [Patchv5 2/7] KVM: s390: add floating irq controller
Date: Mon, 14 Oct 2013 16:35:12 +0300 [thread overview]
Message-ID: <20131014133512.GV15657@redhat.com> (raw)
In-Reply-To: <20131014111330.GC21221@linux.vnet.ibm.com>
On Mon, Oct 14, 2013 at 01:13:30PM +0200, Jens Freimann wrote:
> On Mon, Oct 14, 2013 at 12:07:24PM +0300, Gleb Natapov wrote:
> > On Mon, Oct 14, 2013 at 10:28:57AM +0200, Jens Freimann wrote:
> > > On Sun, Oct 13, 2013 at 11:39:55AM +0300, Gleb Natapov wrote:
> > > > On Tue, Oct 08, 2013 at 04:54:55PM +0200, Christian Borntraeger wrote:
> > > > > From: Jens Freimann <jfrei@linux.vnet.ibm.com>
> > > > >
> > > > > This patch adds a floating irq controller as a kvm_device.
> > > > > It will be necessary for migration of floating interrupts as well
> > > > > as for hardening the reset code by allowing user space to explicitly
> > > > > remove all pending floating interrupts.
> > > > >
> > > > > Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
> > > > > Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> > > > > Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> > > > > ---
> > > > > Documentation/virtual/kvm/devices/s390_flic.txt | 36 +++
> > > > > arch/s390/include/asm/kvm_host.h | 1 +
> > > > > arch/s390/include/uapi/asm/kvm.h | 5 +
> > > > > arch/s390/kvm/interrupt.c | 296 ++++++++++++++++++++----
> > > > > arch/s390/kvm/kvm-s390.c | 1 +
> > > > > include/linux/kvm_host.h | 1 +
> > > > > include/uapi/linux/kvm.h | 1 +
> > > > > virt/kvm/kvm_main.c | 5 +
> > > > > 8 files changed, 295 insertions(+), 51 deletions(-)
> > > > > create mode 100644 Documentation/virtual/kvm/devices/s390_flic.txt
> > > > >
> > > > > diff --git a/Documentation/virtual/kvm/devices/s390_flic.txt b/Documentation/virtual/kvm/devices/s390_flic.txt
> > > > > new file mode 100644
> > > > > index 0000000..06aef31
> > > > > --- /dev/null
> > > > > +++ b/Documentation/virtual/kvm/devices/s390_flic.txt
> > > > > @@ -0,0 +1,36 @@
> > > > > +FLIC (floating interrupt controller)
> > > > > +====================================
> > > > > +
> > > > > +FLIC handles floating (non per-cpu) interrupts, i.e. I/O, service and some
> > > > > +machine check interruptions. All interrupts are stored in a per-vm list of
> > > > > +pending interrupts. FLIC performs operations on this list.
> > > > > +
> > > > > +Only one FLIC instance may be instantiated.
> > > > > +
> > > > > +FLIC provides support to
> > > > > +- add/delete interrupts (KVM_DEV_FLIC_ENQUEUE and _DEQUEUE)
> > > > > +- purge all pending floating interrupts (KVM_DEV_FLIC_CLEAR_IRQS)
> > > > > +
> > > > > +Groups:
> > > > > + KVM_DEV_FLIC_ENQUEUE
> > > > > + Adds one interrupt to the list of pending floating interrupts. Interrupts
> > > > > + are taken from this list for injection into the guest. attr contains
> > > > > + a struct kvm_s390_irq which contains all data relevant for
> > > > > + interrupt injection.
> > > > > + The format of the data structure kvm_s390_irq as it is copied from userspace
> > > > > + is defined in usr/include/linux/kvm.h.
> > > > > + For historic reasons list members are stored in a different data structure, i.e.
> > > > > + we need to copy the relevant data into a struct kvm_s390_interrupt_info
> > > > > + which can then be added to the list.
> > > > > +
> > > > > + KVM_DEV_FLIC_DEQUEUE
> > > > > + Takes one element off the pending interrupts list and copies it into userspace.
> > > > > + Dequeued interrupts are not injected into the guest.
> > > > > + attr->addr contains the userspace address of a struct kvm_s390_irq.
> > > > > + List elements are stored in the format of struct kvm_s390_interrupt_info
> > > > > + (arch/s390/include/asm/kvm_host.h) and are copied into a struct kvm_s390_irq
> > > > > + (usr/include/linux/kvm.h)
> > > > > +
> > > > Can interrupt be dequeued on real HW also? When this interface will be
> > > > used?
> > >
> > > We will it for migration. (See Christians mail)
> > >
> > For migration you do not need dequeue semantics though, dequeuing
> > does not hurt in case of migration, but what if we will want to add
> > QEMU monitor command that inspects interrupt queue (like we have for
> > inspecting processor's register state). The destructive nature of the
> > command will prevent us from doing so. We need non destructive way to
> > inspect the state, no?
>
> Inspection is a requirement that we didn't have in mind when we designed
> this. But yes, it should be non-destructive in that case.
>
BTW, not destructive interface is better for migration too. What if
migration fails and src needs to be restarted?
--
Gleb.
next prev parent reply other threads:[~2013-10-14 13:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 14:54 [PATCHv5 0/7] aync page fault support for s390 (plus flic) Christian Borntraeger
2013-10-08 14:54 ` [Patchv5 1/7] KVM: s390: add and extend interrupt information data structs Christian Borntraeger
2013-10-08 14:54 ` [Patchv5 2/7] KVM: s390: add floating irq controller Christian Borntraeger
2013-10-13 8:39 ` Gleb Natapov
2013-10-14 7:58 ` Christian Borntraeger
2013-10-14 10:21 ` Gleb Natapov
2013-10-14 8:28 ` Jens Freimann
2013-10-14 9:07 ` Gleb Natapov
2013-10-14 11:13 ` Jens Freimann
2013-10-14 11:31 ` Gleb Natapov
2013-10-14 13:35 ` Gleb Natapov [this message]
2013-10-08 14:54 ` [Patchv5 3/7] KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault Christian Borntraeger
2013-10-08 14:54 ` [Patchv5 4/7] KVM: async_pf: Provide additional direct page notification Christian Borntraeger
2013-10-08 14:54 ` [Patchv5 5/7] KVM: async_pf: Allow to wait for outstanding work Christian Borntraeger
2013-10-13 8:48 ` Gleb Natapov
2013-10-13 9:08 ` Gleb Natapov
2013-10-08 14:54 ` [Patchv5 6/7] KVM: async_pf: Async page fault support on s390 Christian Borntraeger
2013-10-13 9:15 ` Gleb Natapov
2013-10-13 9:30 ` Gleb Natapov
2013-10-08 14:55 ` [Patchv5 7/7] KVM: async_pf: Exploit one reg interface for pfault Christian Borntraeger
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=20131014133512.GV15657@redhat.com \
--to=gleb@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=schwidefsky@de.ibm.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).