Skip to content

Commit

Permalink
cxl: New hcalls to support cxl adapters
Browse files Browse the repository at this point in the history
The hypervisor calls provide an interface with a coherent platform
facility and function. It matches version 0.16 of the 'PAPR changes'
document.

The following hcalls are supported:
H_ATTACH_CA_PROCESS    Attach a process element to a coherent platform
                       function.
H_DETACH_CA_PROCESS    Detach a process element from a coherent
                       platform function.
H_CONTROL_CA_FUNCTION  Allow the partition to manipulate or query
                       certain coherent platform function behaviors.
H_COLLECT_CA_INT_INFO  Collect interrupt info about a coherent.
                       platform function after an interrupt occurred
H_CONTROL_CA_FAULTS    Control the operation of a coherent platform
                       function after a fault occurs.
H_DOWNLOAD_CA_FACILITY Support for downloading a base adapter 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 <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
2 people authored and Michael Ellerman committed Mar 9, 2016
1 parent c0efa9a commit 444c4ba
Show file tree
Hide file tree
Showing 5 changed files with 890 additions and 2 deletions.
23 changes: 21 additions & 2 deletions drivers/misc/cxl/cxl.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ void cxl_prefault(struct cxl_context *ctx, u64 wed);

struct cxl *get_cxl_adapter(int num);
int cxl_alloc_sst(struct cxl_context *ctx);
void cxl_dump_debug_buffer(void *addr, size_t size);

void init_cxl_native(void);

Expand All @@ -701,16 +702,34 @@ unsigned int cxl_map_irq(struct cxl *adapter, irq_hw_number_t hwirq,
void cxl_unmap_irq(unsigned int virq, void *cookie);
int __detach_context(struct cxl_context *ctx);

/* This matches the layout of the H_COLLECT_CA_INT_INFO retbuf */
/*
* This must match the layout of the H_COLLECT_CA_INT_INFO retbuf defined
* in PAPR.
* A word about endianness: a pointer to this structure is passed when
* calling the hcall. However, it is not a block of memory filled up by
* the hypervisor. The return values are found in registers, and copied
* one by one when returning from the hcall. See the end of the call to
* plpar_hcall9() in hvCall.S
* As a consequence:
* - we don't need to do any endianness conversion
* - the pid and tid are an exception. They are 32-bit values returned in
* the same 64-bit register. So we do need to worry about byte ordering.
*/
struct cxl_irq_info {
u64 dsisr;
u64 dar;
u64 dsr;
#ifndef CONFIG_CPU_LITTLE_ENDIAN
u32 pid;
u32 tid;
#else
u32 tid;
u32 pid;
#endif
u64 afu_err;
u64 errstat;
u64 padding[3]; /* to match the expected retbuf size for plpar_hcall9 */
u64 proc_handle;
u64 padding[2]; /* to match the expected retbuf size for plpar_hcall9 */
};

void cxl_assign_psn_space(struct cxl_context *ctx);
Expand Down
Loading

0 comments on commit 444c4ba

Please sign in to comment.