Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-06 Thread Gleb Natapov
On Wed, Mar 06, 2013 at 01:48:33PM +1100, Benjamin Herrenschmidt wrote: On Wed, 2013-02-13 at 23:49 -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Paul Mackerras
On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 06:59:26 PM, Paul Mackerras wrote: On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 08:48:33 PM, Benjamin Herrenschmidt wrote: On Wed, 2013-02-13 at 23:49 -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Benjamin Herrenschmidt
On Tue, 2013-03-05 at 21:36 -0600, Scott Wood wrote: Which file is this in? A few hits: $ grep anon arch/powerpc/kvm/* arch/powerpc/kvm/book3s_64_mmu_hv.c:#include linux/anon_inodes.h arch/powerpc/kvm/book3s_64_mmu_hv.c:ret = anon_inode_getfd(kvm-htab, kvm_htab_fops, ctx, rwflag);

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-25 Thread Gleb Natapov
On Mon, Feb 25, 2013 at 12:11:19PM +1100, Paul Mackerras wrote: On Mon, Feb 18, 2013 at 02:21:59PM +0200, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-25 Thread Alexander Graf
On 24.02.2013, at 16:46, Gleb Natapov wrote: On Thu, Feb 21, 2013 at 08:17:54PM -0600, Scott Wood wrote: On 02/21/2013 02:22:09 AM, Gleb Natapov wrote: On Wed, Feb 20, 2013 at 08:05:12PM -0600, Scott Wood wrote: On 02/20/2013 07:09:49 AM, Gleb Natapov wrote: On Tue, Feb 19, 2013 at

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-25 Thread Alexander Graf
On 25.02.2013, at 14:09, Gleb Natapov wrote: On Mon, Feb 25, 2013 at 12:11:19PM +1100, Paul Mackerras wrote: On Mon, Feb 18, 2013 at 02:21:59PM +0200, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote:

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-25 Thread Scott Wood
On 02/23/2013 09:04:33 AM, Marcelo Tosatti wrote: On Thu, Feb 21, 2013 at 08:00:25PM -0600, Scott Wood wrote: On 02/21/2013 05:03:32 PM, Marcelo Tosatti wrote: You are not writing to the registers from the CPU point of view. That's exactly how KVM_DEV_MPIC_GRP_REGISTER is defined and

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-24 Thread Marc Zyngier
On Tue, 19 Feb 2013 18:16:53 -0800, Christoffer Dall cd...@cs.columbia.edu wrote: On Tue, Feb 19, 2013 at 12:16 PM, Scott Wood scottw...@freescale.com wrote: We at least need the numberspace to not be architecture-specific if we want to retain the possibility of changing later -- not to

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-24 Thread Paul Mackerras
On Mon, Feb 18, 2013 at 02:21:59PM +0200, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-23 Thread Marcelo Tosatti
On Thu, Feb 21, 2013 at 08:00:25PM -0600, Scott Wood wrote: On 02/21/2013 05:03:32 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 07:28:52PM -0600, Scott Wood wrote: On 02/20/2013 06:14:37 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: It is

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-21 Thread Gleb Natapov
On Wed, Feb 20, 2013 at 08:05:12PM -0600, Scott Wood wrote: On 02/20/2013 07:09:49 AM, Gleb Natapov wrote: On Tue, Feb 19, 2013 at 03:16:37PM -0600, Scott Wood wrote: On 02/19/2013 06:24:18 AM, Gleb Natapov wrote: On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: The ability to

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-21 Thread Marcelo Tosatti
On Wed, Feb 20, 2013 at 07:28:52PM -0600, Scott Wood wrote: On 02/20/2013 06:14:37 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: It is then not necessary to set device attributes on a live guest and deal with the complications associated with that.

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-21 Thread Scott Wood
On 02/21/2013 05:03:32 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 07:28:52PM -0600, Scott Wood wrote: On 02/20/2013 06:14:37 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: It is then not necessary to set device attributes on a live guest and

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-21 Thread Scott Wood
On 02/21/2013 02:22:09 AM, Gleb Natapov wrote: On Wed, Feb 20, 2013 at 08:05:12PM -0600, Scott Wood wrote: On 02/20/2013 07:09:49 AM, Gleb Natapov wrote: On Tue, Feb 19, 2013 at 03:16:37PM -0600, Scott Wood wrote: On 02/19/2013 06:24:18 AM, Gleb Natapov wrote: On Mon, Feb 18, 2013 at

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-20 Thread Scott Wood
On 02/20/2013 06:01:00 PM, Marcelo Tosatti wrote: The main problem, to me, is that the interface allows flexibility but the details of using such flexibility are not worked out. That is, lack of definitions such as when setting attributes is allowed. That is defined by the individual

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-20 Thread Marcelo Tosatti
On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: Why exactly you need to set attributes Scott? That's best answered by looking at patch 6/6 and discussing the actual attributes that are defined so far. The need to set the base address of the registers is straightforward. When

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-20 Thread Scott Wood
On 02/20/2013 07:09:49 AM, Gleb Natapov wrote: On Tue, Feb 19, 2013 at 03:16:37PM -0600, Scott Wood wrote: On 02/19/2013 06:24:18 AM, Gleb Natapov wrote: On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: The ability to set/get attributes is needed. Sorry, but get or set one

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-19 Thread Gleb Natapov
On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-19 Thread Gleb Natapov
On Mon, Feb 18, 2013 at 09:50:44PM -0800, Christoffer Dall wrote: +static int kvm_ioctl_create_device(struct kvm *kvm, + struct kvm_create_device *cd) +{ + struct kvm_device *dev = NULL; + bool test = cd-flags KVM_CREATE_DEVICE_TEST;

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-19 Thread Christoffer Dall
On Tue, Feb 19, 2013 at 4:24 AM, Gleb Natapov g...@redhat.com wrote: On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-19 Thread Scott Wood
On 02/19/2013 06:24:18 AM, Gleb Natapov wrote: On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: The ability to set/get attributes is needed. Sorry, but get or set one blob of data, up to 512 bytes, for the entire irqchip is just not good enough -- assuming you don't want us to

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Gleb Natapov
Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Scott Wood
On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Christoffer Dall
On Mon, Feb 18, 2013 at 3:01 PM, Scott Wood scottw...@freescale.com wrote: On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: Copying Christoffer since ARM has in kernel irq chip too. On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Christoffer Dall
On Wed, Feb 13, 2013 at 9:49 PM, Scott Wood scottw...@freescale.com wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Scott Wood
On 02/18/2013 06:44:20 PM, Christoffer Dall wrote: On Wed, Feb 13, 2013 at 9:49 PM, Scott Wood scottw...@freescale.com wrote: index 0350e0d..dbaf012 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -335,6 +335,25 @@ struct kvm_memslots { short

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-18 Thread Christoffer Dall
On Mon, Feb 18, 2013 at 4:53 PM, Scott Wood scottw...@freescale.com wrote: On 02/18/2013 06:44:20 PM, Christoffer Dall wrote: On Wed, Feb 13, 2013 at 9:49 PM, Scott Wood scottw...@freescale.com wrote: index 0350e0d..dbaf012 100644 --- a/include/linux/kvm_host.h +++

[RFC PATCH 1/6] kvm: add device control API

2013-02-13 Thread Scott Wood
Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through inflexible one-purpose-only IOCTLs (e.g. KVM_GET/SET_LAPIC). Defining