Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Mon, Jan 11, 2016 at 04:13:12PM +, Peter Maydell wrote: > On 11 January 2016 at 16:09, Andrew Jones wrote: > > I think the save/restore case is where I always flip to seeing it as a > > bunch of separate per cpu devices. It would feel better to me to > > save/restore the cpu-gic registers t

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Mon, Jan 11, 2016 at 04:29:03PM +, Peter Maydell wrote: > On 11 January 2016 at 16:21, Andrew Jones wrote: > > On Mon, Jan 11, 2016 at 05:09:27PM +0100, Andrew Jones wrote: > >> On Mon, Jan 11, 2016 at 04:09:29PM +0100, Christoffer Dall wrote: > >> > Are vcpu ids already exposed to userspac

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Peter Maydell
On 11 January 2016 at 16:21, Andrew Jones wrote: > On Mon, Jan 11, 2016 at 05:09:27PM +0100, Andrew Jones wrote: >> On Mon, Jan 11, 2016 at 04:09:29PM +0100, Christoffer Dall wrote: >> > Are vcpu ids already exposed to userspace (beyond the stupid >> > KVM_IRQ_LINE) ioctl and as such we're bound t

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Mon, Jan 11, 2016 at 05:09:27PM +0100, Andrew Jones wrote: > On Mon, Jan 11, 2016 at 04:09:29PM +0100, Christoffer Dall wrote: > > Are vcpu ids already exposed to userspace (beyond the stupid > > KVM_IRQ_LINE) ioctl and as such we're bound to whatever upper limit and > > format they have? > > T

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Peter Maydell
On 11 January 2016 at 16:09, Andrew Jones wrote: > I think the save/restore case is where I always flip to seeing it as a > bunch of separate per cpu devices. It would feel better to me to > save/restore the cpu-gic registers the same way we do all other cpu > registers. >From QEMU's point of vie

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Mon, Jan 11, 2016 at 04:09:29PM +0100, Christoffer Dall wrote: > On Mon, Jan 11, 2016 at 03:07:17PM +0100, Andrew Jones wrote: > > On Sat, Jan 09, 2016 at 03:03:39PM +, Marc Zyngier wrote: > > > On Sat, 9 Jan 2016 13:29:56 +0100 > > > Christoffer Dall wrote: > > > > > > > On Thu, Jan 07, 2

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Christoffer Dall
On Mon, Jan 11, 2016 at 03:07:17PM +0100, Andrew Jones wrote: > On Sat, Jan 09, 2016 at 03:03:39PM +, Marc Zyngier wrote: > > On Sat, 9 Jan 2016 13:29:56 +0100 > > Christoffer Dall wrote: > > > > > On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: > > > > On Thu, Jan 07, 2016 at 0

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Sat, Jan 09, 2016 at 03:03:39PM +, Marc Zyngier wrote: > On Sat, 9 Jan 2016 13:29:56 +0100 > Christoffer Dall wrote: > > > On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: > > > On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote: > > > > On 7 January 2016 at 14:49,

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Shannon Zhao
On 2016/1/11 19:52, Andrew Jones wrote: On Mon, Jan 11, 2016 at 08:59:38AM +, Marc Zyngier wrote: >On 11/01/16 08:45, Shannon Zhao wrote: > > > > > >On 2016/1/9 23:03, Marc Zyngier wrote: > >>On Sat, 9 Jan 2016 13:29:56 +0100 > >>Christoffer Dall wrote: > >> > On Thu, Jan 07, 2016

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Andrew Jones
On Mon, Jan 11, 2016 at 08:59:38AM +, Marc Zyngier wrote: > On 11/01/16 08:45, Shannon Zhao wrote: > > > > > > On 2016/1/9 23:03, Marc Zyngier wrote: > >> On Sat, 9 Jan 2016 13:29:56 +0100 > >> Christoffer Dall wrote: > >> > On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote:

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Marc Zyngier
On 11/01/16 08:45, Shannon Zhao wrote: > > > On 2016/1/9 23:03, Marc Zyngier wrote: >> On Sat, 9 Jan 2016 13:29:56 +0100 >> Christoffer Dall wrote: >> On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: >> On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote:

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-11 Thread Shannon Zhao
On 2016/1/9 23:03, Marc Zyngier wrote: > On Sat, 9 Jan 2016 13:29:56 +0100 > Christoffer Dall wrote: > >> > On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: >>> > > On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote: > > > On 7 January 2016 at 14:49, Shannon Zhao

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-09 Thread Marc Zyngier
On Sat, 9 Jan 2016 13:29:56 +0100 Christoffer Dall wrote: > On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: > > On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote: > > > On 7 January 2016 at 14:49, Shannon Zhao wrote: > > > >>> + > > > >>> +Groups: > > > >>> + KVM_DEV_A

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-09 Thread Christoffer Dall
On Thu, Jan 07, 2016 at 09:36:47PM +0100, Andrew Jones wrote: > On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote: > > On 7 January 2016 at 14:49, Shannon Zhao wrote: > > >>> + > > >>> +Groups: > > >>> + KVM_DEV_ARM_PMU_GRP_IRQ > > >>> + Attributes: > > >>> +The attr field of kvm

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Andrew Jones
On Fri, Jan 08, 2016 at 04:20:28PM +0100, Andrew Jones wrote: > On Fri, Jan 08, 2016 at 12:22:13PM +0100, Andrew Jones wrote: > > When we want more than 256 vcpus we'll need a new kvm-irq-line ioctl, > > but, as for the arm devices, we could avoid the problem completely by > > extending the SET/GET

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Andrew Jones
On Fri, Jan 08, 2016 at 12:22:13PM +0100, Andrew Jones wrote: > When we want more than 256 vcpus we'll need a new kvm-irq-line ioctl, > but, as for the arm devices, we could avoid the problem completely by > extending the SET/GET_DEVICE_ATTR ioctl to also be a vcpu ioctl. Replying to myself on thi

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Shannon Zhao
On 2016/1/8 20:56, Peter Maydell wrote: On 8 January 2016 at 12:15, Shannon Zhao wrote: Firstly, userspace will call kvm device ioctl to create the PMU device, if it fails it will return an error. Secondly, userspace will call SET_DEVICE_ATTR ioctl to configure the PMU irq number. If the irq

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Peter Maydell
On 8 January 2016 at 12:15, Shannon Zhao wrote: > Firstly, userspace will call kvm device ioctl to create the PMU device, if > it fails it will return an error. > Secondly, userspace will call SET_DEVICE_ATTR ioctl to configure the PMU irq > number. If the irq is invalid, this will return an error

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Shannon Zhao
On 2016/1/8 18:24, Peter Maydell wrote: On 8 January 2016 at 03:06, Shannon Zhao wrote: > > >On 2016/1/7 22:56, Peter Maydell wrote: >+ Errors: > >>>+-ENXIO: Unsupported attribute group > >>>+-EBUSY: The PMU overflow interrupt is already set > >>>+-ENODEV: Getti

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Andrew Jones
On Fri, Jan 08, 2016 at 10:53:03AM +0800, Shannon Zhao wrote: > > > On 2016/1/8 4:18, Andrew Jones wrote: > > On Tue, Dec 22, 2015 at 04:08:15PM +0800, Shannon Zhao wrote: > >> From: Shannon Zhao > >> > >> Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement > >> the kvm_devi

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-08 Thread Peter Maydell
On 8 January 2016 at 03:06, Shannon Zhao wrote: > > > On 2016/1/7 22:56, Peter Maydell wrote: > + Errors: > >>> +-ENXIO: Unsupported attribute group > >>> +-EBUSY: The PMU overflow interrupt is already set > >>> +-ENODEV: Getting the PMU overflow interrupt number while

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-07 Thread Shannon Zhao
On 2016/1/7 22:56, Peter Maydell wrote: + Errors: >>> +-ENXIO: Unsupported attribute group >>> +-EBUSY: The PMU overflow interrupt is already set >>> +-ENODEV: Getting the PMU overflow interrupt number while it's not >>> set >>> +-EINVAL: Invalid vc

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-07 Thread Shannon Zhao
On 2016/1/8 4:18, Andrew Jones wrote: > On Tue, Dec 22, 2015 at 04:08:15PM +0800, Shannon Zhao wrote: >> From: Shannon Zhao >> >> Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement >> the kvm_device_ops for it. >> >> Signed-off-by: Shannon Zhao >> --- >> Documentation/vir

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-07 Thread Andrew Jones
On Thu, Jan 07, 2016 at 02:56:15PM +, Peter Maydell wrote: > On 7 January 2016 at 14:49, Shannon Zhao wrote: > >>> + > >>> +Groups: > >>> + KVM_DEV_ARM_PMU_GRP_IRQ > >>> + Attributes: > >>> +The attr field of kvm_device_attr encodes one value: > >>> +bits: | 63 32 | 31

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-07 Thread Shannon Zhao
On 2016/1/7 22:36, Peter Maydell wrote: > On 22 December 2015 at 08:08, Shannon Zhao wrote: >> From: Shannon Zhao >> >> Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement >> the kvm_device_ops for it. >> >> Signed-off-by: Shannon Zhao >> --- >> Documentation/virtual/kvm/

Re: [PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2016-01-07 Thread Peter Maydell
On 22 December 2015 at 08:08, Shannon Zhao wrote: > From: Shannon Zhao > > Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement > the kvm_device_ops for it. > > Signed-off-by: Shannon Zhao > --- > Documentation/virtual/kvm/devices/arm-pmu.txt | 24 + > arch/arm64/includ

[PATCH v8 20/20] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-22 Thread Shannon Zhao
From: Shannon Zhao Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement the kvm_device_ops for it. Signed-off-by: Shannon Zhao --- Documentation/virtual/kvm/devices/arm-pmu.txt | 24 + arch/arm64/include/uapi/asm/kvm.h | 4 + include/linux/kvm_host.h