From patchwork Tue Dec 22 15:50:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 7905221 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27424BEEE5 for ; Tue, 22 Dec 2015 15:50:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26F642053D for ; Tue, 22 Dec 2015 15:50:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC45420519 for ; Tue, 22 Dec 2015 15:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754982AbbLVPus (ORCPT ); Tue, 22 Dec 2015 10:50:48 -0500 Received: from prv-mh.provo.novell.com ([137.65.248.74]:51067 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787AbbLVPur convert rfc822-to-8bit (ORCPT ); Tue, 22 Dec 2015 10:50:47 -0500 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 22 Dec 2015 08:50:47 -0700 Message-Id: <56797F6502000078000C2525@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Tue, 22 Dec 2015 08:50:45 -0700 From: "Jan Beulich" To: Cc: , "Ingo Molnar" , "Matt Fleming" Subject: [PATCH] ACPI/APEI: correct/extend pgprot_t retrieval to map GHES memory Mime-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Jonathan (Zhixiong) Zhang Cc: Matt Fleming Cc: Ingo Molnar --- 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 --- 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);