arm64: Add mapping of all memory in kernel virtual space at KERNEL_PMAP_BASE.

Change-Id: I828b1ba8c0add614e9df6bba1e14c5e514ec1bad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5258
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
milek7 2022-03-27 22:01:29 +02:00 committed by waddlesplash
parent 2684c64083
commit 7c69ebda17
2 changed files with 6 additions and 5 deletions

View File

@ -23,5 +23,8 @@
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
// Kernel physical memory map area.
#define KERNEL_PMAP_BASE 0xffffff0000000000
#define KERNEL_PMAP_SIZE 0x8000000000
#endif /* _KERNEL_ARCH_ARM64_ARCH_KERNEL_H_ */

View File

@ -496,13 +496,11 @@ arch_mmu_generate_post_efi_page_tables(size_t memory_map_size,
| currentMair.MaskOf(MAIR_DEVICE_nGnRnE));
*/
/* TODO: Whole physical map already covered ...
// identity mapping for page table area
uint64_t page_table_area = (uint64_t)sFirstPageTable;
map_range(page_table_area, page_table_area, PAGE_TABLE_AREA_SIZE,
// TODO: We actually can only map physical RAM, mapping everything
// could cause unwanted MMIO or bus errors on real hardware.
map_range(KERNEL_PMAP_BASE, 0, KERNEL_PMAP_SIZE - 1,
ARMv8TranslationTableDescriptor::DefaultCodeAttribute
| currentMair.MaskOf(MAIR_NORMAL_WB));
*/
sort_address_ranges(gKernelArgs.virtual_allocated_range,
gKernelArgs.num_virtual_allocated_ranges);