core, pxe: Don't push on one stack and pop from the other in pxenv

When saving/restoring the flags around the stack switch test, we
cannot leave live data on the stack *across* the stack switch that we
are going to use on the other side (unlike the "big" stack frame which
we only use once we are back on the original stack.)

Use register BP, which is not live at either point, as a temporary
holding place for the flags from the stack.

Reported-by: Frank Mehnert <>
Signed-off-by: H. Peter Anvin <>
1 file changed