On 16/10/19 23:52, Jim Mattson wrote: > Never mind. After taking a closer look, esp[] is meant to provide > stack space for the code under test, but inregs.esp should point to > the top of this stack rather than the bottom. This is apparently a > long-standing bug, similar to the one Avi fixed for test_long_jmp() > in commit 4aa22949 ("realmode: fix esp in long jump test"). > > For consistency with test_long_jmp, I'd suggest changing the > inregs.esp assignment to: > inregs.esp = (u32)(esp+16); > > Note that you absolutely must preserve the esp[] array! > Agreed, thanks Jim for the review. Paolo