On Thu, 23 Nov 2023, Emile `iMil' Heitor wrote:
It seems we have a similar problem to the second bullet point Colin Percival
noted here
https://www.daemonology.net/blog/2022-10-18-FreeBSD-Firecracker.html
When removing the hvm_start_info address save portion, the sym mapping
doesn't fall into an infinite loop anymore.
Not yet sure how to fix that, I'll have a look at FreeBSD's commits on this
matter.
And so it was, in locore.S:start_xen32, this assumption is wrong when the
entrypoint is called from qemu:
/*
* save addr of the hvm_start_info structure. This is also the end
* of the symbol table
*/
this makes esym point to an address (%ebx + KERNBASE) which is not the
end of the symbol table.
Same goes with eblob which is calculated relative to %ebx.
A friend of mine, Gregory in CC, found that putting those 2 (esym and eblob)
to 0 made the paging init go fine as both tests (l.660 and 667) will trigger
jz 1f and keep %edi to __kernel_end.
This brings us to init_xen_early(), which is failing but that's another story.
------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net