diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-20 12:23:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-20 12:23:31 -0500 |
commit | f479c01c8e81096e01eb20cec67dbaebae669aee (patch) | |
tree | 951890b22992aa6366b55308cdc05b1568cb8622 /arch/s390/include | |
parent | d8ec26d7f8287f5788a494f56e8814210f0e64be (diff) | |
parent | f85168e4d96b31b09ecf09a679820b031224e69e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky:
"The bulk of the s390 updates for v3.14.
New features are the perf support for the CPU-Measurement Sample
Facility and the EP11 support for the crypto cards. And the normal
cleanups and bug-fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (44 commits)
s390/cpum_sf: fix printk format warnings
s390: Fix misspellings using 'codespell' tool
s390/qdio: bridgeport support - CHSC part
s390: delete new instances of __cpuinit usage
s390/compat: fix PSW32_USER_BITS definition
s390/zcrypt: add support for EP11 coprocessor cards
s390/mm: optimize randomize_et_dyn for !PF_RANDOMIZE
s390: use IS_ENABLED to check if a CONFIG is set to y or m
s390/cio: use device_lock to synchronize calls to the ccwgroup driver
s390/cio: use device_lock to synchronize calls to the ccw driver
s390/cio: fix unlocked access of online member
s390/cpum_sf: Add flag to process full SDBs only
s390/cpum_sf: Add raw data sampling to support the diagnostic-sampling function
s390/cpum_sf: Filter perf events based event->attr.exclude_* settings
s390/cpum_sf: Detect KVM guest samples
s390/cpum_sf: Add helper to read TOD from trailer entries
s390/cpum_sf: Atomically reset trailer entry fields of sample-data-blocks
s390/cpum_sf: Dynamically extend the sampling buffer if overflows occur
s390/pci: reenable per default
s390/pci/dma: fix accounting of allocated_pages
...
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/compat.h | 3 | ||||
-rw-r--r-- | arch/s390/include/asm/cpu_mf.h | 181 | ||||
-rw-r--r-- | arch/s390/include/asm/css_chars.h | 2 | ||||
-rw-r--r-- | arch/s390/include/asm/pci.h | 1 | ||||
-rw-r--r-- | arch/s390/include/asm/perf_event.h | 80 | ||||
-rw-r--r-- | arch/s390/include/asm/qdio.h | 35 | ||||
-rw-r--r-- | arch/s390/include/asm/sclp.h | 4 | ||||
-rw-r--r-- | arch/s390/include/uapi/asm/zcrypt.h | 65 |
8 files changed, 362 insertions, 9 deletions
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 4bf9da03591e..5d7e8cf83bd6 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -38,7 +38,8 @@ | |||
38 | 38 | ||
39 | #define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \ | 39 | #define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \ |
40 | PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \ | 40 | PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \ |
41 | PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | PSW32_ASC_HOME) | 41 | PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | \ |
42 | PSW32_ASC_PRIMARY) | ||
42 | 43 | ||
43 | #define COMPAT_USER_HZ 100 | 44 | #define COMPAT_USER_HZ 100 |
44 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" | 45 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" |
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index c879fad404c8..cb700d54bd83 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h | |||
@@ -56,6 +56,96 @@ struct cpumf_ctr_info { | |||
56 | u32 reserved2[12]; | 56 | u32 reserved2[12]; |
57 | } __packed; | 57 | } __packed; |
58 | 58 | ||
59 | /* QUERY SAMPLING INFORMATION block */ | ||
60 | struct hws_qsi_info_block { /* Bit(s) */ | ||
61 | unsigned int b0_13:14; /* 0-13: zeros */ | ||
62 | unsigned int as:1; /* 14: basic-sampling authorization */ | ||
63 | unsigned int ad:1; /* 15: diag-sampling authorization */ | ||
64 | unsigned int b16_21:6; /* 16-21: zeros */ | ||
65 | unsigned int es:1; /* 22: basic-sampling enable control */ | ||
66 | unsigned int ed:1; /* 23: diag-sampling enable control */ | ||
67 | unsigned int b24_29:6; /* 24-29: zeros */ | ||
68 | unsigned int cs:1; /* 30: basic-sampling activation control */ | ||
69 | unsigned int cd:1; /* 31: diag-sampling activation control */ | ||
70 | unsigned int bsdes:16; /* 4-5: size of basic sampling entry */ | ||
71 | unsigned int dsdes:16; /* 6-7: size of diagnostic sampling entry */ | ||
72 | unsigned long min_sampl_rate; /* 8-15: minimum sampling interval */ | ||
73 | unsigned long max_sampl_rate; /* 16-23: maximum sampling interval*/ | ||
74 | unsigned long tear; /* 24-31: TEAR contents */ | ||
75 | unsigned long dear; /* 32-39: DEAR contents */ | ||
76 | unsigned int rsvrd0; /* 40-43: reserved */ | ||
77 | unsigned int cpu_speed; /* 44-47: CPU speed */ | ||
78 | unsigned long long rsvrd1; /* 48-55: reserved */ | ||
79 | unsigned long long rsvrd2; /* 56-63: reserved */ | ||
80 | } __packed; | ||
81 | |||
82 | /* SET SAMPLING CONTROLS request block */ | ||
83 | struct hws_lsctl_request_block { | ||
84 | unsigned int s:1; /* 0: maximum buffer indicator */ | ||
85 | unsigned int h:1; /* 1: part. level reserved for VM use*/ | ||
86 | unsigned long long b2_53:52;/* 2-53: zeros */ | ||
87 | unsigned int es:1; /* 54: basic-sampling enable control */ | ||
88 | unsigned int ed:1; /* 55: diag-sampling enable control */ | ||
89 | unsigned int b56_61:6; /* 56-61: - zeros */ | ||
90 | unsigned int cs:1; /* 62: basic-sampling activation control */ | ||
91 | unsigned int cd:1; /* 63: diag-sampling activation control */ | ||
92 | unsigned long interval; /* 8-15: sampling interval */ | ||
93 | unsigned long tear; /* 16-23: TEAR contents */ | ||
94 | unsigned long dear; /* 24-31: DEAR contents */ | ||
95 | /* 32-63: */ | ||
96 | unsigned long rsvrd1; /* reserved */ | ||
97 | unsigned long rsvrd2; /* reserved */ | ||
98 | unsigned long rsvrd3; /* reserved */ | ||
99 | unsigned long rsvrd4; /* reserved */ | ||
100 | } __packed; | ||
101 | |||
102 | struct hws_basic_entry { | ||
103 | unsigned int def:16; /* 0-15 Data Entry Format */ | ||
104 | unsigned int R:4; /* 16-19 reserved */ | ||
105 | unsigned int U:4; /* 20-23 Number of unique instruct. */ | ||
106 | unsigned int z:2; /* zeros */ | ||
107 | unsigned int T:1; /* 26 PSW DAT mode */ | ||
108 | unsigned int W:1; /* 27 PSW wait state */ | ||
109 | unsigned int P:1; /* 28 PSW Problem state */ | ||
110 | unsigned int AS:2; /* 29-30 PSW address-space control */ | ||
111 | unsigned int I:1; /* 31 entry valid or invalid */ | ||
112 | unsigned int:16; | ||
113 | unsigned int prim_asn:16; /* primary ASN */ | ||
114 | unsigned long long ia; /* Instruction Address */ | ||
115 | unsigned long long gpp; /* Guest Program Parameter */ | ||
116 | unsigned long long hpp; /* Host Program Parameter */ | ||
117 | } __packed; | ||
118 | |||
119 | struct hws_diag_entry { | ||
120 | unsigned int def:16; /* 0-15 Data Entry Format */ | ||
121 | unsigned int R:14; /* 16-19 and 20-30 reserved */ | ||
122 | unsigned int I:1; /* 31 entry valid or invalid */ | ||
123 | u8 data[]; /* Machine-dependent sample data */ | ||
124 | } __packed; | ||
125 | |||
126 | struct hws_combined_entry { | ||
127 | struct hws_basic_entry basic; /* Basic-sampling data entry */ | ||
128 | struct hws_diag_entry diag; /* Diagnostic-sampling data entry */ | ||
129 | } __packed; | ||
130 | |||
131 | struct hws_trailer_entry { | ||
132 | union { | ||
133 | struct { | ||
134 | unsigned int f:1; /* 0 - Block Full Indicator */ | ||
135 | unsigned int a:1; /* 1 - Alert request control */ | ||
136 | unsigned int t:1; /* 2 - Timestamp format */ | ||
137 | unsigned long long:61; /* 3 - 63: Reserved */ | ||
138 | }; | ||
139 | unsigned long long flags; /* 0 - 63: All indicators */ | ||
140 | }; | ||
141 | unsigned long long overflow; /* 64 - sample Overflow count */ | ||
142 | unsigned char timestamp[16]; /* 16 - 31 timestamp */ | ||
143 | unsigned long long reserved1; /* 32 -Reserved */ | ||
144 | unsigned long long reserved2; /* */ | ||
145 | unsigned long long progusage1; /* 48 - reserved for programming use */ | ||
146 | unsigned long long progusage2; /* */ | ||
147 | } __packed; | ||
148 | |||
59 | /* Query counter information */ | 149 | /* Query counter information */ |
60 | static inline int qctri(struct cpumf_ctr_info *info) | 150 | static inline int qctri(struct cpumf_ctr_info *info) |
61 | { | 151 | { |
@@ -99,4 +189,95 @@ static inline int ecctr(u64 ctr, u64 *val) | |||
99 | return cc; | 189 | return cc; |
100 | } | 190 | } |
101 | 191 | ||
192 | /* Query sampling information */ | ||
193 | static inline int qsi(struct hws_qsi_info_block *info) | ||
194 | { | ||
195 | int cc; | ||
196 | cc = 1; | ||
197 | |||
198 | asm volatile( | ||
199 | "0: .insn s,0xb2860000,0(%1)\n" | ||
200 | "1: lhi %0,0\n" | ||
201 | "2:\n" | ||
202 | EX_TABLE(0b, 2b) EX_TABLE(1b, 2b) | ||
203 | : "=d" (cc), "+a" (info) | ||
204 | : "m" (*info) | ||
205 | : "cc", "memory"); | ||
206 | |||
207 | return cc ? -EINVAL : 0; | ||
208 | } | ||
209 | |||
210 | /* Load sampling controls */ | ||
211 | static inline int lsctl(struct hws_lsctl_request_block *req) | ||
212 | { | ||
213 | int cc; | ||
214 | |||
215 | cc = 1; | ||
216 | asm volatile( | ||
217 | "0: .insn s,0xb2870000,0(%1)\n" | ||
218 | "1: ipm %0\n" | ||
219 | " srl %0,28\n" | ||
220 | "2:\n" | ||
221 | EX_TABLE(0b, 2b) EX_TABLE(1b, 2b) | ||
222 | : "+d" (cc), "+a" (req) | ||
223 | : "m" (*req) | ||
224 | : "cc", "memory"); | ||
225 | |||
226 | return cc ? -EINVAL : 0; | ||
227 | } | ||
228 | |||
229 | /* Sampling control helper functions */ | ||
230 | |||
231 | #include <linux/time.h> | ||
232 | |||
233 | static inline unsigned long freq_to_sample_rate(struct hws_qsi_info_block *qsi, | ||
234 | unsigned long freq) | ||
235 | { | ||
236 | return (USEC_PER_SEC / freq) * qsi->cpu_speed; | ||
237 | } | ||
238 | |||
239 | static inline unsigned long sample_rate_to_freq(struct hws_qsi_info_block *qsi, | ||
240 | unsigned long rate) | ||
241 | { | ||
242 | return USEC_PER_SEC * qsi->cpu_speed / rate; | ||
243 | } | ||
244 | |||
245 | #define SDB_TE_ALERT_REQ_MASK 0x4000000000000000UL | ||
246 | #define SDB_TE_BUFFER_FULL_MASK 0x8000000000000000UL | ||
247 | |||
248 | /* Return TOD timestamp contained in an trailer entry */ | ||
249 | static inline unsigned long long trailer_timestamp(struct hws_trailer_entry *te) | ||
250 | { | ||
251 | /* TOD in STCKE format */ | ||
252 | if (te->t) | ||
253 | return *((unsigned long long *) &te->timestamp[1]); | ||
254 | |||
255 | /* TOD in STCK format */ | ||
256 | return *((unsigned long long *) &te->timestamp[0]); | ||
257 | } | ||
258 | |||
259 | /* Return pointer to trailer entry of an sample data block */ | ||
260 | static inline unsigned long *trailer_entry_ptr(unsigned long v) | ||
261 | { | ||
262 | void *ret; | ||
263 | |||
264 | ret = (void *) v; | ||
265 | ret += PAGE_SIZE; | ||
266 | ret -= sizeof(struct hws_trailer_entry); | ||
267 | |||
268 | return (unsigned long *) ret; | ||
269 | } | ||
270 | |||
271 | /* Return if the entry in the sample data block table (sdbt) | ||
272 | * is a link to the next sdbt */ | ||
273 | static inline int is_link_entry(unsigned long *s) | ||
274 | { | ||
275 | return *s & 0x1ul ? 1 : 0; | ||
276 | } | ||
277 | |||
278 | /* Return pointer to the linked sdbt */ | ||
279 | static inline unsigned long *get_next_sdbt(unsigned long *s) | ||
280 | { | ||
281 | return (unsigned long *) (*s & ~0x1ul); | ||
282 | } | ||
102 | #endif /* _ASM_S390_CPU_MF_H */ | 283 | #endif /* _ASM_S390_CPU_MF_H */ |
diff --git a/arch/s390/include/asm/css_chars.h b/arch/s390/include/asm/css_chars.h index 7e1c917bbba2..09d1dd46bd57 100644 --- a/arch/s390/include/asm/css_chars.h +++ b/arch/s390/include/asm/css_chars.h | |||
@@ -29,6 +29,8 @@ struct css_general_char { | |||
29 | u32 fcx : 1; /* bit 88 */ | 29 | u32 fcx : 1; /* bit 88 */ |
30 | u32 : 19; | 30 | u32 : 19; |
31 | u32 alt_ssi : 1; /* bit 108 */ | 31 | u32 alt_ssi : 1; /* bit 108 */ |
32 | u32:1; | ||
33 | u32 narf:1; /* bit 110 */ | ||
32 | } __packed; | 34 | } __packed; |
33 | 35 | ||
34 | extern struct css_general_char css_general_characteristics; | 36 | extern struct css_general_char css_general_characteristics; |
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c129ab2ac731..2583466f576b 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h | |||
@@ -144,6 +144,7 @@ int clp_disable_fh(struct zpci_dev *); | |||
144 | void zpci_event_error(void *); | 144 | void zpci_event_error(void *); |
145 | void zpci_event_availability(void *); | 145 | void zpci_event_availability(void *); |
146 | void zpci_rescan(void); | 146 | void zpci_rescan(void); |
147 | bool zpci_is_enabled(void); | ||
147 | #else /* CONFIG_PCI */ | 148 | #else /* CONFIG_PCI */ |
148 | static inline void zpci_event_error(void *e) {} | 149 | static inline void zpci_event_error(void *e) {} |
149 | static inline void zpci_event_availability(void *e) {} | 150 | static inline void zpci_event_availability(void *e) {} |
diff --git a/arch/s390/include/asm/perf_event.h b/arch/s390/include/asm/perf_event.h index 1141fb3e7b21..159a8ec6da9a 100644 --- a/arch/s390/include/asm/perf_event.h +++ b/arch/s390/include/asm/perf_event.h | |||
@@ -1,21 +1,40 @@ | |||
1 | /* | 1 | /* |
2 | * Performance event support - s390 specific definitions. | 2 | * Performance event support - s390 specific definitions. |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2009, 2012 | 4 | * Copyright IBM Corp. 2009, 2013 |
5 | * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> | 5 | * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> |
6 | * Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 6 | * Hendrik Brueckner <brueckner@linux.vnet.ibm.com> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm/cpu_mf.h> | 9 | #ifndef _ASM_S390_PERF_EVENT_H |
10 | #define _ASM_S390_PERF_EVENT_H | ||
10 | 11 | ||
11 | /* CPU-measurement counter facility */ | 12 | #ifdef CONFIG_64BIT |
12 | #define PERF_CPUM_CF_MAX_CTR 256 | 13 | |
14 | #include <linux/perf_event.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <asm/cpu_mf.h> | ||
13 | 17 | ||
14 | /* Per-CPU flags for PMU states */ | 18 | /* Per-CPU flags for PMU states */ |
15 | #define PMU_F_RESERVED 0x1000 | 19 | #define PMU_F_RESERVED 0x1000 |
16 | #define PMU_F_ENABLED 0x2000 | 20 | #define PMU_F_ENABLED 0x2000 |
21 | #define PMU_F_IN_USE 0x4000 | ||
22 | #define PMU_F_ERR_IBE 0x0100 | ||
23 | #define PMU_F_ERR_LSDA 0x0200 | ||
24 | #define PMU_F_ERR_MASK (PMU_F_ERR_IBE|PMU_F_ERR_LSDA) | ||
25 | |||
26 | /* Perf defintions for PMU event attributes in sysfs */ | ||
27 | extern __init const struct attribute_group **cpumf_cf_event_group(void); | ||
28 | extern ssize_t cpumf_events_sysfs_show(struct device *dev, | ||
29 | struct device_attribute *attr, | ||
30 | char *page); | ||
31 | #define EVENT_VAR(_cat, _name) event_attr_##_cat##_##_name | ||
32 | #define EVENT_PTR(_cat, _name) (&EVENT_VAR(_cat, _name).attr.attr) | ||
33 | |||
34 | #define CPUMF_EVENT_ATTR(cat, name, id) \ | ||
35 | PMU_EVENT_ATTR(name, EVENT_VAR(cat, name), id, cpumf_events_sysfs_show) | ||
36 | #define CPUMF_EVENT_PTR(cat, name) EVENT_PTR(cat, name) | ||
17 | 37 | ||
18 | #ifdef CONFIG_64BIT | ||
19 | 38 | ||
20 | /* Perf callbacks */ | 39 | /* Perf callbacks */ |
21 | struct pt_regs; | 40 | struct pt_regs; |
@@ -23,4 +42,55 @@ extern unsigned long perf_instruction_pointer(struct pt_regs *regs); | |||
23 | extern unsigned long perf_misc_flags(struct pt_regs *regs); | 42 | extern unsigned long perf_misc_flags(struct pt_regs *regs); |
24 | #define perf_misc_flags(regs) perf_misc_flags(regs) | 43 | #define perf_misc_flags(regs) perf_misc_flags(regs) |
25 | 44 | ||
45 | /* Perf pt_regs extension for sample-data-entry indicators */ | ||
46 | struct perf_sf_sde_regs { | ||
47 | unsigned char in_guest:1; /* guest sample */ | ||
48 | unsigned long reserved:63; /* reserved */ | ||
49 | }; | ||
50 | |||
51 | /* Perf PMU definitions for the counter facility */ | ||
52 | #define PERF_CPUM_CF_MAX_CTR 256 | ||
53 | |||
54 | /* Perf PMU definitions for the sampling facility */ | ||
55 | #define PERF_CPUM_SF_MAX_CTR 2 | ||
56 | #define PERF_EVENT_CPUM_SF 0xB0000UL /* Event: Basic-sampling */ | ||
57 | #define PERF_EVENT_CPUM_SF_DIAG 0xBD000UL /* Event: Combined-sampling */ | ||
58 | #define PERF_CPUM_SF_BASIC_MODE 0x0001 /* Basic-sampling flag */ | ||
59 | #define PERF_CPUM_SF_DIAG_MODE 0x0002 /* Diagnostic-sampling flag */ | ||
60 | #define PERF_CPUM_SF_MODE_MASK (PERF_CPUM_SF_BASIC_MODE| \ | ||
61 | PERF_CPUM_SF_DIAG_MODE) | ||
62 | #define PERF_CPUM_SF_FULL_BLOCKS 0x0004 /* Process full SDBs only */ | ||
63 | |||
64 | #define REG_NONE 0 | ||
65 | #define REG_OVERFLOW 1 | ||
66 | #define OVERFLOW_REG(hwc) ((hwc)->extra_reg.config) | ||
67 | #define SFB_ALLOC_REG(hwc) ((hwc)->extra_reg.alloc) | ||
68 | #define RAWSAMPLE_REG(hwc) ((hwc)->config) | ||
69 | #define TEAR_REG(hwc) ((hwc)->last_tag) | ||
70 | #define SAMPL_RATE(hwc) ((hwc)->event_base) | ||
71 | #define SAMPL_FLAGS(hwc) ((hwc)->config_base) | ||
72 | #define SAMPL_DIAG_MODE(hwc) (SAMPL_FLAGS(hwc) & PERF_CPUM_SF_DIAG_MODE) | ||
73 | #define SDB_FULL_BLOCKS(hwc) (SAMPL_FLAGS(hwc) & PERF_CPUM_SF_FULL_BLOCKS) | ||
74 | |||
75 | /* Structure for sampling data entries to be passed as perf raw sample data | ||
76 | * to user space. Note that raw sample data must be aligned and, thus, might | ||
77 | * be padded with zeros. | ||
78 | */ | ||
79 | struct sf_raw_sample { | ||
80 | #define SF_RAW_SAMPLE_BASIC PERF_CPUM_SF_BASIC_MODE | ||
81 | #define SF_RAW_SAMPLE_DIAG PERF_CPUM_SF_DIAG_MODE | ||
82 | u64 format; | ||
83 | u32 size; /* Size of sf_raw_sample */ | ||
84 | u16 bsdes; /* Basic-sampling data entry size */ | ||
85 | u16 dsdes; /* Diagnostic-sampling data entry size */ | ||
86 | struct hws_basic_entry basic; /* Basic-sampling data entry */ | ||
87 | struct hws_diag_entry diag; /* Diagnostic-sampling data entry */ | ||
88 | u8 padding[]; /* Padding to next multiple of 8 */ | ||
89 | } __packed; | ||
90 | |||
91 | /* Perf hardware reserve and release functions */ | ||
92 | int perf_reserve_sampling(void); | ||
93 | void perf_release_sampling(void); | ||
94 | |||
26 | #endif /* CONFIG_64BIT */ | 95 | #endif /* CONFIG_64BIT */ |
96 | #endif /* _ASM_S390_PERF_EVENT_H */ | ||
diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h index 57d0d7e794b1..d786c634e052 100644 --- a/arch/s390/include/asm/qdio.h +++ b/arch/s390/include/asm/qdio.h | |||
@@ -336,7 +336,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, | |||
336 | #define QDIO_FLAG_CLEANUP_USING_HALT 0x02 | 336 | #define QDIO_FLAG_CLEANUP_USING_HALT 0x02 |
337 | 337 | ||
338 | /** | 338 | /** |
339 | * struct qdio_initialize - qdio initalization data | 339 | * struct qdio_initialize - qdio initialization data |
340 | * @cdev: associated ccw device | 340 | * @cdev: associated ccw device |
341 | * @q_format: queue format | 341 | * @q_format: queue format |
342 | * @adapter_name: name for the adapter | 342 | * @adapter_name: name for the adapter |
@@ -378,6 +378,34 @@ struct qdio_initialize { | |||
378 | struct qdio_outbuf_state *output_sbal_state_array; | 378 | struct qdio_outbuf_state *output_sbal_state_array; |
379 | }; | 379 | }; |
380 | 380 | ||
381 | /** | ||
382 | * enum qdio_brinfo_entry_type - type of address entry for qdio_brinfo_desc() | ||
383 | * @l3_ipv6_addr: entry contains IPv6 address | ||
384 | * @l3_ipv4_addr: entry contains IPv4 address | ||
385 | * @l2_addr_lnid: entry contains MAC address and VLAN ID | ||
386 | */ | ||
387 | enum qdio_brinfo_entry_type {l3_ipv6_addr, l3_ipv4_addr, l2_addr_lnid}; | ||
388 | |||
389 | /** | ||
390 | * struct qdio_brinfo_entry_XXX - Address entry for qdio_brinfo_desc() | ||
391 | * @nit: Network interface token | ||
392 | * @addr: Address of one of the three types | ||
393 | * | ||
394 | * The struct is passed to the callback function by qdio_brinfo_desc() | ||
395 | */ | ||
396 | struct qdio_brinfo_entry_l3_ipv6 { | ||
397 | u64 nit; | ||
398 | struct { unsigned char _s6_addr[16]; } addr; | ||
399 | } __packed; | ||
400 | struct qdio_brinfo_entry_l3_ipv4 { | ||
401 | u64 nit; | ||
402 | struct { uint32_t _s_addr; } addr; | ||
403 | } __packed; | ||
404 | struct qdio_brinfo_entry_l2 { | ||
405 | u64 nit; | ||
406 | struct { u8 mac[6]; u16 lnid; } addr_lnid; | ||
407 | } __packed; | ||
408 | |||
381 | #define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */ | 409 | #define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */ |
382 | #define QDIO_STATE_ESTABLISHED 0x00000004 /* after qdio_establish */ | 410 | #define QDIO_STATE_ESTABLISHED 0x00000004 /* after qdio_establish */ |
383 | #define QDIO_STATE_ACTIVE 0x00000008 /* after qdio_activate */ | 411 | #define QDIO_STATE_ACTIVE 0x00000008 /* after qdio_activate */ |
@@ -399,5 +427,10 @@ extern int qdio_get_next_buffers(struct ccw_device *, int, int *, int *); | |||
399 | extern int qdio_shutdown(struct ccw_device *, int); | 427 | extern int qdio_shutdown(struct ccw_device *, int); |
400 | extern int qdio_free(struct ccw_device *); | 428 | extern int qdio_free(struct ccw_device *); |
401 | extern int qdio_get_ssqd_desc(struct ccw_device *, struct qdio_ssqd_desc *); | 429 | extern int qdio_get_ssqd_desc(struct ccw_device *, struct qdio_ssqd_desc *); |
430 | extern int qdio_pnso_brinfo(struct subchannel_id schid, | ||
431 | int cnc, u16 *response, | ||
432 | void (*cb)(void *priv, enum qdio_brinfo_entry_type type, | ||
433 | void *entry), | ||
434 | void *priv); | ||
402 | 435 | ||
403 | #endif /* __QDIO_H__ */ | 436 | #endif /* __QDIO_H__ */ |
diff --git a/arch/s390/include/asm/sclp.h b/arch/s390/include/asm/sclp.h index 2f390956c7c1..220e171413f8 100644 --- a/arch/s390/include/asm/sclp.h +++ b/arch/s390/include/asm/sclp.h | |||
@@ -52,8 +52,8 @@ int sclp_chp_configure(struct chp_id chpid); | |||
52 | int sclp_chp_deconfigure(struct chp_id chpid); | 52 | int sclp_chp_deconfigure(struct chp_id chpid); |
53 | int sclp_chp_read_info(struct sclp_chp_info *info); | 53 | int sclp_chp_read_info(struct sclp_chp_info *info); |
54 | void sclp_get_ipl_info(struct sclp_ipl_info *info); | 54 | void sclp_get_ipl_info(struct sclp_ipl_info *info); |
55 | bool sclp_has_linemode(void); | 55 | bool __init sclp_has_linemode(void); |
56 | bool sclp_has_vt220(void); | 56 | bool __init sclp_has_vt220(void); |
57 | int sclp_pci_configure(u32 fid); | 57 | int sclp_pci_configure(u32 fid); |
58 | int sclp_pci_deconfigure(u32 fid); | 58 | int sclp_pci_deconfigure(u32 fid); |
59 | int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode); | 59 | int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode); |
diff --git a/arch/s390/include/uapi/asm/zcrypt.h b/arch/s390/include/uapi/asm/zcrypt.h index e83fc116f5bf..f2b18eacaca8 100644 --- a/arch/s390/include/uapi/asm/zcrypt.h +++ b/arch/s390/include/uapi/asm/zcrypt.h | |||
@@ -154,6 +154,67 @@ struct ica_xcRB { | |||
154 | unsigned short priority_window; | 154 | unsigned short priority_window; |
155 | unsigned int status; | 155 | unsigned int status; |
156 | } __attribute__((packed)); | 156 | } __attribute__((packed)); |
157 | |||
158 | /** | ||
159 | * struct ep11_cprb - EP11 connectivity programming request block | ||
160 | * @cprb_len: CPRB header length [0x0020] | ||
161 | * @cprb_ver_id: CPRB version id. [0x04] | ||
162 | * @pad_000: Alignment pad bytes | ||
163 | * @flags: Admin cmd [0x80] or functional cmd [0x00] | ||
164 | * @func_id: Function id / subtype [0x5434] | ||
165 | * @source_id: Source id [originator id] | ||
166 | * @target_id: Target id [usage/ctrl domain id] | ||
167 | * @ret_code: Return code | ||
168 | * @reserved1: Reserved | ||
169 | * @reserved2: Reserved | ||
170 | * @payload_len: Payload length | ||
171 | */ | ||
172 | struct ep11_cprb { | ||
173 | uint16_t cprb_len; | ||
174 | unsigned char cprb_ver_id; | ||
175 | unsigned char pad_000[2]; | ||
176 | unsigned char flags; | ||
177 | unsigned char func_id[2]; | ||
178 | uint32_t source_id; | ||
179 | uint32_t target_id; | ||
180 | uint32_t ret_code; | ||
181 | uint32_t reserved1; | ||
182 | uint32_t reserved2; | ||
183 | uint32_t payload_len; | ||
184 | } __attribute__((packed)); | ||
185 | |||
186 | /** | ||
187 | * struct ep11_target_dev - EP11 target device list | ||
188 | * @ap_id: AP device id | ||
189 | * @dom_id: Usage domain id | ||
190 | */ | ||
191 | struct ep11_target_dev { | ||
192 | uint16_t ap_id; | ||
193 | uint16_t dom_id; | ||
194 | }; | ||
195 | |||
196 | /** | ||
197 | * struct ep11_urb - EP11 user request block | ||
198 | * @targets_num: Number of target adapters | ||
199 | * @targets: Addr to target adapter list | ||
200 | * @weight: Level of request priority | ||
201 | * @req_no: Request id/number | ||
202 | * @req_len: Request length | ||
203 | * @req: Addr to request block | ||
204 | * @resp_len: Response length | ||
205 | * @resp: Addr to response block | ||
206 | */ | ||
207 | struct ep11_urb { | ||
208 | uint16_t targets_num; | ||
209 | uint64_t targets; | ||
210 | uint64_t weight; | ||
211 | uint64_t req_no; | ||
212 | uint64_t req_len; | ||
213 | uint64_t req; | ||
214 | uint64_t resp_len; | ||
215 | uint64_t resp; | ||
216 | } __attribute__((packed)); | ||
217 | |||
157 | #define AUTOSELECT ((unsigned int)0xFFFFFFFF) | 218 | #define AUTOSELECT ((unsigned int)0xFFFFFFFF) |
158 | 219 | ||
159 | #define ZCRYPT_IOCTL_MAGIC 'z' | 220 | #define ZCRYPT_IOCTL_MAGIC 'z' |
@@ -183,6 +244,9 @@ struct ica_xcRB { | |||
183 | * ZSECSENDCPRB | 244 | * ZSECSENDCPRB |
184 | * Send an arbitrary CPRB to a crypto card. | 245 | * Send an arbitrary CPRB to a crypto card. |
185 | * | 246 | * |
247 | * ZSENDEP11CPRB | ||
248 | * Send an arbitrary EP11 CPRB to an EP11 coprocessor crypto card. | ||
249 | * | ||
186 | * Z90STAT_STATUS_MASK | 250 | * Z90STAT_STATUS_MASK |
187 | * Return an 64 element array of unsigned chars for the status of | 251 | * Return an 64 element array of unsigned chars for the status of |
188 | * all devices. | 252 | * all devices. |
@@ -256,6 +320,7 @@ struct ica_xcRB { | |||
256 | #define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x05, 0) | 320 | #define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x05, 0) |
257 | #define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x06, 0) | 321 | #define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x06, 0) |
258 | #define ZSECSENDCPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x81, 0) | 322 | #define ZSECSENDCPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x81, 0) |
323 | #define ZSENDEP11CPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0) | ||
259 | 324 | ||
260 | /* New status calls */ | 325 | /* New status calls */ |
261 | #define Z90STAT_TOTALCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x40, int) | 326 | #define Z90STAT_TOTALCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x40, int) |