Running lss with some random descriptor and then performing pop does not work so well. Use mov instructions instead of push/pop pair. Signed-off-by: Nadav Amit <namit@xxxxxxxxxx> --- x86/realmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/realmode.c b/x86/realmode.c index 301b013..90ecd13 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1378,10 +1378,10 @@ static void test_lds_lss(void) outregs.eax == (unsigned long)desc.address && outregs.ebx == desc.sel); - MK_INSN(lss, "pushl %ss\n\t" + MK_INSN(lss, "mov %ss, %dx\n\t" "lss (%ebx), %eax\n\t" "mov %ss, %ebx\n\t" - "popl %ss\n\t"); + "mov %dx, %ss\n\t"); exec_in_big_real_mode(&insn_lss); report("lss", R_AX | R_BX, outregs.eax == (unsigned long)desc.address && -- 2.20.1