Skip to contentSkip to conversation

x86_64: acpi map table fix

PATCH In review Vivek Goyal 2 participants 2 messages Dec 8, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64: acpi map table fix

o Memory till end_pfn_map has been directly mapped. So all the memory references to the last page (represented by end_pfn_map) should be valid.

o I run into problem with kdump when I use memmap=exactmap option and also pass memmap=X#Y to directly map acpi tables. ACPI initialization in second kernel fails because some of the valid ACPI memory is not accessible.

o /proc/iomem shows ACPI tables at c7fcb940-c7fcf7ff : ACPI Tables. Here end_pfn_map is set to c7fcf000. But c7fcf700 should also be a valid access.

---

arch/i386/kernel/acpi/boot.c renamed from arch/i386/kernel/acpi/boot.c~acpi-map-address-fix +1 -1
diff -puN arch/i386/kernel/acpi/boot.c~acpi-map-address-fix arch/i386/kernel/acpi/boot.c
@@ -108,7 +108,7 @@ char *__acpi_map_table(unsigned long phy
 	if (!phys_addr || !size)
 		return NULL;
 
-	if (phys_addr < (end_pfn_map << PAGE_SHIFT))
+	if (phys_addr < ((end_pfn_map << PAGE_SHIFT) + PAGE_SIZE))
 		return __va(phys_addr);
 
 	return NULL;

_

#1 lore raw
Quoted 6 lines · Vivek Goyal

o Memory till end_pfn_map has been directly mapped. So all the memory references to the last page (represented by end_pfn_map) should be valid.

I think the correct test is

if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE)
return __va(phys_addr);

I changed it to that. Thanks.

-Andi