Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292416

Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86

From Toshi Kani <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86
Date 2015-12-15 19:00 +0100
Message-ID <qG23f-7pS-13@gated-at.bofh.it> (permalink)
References <qG17c-6Oe-29@gated-at.bofh.it> <qG1Ad-7eq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2015-12-15 at 09:21 -0800, Dan Williams wrote:
> On Tue, Dec 15, 2015 at 8:59 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > 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 <elliott@hpe.com>
> > Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> > Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > ---
> >  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
> 
> This seems wrong to me.
> 
> In general Kconfig "depends on" are only about compile-time code
> dependency, not about working around random bugs in external projects.

I agree that they do not have a compile dependency, and it looks rather
odd.  On the other hand, proper support of the ACPI NFIT extensions has a
functional dependency to setup_e820() as this is the only code that can
handle the EFI_PERSISTENT_MEMORY type today.

Thanks,
-Toshi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86 Toshi Kani <toshi.kani@hpe.com> - 2015-12-15 18:00 +0100
  Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86 Dan Williams <dan.j.williams@intel.com> - 2015-12-15 18:30 +0100
    Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB  on X86 Toshi Kani <toshi.kani@hpe.com> - 2015-12-15 19:00 +0100
      Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB  on X86 Toshi Kani <toshi.kani@hpe.com> - 2015-12-15 19:00 +0100
        Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86 Dan Williams <dan.j.williams@intel.com> - 2015-12-15 19:10 +0100
          Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB  on X86 Toshi Kani <toshi.kani@hpe.com> - 2015-12-15 21:10 +0100
      Re: [PATCH RESEND] ACPI/Kconfig: Make ACPI_NFIT depend on EFI_STUB on X86 Dan Williams <dan.j.williams@intel.com> - 2015-12-15 19:00 +0100

csiph-web