b1bcb2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b1bcb2
From: Javier Martinez Canillas <javierm@redhat.com>
b1bcb2
Date: Sat, 7 Nov 2020 01:03:18 +0100
b1bcb2
Subject: [PATCH] docs: Document the cutmem command
b1bcb2
b1bcb2
The command is not present in the docs/grub.texi user documentation.
b1bcb2
b1bcb2
Reported-by: Daniel Kiper <daniel.kiper@oracle.com>
b1bcb2
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
b1bcb2
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
b1bcb2
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
b1bcb2
---
b1bcb2
 docs/grub.texi | 21 +++++++++++++++++++++
b1bcb2
 1 file changed, 21 insertions(+)
b1bcb2
b1bcb2
diff --git a/docs/grub.texi b/docs/grub.texi
b1bcb2
index 432610991b7..446574f3ddb 100644
b1bcb2
--- a/docs/grub.texi
b1bcb2
+++ b/docs/grub.texi
b1bcb2
@@ -3828,6 +3828,7 @@ you forget a command, you can run the command @command{help}
b1bcb2
 * cpuid::                       Check for CPU features
b1bcb2
 * crc::                         Compute or check CRC32 checksums
b1bcb2
 * cryptomount::                 Mount a crypto device
b1bcb2
+* cutmem::                      Remove memory regions
b1bcb2
 * date::                        Display or set current date and time
b1bcb2
 * devicetree::                  Load a device tree blob
b1bcb2
 * distrust::                    Remove a pubkey from trusted keys
b1bcb2
@@ -3982,6 +3983,8 @@ this page is to be filtered.  This syntax makes it easy to represent patterns
b1bcb2
 that are often result of memory damage, due to physical distribution of memory
b1bcb2
 cells.
b1bcb2
 
b1bcb2
+The command is similar to @command{cutmem} command.
b1bcb2
+
b1bcb2
 Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}).
b1bcb2
       This prevents removing EFI memory regions to potentially subvert the
b1bcb2
       security mechanisms provided by the UEFI secure boot.
b1bcb2
@@ -4142,6 +4145,24 @@ GRUB suports devices encrypted using LUKS and geli. Note that necessary modules
b1bcb2
 be used.
b1bcb2
 @end deffn
b1bcb2
 
b1bcb2
+@node cutmem
b1bcb2
+@subsection cutmem
b1bcb2
+
b1bcb2
+@deffn Command cutmem from[K|M|G] to[K|M|G]
b1bcb2
+Remove any memory regions in specified range.
b1bcb2
+@end deffn
b1bcb2
+
b1bcb2
+This command notifies the memory manager that specified regions of RAM ought to
b1bcb2
+be filtered out. This remains in effect after a payload kernel has been loaded
b1bcb2
+by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels
b1bcb2
+that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot
b1bcb2
+kernels in general.
b1bcb2
+
b1bcb2
+The command is similar to @command{badram} command.
b1bcb2
+
b1bcb2
+Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}).
b1bcb2
+      This prevents removing EFI memory regions to potentially subvert the
b1bcb2
+      security mechanisms provided by the UEFI secure boot.
b1bcb2
 
b1bcb2
 @node date
b1bcb2
 @subsection date