mm/vmm: Fix paging_mode_va_bits() for aarch64 4 level paging and loongarch64

This commit is contained in:
mintsuki 2024-08-01 08:27:30 +02:00
parent d40cec11f6
commit 5294b2a4e5
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ void map_page(pagemap_t pagemap, uint64_t virt_addr, uint64_t phys_addr, uint64_
#define PAGING_MODE_MIN PAGING_MODE_AARCH64_4LVL #define PAGING_MODE_MIN PAGING_MODE_AARCH64_4LVL
#define PAGING_MODE_MAX PAGING_MODE_AARCH64_5LVL #define PAGING_MODE_MAX PAGING_MODE_AARCH64_5LVL
#define paging_mode_va_bits(mode) ((mode) ? 53 : 48) #define paging_mode_va_bits(mode) ((mode) ? 53 : 49)
static inline uint64_t paging_mode_higher_half(int paging_mode) { static inline uint64_t paging_mode_higher_half(int paging_mode) {
if (paging_mode == PAGING_MODE_AARCH64_5LVL) { if (paging_mode == PAGING_MODE_AARCH64_5LVL) {

View File

@ -785,7 +785,7 @@ FEAT_END
uint64_t pa = aa64mmfr0 & 0xF; uint64_t pa = aa64mmfr0 & 0xF;
uint64_t tsz = 64 - paging_mode_va_bits(paging_mode); uint64_t tsz = 64 - (paging_mode_va_bits(paging_mode) - 1);
#endif #endif
struct limine_file *kf = ext_mem_alloc(sizeof(struct limine_file)); struct limine_file *kf = ext_mem_alloc(sizeof(struct limine_file));