Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
260f3ea
Documentation
LICENSES
arch
block
certs
crypto
drivers
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma-buf
dma
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
block
char
cio
crypto
Makefile
ap_bus.c
ap_bus.h
ap_card.c
ap_debug.h
ap_queue.c
pkey_api.c
vfio_ap_debug.h
vfio_ap_drv.c
vfio_ap_ops.c
vfio_ap_private.h
zcrypt_api.c
zcrypt_api.h
zcrypt_card.c
zcrypt_cca_key.h
zcrypt_ccamisc.c
zcrypt_ccamisc.h
zcrypt_cex2a.c
zcrypt_cex2a.h
zcrypt_cex2c.c
zcrypt_cex2c.h
zcrypt_cex4.c
zcrypt_cex4.h
zcrypt_debug.h
zcrypt_ep11misc.c
zcrypt_ep11misc.h
zcrypt_error.h
zcrypt_msgtype50.c
zcrypt_msgtype50.h
zcrypt_msgtype6.c
zcrypt_msgtype6.h
zcrypt_queue.c
net
scsi
virtio
Makefile
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
s390
/
crypto
/
vfio_ap_private.h
Copy path
Blame
Blame
Latest commit
History
History
123 lines (111 loc) · 3.79 KB
Breadcrumbs
linux
/
drivers
/
s390
/
crypto
/
vfio_ap_private.h
Top
File metadata and controls
Code
Blame
123 lines (111 loc) · 3.79 KB
Raw
/* SPDX-License-Identifier: GPL-2.0 */ /* * Private data and functions for adjunct processor VFIO matrix driver. * * Author(s): Tony Krowiak <akrowiak@linux.ibm.com> * Halil Pasic <pasic@linux.ibm.com> * Pierre Morel <pmorel@linux.ibm.com> * * Copyright IBM Corp. 2018 */ #ifndef _VFIO_AP_PRIVATE_H_ #define _VFIO_AP_PRIVATE_H_ #include <linux/types.h> #include <linux/device.h> #include <linux/mdev.h> #include <linux/delay.h> #include <linux/mutex.h> #include <linux/kvm_host.h> #include <linux/vfio.h> #include "ap_bus.h" #define VFIO_AP_MODULE_NAME "vfio_ap" #define VFIO_AP_DRV_NAME "vfio_ap" /** * struct ap_matrix_dev - Contains the data for the matrix device. * * @device: generic device structure associated with the AP matrix device * @available_instances: number of mediated matrix devices that can be created * @info: the struct containing the output from the PQAP(QCI) instruction * @mdev_list: the list of mediated matrix devices created * @lock: mutex for locking the AP matrix device. This lock will be * taken every time we fiddle with state managed by the vfio_ap * driver, be it using @mdev_list or writing the state of a * single ap_matrix_mdev device. It's quite coarse but we don't * expect much contention. * @vfio_ap_drv: the vfio_ap device driver */ struct ap_matrix_dev { struct device device; atomic_t available_instances; struct ap_config_info info; struct list_head mdev_list; struct mutex lock; struct ap_driver *vfio_ap_drv; }; extern struct ap_matrix_dev *matrix_dev; /** * struct ap_matrix - matrix of adapters, domains and control domains * * @apm_max: max adapter number in @apm * @apm: identifies the AP adapters in the matrix * @aqm_max: max domain number in @aqm * @aqm: identifies the AP queues (domains) in the matrix * @adm_max: max domain number in @adm * @adm: identifies the AP control domains in the matrix * * The AP matrix is comprised of three bit masks identifying the adapters, * queues (domains) and control domains that belong to an AP matrix. The bits in * each mask, from left to right, correspond to IDs 0 to 255. When a bit is set * the corresponding ID belongs to the matrix. */ struct ap_matrix { unsigned long apm_max; DECLARE_BITMAP(apm, 256); unsigned long aqm_max; DECLARE_BITMAP(aqm, 256); unsigned long adm_max; DECLARE_BITMAP(adm, 256); }; /** * struct ap_matrix_mdev - Contains the data associated with a matrix mediated * device. * @vdev: the vfio device * @node: allows the ap_matrix_mdev struct to be added to a list * @matrix: the adapters, usage domains and control domains assigned to the * mediated matrix device. * @iommu_notifier: notifier block used for specifying callback function for * handling the VFIO_IOMMU_NOTIFY_DMA_UNMAP even * @kvm: the struct holding guest's state * @pqap_hook: the function pointer to the interception handler for the * PQAP(AQIC) instruction. * @mdev: the mediated device */ struct ap_matrix_mdev { struct vfio_device vdev; struct list_head node; struct ap_matrix matrix; struct notifier_block iommu_notifier; struct kvm *kvm; crypto_hook pqap_hook; struct mdev_device *mdev; }; /** * struct vfio_ap_queue - contains the data associated with a queue bound to the * vfio_ap device driver * @matrix_mdev: the matrix mediated device * @saved_pfn: the guest PFN pinned for the guest * @apqn: the APQN of the AP queue device * @saved_isc: the guest ISC registered with the GIB interface */ struct vfio_ap_queue { struct ap_matrix_mdev *matrix_mdev; unsigned long saved_pfn; int apqn; #define VFIO_AP_ISC_INVALID 0xff unsigned char saved_isc; }; int vfio_ap_mdev_register(void); void vfio_ap_mdev_unregister(void); int vfio_ap_mdev_probe_queue(struct ap_device *queue); void vfio_ap_mdev_remove_queue(struct ap_device *queue); #endif /* _VFIO_AP_PRIVATE_H_ */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
You can’t perform that action at this time.