MCPcopy Create free account
hub / github.com/coreboot/coreboot / dump_me_memory

Function dump_me_memory

util/intelmetool/src/intelmetool.c:75–105  ·  view source on GitHub ↗

You need >4GB total ram, in kernel cmdline, use 'mem=1000m' * then this code will clone to absolute memory address 0xe0000000 * which can be read using a mmap tool at that offset. * Real ME memory is located around top of memory minus 64MB. (I think) * so we avoid cloning to this part. */

Source from the content-addressed store, hash-verified

73 * so we avoid cloning to this part.
74 */
75static void dump_me_memory(void)
76{
77 uintptr_t me_clone = 0x60000000;
78 uint8_t *dump;
79
80 dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000);
81 if (dump == NULL) {
82 printf("Could not map ME memory\n");
83 return;
84 }
85 zeroit(dump, 0x2000000);
86 printf("Send magic command for memory clone\n");
87
88 mei_reset();
89 usleep(ME_COMMAND_DELAY);
90 void* ptr = &me_clone;
91 int err = mkhi_debug_me_memory(ptr);
92
93 if (!err) {
94 printf("Wait a second...");
95 usleep(ME_COMMAND_DELAY);
96 printf("done\n\nHere are the first bytes:\n");
97 dumpmemfile(dump, 0x2000000);
98 //printf("Try reading 0x%zx with other mmap tool...\n"
99 // "Press enter to quit, you only get one chance to run"
100 // "this tool before reboot required for some reason\n",
101 // me_clone);
102 while (getc(stdin) != '\n') {};
103 unmap_physical(dump, 0x2000000);
104 }
105}
106
107static int pci_platform_scan(void)
108{

Callers

nothing calls this directly

Calls 7

map_physical_exactFunction · 0.85
printfFunction · 0.85
zeroitFunction · 0.85
mkhi_debug_me_memoryFunction · 0.85
dumpmemfileFunction · 0.85
mei_resetFunction · 0.70
unmap_physicalFunction · 0.70

Tested by

no test coverage detected