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. */
| 73 | * so we avoid cloning to this part. |
| 74 | */ |
| 75 | static 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 | |
| 107 | static int pci_platform_scan(void) |
| 108 | { |
nothing calls this directly
no test coverage detected