On 21/03/17 03:17, Frederic Barrat wrote:


Le 14/03/2017 à 12:08, Christophe Lombard a écrit :
The service layer API (in cxl.h) lists some low-level functions whose
implementation is different on PSL8, PSL9 and XSL:
- Init implementation for the adapter and the afu.
- Invalidate TLB/SLB.
- Attach process for dedicated/directed models.
- Handle psl interrupts.
- Debug registers for the adapter and the afu.
- Traces.
Each environment implements its own functions, and the common code uses
them through function pointers, defined in cxl_service_layer_ops.

Signed-off-by: Christophe Lombard <clomb...@linux.vnet.ibm.com>
---
 drivers/misc/cxl/cxl.h     | 34 ++++++++++++++++++++++---------
 drivers/misc/cxl/debugfs.c | 16 +++++++--------
 drivers/misc/cxl/guest.c   |  2 +-
 drivers/misc/cxl/irq.c     |  2 +-
 drivers/misc/cxl/native.c  | 50
+++++++++++++++++++++++++++-------------------
 drivers/misc/cxl/pci.c     | 47
+++++++++++++++++++++++++++++--------------
 6 files changed, 97 insertions(+), 54 deletions(-)

diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 4d1b704..3e03a66 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -553,13 +553,23 @@ struct cxl_context {
     struct mm_struct *mm;
 };

+struct cxl_irq_info;
+
 struct cxl_service_layer_ops {
     int (*adapter_regs_init)(struct cxl *adapter, struct pci_dev *dev);
+    int (*invalidate_all)(struct cxl *adapter);
     int (*afu_regs_init)(struct cxl_afu *afu);
+    int (*sanitise_afu_regs)(struct cxl_afu *afu);
     int (*register_serr_irq)(struct cxl_afu *afu);
     void (*release_serr_irq)(struct cxl_afu *afu);
-    void (*debugfs_add_adapter_sl_regs)(struct cxl *adapter, struct
dentry *dir);
-    void (*debugfs_add_afu_sl_regs)(struct cxl_afu *afu, struct
dentry *dir);
+    irqreturn_t (*handle_interrupt)(int irq, struct cxl_context *ctx,
struct cxl_irq_info *irq_info);
+    irqreturn_t (*fail_irq)(struct cxl_afu *afu, struct cxl_irq_info
*irq_info);
+    int (*activate_dedicated_process)(struct cxl_afu *afu);
+    int (*attach_afu_directed)(struct cxl_context *ctx, u64 wed, u64
amr);
+    int (*attach_dedicated_process)(struct cxl_context *ctx, u64 wed,
u64 amr);
+    void (*update_dedicated_ivtes)(struct cxl_context *ctx);
+    void (*debugfs_add_adapter_regs)(struct cxl *adapter, struct
dentry *dir);
+    void (*debugfs_add_afu_regs)(struct cxl_afu *afu, struct dentry
*dir);
     void (*psl_irq_dump_registers)(struct cxl_context *ctx);
     void (*err_irq_dump_registers)(struct cxl *adapter);
     void (*debugfs_stop_trace)(struct cxl *adapter);
@@ -805,16 +815,21 @@ void afu_irq_name_free(struct cxl_context *ctx);

 #ifdef CONFIG_DEBUG_FS

+int cxl_attach_afu_directed_psl(struct cxl_context *ctx, u64 wed, u64
amr);
+int cxl_activate_dedicated_process_psl(struct cxl_afu *afu);
+int cxl_attach_dedicated_process_psl(struct cxl_context *ctx, u64
wed, u64 amr);
+void cxl_update_dedicated_ivtes_psl(struct cxl_context *ctx);
+


I don't think those prototypes are meant to be dependent on CONFIG_DEBUG_FS

Whoops, looks like I screwed that up when I rebased. :/



--
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnel...@au1.ibm.com  IBM Australia Limited

Reply via email to