Commit 9e05c864 authored by Jens Axboe's avatar Jens Axboe
Browse files

Merge branch 'master' into test

* master: (688 commits)
  dt-bindings: mailbox: qcom: Document the APCS clock binding
  mailbox: qcom: Create APCS child device for clock controller
  mailbox: qcom: Convert APCS IPC driver to use regmap
  KVM/SVM: Allow direct access to MSR_IA32_SPEC_CTRL
  KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL
  KVM/VMX: Emulate MSR_IA32_ARCH_CAPABILITIES
  KVM/x86: Add IBPB support
  KVM/x86: Update the reverse_cpuid list to include CPUID_7_EDX
  pinctrl: remove include file from <linux/device.h>
  firmware: dmi: handle missing DMI data gracefully
  firmware: dmi_scan: Fix handling of empty DMI strings
  firmware: dmi_scan: Drop dmi_initialized
  firmware: dmi: Optimize dmi_matches
  Revert "defer call to mem_cgroup_sk_alloc()"
  soreuseport: fix mem leak in reuseport_add_sock()
  net: qlge: use memmove instead of skb_copy_to_linear_data
  net: qed: use correct strncpy() size
  net: cxgb4: avoid memcpy beyond end of source buffer
  cls_u32: add missing RCU annotation.
  r8152: set rx mode early when linking on
  ...
parents 3c15f3f5 35277995
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
What:		/dev/rtcX
Date:		April 2005
KernelVersion:	2.6.12
Contact:	linux-rtc@vger.kernel.org
Description:
		The ioctl interface to drivers for real-time clocks (RTCs).
		Following actions are supported:

		* RTC_RD_TIME, RTC_SET_TIME: Read or set the RTC time. Time
		  format is a Gregorian calendar date and 24 hour wall clock
		  time.

		* RTC_AIE_ON, RTC_AIE_OFF: Enable or disable the alarm interrupt
		  for RTCs that support alarms

		* RTC_ALM_READ, RTC_ALM_SET: Read or set the alarm time for
		  RTCs that support alarms. Can be set upto 24 hours in the
		  future. Requires a separate RTC_AIE_ON call to enable the
		  alarm interrupt. (Prefer to use RTC_WKALM_*)

		* RTC_WKALM_RD, RTC_WKALM_SET: For RTCs that support a more
		  powerful interface, which can issue alarms beyond 24 hours and
		  enable IRQs in the same request.

		* RTC_PIE_ON, RTC_PIE_OFF: Enable or disable the periodic
		  interrupt for RTCs that support periodic interrupts.

		* RTC_UIE_ON, RTC_UIE_OFF: Enable or disable the update
		  interrupt for RTCs that support it.

		* RTC_IRQP_READ, RTC_IRQP_SET: Read or set the frequency for
		  periodic interrupts for RTCs that support periodic interrupts.
		  Requires a separate RTC_PIE_ON call to enable the periodic
		  interrupts.

		The ioctl() calls supported by the older /dev/rtc interface are
		also supported by the newer RTC class framework. However,
		because the chips and systems are not standardized, some PC/AT
		functionality might not be provided. And in the same way, some
		newer features -- including those enabled by ACPI -- are exposed
		by the RTC class framework, but can't be supported by the older
		driver.
+35 −0
Original line number Diff line number Diff line
What:		/sys/class/ocxl/<afu name>/afu_version
Date:		January 2018
Contact:	linuxppc-dev@lists.ozlabs.org
Description:	read only
		Version of the AFU, in the format <major>:<minor>
		Reflects what is read in the configuration space of the AFU

What:		/sys/class/ocxl/<afu name>/contexts
Date:		January 2018
Contact:	linuxppc-dev@lists.ozlabs.org
Description:	read only
		Number of contexts for the AFU, in the format <n>/<max>
		where:
			n:	number of currently active contexts, for debug
			max:	maximum number of contexts supported by the AFU

What:		/sys/class/ocxl/<afu name>/pp_mmio_size
Date:		January 2018
Contact:	linuxppc-dev@lists.ozlabs.org
Description:	read only
		Size of the per-process mmio area, as defined in the
		configuration space of the AFU

What:		/sys/class/ocxl/<afu name>/global_mmio_size
Date:		January 2018
Contact:	linuxppc-dev@lists.ozlabs.org
Description:	read only
		Size of the global mmio area, as defined in the
		configuration space of the AFU

What:		/sys/class/ocxl/<afu name>/global_mmio_area
Date:		January 2018
Contact:	linuxppc-dev@lists.ozlabs.org
Description:	read/write
		Give access the global mmio area for the AFU
+91 −0
Original line number Diff line number Diff line
What:		/sys/class/rtc/
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		The rtc/ class subdirectory belongs to the RTC subsystem.

What:		/sys/class/rtc/rtcX/
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		The /sys/class/rtc/rtc{0,1,2,3,...} directories correspond
		to each RTC device.

What:		/sys/class/rtc/rtcX/date
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		(RO) RTC-provided date in YYYY-MM-DD format

What:		/sys/class/rtc/rtcX/hctosys
Date:		September 2009
KernelVersion:	2.6.32
Contact:	linux-rtc@vger.kernel.org
Description:
		(RO) 1 if the RTC provided the system time at boot via the
		CONFIG_RTC_HCTOSYS kernel option, 0 otherwise

What:		/sys/class/rtc/rtcX/max_user_freq
Date:		October 2007
KernelVersion:	2.6.24
Contact:	linux-rtc@vger.kernel.org
Description:
		(RW) The maximum interrupt rate an unprivileged user may request
		from this RTC.

What:		/sys/class/rtc/rtcX/name
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		(RO) The name of the RTC corresponding to this sysfs directory

What:		/sys/class/rtc/rtcX/since_epoch
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		(RO) RTC-provided time as the number of seconds since the epoch

What:		/sys/class/rtc/rtcX/time
Date:		March 2006
KernelVersion:	2.6.17
Contact:	linux-rtc@vger.kernel.org
Description:
		(RO) RTC-provided time in 24-hour notation (hh:mm:ss)

What:		/sys/class/rtc/rtcX/*/nvmem
Date:		February 2016
KernelVersion:	4.6
Contact:	linux-rtc@vger.kernel.org
Description:
		(RW) The non volatile storage exported as a raw file, as
		described in Documentation/nvmem/nvmem.txt

What:		/sys/class/rtc/rtcX/offset
Date:		February 2016
KernelVersion:	4.6
Contact:	linux-rtc@vger.kernel.org
Description:
		(RW) The amount which the rtc clock has been adjusted in
		firmware. Visible only if the driver supports clock offset
		adjustment. The unit is parts per billion, i.e. The number of
		clock ticks which are added to or removed from the rtc's base
		clock per billion ticks. A positive value makes a day pass more
		slowly, longer, and a negative value makes a day pass more
		quickly.

What:		/sys/class/rtc/rtcX/wakealarm
Date:		February 2007
KernelVersion:	2.6.20
Contact:	linux-rtc@vger.kernel.org
Description:
		(RW) The time at which the clock will generate a system wakeup
		event. This is a one shot wakeup event, so must be reset after
		wake if a daily wakeup is required. Format is seconds since the
		epoch by default, or if there's a leading +, seconds in the
		future, or if there is a leading +=, seconds ahead of the
		current alarm.
+160 −0
Original line number Diff line number Diff line
========================================================
OpenCAPI (Open Coherent Accelerator Processor Interface)
========================================================

OpenCAPI is an interface between processors and accelerators. It aims
at being low-latency and high-bandwidth. The specification is
developed by the `OpenCAPI Consortium <http://opencapi.org/>`_.

It allows an accelerator (which could be a FPGA, ASICs, ...) to access
the host memory coherently, using virtual addresses. An OpenCAPI
device can also host its own memory, that can be accessed from the
host.

OpenCAPI is known in linux as 'ocxl', as the open, processor-agnostic
evolution of 'cxl' (the driver for the IBM CAPI interface for
powerpc), which was named that way to avoid confusion with the ISDN
CAPI subsystem.


High-level view
===============

OpenCAPI defines a Data Link Layer (DL) and Transaction Layer (TL), to
be implemented on top of a physical link. Any processor or device
implementing the DL and TL can start sharing memory.

::

  +-----------+                         +-------------+
  |           |                         |             |
  |           |                         | Accelerated |
  | Processor |                         |  Function   |
  |           |  +--------+             |    Unit     |  +--------+
  |           |--| Memory |             |    (AFU)    |--| Memory |
  |           |  +--------+             |             |  +--------+
  +-----------+                         +-------------+
       |                                       |
  +-----------+                         +-------------+
  |    TL     |                         |    TLX      |
  +-----------+                         +-------------+
       |                                       |
  +-----------+                         +-------------+
  |    DL     |                         |    DLX      |
  +-----------+                         +-------------+
       |                                       |
       |                   PHY                 |
       +---------------------------------------+



Device discovery
================

OpenCAPI relies on a PCI-like configuration space, implemented on the
device. So the host can discover AFUs by querying the config space.

OpenCAPI devices in Linux are treated like PCI devices (with a few
caveats). The firmware is expected to abstract the hardware as if it
was a PCI link. A lot of the existing PCI infrastructure is reused:
devices are scanned and BARs are assigned during the standard PCI
enumeration. Commands like 'lspci' can therefore be used to see what
devices are available.

The configuration space defines the AFU(s) that can be found on the
physical adapter, such as its name, how many memory contexts it can
work with, the size of its MMIO areas, ...



MMIO
====

OpenCAPI defines two MMIO areas for each AFU:

* the global MMIO area, with registers pertinent to the whole AFU.
* a per-process MMIO area, which has a fixed size for each context.



AFU interrupts
==============

OpenCAPI includes the possibility for an AFU to send an interrupt to a
host process. It is done through a 'intrp_req' defined in the
Transaction Layer, specifying a 64-bit object handle which defines the
interrupt.

The driver allows a process to allocate an interrupt and obtain its
64-bit object handle, that can be passed to the AFU.



char devices
============

The driver creates one char device per AFU found on the physical
device. A physical device may have multiple functions and each
function can have multiple AFUs. At the time of this writing though,
it has only been tested with devices exporting only one AFU.

Char devices can be found in /dev/ocxl/ and are named as:
/dev/ocxl/<AFU name>.<location>.<index>

where <AFU name> is a max 20-character long name, as found in the
config space of the AFU.
<location> is added by the driver and can help distinguish devices
when a system has more than one instance of the same OpenCAPI device.
<index> is also to help distinguish AFUs in the unlikely case where a
device carries multiple copies of the same AFU.



Sysfs class
===========

An ocxl class is added for the devices representing the AFUs. See
/sys/class/ocxl. The layout is described in
Documentation/ABI/testing/sysfs-class-ocxl



User API
========

open
----

Based on the AFU definition found in the config space, an AFU may
support working with more than one memory context, in which case the
associated char device may be opened multiple times by different
processes.


ioctl
-----

OCXL_IOCTL_ATTACH:

  Attach the memory context of the calling process to the AFU so that
  the AFU can access its memory.

OCXL_IOCTL_IRQ_ALLOC:

  Allocate an AFU interrupt and return an identifier.

OCXL_IOCTL_IRQ_FREE:

  Free a previously allocated AFU interrupt.

OCXL_IOCTL_IRQ_SET_FD:

  Associate an event fd to an AFU interrupt so that the user process
  can be notified when the AFU sends an interrupt.


mmap
----

A process can mmap the per-process MMIO area for interactions with the
AFU.
+0 −2
Original line number Diff line number Diff line
@@ -2758,8 +2758,6 @@
	norandmaps	Don't use address space randomization.  Equivalent to
			echo 0 > /proc/sys/kernel/randomize_va_space

	noreplace-paravirt	[X86,IA-64,PV_OPS] Don't patch paravirt_ops

	noreplace-smp	[X86-32,SMP] Don't replace SMP instructions
			with UP alternatives

Loading