26.11.2015 03:12, Elliott, Robert (Persistent Memory) пишет: > > >> -----Original Message----- >> From: Linux-nvdimm [mailto:linux-nvdimm-boun...@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.willi...@intel.com; linux-nvd...@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. _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel