All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexander Graf <agraf@suse.de>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	Stuart Yoder <stuart.yoder@freescale.com>,
	Scott Wood <scottwood@freescale.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: in-kernel interrupt controller steering
Date: Wed, 06 Mar 2013 11:26:29 +0000	[thread overview]
Message-ID: <20130306112629.GO11223@redhat.com> (raw)
In-Reply-To: <2032322197.3144778.1362566313469.JavaMail.root@redhat.com>

On Wed, Mar 06, 2013 at 05:38:33AM -0500, Paolo Bonzini wrote:
> 
> 
> ----- Messaggio originale -----
> > Da: "Gleb Natapov" <gleb@redhat.com>
> > A: "Paolo Bonzini" <pbonzini@redhat.com>
> > Cc: "Alexander Graf" <agraf@suse.de>, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, "Stuart Yoder"
> > <stuart.yoder@freescale.com>, "Scott Wood" <scottwood@freescale.com>, "Paul Mackerras" <paulus@samba.org>, "Peter
> > Maydell" <peter.maydell@linaro.org>
> > Inviato: Mercoledì, 6 marzo 2013 10:58:35
> > Oggetto: Re: in-kernel interrupt controller steering
> > 
> > On Wed, Mar 06, 2013 at 10:40:18AM +0100, Paolo Bonzini wrote:
> > > Il 05/03/2013 16:25, Gleb Natapov ha scritto:
> > > >> 1) We need to set the generic interrupt type of the system
> > > >> before we create vcpus.
> > > >>
> > > >> This is a new ioctl that sets the overall system interrupt
> > > >> controller type to a specific model. This used so that when we
> > > >> create vcpus, we can create the appended "local interrupt
> > > >> controller" state without the actual interrupt controller
> > > >> device available yet. It is also used later to switch between
> > > >> interrupt controller implementations.
> > > >>
> > > >> This interrupt type is write once and frozen after the first
> > > >> vcpu got created.
> > > >
> > > > Why explicit ioctl is needed? Why not require specific irqchip to
> > > > be
> > > > created before first vcpu. The device created determines system
> > > > interrupt
> > > > controller type.
> > > 
> > > QEMU creates CPUs before devices, and CPUs need to know what kind of
> > > local interrupt controller to create.  Similar to how in-kernel LAPIC
> > > state is created long before the userspace device that proxies the
> > > LAPIC.
> >
> > So what is the difference between calling this special ioctl before
> > creating vcpus and calling create device ioctl instead and create
> > QEMU proxy device at whatever point in time QEMU wants to create it?
> 
> Because you'd have to stash the handle that KVM_CREATE_DEVICE returns
> somewhere, waiting for the QEMU device to be created.
> 
OK, we try not to add interfaces for one userspace convenience though.
Is this such insurmountable problem for QEMU?

> Perhaps it's just a problem of naming, and KVM_CREATE_DEVICE is simply
> not the right name for the interface.  Once both KVM_CREATE_IRQCHIP_ARGS
> and KVM_CREATE_DEVICE are added, it really will not create the device anymore.
> Devices will be created by KVM_CREATE_IRQCHIP_ARGS, and possibly by
> KVM_CREATE_VCPU.  KVM_CREATE_DEVICE is really only returning an id.
> 
> So we can have this instead:
> - KVM_CREATE_IRQCHIP_ARGS becomes KVM_SET_IRQCHIP_TYPE (and "none"
> can be a valid irqchip type).
> 
> - KVM_CREATE_DEVICE becomes KVM_GET_IRQCHIP_DEVICE, and you pass it a
> device type and possibly a VCPU number.
> 
> It's mostly about names, but one important property is that
> KVM_GET_IRQCHIP_DEVICE can be called at any time and, in fact,
> multiple times.  Gleb, do you like this more?
> 
If you put it like this it sounds better (well you've just stashed the
handle in kernel for QEMU convenience :)), but you've made the interface
irqchips specific again and this is what we are trying to avoid.

--
			Gleb.

WARNING: multiple messages have this Message-ID (diff)
From: Gleb Natapov <gleb@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexander Graf <agraf@suse.de>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	Stuart Yoder <stuart.yoder@freescale.com>,
	Scott Wood <scottwood@freescale.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: in-kernel interrupt controller steering
Date: Wed, 6 Mar 2013 13:26:29 +0200	[thread overview]
Message-ID: <20130306112629.GO11223@redhat.com> (raw)
In-Reply-To: <2032322197.3144778.1362566313469.JavaMail.root@redhat.com>

On Wed, Mar 06, 2013 at 05:38:33AM -0500, Paolo Bonzini wrote:
> 
> 
> ----- Messaggio originale -----
> > Da: "Gleb Natapov" <gleb@redhat.com>
> > A: "Paolo Bonzini" <pbonzini@redhat.com>
> > Cc: "Alexander Graf" <agraf@suse.de>, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, "Stuart Yoder"
> > <stuart.yoder@freescale.com>, "Scott Wood" <scottwood@freescale.com>, "Paul Mackerras" <paulus@samba.org>, "Peter
> > Maydell" <peter.maydell@linaro.org>
> > Inviato: Mercoledì, 6 marzo 2013 10:58:35
> > Oggetto: Re: in-kernel interrupt controller steering
> > 
> > On Wed, Mar 06, 2013 at 10:40:18AM +0100, Paolo Bonzini wrote:
> > > Il 05/03/2013 16:25, Gleb Natapov ha scritto:
> > > >> 1) We need to set the generic interrupt type of the system
> > > >> before we create vcpus.
> > > >>
> > > >> This is a new ioctl that sets the overall system interrupt
> > > >> controller type to a specific model. This used so that when we
> > > >> create vcpus, we can create the appended "local interrupt
> > > >> controller" state without the actual interrupt controller
> > > >> device available yet. It is also used later to switch between
> > > >> interrupt controller implementations.
> > > >>
> > > >> This interrupt type is write once and frozen after the first
> > > >> vcpu got created.
> > > >
> > > > Why explicit ioctl is needed? Why not require specific irqchip to
> > > > be
> > > > created before first vcpu. The device created determines system
> > > > interrupt
> > > > controller type.
> > > 
> > > QEMU creates CPUs before devices, and CPUs need to know what kind of
> > > local interrupt controller to create.  Similar to how in-kernel LAPIC
> > > state is created long before the userspace device that proxies the
> > > LAPIC.
> >
> > So what is the difference between calling this special ioctl before
> > creating vcpus and calling create device ioctl instead and create
> > QEMU proxy device at whatever point in time QEMU wants to create it?
> 
> Because you'd have to stash the handle that KVM_CREATE_DEVICE returns
> somewhere, waiting for the QEMU device to be created.
> 
OK, we try not to add interfaces for one userspace convenience though.
Is this such insurmountable problem for QEMU?

> Perhaps it's just a problem of naming, and KVM_CREATE_DEVICE is simply
> not the right name for the interface.  Once both KVM_CREATE_IRQCHIP_ARGS
> and KVM_CREATE_DEVICE are added, it really will not create the device anymore.
> Devices will be created by KVM_CREATE_IRQCHIP_ARGS, and possibly by
> KVM_CREATE_VCPU.  KVM_CREATE_DEVICE is really only returning an id.
> 
> So we can have this instead:
> - KVM_CREATE_IRQCHIP_ARGS becomes KVM_SET_IRQCHIP_TYPE (and "none"
> can be a valid irqchip type).
> 
> - KVM_CREATE_DEVICE becomes KVM_GET_IRQCHIP_DEVICE, and you pass it a
> device type and possibly a VCPU number.
> 
> It's mostly about names, but one important property is that
> KVM_GET_IRQCHIP_DEVICE can be called at any time and, in fact,
> multiple times.  Gleb, do you like this more?
> 
If you put it like this it sounds better (well you've just stashed the
handle in kernel for QEMU convenience :)), but you've made the interface
irqchips specific again and this is what we are trying to avoid.

--
			Gleb.

  reply	other threads:[~2013-03-06 11:26 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 22:20 in-kernel interrupt controller steering Alexander Graf
2013-03-04 22:20 ` Alexander Graf
2013-03-05  0:59 ` Scott Wood
2013-03-05  0:59   ` Scott Wood
2013-03-05  5:44   ` Paul Mackerras
2013-03-05  5:44     ` Paul Mackerras
2013-03-05 15:25 ` Gleb Natapov
2013-03-05 15:25   ` Gleb Natapov
2013-03-06  9:40   ` Paolo Bonzini
2013-03-06  9:40     ` Paolo Bonzini
2013-03-06  9:58     ` Gleb Natapov
2013-03-06  9:58       ` Gleb Natapov
2013-03-06 10:04       ` Alexander Graf
2013-03-06 10:04         ` Alexander Graf
2013-03-06 10:12         ` Gleb Natapov
2013-03-06 10:12           ` Gleb Natapov
2013-03-06 10:38       ` Paolo Bonzini
2013-03-06 10:38         ` Paolo Bonzini
2013-03-06 10:38       ` Paolo Bonzini
2013-03-06 10:38         ` Paolo Bonzini
2013-03-06 11:26         ` Gleb Natapov [this message]
2013-03-06 11:26           ` Gleb Natapov
2013-03-06 11:44           ` Alexander Graf
2013-03-06 11:44             ` Alexander Graf
2013-03-06 11:46             ` Paolo Bonzini
2013-03-06 11:46               ` Paolo Bonzini
2013-03-06 11:47               ` Alexander Graf
2013-03-06 11:47                 ` Alexander Graf
2013-03-06 11:57                 ` Paolo Bonzini
2013-03-06 11:57                   ` Paolo Bonzini
2013-03-06 11:58                   ` Alexander Graf
2013-03-06 11:58                     ` Alexander Graf
2013-03-06 13:16                     ` Gleb Natapov
2013-03-06 13:16                       ` Gleb Natapov
2013-03-06 11:44           ` Paolo Bonzini
2013-03-06 11:44             ` Paolo Bonzini
2013-03-06 11:46             ` Alexander Graf
2013-03-06 11:46               ` Alexander Graf
2013-03-06 11:59               ` Gleb Natapov
2013-03-06 11:59                 ` Gleb Natapov
2013-03-06 12:02                 ` Alexander Graf
2013-03-06 12:02                   ` Alexander Graf
2013-03-06 12:14                 ` Paolo Bonzini
2013-03-06 12:14                   ` Paolo Bonzini
2013-03-06 12:20                   ` Alexander Graf
2013-03-06 12:20                     ` Alexander Graf
2013-03-06 12:28                     ` Paolo Bonzini
2013-03-06 12:28                       ` Paolo Bonzini
2013-03-06 13:14                     ` Gleb Natapov
2013-03-06 13:14                       ` Gleb Natapov
2013-03-06 13:22                       ` Alexander Graf
2013-03-06 13:22                         ` Alexander Graf
2013-03-06 13:56                         ` Gleb Natapov
2013-03-06 13:56                           ` Gleb Natapov
2013-03-06 14:03                           ` Alexander Graf
2013-03-06 14:03                             ` Alexander Graf
2013-03-06 14:12                             ` Paolo Bonzini
2013-03-06 14:12                               ` Paolo Bonzini
2013-03-06 14:30                               ` Alexander Graf
2013-03-06 14:30                                 ` Alexander Graf
2013-03-06 14:37                                 ` Paolo Bonzini
2013-03-06 14:37                                   ` Paolo Bonzini
2013-03-06 14:40                                   ` Alexander Graf
2013-03-06 14:40                                     ` Alexander Graf
2013-03-06 14:41                             ` Gleb Natapov
2013-03-06 14:41                               ` Gleb Natapov
2013-03-06 14:48                               ` Alexander Graf
2013-03-06 14:48                                 ` Alexander Graf
2013-03-06 14:59                                 ` Alexander Graf
2013-03-06 14:59                                   ` Alexander Graf
2013-03-06 15:02                                   ` Paolo Bonzini
2013-03-06 15:02                                     ` Paolo Bonzini
2013-03-06 15:30                                 ` Gleb Natapov
2013-03-06 15:30                                   ` Gleb Natapov
2013-03-06 16:33                                   ` Alexander Graf
2013-03-06 16:33                                     ` Alexander Graf
2013-03-07  0:32                                 ` Paul Mackerras
2013-03-07  0:32                                   ` Paul Mackerras
2013-03-07  7:43                                   ` Paolo Bonzini
2013-03-07  7:43                                     ` Paolo Bonzini
2013-03-06 13:41                       ` Paolo Bonzini
2013-03-06 13:41                         ` Paolo Bonzini
2013-03-06 14:11                         ` Gleb Natapov
2013-03-06 14:11                           ` Gleb Natapov
2013-03-06 14:31                           ` Alexander Graf
2013-03-06 14:31                             ` Alexander Graf
2013-03-06 18:46                             ` Peter Maydell
2013-03-06 18:46                               ` Peter Maydell
2013-03-06 19:20                               ` Alexander Graf
2013-03-06 19:20                                 ` Alexander Graf
2013-03-06  0:23 ` Benjamin Herrenschmidt
2013-03-06  0:23   ` Benjamin Herrenschmidt
2013-03-06  0:33   ` Alexander Graf
2013-03-06  0:33     ` Alexander Graf

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=20130306112629.GO11223@redhat.com \
    --to=gleb@redhat.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=scottwood@freescale.com \
    --cc=stuart.yoder@freescale.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.