[PATCH 1/1 v2] powerpc: Correct DSCR during TM context switch

2014-06-05 Thread Sam Bobroff
Correct the DSCR SPR becoming temporarily corrupted if a task is context switched during a transaction. The problem occurs while suspending the task and is caused by saving the DSCR to thread.dscr after it has already been set to the CPU's default value: __switch_to() calls __switch_to_tm()

[PATCH v8 1/3] powerpc/eeh: Avoid event on passed PE

2014-06-05 Thread Gavin Shan
We must not handle EEH error on devices which are passed to somebody else. Instead, we expect that the frozen device owner detects an EEH error and recovers from it. This avoids EEH error handling on passed through devices so the device owner gets a chance to handle them. Signed-off-by: Gavin

[PATCH v8 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch exports functions to be used by new VFIO ioctl command, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h | 14 +++ arch/powerpc/kernel/eeh.c | 268

[PATCH v8 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
The series of patches adds support EEH for PCI devices, which are passed through to PowerKVM based guest via VFIO. The implementation is straightforward based on the issues or problems we have to resolve to support EEH for PowerKVM based guest. - Emulation for EEH RTAS requests. All EEH RTAS

[PATCH v8 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- Documentation/vfio.txt | 87

Re: [PATCH v8 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Benjamin Herrenschmidt
On Thu, 2014-06-05 at 16:36 +1000, Gavin Shan wrote: +#define EEH_OPT_GET_PE_ADDR0 /* Get PE addr */ +#define EEH_OPT_GET_PE_MODE1 /* Get PE mode */ I assume that's just some leftover from the previous patches :-) Don't respin just yet, let's see what other comments come

[PATCH 2/3] PPC: KVM: Reserve KVM_CAP_SPAPR_TCE_64 capability number

2014-06-05 Thread Alexey Kardashevskiy
This adds a capability number for 64-bit TCE tables support. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 944cd21..e6972bf 100644 ---

[PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-05 Thread Alexey Kardashevskiy
This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl. Please advise how to proceed with these patches as I suspect that first two should go via Paolo's tree while the last one via Alex Graf's tree (correct?). Thanks! Alexey Kardashevskiy (3):

[PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
The existing KVM_CREATE_SPAPR_TCE only supports 32bit windows which is not enough for directly mapped windows as the guest can get more than 4GB. This adds KVM_CREATE_SPAPR_TCE_64 ioctl and advertises it via KVM_CAP_SPAPR_TCE_64 capability. Since 64bit windows are to support Dynamic DMA windows

[PATCH 1/3] PPC: KVM: Reserve KVM_CAP_SPAPR_TCE_VFIO capability number

2014-06-05 Thread Alexey Kardashevskiy
This adds a capability number for in-kernel support for VFIO on SPAPR platform. The capability will tell the user space whether in-kernel handlers of H_PUT_TCE can handle VFIO-targeted requests or not. If not, the user space must not attempt allocating a TCE table in the host kernel via the

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Benjamin Herrenschmidt
On Thu, 2014-06-05 at 17:25 +1000, Alexey Kardashevskiy wrote: +This creates a virtual TCE (translation control entry) table, which +is an IOMMU for PAPR-style virtual I/O. It is used to translate +logical addresses used in virtual I/O into guest physical addresses, +and provides a

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 05:38 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 17:25 +1000, Alexey Kardashevskiy wrote: +This creates a virtual TCE (translation control entry) table, which +is an IOMMU for PAPR-style virtual I/O. It is used to translate +logical addresses used in virtual I/O

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Benjamin Herrenschmidt
On Thu, 2014-06-05 at 19:26 +1000, Alexey Kardashevskiy wrote: No trees yet. For 64GB window we need (6430)/(1620)*8 = 32K TCE table. Do we really need trees? The above is assuming hugetlbfs backed guests. These are the least of my worry indeed. But we need to deal with 4k and 64k guests.

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexander Graf
On 05.06.14 12:27, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 19:26 +1000, Alexey Kardashevskiy wrote: No trees yet. For 64GB window we need (6430)/(1620)*8 = 32K TCE table. Do we really need trees? The above is assuming hugetlbfs backed guests. These are the least of my worry

Re: [PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-05 Thread Alexander Graf
On 05.06.14 09:25, Alexey Kardashevskiy wrote: This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl. Please advise how to proceed with these patches as I suspect that first two should go via Paolo's tree while the last one via Alex Graf's

KVM: PPC: BOOK3S: PR: P8 Support

2014-06-05 Thread Aneesh Kumar K.V
This patchset adds support for emulating VTB, IC and Doorbell features in P8. Doorbell support is dummy since we don't support SMT cores with PR-KVM. -aneesh ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

[PATCH 2/4] KVM: PPC: BOOK3S: PR: Doorbell support

2014-06-05 Thread Aneesh Kumar K.V
We don't have SMT support yet, hence we should not find a doorbell message generated Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/powerpc/kvm/book3s_emulate.c

[PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Aneesh Kumar K.V
virtual time base register is a per VM, per cpu register that needs to be saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 1 +

[PATCH 3/4] KVM: PPC: BOOK3S: PR: Emulate DPDES register

2014-06-05 Thread Aneesh Kumar K.V
Since we don't support SMT yet, we should always find zero in Directed privileged doorbell exception state register. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 4/4] KVM: PPC: BOOK3S: PR: Emulate instruction counter

2014-06-05 Thread Aneesh Kumar K.V
Writing to IC is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/book3s.c | 6 ++ arch/powerpc/kvm/book3s_emulate.c | 3 +++ arch/powerpc/kvm/book3s_hv.c| 6

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Alexander Graf
On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per cpu register that needs to be saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com ---

Re: [PATCH 2/4] KVM: PPC: BOOK3S: PR: Doorbell support

2014-06-05 Thread Alexander Graf
On 05.06.14 14:08, Aneesh Kumar K.V wrote: We don't have SMT support yet, hence we should not find a doorbell message generated Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 18 ++ 1 file changed, 18 insertions(+)

Re: [PATCH 2/4] KVM: PPC: BOOK3S: PR: Doorbell support

2014-06-05 Thread Alexander Graf
On 05.06.14 14:21, Alexander Graf wrote: On 05.06.14 14:08, Aneesh Kumar K.V wrote: We don't have SMT support yet, hence we should not find a doorbell message generated Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 18

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Benjamin Herrenschmidt
On Thu, 2014-06-05 at 13:56 +0200, Alexander Graf wrote: What if we ask user space to give us a pointer to user space allocated memory along with the TCE registration? We would still ask user space to only use the returned fd for TCE modifications, but would have some nicely swappable

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexander Graf
On 05.06.14 14:30, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 13:56 +0200, Alexander Graf wrote: What if we ask user space to give us a pointer to user space allocated memory along with the TCE registration? We would still ask user space to only use the returned fd for TCE

Re: [PATCH v8 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Alexander Graf
On 05.06.14 08:36, Gavin Shan wrote: The series of patches adds support EEH for PCI devices, which are passed through to PowerKVM based guest via VFIO. The implementation is straightforward based on the issues or problems we have to resolve to support EEH for PowerKVM based guest. - Emulation

Re: [PATCH 3/3] PPC: KVM: Add support for 64bit TCE windows

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 10:30 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 13:56 +0200, Alexander Graf wrote: What if we ask user space to give us a pointer to user space allocated memory along with the TCE registration? We would still ask user space to only use the returned fd for TCE

[PATCH 1/2] powerpc/powernv: include asm/smp.h to handle UP config

2014-06-05 Thread Shreyas B. Prabhu
Build throws following errors when CONFIG_SMP=n arch/powerpc/platforms/powernv/setup.c: In function ‘pnv_kexec_wait_secondaries_down’: arch/powerpc/platforms/powernv/setup.c:179:4: error: implicit declaration of function ‘get_hard_smp_processor_id’ rc =

[PATCH 2/2] powerpc/powernv : Disable subcore for UP configs

2014-06-05 Thread Shreyas B. Prabhu
Build throws following errors when CONFIG_SMP=n arch/powerpc/platforms/powernv/subcore.c: In function ‘cpu_update_split_mode’: arch/powerpc/platforms/powernv/subcore.c:274:15: error: ‘setup_max_cpus’ undeclared (first use in this function) arch/powerpc/platforms/powernv/subcore.c:285:5: error:

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per cpu register that needs to be saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V

Re: [PATCH 2/4] KVM: PPC: BOOK3S: PR: Doorbell support

2014-06-05 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 05.06.14 14:21, Alexander Graf wrote: On 05.06.14 14:08, Aneesh Kumar K.V wrote: We don't have SMT support yet, hence we should not find a doorbell message generated Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com ---

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Alexander Graf
On 05.06.14 17:50, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per cpu register that needs to be saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode.

Re: [RFC PATCH 3/3] PPC, KVM, CMA: use general CMA reserved area management framework

2014-06-05 Thread Aneesh Kumar K.V
Paolo Bonzini pbonz...@redhat.com writes: Il 03/06/2014 09:02, Michal Nazarewicz ha scritto: On Tue, Jun 03 2014, Joonsoo Kim wrote: Now, we have general CMA reserved area management framework, so use it for future maintainabilty. There is no functional change. Signed-off-by: Joonsoo Kim

Re: [PATCH v8 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-05 Thread Alex Williamson
On Thu, 2014-06-05 at 16:36 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com ---

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 05.06.14 17:50, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per cpu register that needs to be saved and restored on vm exit and entry. Writing to VTB

Re: [RFC PATCH 1/3] CMA: generalize CMA reserved area management functionality

2014-06-05 Thread Aneesh Kumar K.V
Joonsoo Kim iamjoonsoo@lge.com writes: Currently, there are two users on CMA functionality, one is the DMA subsystem and the other is the kvm on powerpc. They have their own code to manage CMA reserved area even if they looks really similar. From my guess, it is caused by some needs on

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Alexander Graf
On 05.06.14 19:33, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 17:50, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per cpu register that needs to be saved and

Re: [PATCH 1/4] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-06-05 Thread Alexander Graf
On 06.06.14 00:32, Alexander Graf wrote: On 05.06.14 19:33, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 17:50, Aneesh Kumar K.V wrote: Alexander Graf ag...@suse.de writes: On 05.06.14 14:08, Aneesh Kumar K.V wrote: virtual time base register is a per VM, per

Re: [PATCH 0/3] Prepare for in-kernel VFIO DMA operations acceleration

2014-06-05 Thread Alexey Kardashevskiy
On 06/05/2014 09:57 PM, Alexander Graf wrote: On 05.06.14 09:25, Alexey Kardashevskiy wrote: This reserves 2 capability numbers. This implements an extended version of KVM_CREATE_SPAPR_TCE_64 ioctl. Please advise how to proceed with these patches as I suspect that first two should go via

Re: [PATCH v8 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 11:18:34AM -0600, Alex Williamson wrote: On Thu, 2014-06-05 at 16:36 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via

Re: [PATCH v8 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 02:54:47PM +0200, Alexander Graf wrote: On 05.06.14 08:36, Gavin Shan wrote: The series of patches adds support EEH for PCI devices, which are passed through to PowerKVM based guest via VFIO. The implementation is straightforward based on the issues or problems we have to

[PATCH v4 1/2]: Allow architectures to skip a callchain entry

2014-06-05 Thread Sukadev Bhattiprolu
The kernel code in Powerpc conservatively saves excess information in the callchain. While most entries are often needed, under some specific conditions, some of the entries are redundant and cause duplicate arcs in the call-graph. Eg: the value in the link register (LR) is needed only when it

[PATCH v4 2/2]: powerpc/perf: Adjust callchain based on DWARF debug info

2014-06-05 Thread Sukadev Bhattiprolu
Replace the arch_skip_callchain_idx() stub in Powerpc with code that checks the DWARF debug information and identifies the callchain entry to skip. Callgraph before the patch: 14.67% 2234 sprintft libc-2.18.so [.] __random | --- __random

[PATCH] powerpc: Don't setup CPUs with bad status

2014-06-05 Thread Michael Neuling
OPAL will mark a CPU that is guarded as bad in the status property of the CPU node. Unfortunatley Linux doesn't check this property and will put the bad CPU in the present map. This has caused hangs on booting when we try to unsplit the core. This patch checks the CPU is avaliable via this

[PATCH v9 1/3] powerpc/eeh: Avoid event on passed PE

2014-06-05 Thread Gavin Shan
We must not handle EEH error on devices which are passed to somebody else. Instead, we expect that the frozen device owner detects an EEH error and recovers from it. This avoids EEH error handling on passed through devices so the device owner gets a chance to handle them. Signed-off-by: Gavin

[PATCH v9 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch exports functions to be used by new VFIO ioctl command, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/eeh.h | 12 ++

[PATCH v9 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
The series of patches adds support EEH for PCI devices, which are passed through to PowerKVM based guest via VFIO. The implementation is straightforward based on the issues or problems we have to resolve to support EEH for PowerKVM based guest. - Emulation for EEH RTAS requests. All EEH RTAS

[PATCH v9 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de ---

RE: [linuxppc-release] [PATCH][v10] powerpc/mpc85xx:Add initial device tree support of T104x

2014-06-05 Thread shengzhou....@freescale.com
-Original Message- From: linuxppc-release-boun...@linux.freescale.net [mailto:linuxppc- release-boun...@linux.freescale.net] On Behalf Of Prabhakar Kushwaha Sent: Monday, April 21, 2014 7:34 PM To: linuxppc-dev@lists.ozlabs.org Cc: Wood Scott-B07421; Jain Priyanka-B32167; Aggrwal

Re: [PATCH 1/2] powerpc/powernv: include asm/smp.h to handle UP config

2014-06-05 Thread Anshuman Khandual
On 06/05/2014 08:51 PM, Shreyas B. Prabhu wrote: Build throws following errors when CONFIG_SMP=n arch/powerpc/platforms/powernv/setup.c: In function ‘pnv_kexec_wait_secondaries_down’: arch/powerpc/platforms/powernv/setup.c:179:4: error: implicit declaration of function

Re: [PATCH 2/2] powerpc/powernv : Disable subcore for UP configs

2014-06-05 Thread Anshuman Khandual
On 06/05/2014 08:54 PM, Shreyas B. Prabhu wrote: Build throws following errors when CONFIG_SMP=n arch/powerpc/platforms/powernv/subcore.c: In function ‘cpu_update_split_mode’: arch/powerpc/platforms/powernv/subcore.c:274:15: error: ‘setup_max_cpus’ undeclared (first use in this function)