diff mbox

ACPI/APEI: correct/extend pgprot_t retrieval to map GHES memory

Message ID 56797F6502000078000C2525@prv-mh.provo.novell.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jan Beulich Dec. 22, 2015, 3:50 p.m. UTC
Commit 8ece249a81 ("acpi/apei: Use appropriate pgprot_t to map GHES
memory") adjusted ghes_ioremap_pfn_irq() but left ghes_ioremap_pfn_nmi()
alone, and while doing the adjustment it introduced an at least latent
truncation issue on ix86 (using "unsigned long" for a physical address).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
Cc: Matt Fleming <mfleming@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
---
 drivers/acpi/apei/ghes.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 4.4-rc6/drivers/acpi/apei/ghes.c
+++ 4.4-rc6-ACPI-GHES-ioremap/drivers/acpi/apei/ghes.c
@@ -147,17 +147,23 @@  static void ghes_ioremap_exit(void)
 static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn)
 {
 	unsigned long vaddr;
+	phys_addr_t paddr;
+	pgprot_t prot;
 
 	vaddr = (unsigned long)GHES_IOREMAP_NMI_PAGE(ghes_ioremap_area->addr);
-	ioremap_page_range(vaddr, vaddr + PAGE_SIZE,
-			   pfn << PAGE_SHIFT, PAGE_KERNEL);
+
+	paddr = pfn << PAGE_SHIFT;
+	prot = arch_apei_get_mem_attribute(paddr);
+
+	ioremap_page_range(vaddr, vaddr + PAGE_SIZE, paddr, prot);
 
 	return (void __iomem *)vaddr;
 }
 
 static void __iomem *ghes_ioremap_pfn_irq(u64 pfn)
 {
-	unsigned long vaddr, paddr;
+	unsigned long vaddr;
+	phys_addr_t paddr;
 	pgprot_t prot;
 
 	vaddr = (unsigned long)GHES_IOREMAP_IRQ_PAGE(ghes_ioremap_area->addr);