Lines Matching +full:0 +full:- +full:4
1 /* SPDX-License-Identifier: GPL-2.0-only */
14 #include <linux/kasan-tags.h>
16 #include <asm/gpr-num.h>
22 * [20-19] : Op0
23 * [18-16] : Op1
24 * [15-12] : CRn
25 * [11-8] : CRm
26 * [7-5] : Op2
29 #define Op0_mask 0x3
31 #define Op1_mask 0x7
33 #define CRn_mask 0xf
35 #define CRm_mask 0xf
37 #define Op2_mask 0x7
67 #define __INSTR_BSWAP(x) ((((x) << 24) & 0xff000000) | \
68 (((x) << 8) & 0x00ff0000) | \
69 (((x) >> 8) & 0x0000ff00) | \
70 (((x) >> 24) & 0x000000ff))
83 * As per Arm ARM for v8-A, Section "C.5.1.3 op0 == 0b00, architectural hints,
86 * Op0 = 0, CRn = 4
89 * Rt = 0x1f
93 #define SET_PSTATE(x, r) __emit_inst(0xd500401f | PSTATE_ ## r | ((!!x) << PSTATE_Imm_shift))
95 #define PSTATE_PAN pstate_field(0, 4)
96 #define PSTATE_UAO pstate_field(0, 3)
99 #define PSTATE_TCO pstate_field(3, 4)
112 /* Register-based PAN access, for save/restore purposes */
113 #define SYS_PSTATE_PAN sys_reg(3, 0, 4, 2, 3)
116 __emit_inst(0xd5000000 | sys_insn(0, 3, 3, (CRm), (op2)) | ((Rt) & 0x1f))
118 #define SB_BARRIER_INSN __SYS_BARRIER_INSN(0, 7, 31)
120 #define SYS_DC_ISW sys_insn(1, 0, 7, 6, 2)
121 #define SYS_DC_IGSW sys_insn(1, 0, 7, 6, 4)
122 #define SYS_DC_IGDSW sys_insn(1, 0, 7, 6, 6)
123 #define SYS_DC_CSW sys_insn(1, 0, 7, 10, 2)
124 #define SYS_DC_CGSW sys_insn(1, 0, 7, 10, 4)
125 #define SYS_DC_CGDSW sys_insn(1, 0, 7, 10, 6)
126 #define SYS_DC_CISW sys_insn(1, 0, 7, 14, 2)
127 #define SYS_DC_CIGSW sys_insn(1, 0, 7, 14, 4)
128 #define SYS_DC_CIGDSW sys_insn(1, 0, 7, 14, 6)
130 #define SYS_IC_IALLUIS sys_insn(1, 0, 7, 1, 0)
131 #define SYS_IC_IALLU sys_insn(1, 0, 7, 5, 0)
134 #define SYS_DC_IVAC sys_insn(1, 0, 7, 6, 1)
135 #define SYS_DC_IGVAC sys_insn(1, 0, 7, 6, 3)
136 #define SYS_DC_IGDVAC sys_insn(1, 0, 7, 6, 5)
157 #define SYS_DC_ZVA sys_insn(1, 3, 7, 4, 1)
158 #define SYS_DC_GVA sys_insn(1, 3, 7, 4, 3)
159 #define SYS_DC_GZVA sys_insn(1, 3, 7, 4, 4)
167 #include "asm/sysreg-defs.h"
173 #define SYS_SVCR_SMSTOP_SM_EL0 sys_reg(0, 3, 4, 2, 3)
174 #define SYS_SVCR_SMSTART_SM_EL0 sys_reg(0, 3, 4, 3, 3)
175 #define SYS_SVCR_SMSTOP_SMZA_EL0 sys_reg(0, 3, 4, 6, 3)
177 #define SYS_DBGBVRn_EL1(n) sys_reg(2, 0, 0, n, 4)
178 #define SYS_DBGBCRn_EL1(n) sys_reg(2, 0, 0, n, 5)
179 #define SYS_DBGWVRn_EL1(n) sys_reg(2, 0, 0, n, 6)
180 #define SYS_DBGWCRn_EL1(n) sys_reg(2, 0, 0, n, 7)
181 #define SYS_MDRAR_EL1 sys_reg(2, 0, 1, 0, 0)
183 #define SYS_OSLSR_EL1 sys_reg(2, 0, 1, 1, 4)
184 #define OSLSR_EL1_OSLM_MASK (BIT(3) | BIT(0))
185 #define OSLSR_EL1_OSLM_NI 0
189 #define SYS_OSDLR_EL1 sys_reg(2, 0, 1, 3, 4)
190 #define SYS_DBGPRCR_EL1 sys_reg(2, 0, 1, 4, 4)
191 #define SYS_DBGCLAIMSET_EL1 sys_reg(2, 0, 7, 8, 6)
192 #define SYS_DBGCLAIMCLR_EL1 sys_reg(2, 0, 7, 9, 6)
193 #define SYS_DBGAUTHSTATUS_EL1 sys_reg(2, 0, 7, 14, 6)
194 #define SYS_MDCCSR_EL0 sys_reg(2, 3, 0, 1, 0)
195 #define SYS_DBGDTR_EL0 sys_reg(2, 3, 0, 4, 0)
196 #define SYS_DBGDTRRX_EL0 sys_reg(2, 3, 0, 5, 0)
197 #define SYS_DBGDTRTX_EL0 sys_reg(2, 3, 0, 5, 0)
198 #define SYS_DBGVCR32_EL2 sys_reg(2, 4, 0, 7, 0)
200 #define SYS_BRBINF_EL1(n) sys_reg(2, 1, 8, (n & 15), (((n & 16) >> 2) | 0))
201 #define SYS_BRBINFINJ_EL1 sys_reg(2, 1, 9, 1, 0)
206 #define SYS_BRBTS_EL1 sys_reg(2, 1, 9, 0, 2)
208 #define SYS_BRBCR_EL1 sys_reg(2, 1, 9, 0, 0)
209 #define SYS_BRBFCR_EL1 sys_reg(2, 1, 9, 0, 1)
210 #define SYS_BRBIDR0_EL1 sys_reg(2, 1, 9, 2, 0)
212 #define SYS_TRCITECR_EL1 sys_reg(3, 0, 1, 2, 3)
214 #define SYS_TRCACVR(m) sys_reg(2, 1, 2, ((m & 7) << 1), (0 | (m >> 3)))
216 #define SYS_TRCAUXCTLR sys_reg(2, 1, 0, 6, 0)
217 #define SYS_TRCBBCTLR sys_reg(2, 1, 0, 15, 0)
218 #define SYS_TRCCCCTLR sys_reg(2, 1, 0, 14, 0)
219 #define SYS_TRCCIDCCTLR0 sys_reg(2, 1, 3, 0, 2)
221 #define SYS_TRCCIDCVR(m) sys_reg(2, 1, 3, ((m & 7) << 1), 0)
224 #define SYS_TRCCNTCTLR(m) sys_reg(2, 1, 0, (4 | (m & 3)), 5)
225 #define SYS_TRCCNTRLDVR(m) sys_reg(2, 1, 0, (0 | (m & 3)), 5)
226 #define SYS_TRCCNTVR(m) sys_reg(2, 1, 0, (8 | (m & 3)), 5)
227 #define SYS_TRCCONFIGR sys_reg(2, 1, 0, 4, 0)
230 #define SYS_TRCEVENTCTL0R sys_reg(2, 1, 0, 8, 0)
231 #define SYS_TRCEVENTCTL1R sys_reg(2, 1, 0, 9, 0)
232 #define SYS_TRCEXTINSELR(m) sys_reg(2, 1, 0, (8 | (m & 3)), 4)
233 #define SYS_TRCIDR0 sys_reg(2, 1, 0, 8, 7)
234 #define SYS_TRCIDR10 sys_reg(2, 1, 0, 2, 6)
235 #define SYS_TRCIDR11 sys_reg(2, 1, 0, 3, 6)
236 #define SYS_TRCIDR12 sys_reg(2, 1, 0, 4, 6)
237 #define SYS_TRCIDR13 sys_reg(2, 1, 0, 5, 6)
238 #define SYS_TRCIDR1 sys_reg(2, 1, 0, 9, 7)
239 #define SYS_TRCIDR2 sys_reg(2, 1, 0, 10, 7)
240 #define SYS_TRCIDR3 sys_reg(2, 1, 0, 11, 7)
241 #define SYS_TRCIDR4 sys_reg(2, 1, 0, 12, 7)
242 #define SYS_TRCIDR5 sys_reg(2, 1, 0, 13, 7)
243 #define SYS_TRCIDR6 sys_reg(2, 1, 0, 14, 7)
244 #define SYS_TRCIDR7 sys_reg(2, 1, 0, 15, 7)
245 #define SYS_TRCIDR8 sys_reg(2, 1, 0, 0, 6)
246 #define SYS_TRCIDR9 sys_reg(2, 1, 0, 1, 6)
247 #define SYS_TRCIMSPEC(m) sys_reg(2, 1, 0, (m & 7), 7)
248 #define SYS_TRCITEEDCR sys_reg(2, 1, 0, 2, 1)
249 #define SYS_TRCOSLSR sys_reg(2, 1, 1, 1, 4)
250 #define SYS_TRCPRGCTLR sys_reg(2, 1, 0, 1, 0)
251 #define SYS_TRCQCTLR sys_reg(2, 1, 0, 1, 1)
252 #define SYS_TRCRSCTLR(m) sys_reg(2, 1, 1, (m & 15), (0 | (m >> 4)))
253 #define SYS_TRCRSR sys_reg(2, 1, 0, 10, 0)
254 #define SYS_TRCSEQEVR(m) sys_reg(2, 1, 0, (m & 3), 4)
255 #define SYS_TRCSEQRSTEVR sys_reg(2, 1, 0, 6, 4)
256 #define SYS_TRCSEQSTR sys_reg(2, 1, 0, 7, 4)
260 #define SYS_TRCSTALLCTLR sys_reg(2, 1, 0, 11, 0)
261 #define SYS_TRCSTATR sys_reg(2, 1, 0, 3, 0)
262 #define SYS_TRCSYNCPR sys_reg(2, 1, 0, 13, 0)
263 #define SYS_TRCTRACEIDR sys_reg(2, 1, 0, 0, 1)
264 #define SYS_TRCTSCTLR sys_reg(2, 1, 0, 12, 0)
265 #define SYS_TRCVICTLR sys_reg(2, 1, 0, 0, 2)
266 #define SYS_TRCVIIECTLR sys_reg(2, 1, 0, 1, 2)
267 #define SYS_TRCVIPCSSCTLR sys_reg(2, 1, 0, 3, 2)
268 #define SYS_TRCVISSCTLR sys_reg(2, 1, 0, 2, 2)
274 #define SYS_TRCOSLAR sys_reg(2, 1, 1, 0, 4)
276 #define SYS_BRBCR_EL2 sys_reg(2, 4, 9, 0, 0)
278 #define SYS_MIDR_EL1 sys_reg(3, 0, 0, 0, 0)
279 #define SYS_MPIDR_EL1 sys_reg(3, 0, 0, 0, 5)
280 #define SYS_REVIDR_EL1 sys_reg(3, 0, 0, 0, 6)
282 #define SYS_ACTLR_EL1 sys_reg(3, 0, 1, 0, 1)
283 #define SYS_RGSR_EL1 sys_reg(3, 0, 1, 0, 5)
284 #define SYS_GCR_EL1 sys_reg(3, 0, 1, 0, 6)
286 #define SYS_TRFCR_EL1 sys_reg(3, 0, 1, 2, 1)
288 #define SYS_TCR_EL1 sys_reg(3, 0, 2, 0, 2)
290 #define SYS_APIAKEYLO_EL1 sys_reg(3, 0, 2, 1, 0)
291 #define SYS_APIAKEYHI_EL1 sys_reg(3, 0, 2, 1, 1)
292 #define SYS_APIBKEYLO_EL1 sys_reg(3, 0, 2, 1, 2)
293 #define SYS_APIBKEYHI_EL1 sys_reg(3, 0, 2, 1, 3)
295 #define SYS_APDAKEYLO_EL1 sys_reg(3, 0, 2, 2, 0)
296 #define SYS_APDAKEYHI_EL1 sys_reg(3, 0, 2, 2, 1)
297 #define SYS_APDBKEYLO_EL1 sys_reg(3, 0, 2, 2, 2)
298 #define SYS_APDBKEYHI_EL1 sys_reg(3, 0, 2, 2, 3)
300 #define SYS_APGAKEYLO_EL1 sys_reg(3, 0, 2, 3, 0)
301 #define SYS_APGAKEYHI_EL1 sys_reg(3, 0, 2, 3, 1)
303 #define SYS_SPSR_EL1 sys_reg(3, 0, 4, 0, 0)
304 #define SYS_ELR_EL1 sys_reg(3, 0, 4, 0, 1)
306 #define SYS_ICC_PMR_EL1 sys_reg(3, 0, 4, 6, 0)
308 #define SYS_AFSR0_EL1 sys_reg(3, 0, 5, 1, 0)
309 #define SYS_AFSR1_EL1 sys_reg(3, 0, 5, 1, 1)
310 #define SYS_ESR_EL1 sys_reg(3, 0, 5, 2, 0)
312 #define SYS_ERRIDR_EL1 sys_reg(3, 0, 5, 3, 0)
313 #define SYS_ERRSELR_EL1 sys_reg(3, 0, 5, 3, 1)
314 #define SYS_ERXFR_EL1 sys_reg(3, 0, 5, 4, 0)
315 #define SYS_ERXCTLR_EL1 sys_reg(3, 0, 5, 4, 1)
316 #define SYS_ERXSTATUS_EL1 sys_reg(3, 0, 5, 4, 2)
317 #define SYS_ERXADDR_EL1 sys_reg(3, 0, 5, 4, 3)
318 #define SYS_ERXPFGF_EL1 sys_reg(3, 0, 5, 4, 4)
319 #define SYS_ERXPFGCTL_EL1 sys_reg(3, 0, 5, 4, 5)
320 #define SYS_ERXPFGCDN_EL1 sys_reg(3, 0, 5, 4, 6)
321 #define SYS_ERXMISC0_EL1 sys_reg(3, 0, 5, 5, 0)
322 #define SYS_ERXMISC1_EL1 sys_reg(3, 0, 5, 5, 1)
323 #define SYS_ERXMISC2_EL1 sys_reg(3, 0, 5, 5, 2)
324 #define SYS_ERXMISC3_EL1 sys_reg(3, 0, 5, 5, 3)
325 #define SYS_TFSR_EL1 sys_reg(3, 0, 5, 6, 0)
326 #define SYS_TFSRE0_EL1 sys_reg(3, 0, 5, 6, 1)
328 #define SYS_PAR_EL1 sys_reg(3, 0, 7, 4, 0)
330 #define SYS_PAR_EL1_F BIT(0)
342 /* When PAR_EL1.F == 0 */
354 BIT_ULL(6) | BIT_ULL(4) | BIT_ULL(2) | BIT_ULL(0))
367 #define PMBSR_EL1_BUF_BSC_FULL 0x1UL
371 #define TRBSR_EL1_BSC_MASK GENMASK(5, 0)
372 #define TRBSR_EL1_BSC_SHIFT 0
374 #define SYS_PMINTENSET_EL1 sys_reg(3, 0, 9, 14, 1)
375 #define SYS_PMINTENCLR_EL1 sys_reg(3, 0, 9, 14, 2)
377 #define SYS_PMMIR_EL1 sys_reg(3, 0, 9, 14, 6)
379 #define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)
380 #define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0)
382 #define SYS_VBAR_EL1 sys_reg(3, 0, 12, 0, 0)
383 #define SYS_DISR_EL1 sys_reg(3, 0, 12, 1, 1)
385 #define SYS_ICC_IAR0_EL1 sys_reg(3, 0, 12, 8, 0)
386 #define SYS_ICC_EOIR0_EL1 sys_reg(3, 0, 12, 8, 1)
387 #define SYS_ICC_HPPIR0_EL1 sys_reg(3, 0, 12, 8, 2)
388 #define SYS_ICC_BPR0_EL1 sys_reg(3, 0, 12, 8, 3)
389 #define SYS_ICC_AP0Rn_EL1(n) sys_reg(3, 0, 12, 8, 4 | n)
390 #define SYS_ICC_AP0R0_EL1 SYS_ICC_AP0Rn_EL1(0)
394 #define SYS_ICC_AP1Rn_EL1(n) sys_reg(3, 0, 12, 9, n)
395 #define SYS_ICC_AP1R0_EL1 SYS_ICC_AP1Rn_EL1(0)
399 #define SYS_ICC_DIR_EL1 sys_reg(3, 0, 12, 11, 1)
400 #define SYS_ICC_RPR_EL1 sys_reg(3, 0, 12, 11, 3)
401 #define SYS_ICC_SGI1R_EL1 sys_reg(3, 0, 12, 11, 5)
402 #define SYS_ICC_ASGI1R_EL1 sys_reg(3, 0, 12, 11, 6)
403 #define SYS_ICC_SGI0R_EL1 sys_reg(3, 0, 12, 11, 7)
404 #define SYS_ICC_IAR1_EL1 sys_reg(3, 0, 12, 12, 0)
405 #define SYS_ICC_EOIR1_EL1 sys_reg(3, 0, 12, 12, 1)
406 #define SYS_ICC_HPPIR1_EL1 sys_reg(3, 0, 12, 12, 2)
407 #define SYS_ICC_BPR1_EL1 sys_reg(3, 0, 12, 12, 3)
408 #define SYS_ICC_CTLR_EL1 sys_reg(3, 0, 12, 12, 4)
409 #define SYS_ICC_SRE_EL1 sys_reg(3, 0, 12, 12, 5)
410 #define SYS_ICC_IGRPEN0_EL1 sys_reg(3, 0, 12, 12, 6)
411 #define SYS_ICC_IGRPEN1_EL1 sys_reg(3, 0, 12, 12, 7)
413 #define SYS_ACCDATA_EL1 sys_reg(3, 0, 13, 0, 5)
415 #define SYS_CNTKCTL_EL1 sys_reg(3, 0, 14, 1, 0)
417 #define SYS_AIDR_EL1 sys_reg(3, 1, 0, 0, 7)
419 #define SYS_RNDR_EL0 sys_reg(3, 3, 2, 4, 0)
420 #define SYS_RNDRRS_EL0 sys_reg(3, 3, 2, 4, 1)
422 #define SYS_PMCR_EL0 sys_reg(3, 3, 9, 12, 0)
426 #define SYS_PMSWINC_EL0 sys_reg(3, 3, 9, 12, 4)
429 #define SYS_PMCCNTR_EL0 sys_reg(3, 3, 9, 13, 0)
432 #define SYS_PMUSERENR_EL0 sys_reg(3, 3, 9, 14, 0)
435 #define SYS_TPIDR_EL0 sys_reg(3, 3, 13, 0, 2)
436 #define SYS_TPIDRRO_EL0 sys_reg(3, 3, 13, 0, 3)
437 #define SYS_TPIDR2_EL0 sys_reg(3, 3, 13, 0, 5)
439 #define SYS_SCXTNUM_EL0 sys_reg(3, 3, 13, 0, 7)
441 /* Definitions for system register interface to AMU for ARMv8.4 onwards */
443 #define SYS_AMCR_EL0 SYS_AM_EL0(2, 0)
447 #define SYS_AMCNTENCLR0_EL0 SYS_AM_EL0(2, 4)
449 #define SYS_AMCNTENCLR1_EL0 SYS_AM_EL0(3, 0)
453 * Group 0 of activity monitors (architected):
455 * Counter: 11 011 1101 010:n<3> n<2:0>
456 * Type: 11 011 1101 011:n<3> n<2:0>
457 * n: 0-15
461 * Counter: 11 011 1101 110:n<3> n<2:0>
462 * Type: 11 011 1101 111:n<3> n<2:0>
463 * n: 0-15
466 #define SYS_AMEVCNTR0_EL0(n) SYS_AM_EL0(4 + ((n) >> 3), (n) & 7)
472 #define SYS_AMEVCNTR0_CORE_EL0 SYS_AMEVCNTR0_EL0(0)
477 #define SYS_CNTFRQ_EL0 sys_reg(3, 3, 14, 0, 0)
479 #define SYS_CNTPCT_EL0 sys_reg(3, 3, 14, 0, 1)
480 #define SYS_CNTPCTSS_EL0 sys_reg(3, 3, 14, 0, 5)
481 #define SYS_CNTVCTSS_EL0 sys_reg(3, 3, 14, 0, 6)
483 #define SYS_CNTP_TVAL_EL0 sys_reg(3, 3, 14, 2, 0)
490 #define SYS_AARCH32_CNTP_TVAL sys_reg(0, 0, 14, 2, 0)
491 #define SYS_AARCH32_CNTP_CTL sys_reg(0, 0, 14, 2, 1)
492 #define SYS_AARCH32_CNTPCT sys_reg(0, 0, 0, 14, 0)
493 #define SYS_AARCH32_CNTP_CVAL sys_reg(0, 2, 0, 14, 0)
494 #define SYS_AARCH32_CNTPCTSS sys_reg(0, 8, 0, 14, 0)
496 #define __PMEV_op2(n) ((n) & 0x7)
497 #define __CNTR_CRm(n) (0x8 | (((n) >> 3) & 0x3))
499 #define __TYPER_CRm(n) (0xc | (((n) >> 3) & 0x3))
504 #define SYS_VPIDR_EL2 sys_reg(3, 4, 0, 0, 0)
505 #define SYS_VMPIDR_EL2 sys_reg(3, 4, 0, 0, 5)
507 #define SYS_SCTLR_EL2 sys_reg(3, 4, 1, 0, 0)
508 #define SYS_ACTLR_EL2 sys_reg(3, 4, 1, 0, 1)
509 #define SYS_SCTLR2_EL2 sys_reg(3, 4, 1, 0, 3)
510 #define SYS_HCR_EL2 sys_reg(3, 4, 1, 1, 0)
511 #define SYS_MDCR_EL2 sys_reg(3, 4, 1, 1, 1)
512 #define SYS_CPTR_EL2 sys_reg(3, 4, 1, 1, 2)
513 #define SYS_HSTR_EL2 sys_reg(3, 4, 1, 1, 3)
514 #define SYS_HACR_EL2 sys_reg(3, 4, 1, 1, 7)
516 #define SYS_TTBR0_EL2 sys_reg(3, 4, 2, 0, 0)
517 #define SYS_TTBR1_EL2 sys_reg(3, 4, 2, 0, 1)
518 #define SYS_TCR_EL2 sys_reg(3, 4, 2, 0, 2)
519 #define SYS_VTTBR_EL2 sys_reg(3, 4, 2, 1, 0)
520 #define SYS_VTCR_EL2 sys_reg(3, 4, 2, 1, 2)
522 #define SYS_TRFCR_EL2 sys_reg(3, 4, 1, 2, 1)
523 #define SYS_VNCR_EL2 sys_reg(3, 4, 2, 2, 0)
524 #define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6)
525 #define SYS_SPSR_EL2 sys_reg(3, 4, 4, 0, 0)
526 #define SYS_ELR_EL2 sys_reg(3, 4, 4, 0, 1)
527 #define SYS_SP_EL1 sys_reg(3, 4, 4, 1, 0)
528 #define SYS_SPSR_irq sys_reg(3, 4, 4, 3, 0)
529 #define SYS_SPSR_abt sys_reg(3, 4, 4, 3, 1)
530 #define SYS_SPSR_und sys_reg(3, 4, 4, 3, 2)
531 #define SYS_SPSR_fiq sys_reg(3, 4, 4, 3, 3)
532 #define SYS_IFSR32_EL2 sys_reg(3, 4, 5, 0, 1)
533 #define SYS_AFSR0_EL2 sys_reg(3, 4, 5, 1, 0)
534 #define SYS_AFSR1_EL2 sys_reg(3, 4, 5, 1, 1)
535 #define SYS_ESR_EL2 sys_reg(3, 4, 5, 2, 0)
536 #define SYS_VSESR_EL2 sys_reg(3, 4, 5, 2, 3)
537 #define SYS_FPEXC32_EL2 sys_reg(3, 4, 5, 3, 0)
538 #define SYS_TFSR_EL2 sys_reg(3, 4, 5, 6, 0)
540 #define SYS_FAR_EL2 sys_reg(3, 4, 6, 0, 0)
541 #define SYS_HPFAR_EL2 sys_reg(3, 4, 6, 0, 4)
543 #define SYS_MAIR_EL2 sys_reg(3, 4, 10, 2, 0)
544 #define SYS_AMAIR_EL2 sys_reg(3, 4, 10, 3, 0)
545 #define SYS_MPAMHCR_EL2 sys_reg(3, 4, 10, 4, 0)
546 #define SYS_MPAMVPMV_EL2 sys_reg(3, 4, 10, 4, 1)
547 #define SYS_MPAM2_EL2 sys_reg(3, 4, 10, 5, 0)
548 #define __SYS__MPAMVPMx_EL2(x) sys_reg(3, 4, 10, 6, x)
549 #define SYS_MPAMVPM0_EL2 __SYS__MPAMVPMx_EL2(0)
553 #define SYS_MPAMVPM4_EL2 __SYS__MPAMVPMx_EL2(4)
558 #define SYS_VBAR_EL2 sys_reg(3, 4, 12, 0, 0)
559 #define SYS_RVBAR_EL2 sys_reg(3, 4, 12, 0, 1)
560 #define SYS_RMR_EL2 sys_reg(3, 4, 12, 0, 2)
561 #define SYS_VDISR_EL2 sys_reg(3, 4, 12, 1, 1)
562 #define __SYS__AP0Rx_EL2(x) sys_reg(3, 4, 12, 8, x)
563 #define SYS_ICH_AP0R0_EL2 __SYS__AP0Rx_EL2(0)
568 #define __SYS__AP1Rx_EL2(x) sys_reg(3, 4, 12, 9, x)
569 #define SYS_ICH_AP1R0_EL2 __SYS__AP1Rx_EL2(0)
574 #define SYS_ICH_VSEIR_EL2 sys_reg(3, 4, 12, 9, 4)
575 #define SYS_ICC_SRE_EL2 sys_reg(3, 4, 12, 9, 5)
576 #define SYS_ICH_HCR_EL2 sys_reg(3, 4, 12, 11, 0)
577 #define SYS_ICH_VTR_EL2 sys_reg(3, 4, 12, 11, 1)
578 #define SYS_ICH_MISR_EL2 sys_reg(3, 4, 12, 11, 2)
579 #define SYS_ICH_EISR_EL2 sys_reg(3, 4, 12, 11, 3)
580 #define SYS_ICH_ELRSR_EL2 sys_reg(3, 4, 12, 11, 5)
581 #define SYS_ICH_VMCR_EL2 sys_reg(3, 4, 12, 11, 7)
583 #define __SYS__LR0_EL2(x) sys_reg(3, 4, 12, 12, x)
584 #define SYS_ICH_LR0_EL2 __SYS__LR0_EL2(0)
588 #define SYS_ICH_LR4_EL2 __SYS__LR0_EL2(4)
593 #define __SYS__LR8_EL2(x) sys_reg(3, 4, 12, 13, x)
594 #define SYS_ICH_LR8_EL2 __SYS__LR8_EL2(0)
598 #define SYS_ICH_LR12_EL2 __SYS__LR8_EL2(4)
603 #define SYS_CONTEXTIDR_EL2 sys_reg(3, 4, 13, 0, 1)
604 #define SYS_TPIDR_EL2 sys_reg(3, 4, 13, 0, 2)
605 #define SYS_SCXTNUM_EL2 sys_reg(3, 4, 13, 0, 7)
607 #define __AMEV_op2(m) (m & 0x7)
608 #define __AMEV_CRm(n, m) (n | ((m & 0x8) >> 3))
609 #define __SYS__AMEVCNTVOFF0n_EL2(m) sys_reg(3, 4, 13, __AMEV_CRm(0x8, m), __AMEV_op2(m))
611 #define __SYS__AMEVCNTVOFF1n_EL2(m) sys_reg(3, 4, 13, __AMEV_CRm(0xA, m), __AMEV_op2(m))
614 #define SYS_CNTVOFF_EL2 sys_reg(3, 4, 14, 0, 3)
615 #define SYS_CNTHCTL_EL2 sys_reg(3, 4, 14, 1, 0)
616 #define SYS_CNTHP_TVAL_EL2 sys_reg(3, 4, 14, 2, 0)
617 #define SYS_CNTHP_CTL_EL2 sys_reg(3, 4, 14, 2, 1)
618 #define SYS_CNTHP_CVAL_EL2 sys_reg(3, 4, 14, 2, 2)
619 #define SYS_CNTHV_TVAL_EL2 sys_reg(3, 4, 14, 3, 0)
620 #define SYS_CNTHV_CTL_EL2 sys_reg(3, 4, 14, 3, 1)
621 #define SYS_CNTHV_CVAL_EL2 sys_reg(3, 4, 14, 3, 2)
624 #define SYS_BRBCR_EL12 sys_reg(2, 5, 9, 0, 0)
625 #define SYS_SCTLR_EL12 sys_reg(3, 5, 1, 0, 0)
626 #define SYS_CPACR_EL12 sys_reg(3, 5, 1, 0, 2)
627 #define SYS_SCTLR2_EL12 sys_reg(3, 5, 1, 0, 3)
628 #define SYS_ZCR_EL12 sys_reg(3, 5, 1, 2, 0)
631 #define SYS_TTBR0_EL12 sys_reg(3, 5, 2, 0, 0)
632 #define SYS_TTBR1_EL12 sys_reg(3, 5, 2, 0, 1)
633 #define SYS_TCR_EL12 sys_reg(3, 5, 2, 0, 2)
634 #define SYS_TCR2_EL12 sys_reg(3, 5, 2, 0, 3)
635 #define SYS_SPSR_EL12 sys_reg(3, 5, 4, 0, 0)
636 #define SYS_ELR_EL12 sys_reg(3, 5, 4, 0, 1)
637 #define SYS_AFSR0_EL12 sys_reg(3, 5, 5, 1, 0)
639 #define SYS_ESR_EL12 sys_reg(3, 5, 5, 2, 0)
640 #define SYS_TFSR_EL12 sys_reg(3, 5, 5, 6, 0)
641 #define SYS_FAR_EL12 sys_reg(3, 5, 6, 0, 0)
642 #define SYS_PMSCR_EL12 sys_reg(3, 5, 9, 9, 0)
643 #define SYS_MAIR_EL12 sys_reg(3, 5, 10, 2, 0)
644 #define SYS_AMAIR_EL12 sys_reg(3, 5, 10, 3, 0)
645 #define SYS_VBAR_EL12 sys_reg(3, 5, 12, 0, 0)
646 #define SYS_CONTEXTIDR_EL12 sys_reg(3, 5, 13, 0, 1)
647 #define SYS_SCXTNUM_EL12 sys_reg(3, 5, 13, 0, 7)
648 #define SYS_CNTKCTL_EL12 sys_reg(3, 5, 14, 1, 0)
649 #define SYS_CNTP_TVAL_EL02 sys_reg(3, 5, 14, 2, 0)
652 #define SYS_CNTV_TVAL_EL02 sys_reg(3, 5, 14, 3, 0)
656 #define SYS_SP_EL2 sys_reg(3, 6, 4, 1, 0)
662 #define OP_AT_S1E1R sys_insn(AT_Op0, 0, AT_CRn, 8, 0)
663 #define OP_AT_S1E1W sys_insn(AT_Op0, 0, AT_CRn, 8, 1)
664 #define OP_AT_S1E0R sys_insn(AT_Op0, 0, AT_CRn, 8, 2)
665 #define OP_AT_S1E0W sys_insn(AT_Op0, 0, AT_CRn, 8, 3)
666 #define OP_AT_S1E1RP sys_insn(AT_Op0, 0, AT_CRn, 9, 0)
667 #define OP_AT_S1E1WP sys_insn(AT_Op0, 0, AT_CRn, 9, 1)
668 #define OP_AT_S1E1A sys_insn(AT_Op0, 0, AT_CRn, 9, 2)
669 #define OP_AT_S1E2R sys_insn(AT_Op0, 4, AT_CRn, 8, 0)
670 #define OP_AT_S1E2W sys_insn(AT_Op0, 4, AT_CRn, 8, 1)
671 #define OP_AT_S12E1R sys_insn(AT_Op0, 4, AT_CRn, 8, 4)
672 #define OP_AT_S12E1W sys_insn(AT_Op0, 4, AT_CRn, 8, 5)
673 #define OP_AT_S12E0R sys_insn(AT_Op0, 4, AT_CRn, 8, 6)
674 #define OP_AT_S12E0W sys_insn(AT_Op0, 4, AT_CRn, 8, 7)
675 #define OP_AT_S1E2A sys_insn(AT_Op0, 4, AT_CRn, 9, 2)
680 #define TLBI_Op1_EL1 0 /* Accessible from EL1 or higher */
681 #define TLBI_Op1_EL2 4 /* Accessible from EL2 or higher */
686 #define TLBI_CRm_IPAIS 0 /* S2 Inner-Shareable */
687 #define TLBI_CRm_nROS 1 /* non-Range, Outer-Sharable */
688 #define TLBI_CRm_RIS 2 /* Range, Inner-Sharable */
689 #define TLBI_CRm_nRIS 3 /* non-Range, Inner-Sharable */
690 #define TLBI_CRm_IPAONS 4 /* S2 Outer and Non-Shareable */
691 #define TLBI_CRm_ROS 5 /* Range, Outer-Sharable */
692 #define TLBI_CRm_RNS 6 /* Range, Non-Sharable */
693 #define TLBI_CRm_nRNS 7 /* non-Range, Non-Sharable */
695 #define OP_TLBI_VMALLE1OS sys_insn(1, 0, 8, 1, 0)
696 #define OP_TLBI_VAE1OS sys_insn(1, 0, 8, 1, 1)
697 #define OP_TLBI_ASIDE1OS sys_insn(1, 0, 8, 1, 2)
698 #define OP_TLBI_VAAE1OS sys_insn(1, 0, 8, 1, 3)
699 #define OP_TLBI_VALE1OS sys_insn(1, 0, 8, 1, 5)
700 #define OP_TLBI_VAALE1OS sys_insn(1, 0, 8, 1, 7)
701 #define OP_TLBI_RVAE1IS sys_insn(1, 0, 8, 2, 1)
702 #define OP_TLBI_RVAAE1IS sys_insn(1, 0, 8, 2, 3)
703 #define OP_TLBI_RVALE1IS sys_insn(1, 0, 8, 2, 5)
704 #define OP_TLBI_RVAALE1IS sys_insn(1, 0, 8, 2, 7)
705 #define OP_TLBI_VMALLE1IS sys_insn(1, 0, 8, 3, 0)
706 #define OP_TLBI_VAE1IS sys_insn(1, 0, 8, 3, 1)
707 #define OP_TLBI_ASIDE1IS sys_insn(1, 0, 8, 3, 2)
708 #define OP_TLBI_VAAE1IS sys_insn(1, 0, 8, 3, 3)
709 #define OP_TLBI_VALE1IS sys_insn(1, 0, 8, 3, 5)
710 #define OP_TLBI_VAALE1IS sys_insn(1, 0, 8, 3, 7)
711 #define OP_TLBI_RVAE1OS sys_insn(1, 0, 8, 5, 1)
712 #define OP_TLBI_RVAAE1OS sys_insn(1, 0, 8, 5, 3)
713 #define OP_TLBI_RVALE1OS sys_insn(1, 0, 8, 5, 5)
714 #define OP_TLBI_RVAALE1OS sys_insn(1, 0, 8, 5, 7)
715 #define OP_TLBI_RVAE1 sys_insn(1, 0, 8, 6, 1)
716 #define OP_TLBI_RVAAE1 sys_insn(1, 0, 8, 6, 3)
717 #define OP_TLBI_RVALE1 sys_insn(1, 0, 8, 6, 5)
718 #define OP_TLBI_RVAALE1 sys_insn(1, 0, 8, 6, 7)
719 #define OP_TLBI_VMALLE1 sys_insn(1, 0, 8, 7, 0)
720 #define OP_TLBI_VAE1 sys_insn(1, 0, 8, 7, 1)
721 #define OP_TLBI_ASIDE1 sys_insn(1, 0, 8, 7, 2)
722 #define OP_TLBI_VAAE1 sys_insn(1, 0, 8, 7, 3)
723 #define OP_TLBI_VALE1 sys_insn(1, 0, 8, 7, 5)
724 #define OP_TLBI_VAALE1 sys_insn(1, 0, 8, 7, 7)
725 #define OP_TLBI_VMALLE1OSNXS sys_insn(1, 0, 9, 1, 0)
726 #define OP_TLBI_VAE1OSNXS sys_insn(1, 0, 9, 1, 1)
727 #define OP_TLBI_ASIDE1OSNXS sys_insn(1, 0, 9, 1, 2)
728 #define OP_TLBI_VAAE1OSNXS sys_insn(1, 0, 9, 1, 3)
729 #define OP_TLBI_VALE1OSNXS sys_insn(1, 0, 9, 1, 5)
730 #define OP_TLBI_VAALE1OSNXS sys_insn(1, 0, 9, 1, 7)
731 #define OP_TLBI_RVAE1ISNXS sys_insn(1, 0, 9, 2, 1)
732 #define OP_TLBI_RVAAE1ISNXS sys_insn(1, 0, 9, 2, 3)
733 #define OP_TLBI_RVALE1ISNXS sys_insn(1, 0, 9, 2, 5)
734 #define OP_TLBI_RVAALE1ISNXS sys_insn(1, 0, 9, 2, 7)
735 #define OP_TLBI_VMALLE1ISNXS sys_insn(1, 0, 9, 3, 0)
736 #define OP_TLBI_VAE1ISNXS sys_insn(1, 0, 9, 3, 1)
737 #define OP_TLBI_ASIDE1ISNXS sys_insn(1, 0, 9, 3, 2)
738 #define OP_TLBI_VAAE1ISNXS sys_insn(1, 0, 9, 3, 3)
739 #define OP_TLBI_VALE1ISNXS sys_insn(1, 0, 9, 3, 5)
740 #define OP_TLBI_VAALE1ISNXS sys_insn(1, 0, 9, 3, 7)
741 #define OP_TLBI_RVAE1OSNXS sys_insn(1, 0, 9, 5, 1)
742 #define OP_TLBI_RVAAE1OSNXS sys_insn(1, 0, 9, 5, 3)
743 #define OP_TLBI_RVALE1OSNXS sys_insn(1, 0, 9, 5, 5)
744 #define OP_TLBI_RVAALE1OSNXS sys_insn(1, 0, 9, 5, 7)
745 #define OP_TLBI_RVAE1NXS sys_insn(1, 0, 9, 6, 1)
746 #define OP_TLBI_RVAAE1NXS sys_insn(1, 0, 9, 6, 3)
747 #define OP_TLBI_RVALE1NXS sys_insn(1, 0, 9, 6, 5)
748 #define OP_TLBI_RVAALE1NXS sys_insn(1, 0, 9, 6, 7)
749 #define OP_TLBI_VMALLE1NXS sys_insn(1, 0, 9, 7, 0)
750 #define OP_TLBI_VAE1NXS sys_insn(1, 0, 9, 7, 1)
751 #define OP_TLBI_ASIDE1NXS sys_insn(1, 0, 9, 7, 2)
752 #define OP_TLBI_VAAE1NXS sys_insn(1, 0, 9, 7, 3)
753 #define OP_TLBI_VALE1NXS sys_insn(1, 0, 9, 7, 5)
754 #define OP_TLBI_VAALE1NXS sys_insn(1, 0, 9, 7, 7)
755 #define OP_TLBI_IPAS2E1IS sys_insn(1, 4, 8, 0, 1)
756 #define OP_TLBI_RIPAS2E1IS sys_insn(1, 4, 8, 0, 2)
757 #define OP_TLBI_IPAS2LE1IS sys_insn(1, 4, 8, 0, 5)
758 #define OP_TLBI_RIPAS2LE1IS sys_insn(1, 4, 8, 0, 6)
759 #define OP_TLBI_ALLE2OS sys_insn(1, 4, 8, 1, 0)
760 #define OP_TLBI_VAE2OS sys_insn(1, 4, 8, 1, 1)
761 #define OP_TLBI_ALLE1OS sys_insn(1, 4, 8, 1, 4)
762 #define OP_TLBI_VALE2OS sys_insn(1, 4, 8, 1, 5)
763 #define OP_TLBI_VMALLS12E1OS sys_insn(1, 4, 8, 1, 6)
764 #define OP_TLBI_RVAE2IS sys_insn(1, 4, 8, 2, 1)
765 #define OP_TLBI_RVALE2IS sys_insn(1, 4, 8, 2, 5)
766 #define OP_TLBI_ALLE2IS sys_insn(1, 4, 8, 3, 0)
767 #define OP_TLBI_VAE2IS sys_insn(1, 4, 8, 3, 1)
768 #define OP_TLBI_ALLE1IS sys_insn(1, 4, 8, 3, 4)
769 #define OP_TLBI_VALE2IS sys_insn(1, 4, 8, 3, 5)
770 #define OP_TLBI_VMALLS12E1IS sys_insn(1, 4, 8, 3, 6)
771 #define OP_TLBI_IPAS2E1OS sys_insn(1, 4, 8, 4, 0)
772 #define OP_TLBI_IPAS2E1 sys_insn(1, 4, 8, 4, 1)
773 #define OP_TLBI_RIPAS2E1 sys_insn(1, 4, 8, 4, 2)
774 #define OP_TLBI_RIPAS2E1OS sys_insn(1, 4, 8, 4, 3)
775 #define OP_TLBI_IPAS2LE1OS sys_insn(1, 4, 8, 4, 4)
776 #define OP_TLBI_IPAS2LE1 sys_insn(1, 4, 8, 4, 5)
777 #define OP_TLBI_RIPAS2LE1 sys_insn(1, 4, 8, 4, 6)
778 #define OP_TLBI_RIPAS2LE1OS sys_insn(1, 4, 8, 4, 7)
779 #define OP_TLBI_RVAE2OS sys_insn(1, 4, 8, 5, 1)
780 #define OP_TLBI_RVALE2OS sys_insn(1, 4, 8, 5, 5)
781 #define OP_TLBI_RVAE2 sys_insn(1, 4, 8, 6, 1)
782 #define OP_TLBI_RVALE2 sys_insn(1, 4, 8, 6, 5)
783 #define OP_TLBI_ALLE2 sys_insn(1, 4, 8, 7, 0)
784 #define OP_TLBI_VAE2 sys_insn(1, 4, 8, 7, 1)
785 #define OP_TLBI_ALLE1 sys_insn(1, 4, 8, 7, 4)
786 #define OP_TLBI_VALE2 sys_insn(1, 4, 8, 7, 5)
787 #define OP_TLBI_VMALLS12E1 sys_insn(1, 4, 8, 7, 6)
788 #define OP_TLBI_IPAS2E1ISNXS sys_insn(1, 4, 9, 0, 1)
789 #define OP_TLBI_RIPAS2E1ISNXS sys_insn(1, 4, 9, 0, 2)
790 #define OP_TLBI_IPAS2LE1ISNXS sys_insn(1, 4, 9, 0, 5)
791 #define OP_TLBI_RIPAS2LE1ISNXS sys_insn(1, 4, 9, 0, 6)
792 #define OP_TLBI_ALLE2OSNXS sys_insn(1, 4, 9, 1, 0)
793 #define OP_TLBI_VAE2OSNXS sys_insn(1, 4, 9, 1, 1)
794 #define OP_TLBI_ALLE1OSNXS sys_insn(1, 4, 9, 1, 4)
795 #define OP_TLBI_VALE2OSNXS sys_insn(1, 4, 9, 1, 5)
796 #define OP_TLBI_VMALLS12E1OSNXS sys_insn(1, 4, 9, 1, 6)
797 #define OP_TLBI_RVAE2ISNXS sys_insn(1, 4, 9, 2, 1)
798 #define OP_TLBI_RVALE2ISNXS sys_insn(1, 4, 9, 2, 5)
799 #define OP_TLBI_ALLE2ISNXS sys_insn(1, 4, 9, 3, 0)
800 #define OP_TLBI_VAE2ISNXS sys_insn(1, 4, 9, 3, 1)
801 #define OP_TLBI_ALLE1ISNXS sys_insn(1, 4, 9, 3, 4)
802 #define OP_TLBI_VALE2ISNXS sys_insn(1, 4, 9, 3, 5)
803 #define OP_TLBI_VMALLS12E1ISNXS sys_insn(1, 4, 9, 3, 6)
804 #define OP_TLBI_IPAS2E1OSNXS sys_insn(1, 4, 9, 4, 0)
805 #define OP_TLBI_IPAS2E1NXS sys_insn(1, 4, 9, 4, 1)
806 #define OP_TLBI_RIPAS2E1NXS sys_insn(1, 4, 9, 4, 2)
807 #define OP_TLBI_RIPAS2E1OSNXS sys_insn(1, 4, 9, 4, 3)
808 #define OP_TLBI_IPAS2LE1OSNXS sys_insn(1, 4, 9, 4, 4)
809 #define OP_TLBI_IPAS2LE1NXS sys_insn(1, 4, 9, 4, 5)
810 #define OP_TLBI_RIPAS2LE1NXS sys_insn(1, 4, 9, 4, 6)
811 #define OP_TLBI_RIPAS2LE1OSNXS sys_insn(1, 4, 9, 4, 7)
812 #define OP_TLBI_RVAE2OSNXS sys_insn(1, 4, 9, 5, 1)
813 #define OP_TLBI_RVALE2OSNXS sys_insn(1, 4, 9, 5, 5)
814 #define OP_TLBI_RVAE2NXS sys_insn(1, 4, 9, 6, 1)
815 #define OP_TLBI_RVALE2NXS sys_insn(1, 4, 9, 6, 5)
816 #define OP_TLBI_ALLE2NXS sys_insn(1, 4, 9, 7, 0)
817 #define OP_TLBI_VAE2NXS sys_insn(1, 4, 9, 7, 1)
818 #define OP_TLBI_ALLE1NXS sys_insn(1, 4, 9, 7, 4)
819 #define OP_TLBI_VALE2NXS sys_insn(1, 4, 9, 7, 5)
820 #define OP_TLBI_VMALLS12E1NXS sys_insn(1, 4, 9, 7, 6)
823 #define OP_GCSPUSHX sys_insn(1, 0, 7, 7, 4)
824 #define OP_GCSPOPCX sys_insn(1, 0, 7, 7, 5)
825 #define OP_GCSPOPX sys_insn(1, 0, 7, 7, 6)
826 #define OP_GCSPUSHM sys_insn(1, 3, 7, 7, 0)
828 #define OP_BRB_IALL sys_insn(1, 1, 7, 2, 4)
830 #define OP_CFP_RCTX sys_insn(1, 3, 7, 3, 4)
860 #define SCTLR_ELx_M (BIT(0))
863 #define SCTLR_EL2_RES1 ((BIT(4)) | (BIT(5)) | (BIT(11)) | (BIT(16)) | \
871 #define ENDIAN_SET_EL2 0
886 #define ENDIAN_SET_EL1 0
903 #define MAIR_ATTR_DEVICE_nGnRnE UL(0x00)
904 #define MAIR_ATTR_DEVICE_nGnRE UL(0x04)
905 #define MAIR_ATTR_NORMAL_NC UL(0x44)
906 #define MAIR_ATTR_NORMAL_TAGGED UL(0xf0)
907 #define MAIR_ATTR_NORMAL UL(0xff)
908 #define MAIR_ATTR_MASK UL(0xff)
914 #define ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MIN 0x0
916 #define ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MAX 0x7
917 #define ID_AA64MMFR0_EL1_TGRAN64_SUPPORTED_MIN 0x0
918 #define ID_AA64MMFR0_EL1_TGRAN64_SUPPORTED_MAX 0x7
919 #define ID_AA64MMFR0_EL1_TGRAN16_SUPPORTED_MIN 0x1
921 #define ID_AA64MMFR0_EL1_TGRAN16_SUPPORTED_MAX 0xf
925 #define ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_DEFAULT 0x0
926 #define ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_NONE 0x1
927 #define ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_MIN 0x2
928 #define ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_LPA2 0x3
929 #define ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_MAX 0x7
967 #define SYS_GCR_EL1_EXCL_MASK 0xffffUL
972 * only uses tags in the range 0xF0-0xFF, which we map to MTE tags 0x0-0xF.
974 #define __MTE_TAG_MIN (KASAN_TAG_MIN & 0xf)
975 #define __MTE_TAG_MAX (KASAN_TAG_MAX & 0xf)
985 #define SYS_RGSR_EL1_TAG_MASK 0xfUL
987 #define SYS_RGSR_EL1_SEED_MASK 0xffffUL
990 #define SYS_TFSR_EL1_TF0_SHIFT 0
995 /* Safe value for MPIDR_EL1: Bit31:RES1, Bit30:U:0, Bit24:MT:0 */
999 #define TRFCR_ELx_TS_MASK ((0x3UL) << TRFCR_ELx_TS_SHIFT)
1000 #define TRFCR_ELx_TS_VIRTUAL ((0x1UL) << TRFCR_ELx_TS_SHIFT)
1001 #define TRFCR_ELx_TS_GUEST_PHYSICAL ((0x2UL) << TRFCR_ELx_TS_SHIFT)
1002 #define TRFCR_ELx_TS_PHYSICAL ((0x3UL) << TRFCR_ELx_TS_SHIFT)
1005 #define TRFCR_ELx_E0TRE BIT(0)
1009 #define ICH_MISR_EOI (1 << 0)
1013 #define ICH_LR_VIRTUAL_ID_MASK ((1ULL << 32) - 1)
1022 #define ICH_LR_PHYS_ID_MASK (0x3ffULL << ICH_LR_PHYS_ID_SHIFT)
1024 #define ICH_LR_PRIORITY_MASK (0xffULL << ICH_LR_PRIORITY_SHIFT)
1027 #define ICH_HCR_EN (1 << 0)
1035 #define ICH_HCR_EOIcount_MASK (0x1f << ICH_HCR_EOIcount_SHIFT)
1042 #define ICH_VMCR_CBPR_SHIFT 4
1051 #define ICH_VMCR_PMR_MASK (0xffUL << ICH_VMCR_PMR_SHIFT)
1052 #define ICH_VMCR_ENG0_SHIFT 0
1073 #define PIE_NONE_O UL(0x0)
1074 #define PIE_R_O UL(0x1)
1075 #define PIE_X_O UL(0x2)
1076 #define PIE_RX_O UL(0x3)
1077 #define PIE_RW_O UL(0x5)
1078 #define PIE_RWnX_O UL(0x6)
1079 #define PIE_RWX_O UL(0x7)
1080 #define PIE_R UL(0x8)
1081 #define PIE_GCS UL(0x9)
1082 #define PIE_RX UL(0xa)
1083 #define PIE_RW UL(0xc)
1084 #define PIE_RWX UL(0xe)
1086 #define PIRx_ELx_PERM(idx, perm) ((perm) << ((idx) * 4))
1091 #define POE_NONE UL(0x0)
1092 #define POE_R UL(0x1)
1093 #define POE_X UL(0x2)
1094 #define POE_RX UL(0x3)
1095 #define POE_W UL(0x4)
1096 #define POE_RW UL(0x5)
1097 #define POE_XW UL(0x6)
1098 #define POE_RXW UL(0x7)
1099 #define POE_MASK UL(0xf)
1104 #define ARM64_FEATURE_FIELD_BITS 4
1112 __emit_inst(0xd5200000|(\sreg)|(.L__gpr_num_\rt))
1116 __emit_inst(0xd5000000|(\sreg)|(.L__gpr_num_\rt))
1129 __emit_inst(0xd5200000|(\\sreg)|(.L__gpr_num_\\rt)) \
1135 __emit_inst(0xd5000000|(\\sreg)|(.L__gpr_num_\\rt)) \
1160 asm volatile("mrs %0, " __stringify(r) : "=r" (__val)); \
1172 } while (0)
1185 asm volatile(__mrs_s("%0", r) : "=r" (__val)); \
1193 } while (0)
1197 * set mask are set. Other bits are left as-is.
1204 } while (0)
1211 } while (0)