Hello community, here is the log from the commit of package libcxl for openSUSE:Factory checked in at 2018-06-02 12:10:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libcxl (Old) and /work/SRC/openSUSE:Factory/.libcxl.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libcxl" Sat Jun 2 12:10:42 2018 rev:7 rq:613088 version:1.7 Changes: -------- --- /work/SRC/openSUSE:Factory/libcxl/libcxl.changes 2017-06-15 11:24:15.764035128 +0200 +++ /work/SRC/openSUSE:Factory/.libcxl.new/libcxl.changes 2018-06-02 12:11:31.517360870 +0200 @@ -1,0 +2,11 @@ +Wed May 30 13:13:03 UTC 2018 - norm...@linux.vnet.ibm.com + +- Update v1.7 + New api cxl_get_tunneled_ops_supported +- Update v1.6 + new functions cxl_afu_host_thread_wait(), cxl_work_disable_wait(), + cxl_work_enable_wait() and cxl_work_get_tid() are now unconditionally + built and exported. +- remove libcxl_sysmacros.patch embeded upstream. + +------------------------------------------------------------------- Old: ---- libcxl-1.5.tar.gz libcxl_sysmacros.patch New: ---- libcxl-1.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libcxl.spec ++++++ --- /var/tmp/diff_new_pack.L4FcCp/_old 2018-06-02 12:11:33.261296905 +0200 +++ /var/tmp/diff_new_pack.L4FcCp/_new 2018-06-02 12:11:33.265296759 +0200 @@ -1,7 +1,7 @@ # # spec file for package libcxl # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libcxl -Version: 1.5 +Version: 1.7 Release: 0 %define soversion 1 Summary: Coherent accelerator interface @@ -28,7 +28,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: glibc ExclusiveArch: ppc64 ppc64le -Patch0: libcxl_sysmacros.patch %description Coherent accelerator interface (refer to lib package with soversion) @@ -69,7 +68,6 @@ %prep %setup -q -%patch0 -p1 %build make CFLAGS="%{optflags} -fPIC" V=1 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.L4FcCp/_old 2018-06-02 12:11:33.297295585 +0200 +++ /var/tmp/diff_new_pack.L4FcCp/_new 2018-06-02 12:11:33.297295585 +0200 @@ -1,15 +1,15 @@ <services> - <service mode="localonly" name="tar_scm"> + <service mode="disabled" name="tar_scm"> <param name="url">https://github.com/ibm-capi/libcxl.git</param> <param name="scm">git</param> - <param name="revision">v1.5</param> - <param name="version">1.5</param> + <param name="revision">v1.7</param> + <param name="version">1.7</param> <param name="filename">libcxl</param> <param name="exclude">.git</param> </service> - <service mode="localonly" name="recompress"> + <service mode="disabled" name="recompress"> <param name="file">*.tar</param> <param name="compression">gz</param> </service> ++++++ libcxl-1.5.tar.gz -> libcxl-1.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/Makefile new/libcxl-1.7/Makefile --- old/libcxl-1.5/Makefile 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/Makefile 2018-05-15 13:23:50.000000000 +0200 @@ -5,7 +5,7 @@ CFLAGS += -I include # change VERS_LIB if new git tag -VERS_LIB = 1.5 +VERS_LIB = 1.7 LIBNAME = libcxl.so.$(VERS_LIB) # change VERS_SONAME only if library breaks backward compatibility. # refer to file symver.map @@ -19,8 +19,8 @@ HAS_CURL = $(shell /bin/which curl > /dev/null 2>&1 && echo y || echo n) # Update this to test a single feature from the most recent header we require: -CHECK_CXL_HEADER_IS_UP_TO_DATE = $(shell /bin/echo -e \\\#include $(1)\\\nvoid test\(struct cxl_afu_id test\)\; | \ - $(CC) $(CFLAGS) -Werror -x c -S -o /dev/null - > /dev/null 2>&1 && echo y || echo n) +CHECK_CXL_HEADER_IS_UP_TO_DATE = $(shell /bin/echo -e \\\#include $(1)\\\nint i = CXL_START_WORK_TID\; | \ + $(CC) $(CFLAGS) -Werror -x c -S -o /dev/null - >/dev/null 2>&1 && echo y || echo n) check_cxl_header: ifeq ($(call CHECK_CXL_HEADER_IS_UP_TO_DATE,"<misc/cxl.h>"),n) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/libcxl.c new/libcxl-1.7/libcxl.c --- old/libcxl-1.5/libcxl.c 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/libcxl.c 2018-05-15 13:23:50.000000000 +0200 @@ -32,6 +32,7 @@ #include <poll.h> #include <sys/ioctl.h> +#include <sys/sysmacros.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> @@ -43,6 +44,10 @@ #include "libcxl_internal.h" +#if defined CXL_START_WORK_TID +#include <syscall.h> +#endif + #undef DEBUG #ifdef DEBUG @@ -91,6 +96,9 @@ afu->sysfs_path = NULL; afu->fd_errbuff = -1; afu->errbuff_size = -1; +#if defined CXL_START_WORK_TID + afu->pid = -1; +#endif return afu; } @@ -624,6 +632,10 @@ errno = EINVAL; return -1; } +#if defined CXL_START_WORK_TID + /* get the internal kernel "pid" of the Thread ID */ + afu->pid = syscall(SYS_gettid); +#endif memset(&work, 0, sizeof(work)); work.work_element_descriptor = wed; @@ -640,6 +652,10 @@ errno = EINVAL; return -1; } +#if defined CXL_START_WORK_TID + /* get the internal kernel "pid" of the Thread ID */ + afu->pid = syscall(SYS_gettid); +#endif memset(&work, 0, sizeof(work)); work.work_element_descriptor = wed; @@ -658,6 +674,11 @@ errno = EINVAL; return -1; } +#if defined CXL_START_WORK_TID + /* get the internal kernel "pid" of the Thread ID */ + afu->pid = syscall(SYS_gettid); +#endif + return ioctl(afu->fd, CXL_IOCTL_START_WORK, work); } @@ -711,6 +732,19 @@ return 0; } +#if defined CXL_START_WORK_TID +inline +int cxl_work_get_tid(struct cxl_ioctl_start_work *work, __u16 *valp) +{ + if (work == NULL || work->tid == -1) { + errno = EINVAL; + return -1; + } + *valp = work->tid; + return 0; +} +#endif + inline int cxl_work_set_amr(struct cxl_ioctl_start_work *work, __u64 amr) { @@ -752,6 +786,30 @@ return 0; } +#if defined CXL_START_WORK_TID +inline +int cxl_work_enable_wait(struct cxl_ioctl_start_work *work) +{ + if (work == NULL) { + errno = EINVAL; + return -1; + } + work->flags |= CXL_START_WORK_TID; + return 0; +} + +inline +int cxl_work_disable_wait(struct cxl_ioctl_start_work *work) +{ + if (work == NULL) { + errno = EINVAL; + return -1; + } + work->flags &= ~(CXL_START_WORK_TID); + return 0; +} +#endif + /* * Event description print helpers */ @@ -1311,3 +1369,22 @@ return sigaction(SIGBUS, &act, &cxl_sigbus_old_action); } + +#if defined CXL_START_WORK_TID +int cxl_afu_host_thread_wait(struct cxl_afu_h *afu, volatile __u64 *uword) +{ + if (afu == NULL) { + errno = EINVAL; + return -1; + } + if (afu->pid != syscall(SYS_gettid)) { + errno = EPERM; + return -1; + } + + while (*uword == 0) { + asm volatile ("wait"); + } + return 0; +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/libcxl.h new/libcxl-1.7/libcxl.h --- old/libcxl-1.5/libcxl.h 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/libcxl.h 2018-05-15 13:23:50.000000000 +0200 @@ -103,6 +103,11 @@ int cxl_work_set_amr(struct cxl_ioctl_start_work *work, __u64 amr); int cxl_work_set_num_irqs(struct cxl_ioctl_start_work *work, __s16 num_irqs); int cxl_work_set_wed(struct cxl_ioctl_start_work *work, __u64 wed); +#if defined CXL_START_WORK_TID +int cxl_work_get_tid(struct cxl_ioctl_start_work *work, __u16 *valp); +int cxl_work_enable_wait(struct cxl_ioctl_start_work *work); +int cxl_work_disable_wait(struct cxl_ioctl_start_work *work); +#endif int cxl_afu_attach(struct cxl_afu_h *afu, __u64 wed); int cxl_afu_attach_work(struct cxl_afu_h *afu, @@ -177,6 +182,7 @@ int cxl_get_image_loaded(struct cxl_adapter_h *adapter, enum cxl_image *valp); int cxl_get_psl_revision(struct cxl_adapter_h *adapter, long *valp); int cxl_get_psl_timebase_synced(struct cxl_adapter_h *adapter, long *valp); +int cxl_get_tunneled_ops_supported(struct cxl_adapter_h *adapter, long *valp); /* * Events @@ -247,6 +253,20 @@ */ ssize_t cxl_errinfo_read(struct cxl_afu_h *afu, void *dst, off_t off, size_t len); + + +#if defined CXL_START_WORK_TID +/** + * Execute the instruction "wait" while the value of the shared + * memory (uword) has not changed. Only the current thread, which has + * attached the work, may be asleep. + * @param uword Pointer to the shared memory to exit from the loop. + * @return In case of success '0' is returned. In case of an error or + * the afu doesn't exist, -1 is returned and errno is set + * appropriately. + */ +int cxl_afu_host_thread_wait(struct cxl_afu_h *afu, volatile __u64 *uword); +#endif #ifdef __cplusplus } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/libcxl_internal.h new/libcxl-1.7/libcxl_internal.h --- old/libcxl-1.5/libcxl_internal.h 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/libcxl_internal.h 2018-05-15 13:23:50.000000000 +0200 @@ -43,6 +43,9 @@ size_t mmio_size; int fd_errbuff; /* fd to the afu_err_buff */ size_t errbuff_size; +#if defined CXL_START_WORK_TID + int pid; +#endif }; int cxl_get_dev(struct cxl_afu_h *afu, long *majorp, long *minorp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/libcxl_sysfs.c new/libcxl-1.7/libcxl_sysfs.c --- old/libcxl-1.5/libcxl_sysfs.c 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/libcxl_sysfs.c 2018-05-15 13:23:50.000000000 +0200 @@ -54,6 +54,7 @@ IMAGE_LOADED, PSL_REVISION, PSL_TIMEBASE_SYNCED, + TUNNELED_OPS_SUPPORTED, /* Add new attrs above this */ CXL_ATTR_MAX @@ -94,6 +95,7 @@ [IMAGE_LOADED] = { "image_loaded", scan_image, 1 }, [PSL_REVISION] = { "psl_revision", scan_int, 1 }, [PSL_TIMEBASE_SYNCED] = { "psl_timebase_synced", scan_int, 1 }, + [TUNNELED_OPS_SUPPORTED] = { "tunneled_ops_supported", scan_int, 1 }, }; #define OUT_OF_RANGE(attr) ((attr) < 0 || (attr) >= CXL_ATTR_MAX || \ @@ -436,6 +438,11 @@ return read_sysfs_adapter(adapter, PSL_TIMEBASE_SYNCED, valp, NULL); } +int cxl_get_tunneled_ops_supported(struct cxl_adapter_h *adapter, long *valp) +{ + return read_sysfs_adapter(adapter, TUNNELED_OPS_SUPPORTED, valp, NULL); +} + static int write_sysfs_str(char *path, enum cxl_sysfs_attr attr, char *str) { char *attr_name; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl.3 new/libcxl-1.7/man3/cxl.3 --- old/libcxl-1.5/man3/cxl.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl.3 2018-05-15 13:23:50.000000000 +0200 @@ -1,6 +1,6 @@ -.\" Copyright 2015-2017 IBM Corp. +.\" Copyright 2015-2018 IBM Corp. .\" -.TH CXL 3 2017-05-24 "LIBCXL 1.5" "CXL Programmer's Manual" +.TH CXL 3 2018-04-26 "LIBCXL 1.7" "CXL Programmer's Manual" .SH NAME cxl \- Coherent Accelerator Interface (CXL) library functions .SH SYNOPSIS @@ -92,25 +92,45 @@ cxl_afu_open_h open an AFU by AFU handle cxl_afu_opened return whether an AFU handle is opened .TE -.SS Attach AFU Context functions +.SS Work Structure Handling functions .TS ; lb lb lb l. Function Description _ -cxl_afu_attach attach the calling process's memory to an open AFU -cxl_afu_attach_full attach the calling process's memory to an open AFU (Deprecated Interface) -cxl_afu_attach_work attach the calling process's memory to an open AFU cxl_work_alloc allocate and initialize a work structure +cxl_work_disable_wait indicate that a host thread will not wait +cxl_work_enable_wait indicate that a host thread will wait cxl_work_free free a work structure cxl_work_get_amr get the value of the authority mask register cxl_work_get_num_irqs get the number of interrupts requested +cxl_work_get_tid get the tid of the thread that will wait cxl_work_get_wed get the value of the work element descriptor cxl_work_set_amr set the value of the authority mask register cxl_work_set_num_irqs set the number of interrupts requested cxl_work_set_wed set the value of the work element descriptor .TE +.SS Attach AFU Context functions +.TS +; +lb lb +lb l. +Function Description +_ +cxl_afu_attach attach the calling process's memory to an open AFU +cxl_afu_attach_full attach the calling process's memory to an open AFU (Deprecated Interface) +cxl_afu_attach_work attach the calling process's memory to an open AFU +.TE +.SS Wait for AFU Notification function +.TS +; +lb lb +lb l. +Function Description +_ +cxl_afu_host_thread_wait wait for AFU notification +.TE .SS CXL Adapter Sysfs Helper functions .TS ; @@ -122,6 +142,8 @@ cxl_get_caia_version get the CAIA version supported by a CXL adapter cxl_get_image_loaded returns which of the user and factory PSL images is currently loaded on the CXL device cxl_get_psl_revision get the revision level of the current PSL image loaded on the CXL device +cxl_get_psl_timebase_synced get the status of timebase on the CXL device +cxl_get_tunneled_ops_supported get the status of tunneled operations on the CXL device .TE .SS AFU Directed Master Context Sysfs Helper functions .TS @@ -195,8 +217,8 @@ lb l. Function Description _ -cxl_errinfo_size returns the size of afu_err_buff in bytes cxl_errinfo_read read and copy the contents of afu_err_info buffer into the provided buffer +cxl_errinfo_size returns the size of afu_err_buff in bytes .TE .SH SEE ALSO .BR cxl_adapter_afu_next (3), @@ -206,11 +228,13 @@ .BR cxl_afu_attach (3), .BR cxl_afu_attach_full (3), .BR cxl_afu_attach_work (3), +.BR cxl_afu_attach_work (3), .BR cxl_afu_dev_name (3), .BR cxl_afu_fd (3), .BR cxl_afu_fd_to_h (3), .BR cxl_afu_free (3), .BR cxl_afu_get_process_element (3), +.BR cxl_afu_host_thread_wait (3), .BR cxl_afu_next (3), .BR cxl_afu_open_dev (3), .BR cxl_afu_open_h (3), @@ -242,24 +266,28 @@ .BR cxl_get_prefault_mode (3), .BR cxl_get_psl_revision (3), .BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3), .BR cxl_mmio_install_sigbus_handler (3), .BR cxl_mmio_map (3), .BR cxl_mmio_ptr (3), -.BR cxl_mmio_rea (3),2.3 +.BR cxl_mmio_read32 (3), .BR cxl_mmio_read64 (3), .BR cxl_mmio_unmap (3), -.BR cxl_mmio_writ (3),2.3 +.BR cxl_mmio_write32 (3), .BR cxl_mmio_write64 (3), .BR cxl_read_event (3), .BR cxl_read_expected_event (3), .BR cxl_set_irqs_max (3), .BR cxl_set_mode (3), -.BR cxl_set_prefault_mode, (3) +.BR cxl_set_prefault_mode (3) .BR cxl_work_alloc (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), +.BR cxl_work_free (3), .BR cxl_work_get_amr (3), -.BR cxl_work_set_amr (3), .BR cxl_work_get_num_irqs (3), -.BR cxl_work_set_num_irqs (3), -.BR cxl_work_free (3), +.BR cxl_work_get_tid (3), .BR cxl_work_get_wed (3), +.BR cxl_work_set_amr (3), +.BR cxl_work_set_num_irqs (3), .BR cxl_work_set_wed (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_adapter_next.3 new/libcxl-1.7/man3/cxl_adapter_next.3 --- old/libcxl-1.5/man3/cxl_adapter_next.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_adapter_next.3 2018-05-15 13:23:50.000000000 +0200 @@ -60,4 +60,5 @@ .BR cxl_get_caia_version (3), .BR cxl_get_image_loaded (3), .BR cxl_get_psl_revision (3), -.BR cxl_get_psl_timebase_synced (3) +.BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_afu_attach_work.3 new/libcxl-1.7/man3/cxl_afu_attach_work.3 --- old/libcxl-1.5/man3/cxl_afu_attach_work.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_afu_attach_work.3 2018-05-15 13:23:50.000000000 +0200 @@ -1,13 +1,13 @@ -.\" Copyright 2015-2017 IBM Corp. +.\" Copyright 2015-2018 IBM Corp. .\" -.TH CXL_AFU_ATTACH_WORK 3 2017-05-24 "LIBCXL 1.5" "CXL Programmer's Manual" +.TH CXL_AFU_ATTACH_WORK 3 2018-02-13 "LIBCXL 1.5" "CXL Programmer's Manual" .SH NAME cxl_afu_attach_work \- attach the calling process's memory to an open AFU .SH SYNOPSIS .B #include <libcxl.h> .PP .B "int cxl_afu_attach_work(struct cxl_afu_h" -.BI * afu ", struct cxl_ioctl_work_attach *" work ); +.BI * afu ", struct cxl_ioctl_start_work *" work ); .SH DESCRIPTION .BR cxl_afu_attach_work () attaches a context of @@ -22,7 +22,7 @@ The AFU memory context will be updated as userspace allocates and frees memory. .PP -Three parameters can be set in the +Four parameters can be set in the .I work structure: .PP @@ -47,6 +47,11 @@ sets the authority mask register (same as the powerpc AMR). A null value indicates that the authority mask register should not be set. +.PP +.BR cxl_work_enable_wait() +indicates that the thread that will attach an AFU context +requires to be able to wait and be notified by the AFU with +.BR cxl_afu_host_thread_wait (). .SH RETURN VALUE On success, 0 is returned. On error, \-1 is returned and @@ -63,25 +68,29 @@ .B ENOSPC Not enough interrupts available. .SH SEE ALSO -.BR cxl (), -.BR cxl_afu_attach (), -.BR cxl_afu_attach_full (), -.BR cxl_afu_fd_to_h (), -.BR cxl_afu_free (), -.BR cxl_afu_open_dev (), -.BR cxl_afu_opened (), -.BR cxl_get_irqs_max (), -.BR cxl_get_irqs_min (), -.BR cxl_get_prefault_mode (), -.BR cxl_mmio_map (), -.BR cxl_set_irqs_max (), -.BR cxl_set_mode (), -.BR cxl_set_prefault_mode (), -.BR cxl_work_alloc (), -.BR cxl_work_free (), -.BR cxl_work_get_amr (), -.BR cxl_work_get_num_irqs (), -.BR cxl_work_get_wed (), -.BR cxl_work_set_amr (), -.BR cxl_work_set_num_irqs (), -.BR cxl_work_set_wed () +.BR cxl (3), +.BR cxl_afu_attach (3), +.BR cxl_afu_attach_full (3), +.BR cxl_afu_fd_to_h (3), +.BR cxl_afu_free (3), +.BR cxl_afu_host_thread_wait(3), +.BR cxl_afu_open_dev (3), +.BR cxl_afu_opened (3), +.BR cxl_get_irqs_max (3), +.BR cxl_get_irqs_min (3), +.BR cxl_get_prefault_mode (3), +.BR cxl_mmio_map (3), +.BR cxl_set_irqs_max (3), +.BR cxl_set_mode (3), +.BR cxl_set_prefault_mode (3), +.BR cxl_work_alloc (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), +.BR cxl_work_free (3), +.BR cxl_work_get_amr (3), +.BR cxl_work_get_num_irqs (3), +.BR cxl_work_get_tid (3), +.BR cxl_work_get_wed (3), +.BR cxl_work_set_amr (3), +.BR cxl_work_set_num_irqs (3), +.BR cxl_work_set_wed (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_afu_get_process_element.3 new/libcxl-1.7/man3/cxl_afu_get_process_element.3 --- old/libcxl-1.5/man3/cxl_afu_get_process_element.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_afu_get_process_element.3 2018-05-15 13:23:50.000000000 +0200 @@ -9,10 +9,10 @@ .BI "int cxl_afu_get_process_element(struct cxl_afu_h *" afu ); .SH DESCRIPTION .BR cxl_afu_get_process_element () -returns the process element associated with the open +returns the process element number associated with the open .IR afu . .SH RETURN VALUE -On success, 0 is returned. +On success, the process element number is returned. On error, \-1 is returned and .I errno is set appropriately. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_afu_host_thread_wait.3 new/libcxl-1.7/man3/cxl_afu_host_thread_wait.3 --- old/libcxl-1.5/man3/cxl_afu_host_thread_wait.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxl-1.7/man3/cxl_afu_host_thread_wait.3 2018-05-15 13:23:50.000000000 +0200 @@ -0,0 +1,58 @@ +.\" Copyright 2018 IBM Corp. +.\" +.TH CXL_AFU_HOST_THREAD_WAIT 3 2018-04-24 "LIBCXL 1.6" "CXL Manual" +.SH NAME +cxl_afu_host_thread_wait \- wait for AFU notification +.SH SYNOPSIS +.B #include <libcxl.h> +.PP +.B "int afu_host_thread_wait(struct cxl_afu_h" +.BI * afu ", volatile __u64 *" uword ); +.SH DESCRIPTION +The tunneled operation as_notify is supported on POWER9. See +.BR cxl_get_tunneled_ops_supported (). +.PP +The thread calling +.BR afu_host_thread_wait () +executes the instruction "wait" and goes to sleep. +It will resume execution upon receiving an interrupt or an +.I afu +notification. It will then check the value +of the shared memory word pointed to by +.IR uword . +The thread will loop and sleep again while the value of +.I uword +is equal to zero. It will return from +.BR afu_host_thread_wait () +when the value of +.I uword +becomes different from zero. +.PP +The thread calling +.BR afu_host_thread_wait () +must have attached an +.I afu +context to a work structure with +.BR cxl_afu_attach_work () +The work structure must have been wait-enabled with +.BR cxl_work_enable_wait (). +.SH RETURN VALUE +On success, 0 is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid argument value +.TP +.B EPERM +AFU context not attached by current thread, or wait not enabled +.SH SEE ALSO +.BR cxl (3), +.BR cxl_afu_attach_work (3), +.BR cxl_afu_host_thread_wait (3), +.BR cxl_get_tunneled_ops_supported (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), +.BR cxl_work_get_tid (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_base_image.3 new/libcxl-1.7/man3/cxl_get_base_image.3 --- old/libcxl-1.5/man3/cxl_get_base_image.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_get_base_image.3 2018-05-15 13:23:50.000000000 +0200 @@ -37,4 +37,5 @@ .BR cxl_get_caia_version (3), .BR cxl_get_image_loaded (3), .BR cxl_get_psl_revision (3), -.BR cxl_get_psl_timebase_synced (3) +.BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_caia_version.3 new/libcxl-1.7/man3/cxl_get_caia_version.3 --- old/libcxl-1.5/man3/cxl_get_caia_version.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_get_caia_version.3 2018-05-15 13:23:50.000000000 +0200 @@ -35,4 +35,5 @@ .BR cxl_get_base_image (3), .BR cxl_get_image_loaded (3), .BR cxl_get_psl_revision (3), -.BR cxl_get_psl_timebase_synced (3) +.BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_image_loaded.3 new/libcxl-1.7/man3/cxl_get_image_loaded.3 --- old/libcxl-1.5/man3/cxl_get_image_loaded.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_get_image_loaded.3 2018-05-15 13:23:50.000000000 +0200 @@ -39,4 +39,5 @@ .BR cxl_get_base_image (3), .BR cxl_get_caia_version (3), .BR cxl_get_psl_revision (3), -.BR cxl_get_psl_timebase_synced (3) +.BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_psl_revision.3 new/libcxl-1.7/man3/cxl_get_psl_revision.3 --- old/libcxl-1.5/man3/cxl_get_psl_revision.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_get_psl_revision.3 2018-05-15 13:23:50.000000000 +0200 @@ -32,4 +32,5 @@ .BR cxl_get_base_image (3), .BR cxl_get_caia_version (3), .BR cxl_get_image_loaded (3) -.BR cxl_get_psl_timebase_synced (3) +.BR cxl_get_psl_timebase_synced (3), +.BR cxl_get_tunneled_ops_supported (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_psl_timebase_synced.3 new/libcxl-1.7/man3/cxl_get_psl_timebase_synced.3 --- old/libcxl-1.5/man3/cxl_get_psl_timebase_synced.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_get_psl_timebase_synced.3 2018-05-15 13:23:50.000000000 +0200 @@ -37,4 +37,5 @@ .BR cxl_get_base_image (3), .BR cxl_get_caia_version (3), .BR cxl_get_image_loaded (3), -.BR cxl_get_psl_revision (3) +.BR cxl_get_psl_revision (3), +.BR cxl_get_tunneled_ops_supported(3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_get_tunneled_ops_supported.3 new/libcxl-1.7/man3/cxl_get_tunneled_ops_supported.3 --- old/libcxl-1.5/man3/cxl_get_tunneled_ops_supported.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxl-1.7/man3/cxl_get_tunneled_ops_supported.3 2018-05-15 13:23:50.000000000 +0200 @@ -0,0 +1,53 @@ +.\" Copyright 2018 IBM Corp. +.\" +.TH CXL_GET_TUNNELED_OPS_SUPPORTED 3 2018-04-26 "LIBCXL 1.7" "CXL Manual" +.SH NAME +cxl_get_tunneled_ops_supported \- get the status of tunneled operations on the CXL device +.SH SYNOPSIS +.B #include <libcxl.h> +.PP +.B "int cxl_get_tunneled_ops_supported(struct cxl_adapter_h" +.BI * adapter ", long *" valp ); +.SH DESCRIPTION +.BR cxl_get_tunneled_ops_supported () +copies the status of tunneled operations on the CXL +.I adapter +to the long integer pointed to by +.IR valp . +This value will be 1 if tunneled operations are supported in capi mode, +0 otherwise. +.PP +Tunneled operations (atomics and as_notify) are supported on POWER9. +Libcxl functions related to as_notify are +.BR cxl_afu_host_thread_wait (), +.BR cxl_work_disable_wait (), +.BR cxl_work_enable_wait () +and +.BR cxl_work_get_tid (). +.SH RETURN VALUE +On success, 0 is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid argument value. +.TP +.B ENODEV +The kernel does not export the tunneled operations status. +.TP +.B ENOMEM +Insufficient memory. +.SH SEE ALSO +.BR cxl (3), +.BR cxl_adapter_next (3), +.BR cxl_afu_host_thread_wait (3), +.BR cxl_get_base_image (3), +.BR cxl_get_caia_version (3), +.BR cxl_get_image_loaded (3), +.BR cxl_get_psl_revision (3), +.BR cxl_get_timebase_synced (3) +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), +.BR cxl_work_get_tid (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_work_alloc.3 new/libcxl-1.7/man3/cxl_work_alloc.3 --- old/libcxl-1.5/man3/cxl_work_alloc.3 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/man3/cxl_work_alloc.3 2018-05-15 13:23:50.000000000 +0200 @@ -1,6 +1,6 @@ -.\" Copyright 2015-2017 IBM Corp. +.\" Copyright 2015-2018 IBM Corp. .\" -.TH CXL_WORK_ALLOC 3 2017-05-24 "LIBCXL 1.5" "CXL Programmer's Manual" +.TH CXL_WORK_ALLOC 3 2018-02-13 "LIBCXL 1.5" "CXL Programmer's Manual" .SH NAME cxl_work_alloc \- allocate and initialize a work structure .SH SYNOPSIS @@ -25,9 +25,12 @@ .SH SEE ALSO .BR cxl (3), .BR cxl_afu_attach_work (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), .BR cxl_work_free (3), .BR cxl_work_get_amr (3), .BR cxl_work_get_num_irqs (3), +.BR cxl_work_get_tid (3), .BR cxl_work_get_wed (3), .BR cxl_work_set_amr (3), .BR cxl_work_set_num_irqs (3), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_work_disable_wait.3 new/libcxl-1.7/man3/cxl_work_disable_wait.3 --- old/libcxl-1.5/man3/cxl_work_disable_wait.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxl-1.7/man3/cxl_work_disable_wait.3 2018-05-15 13:23:50.000000000 +0200 @@ -0,0 +1,44 @@ +.\" Copyright 2018 IBM Corp. +.\" +.TH CXL_WORK_DISABLE_WAIT 3 2018-04-24 "LIBCXL 1.6" "CXL Programmer's Manual" +.SH NAME +cxl_work_disable_wait \- indicate that a host thread will not wait +.SH SYNOPSIS +.B #include <libcxl.h> +.PP +.B "int cxl_work_disable_wait(struct cxl_ioctl_start_work" +.BI * work ); +.SH DESCRIPTION +The tunneled operation as_notify is supported on POWER9. See +.BR cxl_get_tunneled_ops_supported (). +.PP +.BR cxl_work_disable_wait () +indicates in the +.I work +structure allocated by +.BR cxl_work_alloc (), +that the thread that will attach an AFU context with +.BR cxl_afu_attach_work () +will not call +.BR cxl_afu_host_thread_wait (). +.PP +This is the default behaviour. Calling this function is only required to cancel +a previous call to +.BR cxl_work_enable_wait (). +.SH RETURN VALUE +On success, 0 is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid argument value. +.SH SEE ALSO +.BR cxl (3), +.BR cxl_afu_attach_work (3), +.BR cxl_afu_host_thread_wait (3), +.BR cxl_get_tunneled_ops_supported (3), +.BR cxl_work_alloc (3), +.BR cxl_work_enable_wait (3), +.BR cxl_work_get_tid (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_work_enable_wait.3 new/libcxl-1.7/man3/cxl_work_enable_wait.3 --- old/libcxl-1.5/man3/cxl_work_enable_wait.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxl-1.7/man3/cxl_work_enable_wait.3 2018-05-15 13:23:50.000000000 +0200 @@ -0,0 +1,40 @@ +.\" Copyright 2018 IBM Corp. +.\" +.TH CXL_WORK_ENABLE_WAIT 3 2018-04-24 "LIBCXL 1.6" "CXL Programmer's Manual" +.SH NAME +cxl_work_enable_wait \- indicate that a host thread will wait +.SH SYNOPSIS +.B #include <libcxl.h> +.PP +.B "int cxl_work_enable_wait(struct cxl_ioctl_start_work" +.BI * work ); +.SH DESCRIPTION +The tunneled operation as_notify is supported on POWER9. See +.BR cxl_get_tunneled_ops_supported (). +.PP +.BR cxl_work_enable_wait () +indicates in the +.I work +structure allocated by +.BR cxl_work_alloc (), +that the thread that will attach an AFU context with +.BR cxl_afu_attach_work () +requires to be able to wait and be notified by the AFU with +.BR cxl_afu_host_thread_wait (). +.SH RETURN VALUE +On success, 0 is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid argument value. +.SH SEE ALSO +.BR cxl (3), +.BR cxl_afu_attach_work (3), +.BR cxl_afu_host_thread_wait (3), +.BR cxl_get_tunneled_ops_supported (3), +.BR cxl_work_alloc (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_get_tid (3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/man3/cxl_work_get_tid.3 new/libcxl-1.7/man3/cxl_work_get_tid.3 --- old/libcxl-1.5/man3/cxl_work_get_tid.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxl-1.7/man3/cxl_work_get_tid.3 2018-05-15 13:23:50.000000000 +0200 @@ -0,0 +1,48 @@ +.\" Copyright 2018 IBM Corp. +.\" +.TH CXL_WORK_GET_TID 3 2018-04-24 "LIBCXL 1.6" "CXL Programmer's Manual" +.SH NAME +cxl_work_get_tid \- get the tid of the thread that will wait +.SH SYNOPSIS +.B #include <libcxl.h> +.PP +.B "int cxl_work_get_tid(struct cxl_ioctl_start_work" +.BI * work ", __u16 *" valp ); +.SH DESCRIPTION +The tunneled operation as_notify is supported on POWER9. See +.BR cxl_get_tunneled_ops_supported (). +.PP +.BR cxl_work_get_tid () +copies to the address pointed to by +.I valp +the 16-bit tid value assigned by +.BR cxl_afu_attach_work () +to the thread that will wait to be notified by the AFU with +.BR cxl_afu_host_thread_wait (). +The +.I work +structure must have been wait-enabled with +.BR cxl_work_enable_wait (). +.PP +Note: the 16-bit tid returned by +.BR cxl_work_get_tid () +is a capi-specific value, unrelated to the thread ID +returned by the Linux system call +.BR gettid (). +.SH RETURN VALUE +On success, 0 is returned. +On error, \-1 is returned and +.I errno +is set appropriately. +.SH ERRORS +.TP +.B EINVAL +Invalid argument value, or AFU context not attached, or wait not enabled +.SH SEE ALSO +.BR cxl (3), +.BR cxl_afu_attach_work (3), +.BR cxl_afu_host_thread_wait (3), +.BR cxl_get_tunneled_ops_supported (3), +.BR cxl_work_disable_wait (3), +.BR cxl_work_enable_wait (3), +.BR gettid(2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxl-1.5/symver.map new/libcxl-1.7/symver.map --- old/libcxl-1.5/symver.map 2017-05-24 11:51:38.000000000 +0200 +++ new/libcxl-1.7/symver.map 2018-05-15 13:23:50.000000000 +0200 @@ -90,3 +90,16 @@ global: cxl_get_psl_timebase_synced; } LIBCXL_1.2; + +LIBCXL_1.6 { + global: + cxl_afu_host_thread_wait; + cxl_work_disable_wait; + cxl_work_enable_wait; + cxl_work_get_tid; +} LIBCXL_1.4; + +LIBCXL_1.7 { + global: + cxl_get_tunneled_ops_supported; +} LIBCXL_1.6;