[PATCH v4 00/18] cxl: Add support for powerVM guest​

2016-02-16 Thread Frederic Barrat
patchset on 4.5-rc1 Frederic Barrat (18): cxl: Move common code away from bare-metal-specific files cxl: Move bare-metal specific code to specialized files cxl: Define process problem state area at attach time only cxl: Introduce implementation-specific API cxl: Rename some bare-metal speci

[PATCH v4 02/18] cxl: Move bare-metal specific code to specialized files

2016-02-16 Thread Frederic Barrat
me p2 registers not needed from a guest and the PCI interface. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h| 24 + drivers/misc/cxl/irq.c

[PATCH v4 03/18] cxl: Define process problem state area at attach time only

2016-02-16 Thread Frederic Barrat
state area. Remove calls to cxl_assign_psn_space during init. The function is already called on the attach paths. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c | 11 ++- 1 file changed, 2 insertions(+), 9 dele

[PATCH v4 01/18] cxl: Move common code away from bare-metal-specific files

2016-02-16 Thread Frederic Barrat
From: Christophe Lombard Move around some functions which will be accessed from the bare-metal and guest environments. Code in native.c and pci.c is meant to be bare-metal specific. Other files contain code which may be shared with guests. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v4 05/18] cxl: Rename some bare-metal specific functions

2016-02-16 Thread Frederic Barrat
Rename a few functions, changing the 'cxl_' prefix to either 'cxl_pci_' or 'cxl_native_', to make clear that the implementation is bare-metal specific. Those functions will have an equivalent implementation for a guest in a later patch. Co-authored-by: Christophe Lo

[PATCH v4 04/18] cxl: Introduce implementation-specific API

2016-02-16 Thread Frederic Barrat
-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/api.c | 8 +-- drivers/misc/cxl/context.c | 4 +- drivers/misc/cxl/cxl.h | 53 +++--- drivers/misc/cxl/fault.c | 6 +- drivers/misc/cxl/file.c| 15 ++--- drivers

[PATCH v4 07/18] cxl: Update cxl_irq() prototype

2016-02-16 Thread Frederic Barrat
The context parameter when calling cxl_irq() should be strongly typed. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h | 2 +- drivers/misc/cxl/irq.c | 3 +-- 2 files changed, 2 insertions

[PATCH v4 06/18] cxl: Isolate a few bare-metal-specific calls

2016-02-16 Thread Frederic Barrat
A few functions are mostly common between bare-metal and guest and just need minor tuning. To avoid crowding the backend API, introduce a few 'if' based on the CPU being in HV mode. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard

[PATCH v4 08/18] cxl: IRQ allocation for guests

2016-02-16 Thread Frederic Barrat
is different. Rework the code so that the range 0 is treated like the other ranges. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/irq.c | 78 +- 1 file changed, 64

[PATCH v4 09/18] cxl: New possible return value from hcall

2016-02-16 Thread Frederic Barrat
From: Christophe Lombard The hcalls introduced for CAPI use a possible new value: H_STATE (invalid state). Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- arch/powerpc/include/asm/hvcall.h | 1 + 1 file changed, 1

[PATCH v4 10/18] cxl: New hcalls to support CAPI adapters

2016-02-16 Thread Frederic Barrat
r image to the coherent platform facility, and for validating the entire image after the download. H_CONTROL_CA_FACILITY Allow the partition to manipulate or query certain coherent platform facility behaviors. Co-authored-by: Frederic Barrat Sig

[PATCH v4 11/18] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-02-16 Thread Frederic Barrat
From: Christophe Lombard Introduce sub-structures containing the bare-metal specific fields in the structures describing the adapter (struct cxl) and AFU (struct cxl_afu). Update all their references. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v4 12/18] cxl: Add guest-specific code

2016-02-16 Thread Frederic Barrat
ID assigned by the cxl driver from the process element ID visible to the user applications. In bare-metal, the 2 IDs match. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/Makefile | 1 + drivers/misc/cxl/api.c | 2

[PATCH v4 13/18] cxl: sysfs support for guests

2016-02-16 Thread Frederic Barrat
From: Christophe Lombard Filter out a few adapter parameters which don't make sense in a guest. Document the changes. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- Documentation/ABI/testing/sysfs-class-cxl | 8 +++ drivers/mis

[PATCH v4 16/18] cxl: Support the cxl kernel API from a guest

2016-02-16 Thread Frederic Barrat
: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c| 63 ++- drivers/misc/cxl/cxl.h| 6 +- drivers/misc/cxl/guest.c | 26 drivers/misc/cxl/native.c | 50 +++ drivers/misc/cxl/pci.c

[PATCH v4 15/18] cxl: Parse device tree and create CAPI device(s) at boot

2016-02-16 Thread Frederic Barrat
Add new entry point to scan the device tree at boot in a guest, looking for CAPI devices. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/base.c | 25 + 1 file changed, 25

[PATCH v4 14/18] cxl: Support to flash a new image on the adapter from a guest

2016-02-16 Thread Frederic Barrat
flashing is successful, an rtas call is made to update the device tree with the new properties values for the adapter and the AFU(s) Add a new char device for the adapter, so that the flash tool can access the card, even if there is no valid AFU on it. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v4 17/18] cxl: Adapter failure handling

2016-02-16 Thread Frederic Barrat
found to be disabled, detach all existing contexts from it before issuing a AFU reset to re-enable it. Before detaching contexts, notify any kernel driver through the EEH callbacks of the AFU pci device. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v4 18/18] cxl: Add tracepoints around the CAPI hcall

2016-02-16 Thread Frederic Barrat
From: Christophe Lombard To ease debugging, add a few tracepoints around the CAPI hcalls. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/hcalls.c | 9 +++ drivers/misc/cxl/trace.h | 193

Re: Fwd: [PATCH v4 08/18] cxl: IRQ allocation for guests

2016-02-22 Thread Frederic Barrat
Le 21/02/2016 23:30, Manoj Kumar a écrit : Subject: [PATCH v4 08/18] cxl: IRQ allocation for guests Date: Tue, 16 Feb 2016 22:39:01 +0100 From: Frederic Barrat To: imun...@au1.ibm.com, michael.neul...@au1.ibm.com, m...@ellerman.id.au, linuxppc-dev@lists.ozlabs.org The PSL interrupt is not

Re: Fwd: [PATCH v4 11/18] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-02-22 Thread Frederic Barrat
Manoj, Point taken. Those constants are all defined in the architecture document (CAIA). We should probably use more macros there. However, since those were not introduced by this patch, I'll put it in my todo list for the future, but don't intend to address it in this patchset. Fred Le 2

Re: Fwd: [PATCH v4 12/18] cxl: Add guest-specific code

2016-02-22 Thread Frederic Barrat
2016 22:39:05 +0100 From: Frederic Barrat To: imun...@au1.ibm.com, michael.neul...@au1.ibm.com, m...@ellerman.id.au, linuxppc-dev@lists.ozlabs.org From: Christophe Lombard The new of.c file contains code to parse the device tree to find out about CAPI adapters and AFUs. guest.c implement

Re: Fwd: [PATCH v4 02/18] cxl: Move bare-metal specific code to specialized files

2016-02-22 Thread Frederic Barrat
Le 21/02/2016 22:44, Manoj Kumar a écrit : Code specific to bare-metal is meant to be in native.c or pci.c only. It's basically anything which touches the capi p1 registers, I thought we were going to avoid using the CAPI term externally. Please update if submitting a v4 of this patch series.

Re: Fwd: [PATCH v4 10/18] cxl: New hcalls to support CAPI adapters

2016-02-22 Thread Frederic Barrat
+ +/** + * cxl_h_validate_adapter_image - Validate the base image in the coherent + *platoform facility. platoform->platform Irreverent to the Socratic amongst us. Hope we didn't hurt your feelings :-D Fred ___

[PATCH v5 00/18] cxl: Add support for powerVM guest​

2016-02-23 Thread Frederic Barrat
This series adds support for a cxl card in a powerVM guest. It requires firmware FW840 and an activation code for cxl (CAPI). Note that pHyp only claims support for cxlflash, and not generic support for FPGA CAPI accelerators. cxlflash uses the (slightly modified) Nallatech card, so the memcopy AF

[PATCH v5 02/18] cxl: Move bare-metal specific code to specialized files

2016-02-23 Thread Frederic Barrat
me p2 registers not needed from a guest and the PCI interface. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h| 24 + drivers/misc/cxl/irq.c

[PATCH v5 03/18] cxl: Define process problem state area at attach time only

2016-02-23 Thread Frederic Barrat
state area. Remove calls to cxl_assign_psn_space during init. The function is already called on the attach paths. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c | 11 ++- 1 file changed, 2 insertions(+), 9 dele

[PATCH v5 05/18] cxl: Rename some bare-metal specific functions

2016-02-23 Thread Frederic Barrat
Rename a few functions, changing the 'cxl_' prefix to either 'cxl_pci_' or 'cxl_native_', to make clear that the implementation is bare-metal specific. Those functions will have an equivalent implementation for a guest in a later patch. Co-authored-by: Christophe Lo

[PATCH v5 04/18] cxl: Introduce implementation-specific API

2016-02-23 Thread Frederic Barrat
-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/api.c | 8 +-- drivers/misc/cxl/context.c | 4 +- drivers/misc/cxl/cxl.h | 53 +++--- drivers/misc/cxl/fault.c | 6 +- drivers/misc/cxl/file.c| 15 ++--- drivers

[PATCH v5 08/18] cxl: IRQ allocation for guests

2016-02-23 Thread Frederic Barrat
/deleting the context. Only the handler is different. Rework the code so that the range 0 is treated like the other ranges. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/irq.c | 78

[PATCH v5 06/18] cxl: Isolate a few bare-metal-specific calls

2016-02-23 Thread Frederic Barrat
A few functions are mostly common between bare-metal and guest and just need minor tuning. To avoid crowding the backend API, introduce a few 'if' based on the CPU being in HV mode. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard

[PATCH v5 12/18] cxl: Add guest-specific code

2016-02-23 Thread Frederic Barrat
ID assigned by the cxl driver from the process element ID visible to the user applications. In bare-metal, the 2 IDs match. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/Makefile | 1 + drivers/misc/cxl/api.c | 2

[PATCH v5 07/18] cxl: Update cxl_irq() prototype

2016-02-23 Thread Frederic Barrat
The context parameter when calling cxl_irq() should be strongly typed. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h | 2 +- drivers/misc/cxl/irq.c | 3 +-- 2 files changed, 2 insertions

[PATCH v5 01/18] cxl: Move common code away from bare-metal-specific files

2016-02-23 Thread Frederic Barrat
From: Christophe Lombard Move around some functions which will be accessed from the bare-metal and guest environments. Code in native.c and pci.c is meant to be bare-metal specific. Other files contain code which may be shared with guests. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v5 09/18] cxl: New possible return value from hcall

2016-02-23 Thread Frederic Barrat
From: Christophe Lombard The hcalls introduced for cxl use a possible new value: H_STATE (invalid state). Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- arch/powerpc/include/asm/hvcall.h | 1 + 1 file changed, 1

[PATCH v5 15/18] cxl: Parse device tree and create cxl device(s) at boot

2016-02-23 Thread Frederic Barrat
Add new entry point to scan the device tree at boot in a guest, looking for cxl devices. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/base.c | 25 + 1 file changed, 25

[PATCH v5 13/18] cxl: sysfs support for guests

2016-02-23 Thread Frederic Barrat
From: Christophe Lombard Filter out a few adapter parameters which don't make sense in a guest. Document the changes. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- Documentation/ABI/testing/sysfs-class-cxl | 8 +++ drivers/mis

[PATCH v5 10/18] cxl: New hcalls to support cxl adapters

2016-02-23 Thread Frederic Barrat
r image to the coherent platform facility, and for validating the entire image after the download. H_CONTROL_CA_FACILITY Allow the partition to manipulate or query certain coherent platform facility behaviors. Co-authored-by: Frederic Barrat Sig

[PATCH v5 17/18] cxl: Adapter failure handling

2016-02-23 Thread Frederic Barrat
found to be disabled, detach all existing contexts from it before issuing a AFU reset to re-enable it. Before detaching contexts, notify any kernel driver through the EEH callbacks of the AFU pci device. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v5 18/18] cxl: Add tracepoints around the cxl hcall

2016-02-23 Thread Frederic Barrat
From: Christophe Lombard To ease debugging, add a few tracepoints around the cxl hcalls. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Acked-by: Ian Munsie --- drivers/misc/cxl/hcalls.c | 9 +++ drivers/misc/cxl/trace.h | 193

[PATCH v5 11/18] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-02-23 Thread Frederic Barrat
From: Christophe Lombard Introduce sub-structures containing the bare-metal specific fields in the structures describing the adapter (struct cxl) and AFU (struct cxl_afu). Update all their references. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v5 16/18] cxl: Support the cxl kernel API from a guest

2016-02-23 Thread Frederic Barrat
: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c| 63 ++- drivers/misc/cxl/cxl.h| 6 +- drivers/misc/cxl/guest.c | 26 drivers/misc/cxl/native.c | 50 +++ drivers/misc/cxl/pci.c

[PATCH v5 14/18] cxl: Support to flash a new image on the adapter from a guest

2016-02-23 Thread Frederic Barrat
flashing is successful, an rtas call is made to update the device tree with the new properties values for the adapter and the AFU(s) Add a new char device for the adapter, so that the flash tool can access the card, even if there is no valid AFU on it. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH] cxl: Fix PSL timebase synchronization detection

2016-02-24 Thread Frederic Barrat
to use the proper timebase-to-time conversion. Signed-off-by: Frederic Barrat Cc: # 4.3+ --- drivers/misc/cxl/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 4c1903f..0c6c17a1 100644 --- a/drivers/misc/cxl/pci.c +++ b

Re: [PATCH v5 14/18] cxl: Support to flash a new image on the adapter from a guest

2016-02-25 Thread Frederic Barrat
Le 24/02/2016 21:03, Manoj Kumar a écrit : From: Christophe Lombard +#define CXL_DEV_MINORS 13 /* 1 control + 4 AFUs * 3 (dedicated/master/shared) */ Where does this limit of 4 AFUs come from? Is this related to CXL_MAX_SLICES? Should this be a computed value, in case the number of AFUs/

Re: [PATCH v5 15/18] cxl: Parse device tree and create cxl device(s) at boot

2016-02-25 Thread Frederic Barrat
Le 24/02/2016 21:15, Manoj Kumar a écrit : On 2/23/2016 10:21 AM, Frederic Barrat wrote: +module_init(cxl_base_init); Is this a remnant from when there were two modules? Do you really need two module_init() calls (can't one be called from the other)? What is the tear-down portion of

Re: [PATCH] cxl: Ignore probes for virtual afu pci devices

2016-03-02 Thread Frederic Barrat
vsec, when cxl probe is unable to find necessary vsec entries in device pci config space. The error message logged are of the form : cxl-pci 0004:00:00.0: ABORTING: CXL VSEC not found! cxl-pci 0004:00:00.0: cxl_init_adapter failed: -19 Cc: Ian Munsie Cc: Frederic Barrat Signed-off-by: Vaibhav

Re: [PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API

2016-03-04 Thread Frederic Barrat
ication to cxlflash (and remove the now obsolete cxl_get_phys_dev() kernel API, as discussed in this thread with Mikey). So no more dependencies. It will be part of the powerVM patchset v6 Fred Le 19/01/2016 18:14, Frederic Barrat a écrit : Introduce a new API to read the VPD of the adapte

[PATCH v6 02/20] cxl: Move bare-metal specific code to specialized files

2016-03-04 Thread Frederic Barrat
me p2 registers not needed from a guest and the PCI interface. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h| 24 + drivers/misc/cxl/irq.c

[PATCH v6 00/20] cxl: Add support for powerVM guest

2016-03-04 Thread Frederic Barrat
This series adds support for a cxl card in a powerVM guest. It requires firmware FW840 and an activation code for cxl (CAPI). Note that pHyp only claims support for cxlflash, and not generic support for FPGA CAPI accelerators. cxlflash uses the (slightly modified) Nallatech card, so the memcopy AF

[PATCH v6 01/20] cxl: Move common code away from bare-metal-specific files

2016-03-04 Thread Frederic Barrat
From: Christophe Lombard Move around some functions which will be accessed from the bare-metal and guest environments. Code in native.c and pci.c is meant to be bare-metal specific. Other files contain code which may be shared with guests. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v6 03/20] cxl: Define process problem state area at attach time only

2016-03-04 Thread Frederic Barrat
state area. Remove calls to cxl_assign_psn_space during init. The function is already called on the attach paths. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/api.c

[PATCH v6 04/20] cxl: Introduce implementation-specific API

2016-03-04 Thread Frederic Barrat
-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/api.c | 8 +-- drivers/misc/cxl/context.c | 4 +- drivers/misc/cxl/cxl.h | 53 +++--- drivers/misc/cxl/fault.c | 6 +- drivers/misc/cxl/file.c

[PATCH v6 05/20] cxl: Rename some bare-metal specific functions

2016-03-04 Thread Frederic Barrat
Rename a few functions, changing the 'cxl_' prefix to either 'cxl_pci_' or 'cxl_native_', to make clear that the implementation is bare-metal specific. Those functions will have an equivalent implementation for a guest in a later patch. Co-authored-by: Christophe Lo

[PATCH v6 08/20] cxl: IRQ allocation for guests

2016-03-04 Thread Frederic Barrat
/deleting the context. Only the handler is different. Rework the code so that the range 0 is treated like the other ranges. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/irq.c | 78

[PATCH v6 06/20] cxl: Isolate a few bare-metal-specific calls

2016-03-04 Thread Frederic Barrat
A few functions are mostly common between bare-metal and guest and just need minor tuning. To avoid crowding the backend API, introduce a few 'if' based on the CPU being in HV mode. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard R

[PATCH v6 07/20] cxl: Update cxl_irq() prototype

2016-03-04 Thread Frederic Barrat
The context parameter when calling cxl_irq() should be strongly typed. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/cxl.h | 2 +- drivers/misc/cxl/irq.c | 3 +-- 2 files

[PATCH v6 09/20] powerpc: New possible return value from hcall

2016-03-04 Thread Frederic Barrat
From: Christophe Lombard The hcalls introduced for cxl use a possible new value: H_STATE (invalid state). Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- arch/powerpc/include/asm/hvcall.h

[PATCH v6 10/20] cxl: New hcalls to support cxl adapters

2016-03-04 Thread Frederic Barrat
r image to the coherent platform facility, and for validating the entire image after the download. H_CONTROL_CA_FACILITY Allow the partition to manipulate or query certain coherent platform facility behaviors. Co-authored-by: Frederic Barrat Sig

[PATCH v6 12/20] cxl: Add guest-specific code

2016-03-04 Thread Frederic Barrat
ID assigned by the cxl driver from the process element ID visible to the user applications. In bare-metal, the 2 IDs match. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl

[PATCH v6 14/20] cxl: Support to flash a new image on the adapter from a guest

2016-03-04 Thread Frederic Barrat
flashing is successful, an rtas call is made to update the device tree with the new properties values for the adapter and the AFU(s) Add a new char device for the adapter, so that the flash tool can access the card, even if there is no valid AFU on it. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v6 13/20] cxl: sysfs support for guests

2016-03-04 Thread Frederic Barrat
From: Christophe Lombard Filter out a few adapter parameters which don't make sense in a guest. Document the changes. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar --- Documentation/ABI/testing/sysfs-class-cxl

[PATCH v6 15/20] cxl: Parse device tree and create cxl device(s) at boot

2016-03-04 Thread Frederic Barrat
Add new entry point to scan the device tree at boot in a guest, looking for cxl devices. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/base.c | 25

[PATCH v6 16/20] cxl: Support the cxl kernel API from a guest

2016-03-04 Thread Frederic Barrat
: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/api.c| 63 ++- drivers/misc/cxl/cxl.h| 6 +- drivers/misc/cxl/guest.c | 26 drivers/misc/cxl/native.c

[PATCH v6 17/20] cxl: Adapter failure handling

2016-03-04 Thread Frederic Barrat
found to be disabled, detach all existing contexts from it before issuing a AFU reset to re-enable it. Before detaching contexts, notify any kernel driver through the EEH callbacks of the AFU pci device. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v6 18/20] cxl: Add tracepoints around the cxl hcall

2016-03-04 Thread Frederic Barrat
From: Christophe Lombard To ease debugging, add a few tracepoints around the cxl hcalls. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard Reviewed-by: Manoj Kumar Acked-by: Ian Munsie --- drivers/misc/cxl/hcalls.c | 9 +++ drivers/misc/cxl

[PATCH v6 19/20] cxlflash: Use new cxl_pci_read_adapter_vpd() API

2016-03-04 Thread Frederic Barrat
To read the adapter VPD, drivers can't rely on pci config APIs, as it wouldn't work on powerVM. cxl introduced a new kernel API especially for this, so start using it. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/scs

[PATCH v6 11/20] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-03-04 Thread Frederic Barrat
From: Christophe Lombard Introduce sub-structures containing the bare-metal specific fields in the structures describing the adapter (struct cxl) and AFU (struct cxl_afu). Update all their references. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v6 20/20] cxl: Remove cxl_get_phys_dev() kernel API

2016-03-04 Thread Frederic Barrat
provides the cxl_pci_read_adapter_vpd() API for that purpose. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c | 1 - include/misc/cxl.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/drivers/misc/cxl/api.c b

Re: [v6,12/20] cxl: Add guest-specific code

2016-03-09 Thread Frederic Barrat
Hi Michael, Le 09/03/2016 06:55, Michael Ellerman a écrit : This breaks the SMP=n build: Arg! I'm adding it to my checklist. Thanks for the fix. Fred I've fixed it up with: diff --git a/drivers/misc/cxl/hcalls.c b/drivers/misc/cxl/hcalls.c index f01d4c012620..d6d11f4056d7 100644 --- a/d

Re: [PATCH v3 1/2] cxl: Add mechanism for delivering AFU driver specific events

2016-03-09 Thread Frederic Barrat
Hi Ian, Le 08/03/2016 02:48, Ian Munsie a écrit : diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c ... +static inline bool ctx_event_pending(struct cxl_context *ctx) +{ + if (ctx->pending_irq || ctx->pending_fault || ctx->pending_afu_err) + return true; + +

Re: [v6,20/20] cxl: Remove cxl_get_phys_dev() kernel API

2016-03-09 Thread Frederic Barrat
Le 09/03/2016 12:09, Michael Ellerman a écrit : This appears to make cxl_get_phys_dev() completely unused, doesn't it? If so, please send me a follow-up patch to remove it entirely. I would have sworn there was one internal call to it, but I was confused by some older version. Follow-up

[PATCH] cxl: Remove dead code

2016-03-09 Thread Frederic Barrat
Function cxl_get_phys_dev() was removed from the kernel API by a previous patch, but it's actually dead code. Remove it. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/api.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c

Re: [v6,12/20] cxl: Add guest-specific code

2016-03-09 Thread Frederic Barrat
Le 09/03/2016 13:42, Michael Ellerman a écrit : I've applied the following patch, let me know if there's anything wrong with it. It would be great if we could do something cleaner. I think this is fine. I've built pseries_le_defconfig and powernv_defconfig, and did minimum of testing with t

Re: [PATCH v3 1/2] cxl: Add mechanism for delivering AFU driver specific events

2016-03-09 Thread Frederic Barrat
Hi Vaibhav, Le 09/03/2016 15:37, Vaibhav Jain a écrit : I would propose these two apis. /* * fetches an event from the driver event queue. NULL means that queue * is empty. Can sleep if needed. The memory for cxl_event is allocated * by module being called. Hence it can be potentially be la

[PATCH] cxl: Allow PSL timebase to not sync

2016-03-14 Thread Frederic Barrat
e and there are no known use of it. Introduce a psl_timebase module parameter to control whether PSL timebase is required or not. Default is to allow initializaton even if syncing failed. Default behavior will be changed when current issues with some cxl adapters are resolved. Signed-off-by: Fre

[PATCH next] cxl: Allow PSL timebase to not sync

2016-03-14 Thread Frederic Barrat
e and there are no known use of it. Introduce a psl_timebase module parameter to control whether PSL timebase is required or not. Default is to allow initializaton even if syncing failed. Default behavior will be changed when current issues with some cxl adapters are resolved. Signed-off-by: Fre

Re: [PATCH next] cxl: Allow PSL timebase to not sync

2016-03-15 Thread Frederic Barrat
Hi Mikey, Le 15/03/2016 01:27, Michael Neuling a écrit : I'm not happy with doing this unless we add something which advertises that it's synced or not to userspace. If we do that, I'm happy to just fail without the need of the parameter but advertise it to userspace. OK, so I'm guessing that

Re: [PATCH next] cxl: Allow PSL timebase to not sync

2016-03-18 Thread Frederic Barrat
Ian, Miley, OK, I'm convinced. New version of the patch out shortly. Fred ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] cxl: Don't fail initialization if PSL timebase can't be synced

2016-03-18 Thread Frederic Barrat
fail if it can't. Instead, it reports a status via /sys. Signed-off-by: Frederic Barrat --- Patch will need a small update for next, due to the powerVM patchset. Will send that as soon as this one is agreed upon. Documentation/ABI/testing/sysfs-class-cxl | 8 drivers/misc

Re: [PATCH next] cxl: Allow PSL timebase to not sync

2016-03-18 Thread Frederic Barrat
Le 15/03/2016 04:56, Michael Ellerman a écrit : And it just sounds like a big hack around broken hardware, which we'll have to carry for the foreseeable future. I discussed with Mikey about what would be acceptable here. There's basically no good solution. No matter how we workaround the issu

[PATCH v2] cxl: Allow initialization on timebase sync failures

2016-03-19 Thread Frederic Barrat
the PSL timebase when the card is initialized, but ignores the error if it can't. Instead, it reports a status via /sys. Signed-off-by: Frederic Barrat Acked-by: Michael Neuling Acked-by: Ian Munsie --- Applies on 4.5 tree. Version to be picked-up potentially by distros. Needs a refresh for

[PATCH v2 next] cxl: Allow initialization on timebase sync failures

2016-03-21 Thread Frederic Barrat
the PSL timebase when the card is initialized, but ignores the error if it can't. Instead, it reports a status via /sys. Signed-off-by: Frederic Barrat --- Applies on current (4.6) tree. Changelog: version for 4.6 adds definition of psl_timebase_synced attribute for LPARs v2: Update commit ms

Re: [PATCH] cxl: static-ify variables to fix sparse warnings

2016-04-18 Thread Frederic Barrat
Thanks Andrew! Reviewed-by: fbar...@linux.vnet.ibm.com Fred Le 18/04/2016 07:03, Andrew Donnellan a écrit : Make a couple more variables static. Found by sparse. Signed-off-by: Andrew Donnellan --- drivers/misc/cxl/flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] cxl: Increase timeout for detection of AFU mmio hang

2016-04-19 Thread Frederic Barrat
PSL designers recommend a larger value for the mmio hang pulse, 256 us instead of 1 us. The CAIA architecture states that it needs to be smaller than 1/2 of the RTOS timeout set in the PHB for outbound non-posted transactions, which is still (easily) the case here. Signed-off-by: Frederic Barrat

Re: [PATCH] cxl: Increase timeout for detection of AFU mmio hang

2016-04-20 Thread Frederic Barrat
Received privately: Tested-by: Frank Haverkamp Le 19/04/2016 18:34, Frederic Barrat a écrit : PSL designers recommend a larger value for the mmio hang pulse, 256 us instead of 1 us. The CAIA architecture states that it needs to be smaller than 1/2 of the RTOS timeout set in the PHB for

[PATCH] cxl: Fix reference count on struct pid when attaching

2015-10-29 Thread Frederic Barrat
detach, thus the struct pid of the task attaching is never freed. The fix is to simply remove the call to get_pid(). Signed-off-by: Frederic Barrat --- drivers/misc/cxl/api.c | 1 - drivers/misc/cxl/file.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/cxl/api.c b

Re: [PATCH] cxl: Fix reference count on struct pid when attaching

2015-11-03 Thread Frederic Barrat
Le 03/11/2015 00:48, Ian Munsie a écrit : Excerpts from Michael Ellerman's message of 2015-11-02 11:53:45 +1100: On Thu, 2015-10-29 at 13:39 +0100, Frederic Barrat wrote: When the cxl driver creates a context, it stores the pid of the calling task, incrementing the reference count o

[PATCH] cxl: Fix struct pid leak when attaching a process through user API

2015-11-03 Thread Frederic Barrat
it reduces the number of processes that can run simultaneously by one. The fix is to simply remove the call to get_pid(). There is a separate patch for the kernel API, since it goes to different kernel versions. Signed-off-by: Frederic Barrat Cc: # 3.18+ --- drivers/misc/cxl/file.c | 2 +- 1

[PATCH] cxl: Fix struct pid leak when attaching a process through kernel API

2015-11-03 Thread Frederic Barrat
it reduces the number of processes that can run simultaneously by one. The fix is to simply remove the call to get_pid(). There is a separate patch for the user API, since it goes to different kernel versions. Signed-off-by: Frederic Barrat Cc: # 4.3+ --- drivers/misc/cxl/api.c | 1 - 1 file

Re: [PATCH] cxl: Fix DSI misses when the context owning task exits

2015-11-25 Thread Frederic Barrat
der associated with the context owning task. Reported-by: Matthew R. Ochs Reported-by: Frank Haverkamp Suggested-by: Ian Munsie Signed-off-by: Vaibhav Jain Looks good to me. Thanks! Reviewed-by: Frederic Barrat ___ Linuxppc-dev mailing list Linuxppc-

[PATCH] cxl: Set endianess of kernel contexts

2015-12-07 Thread Frederic Barrat
the context is attached through the kernel API. Signed-off-by: Frederic Barrat Suggested-by: Michael Neuling Cc: # 4.3+ --- cxl kernel API is supported starting with 4.3 (for cxlflash) drivers/misc/cxl/native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/cxl

[PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API

2016-01-19 Thread Frederic Barrat
using it. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/api.c | 8 include/misc/cxl.h | 5 + 2 files changed, 13 insertions(+) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index ea3eeb7..c73aa3a 100644 --- a/drivers/misc/cxl/api.c +++ b/drivers/misc/cxl/

Re: [PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API

2016-01-21 Thread Frederic Barrat
Le 20/01/2016 03:20, Michael Neuling a écrit : The only thing I'm a bit concerned about is are we going to end up duplicating a lot of the linux PCI API, but I guess we are only going to do this for things the papr HCALL interface mimics. There are actually very few operations we can do on th

Re: [PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API

2016-01-22 Thread Frederic Barrat
Le 22/01/2016 01:38, Michael Neuling a écrit : On Thu, 2016-01-21 at 19:48 +0100, Frederic Barrat wrote: Le 20/01/2016 03:20, Michael Neuling a écrit : The only thing I'm a bit concerned about is are we going to end up duplicating a lot of the linux PCI API, but I guess we are only goi

Re: cxl: Fix struct pid leak when attaching a process through user API

2016-01-26 Thread Frederic Barrat
Le 26/01/2016 04:11, Michael Ellerman a écrit : This no longer applies, since we merged 7b8ad495d592 ("cxl: Fix DSI misses when the context owning task exits"). Yes, on 4.5, it has been superseded by 7b8ad495d592. It may still be worth considering for stable releases though. Fred

[PATCH v2 02/16] cxl: Move bare-metal specific code to specialized files

2016-01-30 Thread Frederic Barrat
me p2 registers not needed from a guest and the PCI interface. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/cxl.h| 24 + drivers/misc/cxl/irq.c| 205 +-- drivers/misc/cxl/m

[PATCH v2 00/16] cxl: Add support for powerVM guest

2016-01-30 Thread Frederic Barrat
kernel API, flash of the adapter and failure handling Changelog: v1->v2: (v1 was privately reviewed) - integrate comments from Michael Neuling and Ian Munsie - add another patch to the series: adapter failure handling - base patchset on 4.5-rc1 Frederic Barrat (16): cxl: Move common code a

[PATCH v2 01/16] cxl: Move common code away from bare-metal-specific files

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard Move around some functions which will be accessed from the bare-metal and guest environments. Code in native.c and pci.c is meant to be bare-metal specific. Other files contain code which may be shared with guests. Co-authored-by: Frederic Barrat Signed-off-by

[PATCH v2 03/16] cxl: Introduce implementation-specific API

2016-01-30 Thread Frederic Barrat
: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/api.c | 10 ++-- drivers/misc/cxl/context.c | 4 +- drivers/misc/cxl/cxl.h | 53 +++--- drivers/misc/cxl/fault.c | 6 +- drivers/misc/cxl/file.c| 15 ++--- drivers/misc/cxl/irq.c | 19

  1   2   3   4   5   6   7   8   >