-
Avi Kivity authored
This allows us to clear the area around the null pointer, and so trap errors. The switch is tricky wrt setting up memory, since we need the memory to be mapped in order to free it, but we need free memory to map (for the page tables). What we do is set up a temporart 1:1 map at ffff800000000000 that mirrors the first 1G map we already have from bootstreap, use that to free all of memory under 1G, then map and free everything else.
Avi Kivity authoredThis allows us to clear the area around the null pointer, and so trap errors. The switch is tricky wrt setting up memory, since we need the memory to be mapped in order to free it, but we need free memory to map (for the page tables). What we do is set up a temporart 1:1 map at ffff800000000000 that mirrors the first 1G map we already have from bootstreap, use that to free all of memory under 1G, then map and free everything else.