From a52ad6aa6182e8a2f72a5c338ffd6022a4be2238 Mon Sep 17 00:00:00 2001 From: Chao Li Date: Thu, 17 Oct 2024 20:43:27 +0800 Subject: [PATCH] system/loongarch: Fix a bug about the memory boundary. (#447) In LoongArch, the addresses from 0x30000000 to 0x80000000 are 32-bit PCI memory space, If the BAR happens start at 0x30000000, a mapping error will occur according to the old logic, and 0x30000000 should also be mapped, so fix it. Signed-off-by: Chao Li --- system/loongarch/vmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/loongarch/vmem.c b/system/loongarch/vmem.c index 29f8b24..8e70d47 100644 --- a/system/loongarch/vmem.c +++ b/system/loongarch/vmem.c @@ -29,7 +29,7 @@ extern uint8_t highest_map_bit; uintptr_t map_region(uintptr_t base_addr, size_t size __attribute__((unused)), bool only_for_startup __attribute__((unused))) { - if (((base_addr < 0x80000000) && (base_addr > 0x30000000)) || ((base_addr & PCI_IO_PERFIX) != 0x0)) { + if (((base_addr < 0x80000000) && (base_addr >= 0x30000000)) || ((base_addr & PCI_IO_PERFIX) != 0x0)) { return MMIO_BASE | base_addr; } else if ((base_addr < 0x20000000) && (base_addr > 0x10000000)) { return DMW0_BASE | base_addr;