Re: [RFC PATCH v3 5/6] kvm/ppc/mpic: in-kernel MPIC emulation

2013-04-08 Thread Paul Mackerras
On Tue, Apr 02, 2013 at 08:57:52PM -0500, Scott Wood wrote: Hook the MPIC code up to the KVM interfaces, add locking, etc. [snip] @@ -2164,6 +2164,15 @@ static int kvm_ioctl_create_device(struct kvm *kvm, bool test = cd-flags KVM_CREATE_DEVICE_TEST; switch (cd-type) {

[PATCH 0/7 v3] KVM :PPC: Userspace Debug support

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com This patchset adds the userspace debug support for booke/bookehv. this is tested on powerpc e500v2/e500mc devices. We are now assuming that debug resource will not be used by kernel for its own debugging. It will be used for only kernel user

[PATCH 1/7 v3] KVM: PPC: debug stub interface parameter defined

2013-04-08 Thread Bharat Bhushan
This patch defines the interface parameter for KVM_SET_GUEST_DEBUG ioctl support. Follow up patches will use this for setting up hardware breakpoints, watchpoints and software breakpoints. Also kvm_arch_vcpu_ioctl_set_guest_debug() is brought one level below. This is because I am not sure what is

[PATCH 2/7 v3] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER

2013-04-08 Thread Bharat Bhushan
Instruction emulation return EMULATE_DO_PAPR when it requires exit to userspace on book3s. Similar return is required for booke. EMULATE_DO_PAPR reads out to be confusing so it is renamed to EMULATE_EXIT_USER. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com ---

[PATCH 3/7 v3] KVM: extend EMULATE_EXIT_USER to support different exit reasons

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com Currently the instruction emulator code returns EMULATE_EXIT_USER and common code initializes the run-exit_reason = .. and vcpu-arch.hcall_needed = .. with one fixed reason. But there can be different reasons when emulator need to exit to user

[PATCH 4/7 v3] booke: exit to user space if emulator request

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com This allows the exit to user space if emulator request by returning EMULATE_EXIT_USER. This will be used in subsequent patches in list Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/kvm/booke.c |3 +++ 1 files

[PATCH 5/7 v3] KVM: PPC: exit to user space on ehpriv instruction

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com ehpriv instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with run-debug have relevant information. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com ---

[PATCH 6/7 v3] powerpc: export debug register save function for KVM

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/switch_to.h |4

[PATCH 7/7 v3] KVM: PPC: Add userspace debug stub support

2013-04-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com This patch adds the debug stub support on booke/bookehv. Now QEMU debug stub can use hw breakpoint, watchpoint and software breakpoint to debug guest. Debug registers are saved/restored on vcpu_put()/vcpu_get(). Also the debug registers are saved

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

2013-04-08 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 06:47:45PM -0500, Scott Wood wrote: On 04/04/2013 05:41:35 AM, Gleb Natapov wrote: On Tue, Apr 02, 2013 at 08:57:48PM -0500, Scott Wood wrote: +struct kvm_device_attr { + __u32 flags; /* no flags currently defined */ + __u32 group; /*

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

2013-04-08 Thread Gleb Natapov
On Fri, Apr 05, 2013 at 12:02:06PM +1100, Paul Mackerras wrote: On Thu, Apr 04, 2013 at 01:41:35PM +0300, Gleb Natapov wrote: Since now each device has its own fd is it an advantage to enforce common interface between different devices? If we do so though why not handle file creation,

Re: [RFC PATCH v3 5/6] kvm/ppc/mpic: in-kernel MPIC emulation

2013-04-08 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 06:33:38PM -0500, Scott Wood wrote: On 04/04/2013 12:59:02 AM, Gleb Natapov wrote: On Wed, Apr 03, 2013 at 03:58:04PM -0500, Scott Wood wrote: KVM_DEV_MPIC_* could go elsewhere if you want to avoid cluttering the main kvm.h. The arch header would be OK, since the

Re: [PULL 0/7] ppc patch queue 2013-03-22

2013-04-08 Thread Scott Wood
On 03/31/2013 06:05:40 AM, Alexander Graf wrote: On 31.03.2013, at 12:49, Gleb Natapov wrote: On Tue, Mar 26, 2013 at 11:37:42AM -0500, Scott Wood wrote: On 03/25/2013 08:33:12 PM, Gleb Natapov wrote: On Tue, Mar 26, 2013 at 12:35:09AM +0100, Alexander Graf wrote: On 26.03.2013, at 00:16,

Re: [RFC PATCH v3 5/6] kvm/ppc/mpic: in-kernel MPIC emulation

2013-04-08 Thread Scott Wood
On 04/08/2013 01:30:42 AM, Paul Mackerras wrote: On Tue, Apr 02, 2013 at 08:57:52PM -0500, Scott Wood wrote: Hook the MPIC code up to the KVM interfaces, add locking, etc. [snip] @@ -2164,6 +2164,15 @@ static int kvm_ioctl_create_device(struct kvm *kvm, bool test = cd-flags

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

2013-04-08 Thread Scott Wood
On 04/08/2013 12:33:13 AM, Paul Mackerras wrote: On Tue, Apr 02, 2013 at 08:57:48PM -0500, Scott Wood wrote: [snip] +static int kvm_ioctl_create_device(struct kvm *kvm, + struct kvm_create_device *cd) +{ + bool test = cd-flags KVM_CREATE_DEVICE_TEST; + +