From patchwork Tue Dec 15 16:59:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kani, Toshi" X-Patchwork-Id: 7855961 Return-Path: X-Original-To: patchwork-linux-nvdimm@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 BED63BEEE1 for ; Tue, 15 Dec 2015 16:59:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC5FB203E1 for ; Tue, 15 Dec 2015 16:59:24 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6B2E203DB for ; Tue, 15 Dec 2015 16:59:23 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AB1421A1FC1; Tue, 15 Dec 2015 08:59:23 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from g4t3426.houston.hp.com (g4t3426.houston.hp.com [15.201.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E2D451A1FC1 for ; Tue, 15 Dec 2015 08:59:21 -0800 (PST) Received: from g4t3433.houston.hp.com (g4t3433.houston.hp.com [16.210.25.219]) by g4t3426.houston.hp.com (Postfix) with ESMTP id 784A260; Tue, 15 Dec 2015 16:59:20 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.78.168.61]) by g4t3433.houston.hp.com (Postfix) with ESMTP id 9DD415F; Tue, 15 Dec 2015 16:59:19 +0000 (UTC) From: Toshi Kani To: rjw@rjwysocki.net, dan.j.williams@intel.com Subject: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86 Date: Tue, 15 Dec 2015 09:59:06 -0700 Message-Id: <1450198746-14161-1-git-send-email-toshi.kani@hpe.com> X-Mailer: git-send-email 2.4.3 Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_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 ACPI 6.0 defines NFIT table and new persistent memory types for EFI memory table (EFI_PERSISTENT_MEMORY) and e820 table (E820_PMEM). setup_e820() enabled by EFI_STUB converts EFI_PERSISTENT_MEMORY to E820_PMEM for the e820_map table on x86 EFI platforms. When EFI_STUB is disabled, x86 kernels rely on the bootloader to perform this conversion. It was found that the upstream grub bootloader since 2012 has a bug that converts EFI_PERSISTENT_MEMORY (or any new type) to E820_RAM, which causes the kernel to use persistent memory ranges as regular memory and corrupts the data in NVDIMM. Therefore, this patch sets ACPI_NFIT to depend on EFI_STUB on x86. This assures that ACPI_NFIT kernels are self-contained and are protected from the upstream grub bug on x86. Note, X86_PMEM_LEGACY allows the kernel to use the pmem driver on pre-ACPI 6.0 platforms, and does not require ACPI_NFIT enabled. References: http://www.mail-archive.com/grub-devel@gnu.org/msg23961.html Reported-by: Robert Elliott Signed-off-by: Toshi Kani Cc: Rafael J. Wysocki Cc: Dan Williams --- drivers/acpi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 5eef4cb..5368baa 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -441,6 +441,7 @@ config ACPI_NFIT depends on PHYS_ADDR_T_64BIT depends on BLK_DEV depends on ARCH_HAS_MMIO_FLUSH + depends on !X86 || (X86 && EFI_STUB) select LIBNVDIMM help Infrastructure to probe ACPI 6 compliant platforms for