The MDCR_EL2 characteristics are:
Provides EL2 configuration options for self-hosted debug and the Performance Monitors Extension.
This register is part of:
AArch64 System register MDCR_EL2 is architecturally mapped to AArch32 System register HDCR.
If EL2 is not implemented, this register is RES0 from EL3.
This register is in the Warm reset domain. Some or all RW fields of this register have defined reset values. On a Warm or Cold reset these apply only if the PE resets into an Exception level that is using AArch64. Otherwise, on a Warm or Cold reset RW fields in this register reset to architecturally UNKNOWN values.
MDCR_EL2 is a 32-bit register.
The MDCR_EL2 bit assignments are:
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | HPMD | 0 | 0 | TPMS | E2PB | TDRA | TDOSA | TDA | TDE | HPME | TPM | TPMCR | HPMN |
Reserved, RES0.
Guest Performance Monitors Disable. This control prohibits event counting at EL2. Permitted values are:
HPMD | Meaning |
---|---|
0 |
Event counting allowed at EL2. |
1 |
Event counting prohibited at EL2. In an ARMv8.1 implementation, event counting is prohibited unless enabled by the IMPLEMENTATION DEFINED authentication interface ExternalSecureNoninvasiveDebugEnabled(). |
This control applies only to:
The other event counters are unaffected, and when PMCR_EL0.DP is set to 0, PMCCNTR_EL0 is unaffected.
When this register has an architecturally-defined reset value, this field resets to 0.
Reserved, RES0.
Reserved, RES0.
Trap Performance Monitor Sampling. When the Statistical Profiling Extension is implemented this field controls access to Statistical Profiling control registers from Non-secure EL1 and EL0. The possible values of this bit are:
TPMS | Meaning |
---|---|
0 |
Do not trap Statistical Profiling controls to EL2. |
1 |
Accesses to Statistical Profiling controls at Non-secure EL1 generate a Trap exception to EL2. |
If EL2 is not implemented, the PE behaves as if TPMS == 0, other than for a direct read of the register.
When the Statistical Profiling Extension is not implemented this field is reserved, RES0.
Reserved, RES0.
EL2 Profiling Buffer. When the Statistical Profiling Extension is implemented this field controls the owning translation regime and access to Profiling Buffer control registers from Non-secure EL1. The possible values of this field are:
E2PB | Meaning |
---|---|
00 |
Profiling Buffer uses the EL2 stage 1 translation regime. Accesses to Profiling Buffer controls at Non-secure EL1 generate a Trap exception to EL2. |
10 |
Profiling Buffer uses the EL1&0 stage 1 translation regime. Accesses to Profiling Buffer controls at Non-secure EL1 generate a Trap exception to EL2. |
11 |
Profiling Buffer uses the EL1&0 stage 1 translation regime. Accesses to Profiling Buffer controls at Non-secure EL1 are not trapped to EL2. |
All other values are reserved. If this field is programmed with a reserved value, the PE behaves as if this field has a defined value, other than for a direct read of the register. Software must not rely on the behavior of reserved values, as they might change in a future version of the architecture.
If EL2 is not implemented, the PE behaves as if E2PB == 0b11, other than for a direct read of the register.
When the Statistical Profiling Extension is not implemented this field is reserved, RES0.
Reserved, RES0.
Trap Debug ROM Address register access. Traps Non-secure System register accesses to the Debug ROM registers to EL2. This trap is from:
TDRA | Meaning |
---|---|
0 |
This control does not cause any instructions to be trapped. |
1 |
Non-secure EL0 and EL1 System register accesses to the Debug ROM registers are trapped to EL2, unless it is trapped by DBGDSCRext.UDCCdis or MDSCR_EL1.TDCC. |
The registers for which accesses are trapped are as follows:
AArch64: MDRAR_EL1.
If MDCR_EL2.TDE == 1 or HCR_EL2.TGE == 1, behavior is as if this bit is 1 other than for the purpose of a direct read.
When this register has an architecturally-defined reset value, this field resets to a value that is architecturally UNKNOWN.
Trap debug OS-related register access. Traps Non-secure EL1 System register accesses to the powerdown debug registers to EL2, from both Execution states:
TDOSA | Meaning |
---|---|
0 |
This control does not cause any instructions to be trapped. |
1 |
Non-secure EL1 System register accesses to the powerdown debug registers are trapped to EL2. |
The registers for which accesses are trapped are as follows:
AArch64: OSLAR_EL1, OSLSR_EL1, OSDLR_EL1, and the DBGPRCR_EL1.
AArch32: DBGOSLSR, DBGOSLAR, DBGOSDLR, and the DBGPRCR.
AArch64 and AArch32: Any IMPLEMENTATION DEFINED register with similar functionality that the implementation specifies as trapped by this bit.
These registers are not accessible at EL0.
If MDCR_EL2.TDE == 1 or HCR_EL2.TGE == 1, behavior is as if this bit is 1 other than for the purpose of a direct read.
When this register has an architecturally-defined reset value, this field resets to a value that is architecturally UNKNOWN.
Trap Debug Access. Traps Non-secure EL0 and EL1 System register accesses to those debug System registers that are not trapped by either of the following:
TDA | Meaning |
---|---|
0 |
This control does not cause any instructions to be trapped. |
1 |
Non-secure EL0 or EL1 System register accesses to the debug registers, other than the registers trapped by MDCR_EL2.TDRA and MDCR_EL2.TDOSA, are trapped to EL2, from both Execution states, unless it is trapped by DBGDSCRext.UDCCdis or MDSCR_EL1.TDCC. |
Traps of AArch32 accesses to DBGDTRRXint and DBGDTRTXint are ignored in Debug state.
Traps of AArch64 accesses to DBGDTR_EL0, DBGDTRRX_EL0, and DBGDTRTX_EL0 are ignored in Debug state.
If MDCR_EL2.TDE == 1 or HCR_EL2.TGE == 1, behavior is as if this bit is 1 other than for the purpose of a direct read.
When this register has an architecturally-defined reset value, this field resets to a value that is architecturally UNKNOWN.
Trap Debug exceptions. The possible values of this field are:
TDE | Meaning |
---|---|
0 |
This control has no effect on the routing of debug exceptions, and has no effect on Non-secure accesses to debug registers. |
1 |
In Non-secure state:
|
When HCR_EL2.TGE == 1, the PE behaves as if the value of this field is 1 for all purposes other than returning the value of a direct read of the register.
When this register has an architecturally-defined reset value, this field resets to a value that is architecturally UNKNOWN.
Hypervisor Performance Monitors Counters Enable. The possible values of this bit are:
HPME | Meaning |
---|---|
0 |
EL2 Performance Monitors counters disabled. |
1 |
EL2 Performance Monitors counters enabled. |
When the value of this bit is 1, the Performance Monitors counters that are reserved for use from EL2 or Secure state are enabled. For more information see the description of the HPMN field.
If the Performance Monitors Extension is not implemented, this field is RES0.
When this register has an architecturally-defined reset value, if this field is implemented as an RW field, it resets to a value that is architecturally UNKNOWN.
Trap Performance Monitors accesses. Traps Non-secure EL0 and EL1 accesses to all Performance Monitors registers to EL2, from both Execution states:
TPM | Meaning |
---|---|
0 |
This control does not cause any instructions to be trapped. |
1 |
Non-secure EL0 and EL1 accesses to all Performance Monitors registers are trapped to EL2. |
EL2 does not provide traps on Performance Monitor register accesses through the optional memory-mapped external debug interface.
If the Performance Monitors Extension is not implemented, this field is RES0.
When this register has an architecturally-defined reset value, if this field is implemented as an RW field, it resets to a value that is architecturally UNKNOWN.
Trap PMCR_EL0 or PMCR accesses. Traps Non-secure EL0 and EL1 accesses to the PMCR_EL0 or PMCR to EL2.
TPMCR | Meaning |
---|---|
0 |
This control does not cause any instructions to be trapped. |
1 |
Non-secure EL0 and EL1 accesses to the PMCR_EL0 or PMCR are trapped to EL2, unless it is trapped by PMUSERENR.EN or PMUSERENR_EL0.EN. |
EL2 does not provide traps on Performance Monitor register accesses through the optional memory-mapped external debug interface.
If the Performance Monitors Extension is not implemented, this field is RES0.
When this register has an architecturally-defined reset value, if this field is implemented as an RW field, it resets to a value that is architecturally UNKNOWN.
Defines the number of Performance Monitors counters that are accessible from Non-secure EL0 and EL1 modes.
If the Performance Monitors Extension is not implemented, this field is RES0.
In Non-secure state, HPMN divides the Performance Monitors counters as follows. For counter n in Non-secure state:
If this field is set to 0, or to a value larger than PMCR_EL0.N, then the following CONSTRAINED UNPREDICTABLE behavior applies:
When this register has an architecturally-defined reset value, if this field is implemented as an RW field, it resets to the value of PMCR_EL0.N.
This register can be read using MRS with the following syntax:
MRS <Xt>, <systemreg>
This register can be written using MSR (register) with the following syntax:
MSR <systemreg>, <Xt>
This syntax uses the following encoding in the System instruction encoding space:
<systemreg> | op0 | op1 | CRn | CRm | op2 |
---|---|---|---|---|---|
MDCR_EL2 | 11 | 100 | 0001 | 0001 | 001 |
The register is accessible as follows:
Control | Accessibility | |||||
---|---|---|---|---|---|---|
E2H | TGE | NS | EL0 | EL1 | EL2 | EL3 |
x | x | 0 | - | - | n/a | RW |
x | 0 | 1 | - | - | RW | RW |
x | 1 | 1 | - | n/a | RW | RW |
This table applies to all instructions that can access this register.
For a description of the prioritization of any generated exceptions, see section D1.13.2 (Synchronous exception prioritization) in the ARM® Architecture Reference Manual, ARMv8, for ARMv8-A architecture profile. Subject to the prioritization rules, the following traps and enables are applicable when accessing this register.
When EL2 is implemented and is using AArch64 and SCR_EL3.NS==1 && HCR_EL2.E2H==0 :
If HCR_EL2.NV==1, Non-secure accesses to this register from EL1 are trapped to EL2.
When EL2 is implemented and is using AArch64 and SCR_EL3.NS==1 && HCR_EL2.E2H==1 && HCR_EL2.TGE==0 :
If HCR_EL2.NV==1, Non-secure accesses to this register from EL1 are trapped to EL2.
When EL3 is implemented and is using AArch64 :
If MDCR_EL3.TDA==1, accesses to this register from EL2 are trapped to EL3.
28/09/2017 08:24
Copyright © 2010-2017 ARM Limited or its affiliates. All rights reserved. This document is Non-Confidential.