[PATCH] x86: Fix SYSRETQ disassembly

Borislav Petkov bp@suse.de
Sun Oct 4 21:57:06 GMT 2020


On Sun, Oct 04, 2020 at 02:52:39PM -0700, H.J. Lu wrote:
> I can't reproduce it with your testcase.  Please show me how to reproduce it.

[boris@zn: /home/share/src/binutils/build> cat /tmp/sysretq.c
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{

        asm volatile("sysretq");

        return 0;
}

[boris@zn: /home/share/src/binutils/build> gcc -Wall -o /tmp/sysretq{,.c}
[boris@zn: /home/share/src/binutils/build> ./binutils/objdump -d /tmp/sysretq | grep -A 10 "<main>:"
0000000000001125 <main>:
    1125:       55                      push   %rbp
    1126:       48 89 e5                mov    %rsp,%rbp
    1129:       48 0f 07                rex.W sysret 
    112c:       b8 00 00 00 00          mov    $0x0,%eax
    1131:       5d                      pop    %rbp
    1132:       c3                      ret    
    1133:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
    113a:       00 00 00 
    113d:       0f 1f 00                nopl   (%rax)

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg


More information about the Binutils mailing list