grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub causing NVDIMMs to be treated as normal memory


From: Andrei Borzenkov
Subject: Re: grub causing NVDIMMs to be treated as normal memory
Date: Thu, 26 Nov 2015 06:30:11 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

26.11.2015 03:12, Elliott, Robert (Persistent Memory) пишет:
> 
> 
>> -----Original Message-----
>> From: Linux-nvdimm [mailto:address@hidden On
>> Behalf Of Andrei Borzenkov
>> Sent: Wednesday, November 25, 2015 12:37 PM
>> To: The development of GNU GRUB <address@hidden>;
>> address@hidden; address@hidden
>> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]