Revert "arm64: Use DEVICE_GRE memory when mapping MTR_WC."
This reverts commit 0caf23319c.
This change is not safe because changing MAIR may invalidate
early mappings. It's also not clear if it's needed, as e.g.
FreeBSD does not use Device GRE mappings.
Change-Id: I95a904ee928281d44989ce707ed1ac59985a308d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8268
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Milek7 Milek7 <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
4bb796cf9d
commit
edb17c548f
@@ -501,8 +501,6 @@
|
|||||||
#define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8))
|
#define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8))
|
||||||
#define MAIR_DEVICE_nGnRnE 0x00
|
#define MAIR_DEVICE_nGnRnE 0x00
|
||||||
#define MAIR_DEVICE_nGnRE 0x04
|
#define MAIR_DEVICE_nGnRE 0x04
|
||||||
#define MAIR_DEVICE_nGRE 0x08
|
|
||||||
#define MAIR_DEVICE_GRE 0x0C
|
|
||||||
#define MAIR_NORMAL_NC 0x44
|
#define MAIR_NORMAL_NC 0x44
|
||||||
#define MAIR_NORMAL_WT 0xbb
|
#define MAIR_NORMAL_WT 0xbb
|
||||||
#define MAIR_NORMAL_WB 0xff
|
#define MAIR_NORMAL_WB 0xff
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ VMSAv8TranslationMap::GetMemoryAttr(uint32 attributes, uint32 memoryType, bool i
|
|||||||
type = MAIR_DEVICE_nGnRnE;
|
type = MAIR_DEVICE_nGnRnE;
|
||||||
break;
|
break;
|
||||||
case B_MTR_WC:
|
case B_MTR_WC:
|
||||||
type = MAIR_DEVICE_GRE;
|
type = MAIR_NORMAL_NC;
|
||||||
break;
|
break;
|
||||||
case B_MTR_WT:
|
case B_MTR_WT:
|
||||||
type = MAIR_NORMAL_WT;
|
type = MAIR_NORMAL_WT;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ arch_vm_translation_map_init(kernel_args* args, VMPhysicalPageMapper** _physical
|
|||||||
uint32_t tg1 = (tcr >> 30) & 0x3;
|
uint32_t tg1 = (tcr >> 30) & 0x3;
|
||||||
uint64_t ttbr0 = READ_SPECIALREG(TTBR0_EL1);
|
uint64_t ttbr0 = READ_SPECIALREG(TTBR0_EL1);
|
||||||
uint64_t ttbr1 = READ_SPECIALREG(TTBR1_EL1);
|
uint64_t ttbr1 = READ_SPECIALREG(TTBR1_EL1);
|
||||||
|
uint64_t mair = READ_SPECIALREG(MAIR_EL1);
|
||||||
uint64_t mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1);
|
uint64_t mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1);
|
||||||
uint64_t mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1);
|
uint64_t mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1);
|
||||||
uint64_t sctlr = READ_SPECIALREG(SCTLR_EL1);
|
uint64_t sctlr = READ_SPECIALREG(SCTLR_EL1);
|
||||||
@@ -92,13 +93,7 @@ arch_vm_translation_map_init(kernel_args* args, VMPhysicalPageMapper** _physical
|
|||||||
VMSAv8TranslationMap::fHwFeature |= VMSAv8TranslationMap::HW_COMMON_NOT_PRIVATE;
|
VMSAv8TranslationMap::fHwFeature |= VMSAv8TranslationMap::HW_COMMON_NOT_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t mair =
|
|
||||||
(MAIR_DEVICE_nGnRnE) | // Uncached
|
|
||||||
(MAIR_DEVICE_GRE << 8) | // Write-combining
|
|
||||||
(MAIR_NORMAL_WT << 16) | // Write-through
|
|
||||||
(MAIR_NORMAL_WB << 24); // Write-back
|
|
||||||
VMSAv8TranslationMap::fMair = mair;
|
VMSAv8TranslationMap::fMair = mair;
|
||||||
WRITE_SPECIALREG(MAIR_EL1, mair);
|
|
||||||
|
|
||||||
WRITE_SPECIALREG(TCR_EL1, tcr);
|
WRITE_SPECIALREG(TCR_EL1, tcr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user