mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-24 10:32:02 -06:00
target-arm: make MAIR0/1 banked
Added CP register info entries for the ARMv7 MAIR0/1 secure banks. Signed-off-by: Greg Bellows <greg.bellows@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1416242878-876-26-git-send-email-greg.bellows@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
54bf36ed35
commit
be693c87e4
2 changed files with 29 additions and 4 deletions
|
@ -296,7 +296,26 @@ typedef struct CPUARMState {
|
||||||
uint32_t c9_pmxevtyper; /* perf monitor event type */
|
uint32_t c9_pmxevtyper; /* perf monitor event type */
|
||||||
uint32_t c9_pmuserenr; /* perf monitor user enable */
|
uint32_t c9_pmuserenr; /* perf monitor user enable */
|
||||||
uint32_t c9_pminten; /* perf monitor interrupt enables */
|
uint32_t c9_pminten; /* perf monitor interrupt enables */
|
||||||
uint64_t mair_el1;
|
union { /* Memory attribute redirection */
|
||||||
|
struct {
|
||||||
|
#ifdef HOST_WORDS_BIGENDIAN
|
||||||
|
uint64_t _unused_mair_0;
|
||||||
|
uint32_t mair1_ns;
|
||||||
|
uint32_t mair0_ns;
|
||||||
|
uint64_t _unused_mair_1;
|
||||||
|
uint32_t mair1_s;
|
||||||
|
uint32_t mair0_s;
|
||||||
|
#else
|
||||||
|
uint64_t _unused_mair_0;
|
||||||
|
uint32_t mair0_ns;
|
||||||
|
uint32_t mair1_ns;
|
||||||
|
uint64_t _unused_mair_1;
|
||||||
|
uint32_t mair0_s;
|
||||||
|
uint32_t mair1_s;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
uint64_t mair_el[4];
|
||||||
|
};
|
||||||
union { /* vector base address register */
|
union { /* vector base address register */
|
||||||
struct {
|
struct {
|
||||||
uint64_t _unused_vbar;
|
uint64_t _unused_vbar;
|
||||||
|
|
|
@ -965,20 +965,26 @@ static const ARMCPRegInfo v7_cp_reginfo[] = {
|
||||||
*/
|
*/
|
||||||
{ .name = "MAIR_EL1", .state = ARM_CP_STATE_AA64,
|
{ .name = "MAIR_EL1", .state = ARM_CP_STATE_AA64,
|
||||||
.opc0 = 3, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0,
|
.opc0 = 3, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0,
|
||||||
.access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.mair_el1),
|
.access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.mair_el[1]),
|
||||||
.resetvalue = 0 },
|
.resetvalue = 0 },
|
||||||
/* For non-long-descriptor page tables these are PRRR and NMRR;
|
/* For non-long-descriptor page tables these are PRRR and NMRR;
|
||||||
* regardless they still act as reads-as-written for QEMU.
|
* regardless they still act as reads-as-written for QEMU.
|
||||||
* The override is necessary because of the overly-broad TLB_LOCKDOWN
|
* The override is necessary because of the overly-broad TLB_LOCKDOWN
|
||||||
* definition.
|
* definition.
|
||||||
*/
|
*/
|
||||||
|
/* MAIR0/1 are defined seperately from their 64-bit counterpart which
|
||||||
|
* allows them to assign the correct fieldoffset based on the endianness
|
||||||
|
* handled in the field definitions.
|
||||||
|
*/
|
||||||
{ .name = "MAIR0", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE,
|
{ .name = "MAIR0", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE,
|
||||||
.cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0, .access = PL1_RW,
|
.cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0, .access = PL1_RW,
|
||||||
.fieldoffset = offsetoflow32(CPUARMState, cp15.mair_el1),
|
.bank_fieldoffsets = { offsetof(CPUARMState, cp15.mair0_s),
|
||||||
|
offsetof(CPUARMState, cp15.mair0_ns) },
|
||||||
.resetfn = arm_cp_reset_ignore },
|
.resetfn = arm_cp_reset_ignore },
|
||||||
{ .name = "MAIR1", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE,
|
{ .name = "MAIR1", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE,
|
||||||
.cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 1, .access = PL1_RW,
|
.cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 1, .access = PL1_RW,
|
||||||
.fieldoffset = offsetofhigh32(CPUARMState, cp15.mair_el1),
|
.bank_fieldoffsets = { offsetof(CPUARMState, cp15.mair1_s),
|
||||||
|
offsetof(CPUARMState, cp15.mair1_ns) },
|
||||||
.resetfn = arm_cp_reset_ignore },
|
.resetfn = arm_cp_reset_ignore },
|
||||||
{ .name = "ISR_EL1", .state = ARM_CP_STATE_BOTH,
|
{ .name = "ISR_EL1", .state = ARM_CP_STATE_BOTH,
|
||||||
.opc0 = 3, .opc1 = 0, .crn = 12, .crm = 1, .opc2 = 0,
|
.opc0 = 3, .opc1 = 0, .crn = 12, .crm = 1, .opc2 = 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue