All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>,
	The development of GNU GRUB <grub-devel@gnu.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: grub causing NVDIMMs to be treated as normal memory
Date: Thu, 26 Nov 2015 06:30:11 +0300	[thread overview]
Message-ID: <56567CC3.3040405@gmail.com> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B40295BE5549A@G9W0745.americas.hpqcorp.net>

26.11.2015 03:12, Elliott, Robert (Persistent Memory) пишет:
> 
> 
>> -----Original Message-----
>> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On
>> Behalf Of Andrei Borzenkov
>> Sent: Wednesday, November 25, 2015 12:37 PM
>> To: The development of GNU GRUB <grub-devel@gnu.org>;
>> dan.j.williams@intel.com; linux-nvdimm@lists.01.org
>> Subject: Re: grub causing NVDIMMs to be treated as normal memory
>>
>> 25.11.2015 02:52, Elliott, Robert (Persistent Memory) пишет:
>>> We've noticed that some combinations of grub and old linux kernels
>>>
>>> end up interpreting the UEFI memory map EfiPersistentMemory type 14
>>> (formerly a reserved value) as regular memory in the linux e820
>>> table, causing silent data corruption on the NVDIMMs.  That occurs
>>> even though grub prints this message suggesting everything is safe:
>>>
>>>     Unknown memory type 14, considering reserved
>>>
>>>
>>>
>>> In broken versions of grub, the code parsing the UEFI memory map
>>> has a "default" case that falls through to the
>>>
>>> GRUB_EFI_BOOT_SERVICES_DATA case, which marks the memory range
>>> as GRUB_MEMORY_AVAILABLE and ends up in e820 as regular memory.
>>
>> Could you test if attached patch works for you (compile tested)?
> 
> Thanks.
> 
> I think I finally got that to compile with
>     configure --with-platform=efi
>     make
> 
> but have no clue how to install it and try it out.  I'm using a
> fedora22 system, which has its own /sbin/grub2-install.  I 
> don't understand how that differs from the grub-install in the
> build directory or how to get either of them to work.
> 

From the build directory

pkgdatadir=$PWD ./grub-install --bootloader-id testgrub -d grub-core

This should install grub in \EFI\testgrub on ESP and add EFI menu for
it. You can add --no-nvram to skip EFI menu update and load it manually
then. It will install modules in /boot/grub (instead of /boot/grub2), so
you should probably copy /boot/grub2/grub.cfg there.

Of course you can simply add patch to Fedora package and rebuild this
package.

> Anyway, we should create another patch that does:
> * #define GRUB_EFI_PERSISTENT_MEMORY 14	per UEFI 2.5
> * #define GRUB_E820_PERSISTENT_MEMORY 7	per ACPI 6.0
> * add a GRUB_MEMORY_PMEM enum
> * map GRUB_EFI_PERSISTENT_MEMORY -> GRUM_PMEMORY_MEM 
>   -> GRUB_E820_PERSISTENT_MEMORY per ACPI 6.0
> 
> to explicitly handle the new types (in addition to handling
> unknown values correctly).
> 

That is much more involved than obvious bug fix. It can be done later.


  reply	other threads:[~2015-11-26  3:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 23:52 grub causing NVDIMMs to be treated as normal memory Elliott, Robert (Persistent Memory)
2015-11-25 14:08 ` Andrei Borzenkov
2015-11-25 16:51   ` Dan Williams
2015-11-25 17:04   ` Elliott, Robert (Persistent Memory)
2015-11-25 17:07   ` Seth Goldberg
2015-11-25 18:36 ` Andrei Borzenkov
2015-11-26  0:12   ` Elliott, Robert (Persistent Memory)
2015-11-26  3:30     ` Andrei Borzenkov [this message]
2015-11-26  6:15       ` Elliott, Robert (Persistent Memory)
2015-11-26 16:55         ` Andrei Borzenkov
2015-11-26 23:24           ` Elliott, Robert (Persistent Memory)
2015-11-27  3:58             ` Andrei Borzenkov
2015-11-27  6:22               ` Elliott, Robert (Persistent Memory)
2015-11-27 11:08                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-11-27 11:48                   ` Andrei Borzenkov
2015-11-27 13:55                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-11-27 17:23                       ` Andrei Borzenkov
2015-11-28  6:41                   ` Elliott, Robert (Persistent Memory)
2015-12-01  0:25                     ` Elliott, Robert (Persistent Memory)
2015-12-03 17:50                     ` Elliott, Robert (Persistent Memory)
2015-12-08 17:15                       ` Andrei Borzenkov
2015-12-09  6:37                         ` Elliott, Robert (Persistent Memory)
2015-12-29 17:17                     ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56567CC3.3040405@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=elliott@hpe.com \
    --cc=grub-devel@gnu.org \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.