xref: /OK3568_Linux_fs/buildroot/boot/grub2/0046-docs-Document-the-cutmem-command.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From f05e79a0143beb2d9a482a3ebf4fe0ce76778122 Mon Sep 17 00:00:00 2001
2From: Javier Martinez Canillas <javierm@redhat.com>
3Date: Sat, 7 Nov 2020 01:03:18 +0100
4Subject: [PATCH] docs: Document the cutmem command
5
6The command is not present in the docs/grub.texi user documentation.
7
8Reported-by: Daniel Kiper <daniel.kiper@oracle.com>
9Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
10Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
11Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
12Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
13---
14 docs/grub.texi | 21 +++++++++++++++++++++
15 1 file changed, 21 insertions(+)
16
17diff --git a/docs/grub.texi b/docs/grub.texi
18index 79f58c5..8518cc0 100644
19--- a/docs/grub.texi
20+++ b/docs/grub.texi
21@@ -3892,6 +3892,7 @@ you forget a command, you can run the command @command{help}
22 * cpuid::                       Check for CPU features
23 * crc::                         Compute or check CRC32 checksums
24 * cryptomount::                 Mount a crypto device
25+* cutmem::                      Remove memory regions
26 * date::                        Display or set current date and time
27 * devicetree::                  Load a device tree blob
28 * distrust::                    Remove a pubkey from trusted keys
29@@ -4051,6 +4052,8 @@ this page is to be filtered.  This syntax makes it easy to represent patterns
30 that are often result of memory damage, due to physical distribution of memory
31 cells.
32
33+The command is similar to @command{cutmem} command.
34+
35 Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}).
36       This prevents removing EFI memory regions to potentially subvert the
37       security mechanisms provided by the UEFI secure boot.
38@@ -4214,6 +4217,24 @@ GRUB suports devices encrypted using LUKS and geli. Note that necessary modules
39 be used.
40 @end deffn
41
42+@node cutmem
43+@subsection cutmem
44+
45+@deffn Command cutmem from[K|M|G] to[K|M|G]
46+Remove any memory regions in specified range.
47+@end deffn
48+
49+This command notifies the memory manager that specified regions of RAM ought to
50+be filtered out. This remains in effect after a payload kernel has been loaded
51+by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels
52+that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot
53+kernels in general.
54+
55+The command is similar to @command{badram} command.
56+
57+Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}).
58+      This prevents removing EFI memory regions to potentially subvert the
59+      security mechanisms provided by the UEFI secure boot.
60
61 @node date
62 @subsection date
63--
642.14.2
65
66