target-arm: Suppress EPD for S2, EL2 and EL3 translations

Stage-2 translations, EL2 and EL3 regimes don't have the
EPD control.

Backports commit 0c5fbf3b4c1e5210354de71a3dc2ebc8c8a01f31 from qemu
This commit is contained in:
Edgar E. Iglesias 2018-02-15 12:35:33 -05:00 committed by Lioncash
parent f5b3b9f6e9
commit 2dfdb13786
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -5717,7 +5717,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
/* Read an LPAE long-descriptor translation table. */
MMUFaultType fault_type = translation_fault;
uint32_t level = 1;
uint32_t epd;
uint32_t epd = 0;
int32_t tsz;
uint32_t tg;
uint64_t ttbr;
@ -5811,7 +5811,9 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
*/
if (ttbr_select == 0) {
ttbr = regime_ttbr(env, mmu_idx, 0);
epd = extract32(tcr->raw_tcr, 7, 1);
if (el < 2) {
epd = extract32(tcr->raw_tcr, 7, 1);
}
tsz = t0sz;
tg = extract32(tcr->raw_tcr, 14, 2);