I included the larger diff that demonstrates where the functionality is needed. Apparently resume is broken on i386 PAE when nx bit is available, it was so before my PAE merge, but the merge switched normal mode to PAE and the issue become visible. There are several issues:
- the trampoline page is not mapped executable, so machine faults when paging is on;
- EFER and %cr4 both should be loaded before paging is enabled, otherwise paging structures are invalid (cr4.PAE and EFER.NX).
There are some more bits still not correct, e.g. unconditional access to %cr4 in resumectx.
So I only request to review the vm_kern.c bits, of course feel free to review/comment on the whole patch.