| 10 Mar 2025 |
raitobezarius | well, you know what we did last time right | 18:12:09 |
raitobezarius | let me check the source code of qemu quickly | 18:12:24 |
raitobezarius | basically | 18:13:30 |
raitobezarius | bool x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
Error **errp);
| 18:13:32 |
raitobezarius | i think this needs to answer "yo bro i have nothing for you below 4GB boundary" | 18:13:41 |
raitobezarius | then you are going to reproduce it | 18:13:50 |
raitobezarius | target/i386/cpu.h | 18:14:01 |
raitobezarius | hmm | 18:14:37 |
raitobezarius | i think there's easier ways to do it | 18:14:40 |
raitobezarius | https://www.qemu.org/docs/master/devel/memory.html | 18:14:42 |
@elvishjerricco:matrix.org | I thought we just tested everything on bare metal asahi machines | 18:15:33 |
raitobezarius | In reply to @elvishjerricco:matrix.org I thought we just tested everything on bare metal asahi machines the day where the sd-boot read() was relying on the firmware not being broken | 18:15:51 |
@elvishjerricco:matrix.org | oh I fixed that by fucking with the OVMF implementation in a cursed way | 18:16:09 |
@elvishjerricco:matrix.org | which I guess would be another way to do this, huh? | 18:16:16 |
raitobezarius | memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", machine->ram,
0, x86ms->below_4g_mem_size);
| 18:16:36 |
raitobezarius | either you patch OVMF | 18:16:40 |
@elvishjerricco:matrix.org | * oh I tested that by fucking with the OVMF implementation in a cursed way | 18:16:42 |
raitobezarius | either you patch QEMU | 18:16:43 |
raitobezarius | just kill these lines | 18:16:57 |
raitobezarius | ram_below_4g = g_malloc(sizeof(*ram_below_4g));
memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", machine->ram,
0, x86ms->below_4g_mem_size);
memory_region_add_subregion(system_memory, 0, ram_below_4g);
| 18:17:00 |
raitobezarius | i think that's enough to make RAM below 4GB disappear | 18:17:05 |
raitobezarius | (pc.c file) | 18:17:13 |
raitobezarius | but you need a QEMU rebuild | 18:17:19 |
raitobezarius | a OVMF rebuild may be easier | 18:17:23 |
@elvishjerricco:matrix.org | right | 18:17:24 |
raitobezarius | if you want to do it in OVMF | 18:18:11 |
raitobezarius | for (Link = gMemoryMap.ForwardLink; Link != &gMemoryMap; Link = Link->ForwardLink) {
Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
ASSERT (Entry->VirtualStart == 0);
``
| 18:18:13 |
raitobezarius | this is the start of the code you want to hook | 18:18:17 |
raitobezarius | in Page.c | 18:18:18 |
raitobezarius | you want to check the ranges and just continue; it | 18:18:24 |