* [PATCH v2] Translate UEFI persistent memory type
@ 2015-12-14 0:41 Elliott, Robert (Persistent Memory)
2015-12-15 7:49 ` Andrei Borzenkov
0 siblings, 1 reply; 3+ messages in thread
From: Elliott, Robert (Persistent Memory) @ 2015-12-14 0:41 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 638 bytes --]
Per the thread:
grub causing NVDIMMs to be treated as normal memory
Robert Elliott (3):
Translate UEFI persistent memory type
efiemu: Handle all reserved UEFI memory map types the same way
Bump version to 2.03
NEWS | 20 ++++++++++++++++++++
configure.ac | 2 +-
grub-core/commands/lsmmap.c | 2 ++
grub-core/efiemu/mm.c | 2 +-
grub-core/mmap/efi/mmap.c | 12 ++++++++++++
include/grub/efi/api.h | 1 +
include/grub/memory.h | 2 ++
7 files changed, 39 insertions(+), 2 deletions(-)
--
2.4.3
---
Robert Elliott, HPE Persistent Memory
[-- Attachment #2: v2-0001-Translate-UEFI-persistent-memory-type.patch --]
[-- Type: application/octet-stream, Size: 3603 bytes --]
From 6f9ed076516667a422cba7c426a3f432f65b4253 Mon Sep 17 00:00:00 2001
From: Robert Elliott <elliott@hpe.com>
Date: Thu, 3 Dec 2015 11:38:36 -0600
Subject: [PATCH v2 1/3] Translate UEFI persistent memory type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Define
* GRUB_EFI_PERSISTENT_MEMORY (UEFI memory map type 14) per UEFI 2.5
* GRUB_MEMORY_PERSISTENT (E820 type 7) per ACPI 3.0
* GRUB_MEMORY_PERSISTENT_LEGACY (E820 unofficial type 12) per ACPI 3.0
and translate GRUB_EFI_PERSISTENT_MEMORY to GRUB_MEMORY_PMEM in
grub_efi_mmap_iterate().
Includes
* adding the E820 names to lsmmap
* handling the E820 types in make_efi_memtype()
Suggested-by: Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
Suggested-by: Andrei Borzenkov <arvidjaar@gmail.com>
---
grub-core/commands/lsmmap.c | 2 ++
grub-core/mmap/efi/mmap.c | 12 ++++++++++++
include/grub/efi/api.h | 1 +
include/grub/memory.h | 2 ++
4 files changed, 17 insertions(+)
diff --git a/grub-core/commands/lsmmap.c b/grub-core/commands/lsmmap.c
index 4b504fd..816ee47 100644
--- a/grub-core/commands/lsmmap.c
+++ b/grub-core/commands/lsmmap.c
@@ -37,6 +37,8 @@ static const char *names[] =
is required to save accross hibernations. */
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"),
[GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"),
+ [GRUB_MEMORY_PERSISTENT] = N_("persistent RAM"),
+ [GRUB_MEMORY_PERSISTENT_LEGACY] = N_("persistent RAM (legacy)"),
[GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"),
[GRUB_MEMORY_CODE] = N_("RAM holding firmware code")
};
diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c
index 900a4d6..bd495a1 100644
--- a/grub-core/mmap/efi/mmap.c
+++ b/grub-core/mmap/efi/mmap.c
@@ -118,6 +118,11 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data,
GRUB_MEMORY_NVS, hook_data);
break;
+ case GRUB_EFI_PERSISTENT_MEMORY:
+ hook (desc->physical_start, desc->num_pages * 4096,
+ GRUB_MEMORY_PERSISTENT, hook_data);
+ break;
+
default:
grub_printf ("Unknown memory type %d, considering reserved\n",
desc->type);
@@ -147,6 +152,13 @@ make_efi_memtype (int type)
/* No way to remove a chunk of memory from EFI mmap.
So mark it as unusable. */
case GRUB_MEMORY_HOLE:
+ /*
+ * AllocatePages() does not support GRUB_EFI_PERSISTENT_MEMORY,
+ * so no translation for GRUB_MEMORY_PERSISTENT or
+ * GRUB_MEMORY_PERSISTENT_LEGACY.
+ */
+ case GRUB_MEMORY_PERSISTENT:
+ case GRUB_MEMORY_PERSISTENT_LEGACY:
case GRUB_MEMORY_RESERVED:
return GRUB_EFI_UNUSABLE_MEMORY;
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 24a05c5..2bbfe34 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -476,6 +476,7 @@ enum grub_efi_memory_type
GRUB_EFI_MEMORY_MAPPED_IO,
GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE,
GRUB_EFI_PAL_CODE,
+ GRUB_EFI_PERSISTENT_MEMORY,
GRUB_EFI_MAX_MEMORY_TYPE
};
typedef enum grub_efi_memory_type grub_efi_memory_type_t;
diff --git a/include/grub/memory.h b/include/grub/memory.h
index 083cfb6..6da114a 100644
--- a/include/grub/memory.h
+++ b/include/grub/memory.h
@@ -30,6 +30,8 @@ typedef enum grub_memory_type
GRUB_MEMORY_ACPI = 3,
GRUB_MEMORY_NVS = 4,
GRUB_MEMORY_BADRAM = 5,
+ GRUB_MEMORY_PERSISTENT = 7,
+ GRUB_MEMORY_PERSISTENT_LEGACY = 12,
GRUB_MEMORY_COREBOOT_TABLES = 16,
GRUB_MEMORY_CODE = 20,
/* This one is special: it's used internally but is never reported
--
2.4.3
[-- Attachment #3: v2-0002-efiemu-Handle-all-reserved-UEFI-memory-map-types-.patch --]
[-- Type: application/octet-stream, Size: 1292 bytes --]
From cbd5cd7d6db41bdda7c7122259dbab79de64bb40 Mon Sep 17 00:00:00 2001
From: Robert Elliott <elliott@hpe.com>
Date: Thu, 3 Dec 2015 11:43:09 -0600
Subject: [PATCH v2 2/3] efiemu: Handle all reserved UEFI memory map types the
same way
In grub_efiemu_mmap_iterate, handle all undefined UEFI memory map
types the same - don't handle MAX_MEMORY_TYPE (which is not really
a type) differently and ignore the rest of the undefined types.
UEFI 2.5 defined type 14, which was formerly reserved and the value
of MAX_MEMORY_TYPE, as Persistent Memory. MAX_MEMORY_TYPE becomes
type 15, and handling one potentially changing reserved value
differently than others is dangerous.
---
grub-core/efiemu/mm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c
index d4a4f3a..4808bcc 100644
--- a/grub-core/efiemu/mm.c
+++ b/grub-core/efiemu/mm.c
@@ -445,7 +445,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
case GRUB_EFI_MEMORY_MAPPED_IO:
case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE:
case GRUB_EFI_PAL_CODE:
- case GRUB_EFI_MAX_MEMORY_TYPE:
+ default:
hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
GRUB_MEMORY_RESERVED, hook_data);
break;
--
2.4.3
[-- Attachment #4: v2-0003-Bump-version-to-2.03.patch --]
[-- Type: application/octet-stream, Size: 1986 bytes --]
From d1c3628ea5f5b3b7a805e21ecf0a57f616f873b6 Mon Sep 17 00:00:00 2001
From: Robert Elliott <elliott@hpe.com>
Date: Thu, 3 Dec 2015 11:52:36 -0600
Subject: [PATCH v2 3/3] Bump version to 2.03
In NEWS, include summary of user-visible changes since the last update
on 2015-10-29 (commit 33b1103, which added an entry in the 2.02 list).
---
NEWS | 20 ++++++++++++++++++++
configure.ac | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index 2db2f87..2294208 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,23 @@
+New in 2.03:
+
+ * Map UEFI Persistent Memory to E820 persistent memory
+ * Improve TCP window scaling support
+ * Fix Fast TSC (timestamp counter) calibration if the PIT
+ (programmable interval timer) is broken
+ * Perform TSC (timestamp counter) calibration with other
+ sources such as pmtimers (power management timers)
+ (e.g., in Hyper-V Gen2 VMs)
+ * Fix bug incorrectly mapping formerly reserved UEFI types
+ (including Persistent Memory type 14) to E820 usable memory
+ rather than E820 reserved memory
+ * Fix DNS record lookup fallback
+ * Fix password entry on stdin
+ * Fixed terminal size and position in FGX themes
+ * Added SAS disks to the IEEE 1275 Open Firmware device list
+ * Support encrypted containers on multiple partitions of the same disk
+ * Fixed device detection with large number of devices
+ * Improved reproducible builds
+
New in 2.02:
* New/improved filesystem and disk support:
diff --git a/configure.ac b/configure.ac
index 3300545..95f94bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables
dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are
dnl used for the target type. See INSTALL for full list of variables.
-AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org])
+AC_INIT([GRUB],[2.03],[bug-grub@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
--
2.4.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Translate UEFI persistent memory type
2015-12-14 0:41 [PATCH v2] Translate UEFI persistent memory type Elliott, Robert (Persistent Memory)
@ 2015-12-15 7:49 ` Andrei Borzenkov
2015-12-15 17:00 ` Elliott, Robert (Persistent Memory)
0 siblings, 1 reply; 3+ messages in thread
From: Andrei Borzenkov @ 2015-12-15 7:49 UTC (permalink / raw)
To: The development of GNU GRUB
14.12.2015 03:41, Elliott, Robert (Persistent Memory) пишет:
> Per the thread:
> grub causing NVDIMMs to be treated as normal memory
>
>
> Robert Elliott (3):
> Translate UEFI persistent memory type
> efiemu: Handle all reserved UEFI memory map types the same way
> Bump version to 2.03
>
> NEWS | 20 ++++++++++++++++++++
> configure.ac | 2 +-
> grub-core/commands/lsmmap.c | 2 ++
> grub-core/efiemu/mm.c | 2 +-
> grub-core/mmap/efi/mmap.c | 12 ++++++++++++
> include/grub/efi/api.h | 1 +
> include/grub/memory.h | 2 ++
> 7 files changed, 39 insertions(+), 2 deletions(-)
>
Committed, thanks!
Also selected NEWS updates; I omitted bug fixes, they are not normally
listed there. Please review if you think something is still missing.
This is still hoped to be in 2.02 :)
Regarding efiemu - grub_efiemu_mmap_iterate() is not even called
anywhere. I commented it out and it happily builds.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v2] Translate UEFI persistent memory type
2015-12-15 7:49 ` Andrei Borzenkov
@ 2015-12-15 17:00 ` Elliott, Robert (Persistent Memory)
0 siblings, 0 replies; 3+ messages in thread
From: Elliott, Robert (Persistent Memory) @ 2015-12-15 17:00 UTC (permalink / raw)
To: The development of GNU GRUB
> -----Original Message-----
> From: grub-devel-bounces+elliott=hp.com@gnu.org [mailto:grub-devel-
> bounces+elliott=hp.com@gnu.org] On Behalf Of Andrei Borzenkov
> Sent: Tuesday, December 15, 2015 1:49 AM
> To: The development of GNU GRUB <grub-devel@gnu.org>
> Subject: Re: [PATCH v2] Translate UEFI persistent memory type
>
> 14.12.2015 03:41, Elliott, Robert (Persistent Memory) пишет:
> > Per the thread:
> > grub causing NVDIMMs to be treated as normal memory
> >
> >
> > Robert Elliott (3):
> > Translate UEFI persistent memory type
...
>
> Committed, thanks!
>
> Also selected NEWS updates; I omitted bug fixes, they are not normally
> listed there. Please review if you think something is still missing.
>
> This is still hoped to be in 2.02 :)
A 2.03 tag will clearly indicate that all the
changes/fixes since December 2013 are incorporated.
This will let us say:
* 2.03 is NVDIMM safe
* 2.00 to 2.02 are not NVDIMM safe
Distros using 2.02~beta2 plus their own patches
don't always include beta2 in their version numbers,
so it'd be less confusing if we move on from "2.02".
---
Robert Elliott, HPE Persistent Memory
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-15 17:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 0:41 [PATCH v2] Translate UEFI persistent memory type Elliott, Robert (Persistent Memory)
2015-12-15 7:49 ` Andrei Borzenkov
2015-12-15 17:00 ` Elliott, Robert (Persistent Memory)
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.