History

Merge tag 'char-misc-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH: "Here is the big set of char and misc and other tiny driver subsystem updates for 5.16-rc1. Loads of things in here, all of which have been in linux-next for a while with no reported problems (except for one called out below.) Included are: - habanana labs driver updates, including dma_buf usage, reviewed and acked by the dma_buf maintainers - iio driver update (going through this tree not staging as they really do not belong going through that tree anymore) - counter driver updates - hwmon driver updates that the counter drivers needed, acked by the hwmon maintainer - xillybus driver updates - binder driver updates - extcon driver updates - dma_buf module namespaces added (will cause a build error in arm64 for allmodconfig, but that change is on its way through the drm tree) - lkdtm driver updates - pvpanic driver updates - phy driver updates - virt acrn and nitr_enclaves driver updates - smaller char and misc driver updates" * tag 'char-misc-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (386 commits) comedi: dt9812: fix DMA buffers on stack comedi: ni_usb6501: fix NULL-deref in command paths arm64: errata: Enable TRBE workaround for write to out-of-range address arm64: errata: Enable workaround for TRBE overwrite in FILL mode coresight: trbe: Work around write to out of range coresight: trbe: Make sure we have enough space coresight: trbe: Add a helper to determine the minimum buffer size coresight: trbe: Workaround TRBE errata overwrite in FILL mode coresight: trbe: Add infrastructure for Errata handling coresight: trbe: Allow driver to choose a different alignment coresight: trbe: Decouple buffer base from the hardware base coresight: trbe: Add a helper to pad a given buffer area coresight: trbe: Add a helper to calculate the trace generated coresight: trbe: Defer the probe on offline CPUs coresight: trbe: Fix incorrect access of the sink specific data coresight: etm4x: Add ETM PID for Kryo-5XX coresight: trbe: Prohibit trace before disabling TRBE coresight: trbe: End the AUX handle on truncation coresight: trbe: Do not truncate buffer on IRQ coresight: trbe: Fix handling of spurious interrupts ...

Linus Torvalds committed 5 years ago

Commit 5c904c62 parents 5cd4dc4 536de74393 files · +22124 −6909Browse files

Showing the changes to include/uapi/linux (3 of 393 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/acrn.h +70 −0
  2. include/uapi/linux/counter.h +154 −0
  3. include/uapi/linux/nitro_enclaves.h +5 −5
include/uapi/linux/acrn.h+70−0
@@ -396,6 +396,7 @@ struct acrn_ptdev_irq { · 395 unmodified lines
396396 /* Type of PCI device assignment */
397397 #define ACRN_PTDEV_QUIRK_ASSIGN (1U << 0)
398398
399+#define ACRN_MMIODEV_RES_NUM 3
399400 #define ACRN_PCI_NUM_BARS 6
400401 /**
401402 * struct acrn_pcidev - Info for assigning or de-assigning a PCI device
@@ -417,6 +418,67 @@ struct acrn_pcidev { · 15 unmodified lines
417418 __u32 bar[ACRN_PCI_NUM_BARS];
418419 };
419420
421+/**
422+ * struct acrn_mmiodev - Info for assigning or de-assigning a MMIO device
423+ * @name: Name of the MMIO device.
424+ * @res[].user_vm_pa: Physical address of User VM of the MMIO region
425+ * for the MMIO device.
426+ * @res[].service_vm_pa: Physical address of Service VM of the MMIO
427+ * region for the MMIO device.
428+ * @res[].size: Size of the MMIO region for the MMIO device.
429+ * @res[].mem_type: Memory type of the MMIO region for the MMIO
430+ * device.
431+ *
432+ * This structure will be passed to hypervisor directly.
433+ */
434+struct acrn_mmiodev {
435+ __u8 name[8];
436+ struct {
437+ __u64 user_vm_pa;
438+ __u64 service_vm_pa;
439+ __u64 size;
440+ __u64 mem_type;
441+ } res[ACRN_MMIODEV_RES_NUM];
442+};
443+
444+/**
445+ * struct acrn_vdev - Info for creating or destroying a virtual device
446+ * @id: Union of identifier of the virtual device
447+ * @id.value: Raw data of the identifier
448+ * @id.fields.vendor: Vendor id of the virtual PCI device
449+ * @id.fields.device: Device id of the virtual PCI device
450+ * @id.fields.legacy_id: ID of the virtual device if not a PCI device
451+ * @slot: Virtual Bus/Device/Function of the virtual
452+ * device
453+ * @io_base: IO resource base address of the virtual device
454+ * @io_size: IO resource size of the virtual device
455+ * @args: Arguments for the virtual device creation
456+ *
457+ * The created virtual device can be a PCI device or a legacy device (e.g.
458+ * a virtual UART controller) and it is emulated by the hypervisor. This
459+ * structure will be passed to hypervisor directly.
460+ */
461+struct acrn_vdev {
462+ /*
463+ * the identifier of the device, the low 32 bits represent the vendor
464+ * id and device id of PCI device and the high 32 bits represent the
465+ * device number of the legacy device
466+ */
467+ union {
468+ __u64 value;
469+ struct {
470+ __le16 vendor;
471+ __le16 device;
472+ __le32 legacy_id;
473+ } fields;
474+ } id;
475+
476+ __u64 slot;
477+ __u32 io_addr[ACRN_PCI_NUM_BARS];
478+ __u32 io_size[ACRN_PCI_NUM_BARS];
479+ __u8 args[128];
480+};
481+
420482 /**
421483 * struct acrn_msi_entry - Info for injecting a MSI interrupt to a VM
422484 * @msi_addr: MSI addr[19:12] with dest vCPU ID
@@ -568,6 +630,14 @@ struct acrn_irqfd { · 145 unmodified lines
568630 _IOW(ACRN_IOCTL_TYPE, 0x55, struct acrn_pcidev)
569631 #define ACRN_IOCTL_DEASSIGN_PCIDEV \
570632 _IOW(ACRN_IOCTL_TYPE, 0x56, struct acrn_pcidev)
633+#define ACRN_IOCTL_ASSIGN_MMIODEV \
634+ _IOW(ACRN_IOCTL_TYPE, 0x57, struct acrn_mmiodev)
635+#define ACRN_IOCTL_DEASSIGN_MMIODEV \
636+ _IOW(ACRN_IOCTL_TYPE, 0x58, struct acrn_mmiodev)
637+#define ACRN_IOCTL_CREATE_VDEV \
638+ _IOW(ACRN_IOCTL_TYPE, 0x59, struct acrn_vdev)
639+#define ACRN_IOCTL_DESTROY_VDEV \
640+ _IOW(ACRN_IOCTL_TYPE, 0x5A, struct acrn_vdev)
571641
572642 #define ACRN_IOCTL_PM_GET_CPU_STATE \
573643 _IOWR(ACRN_IOCTL_TYPE, 0x60, __u64)
include/uapi/linux/counter.h+154−0
@@ -0,0 +1,154 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+/*
3+ * Userspace ABI for Counter character devices
4+ * Copyright (C) 2020 William Breathitt Gray
5+ */
6+#ifndef _UAPI_COUNTER_H_
7+#define _UAPI_COUNTER_H_
8+
9+#include <linux/ioctl.h>
10+#include <linux/types.h>
11+
12+/* Component type definitions */
13+enum counter_component_type {
14+ COUNTER_COMPONENT_NONE,
15+ COUNTER_COMPONENT_SIGNAL,
16+ COUNTER_COMPONENT_COUNT,
17+ COUNTER_COMPONENT_FUNCTION,
18+ COUNTER_COMPONENT_SYNAPSE_ACTION,
19+ COUNTER_COMPONENT_EXTENSION,
20+};
21+
22+/* Component scope definitions */
23+enum counter_scope {
24+ COUNTER_SCOPE_DEVICE,
25+ COUNTER_SCOPE_SIGNAL,
26+ COUNTER_SCOPE_COUNT,
27+};
28+
29+/**
30+ * struct counter_component - Counter component identification
31+ * @type: component type (one of enum counter_component_type)
32+ * @scope: component scope (one of enum counter_scope)
33+ * @parent: parent ID (matching the ID suffix of the respective parent sysfs
34+ * path as described by the ABI documentation file
35+ * Documentation/ABI/testing/sysfs-bus-counter)
36+ * @id: component ID (matching the ID provided by the respective *_component_id
37+ * sysfs attribute of the desired component)
38+ *
39+ * For example, if the Count 2 ceiling extension of Counter device 4 is desired,
40+ * set type equal to COUNTER_COMPONENT_EXTENSION, scope equal to
41+ * COUNTER_COUNT_SCOPE, parent equal to 2, and id equal to the value provided by
42+ * the respective /sys/bus/counter/devices/counter4/count2/ceiling_component_id
43+ * sysfs attribute.
44+ */
45+struct counter_component {
46+ __u8 type;
47+ __u8 scope;
48+ __u8 parent;
49+ __u8 id;
50+};
51+
52+/* Event type definitions */
53+enum counter_event_type {
54+ /* Count value increased past ceiling */
55+ COUNTER_EVENT_OVERFLOW,
56+ /* Count value decreased past floor */
57+ COUNTER_EVENT_UNDERFLOW,
58+ /* Count value increased past ceiling, or decreased past floor */
59+ COUNTER_EVENT_OVERFLOW_UNDERFLOW,
60+ /* Count value reached threshold */
61+ COUNTER_EVENT_THRESHOLD,
62+ /* Index signal detected */
63+ COUNTER_EVENT_INDEX,
64+};
65+
66+/**
67+ * struct counter_watch - Counter component watch configuration
68+ * @component: component to watch when event triggers
69+ * @event: event that triggers (one of enum counter_event_type)
70+ * @channel: event channel (typically 0 unless the device supports concurrent
71+ * events of the same type)
72+ */
73+struct counter_watch {
74+ struct counter_component component;
75+ __u8 event;
76+ __u8 channel;
77+};
78+
79+/*
80+ * Queues a Counter watch for the specified event.
81+ *
82+ * The queued watches will not be applied until COUNTER_ENABLE_EVENTS_IOCTL is
83+ * called.
84+ */
85+#define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch)
86+/*
87+ * Enables monitoring the events specified by the Counter watches that were
88+ * queued by COUNTER_ADD_WATCH_IOCTL.
89+ *
90+ * If events are already enabled, the new set of watches replaces the old one.
91+ * Calling this ioctl also has the effect of clearing the queue of watches added
92+ * by COUNTER_ADD_WATCH_IOCTL.
93+ */
94+#define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01)
95+/*
96+ * Stops monitoring the previously enabled events.
97+ */
98+#define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02)
99+
100+/**
101+ * struct counter_event - Counter event data
102+ * @timestamp: best estimate of time of event occurrence, in nanoseconds
103+ * @value: component value
104+ * @watch: component watch configuration
105+ * @status: return status (system error number)
106+ */
107+struct counter_event {
108+ __aligned_u64 timestamp;
109+ __aligned_u64 value;
110+ struct counter_watch watch;
111+ __u8 status;
112+};
113+
114+/* Count direction values */
115+enum counter_count_direction {
116+ COUNTER_COUNT_DIRECTION_FORWARD,
117+ COUNTER_COUNT_DIRECTION_BACKWARD,
118+};
119+
120+/* Count mode values */
121+enum counter_count_mode {
122+ COUNTER_COUNT_MODE_NORMAL,
123+ COUNTER_COUNT_MODE_RANGE_LIMIT,
124+ COUNTER_COUNT_MODE_NON_RECYCLE,
125+ COUNTER_COUNT_MODE_MODULO_N,
126+};
127+
128+/* Count function values */
129+enum counter_function {
130+ COUNTER_FUNCTION_INCREASE,
131+ COUNTER_FUNCTION_DECREASE,
132+ COUNTER_FUNCTION_PULSE_DIRECTION,
133+ COUNTER_FUNCTION_QUADRATURE_X1_A,
134+ COUNTER_FUNCTION_QUADRATURE_X1_B,
135+ COUNTER_FUNCTION_QUADRATURE_X2_A,
136+ COUNTER_FUNCTION_QUADRATURE_X2_B,
137+ COUNTER_FUNCTION_QUADRATURE_X4,
138+};
139+
140+/* Signal values */
141+enum counter_signal_level {
142+ COUNTER_SIGNAL_LEVEL_LOW,
143+ COUNTER_SIGNAL_LEVEL_HIGH,
144+};
145+
146+/* Action mode values */
147+enum counter_synapse_action {
148+ COUNTER_SYNAPSE_ACTION_NONE,
149+ COUNTER_SYNAPSE_ACTION_RISING_EDGE,
150+ COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
151+ COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
152+};
153+
154+#endif /* _UAPI_COUNTER_H_ */
include/uapi/linux/nitro_enclaves.h+5−5
@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
3− * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44 */
55
66 #ifndef _UAPI_LINUX_NITRO_ENCLAVES_H_
@@ -60,7 +60,7 @@ · 53 unmodified lines
6060 *
6161 * Context: Process context.
6262 * Return:
63− * * 0 - Logic succesfully completed.
63+ * * 0 - Logic successfully completed.
6464 * * -1 - There was a failure in the ioctl logic.
6565 * On failure, errno is set to:
6666 * * EFAULT - copy_from_user() / copy_to_user() failure.
@@ -95,7 +95,7 @@ · 28 unmodified lines
9595 *
9696 * Context: Process context.
9797 * Return:
98− * * 0 - Logic succesfully completed.
98+ * * 0 - Logic successfully completed.
9999 * * -1 - There was a failure in the ioctl logic.
100100 * On failure, errno is set to:
101101 * * EFAULT - copy_from_user() / copy_to_user() failure.
@@ -118,7 +118,7 @@ · 16 unmodified lines
118118 *
119119 * Context: Process context.
120120 * Return:
121− * * 0 - Logic succesfully completed.
121+ * * 0 - Logic successfully completed.
122122 * * -1 - There was a failure in the ioctl logic.
123123 * On failure, errno is set to:
124124 * * EFAULT - copy_from_user() failure.
@@ -161,7 +161,7 @@ · 36 unmodified lines
161161 *
162162 * Context: Process context.
163163 * Return:
164− * * 0 - Logic succesfully completed.
164+ * * 0 - Logic successfully completed.
165165 * * -1 - There was a failure in the ioctl logic.
166166 * On failure, errno is set to:
167167 * * EFAULT - copy_from_user() / copy_to_user() failure.