Bug 230085

Summary: vex amd64->IR: unhandled instruction bytes: 0xF 0x1 0x4D 0xF0 0xB8 0x0 ("sidt -0x10(%rbp)")
Product: [Developer tools] valgrind Reporter: Alexander Potapenko <glider>
Component: vexAssignee: Julian Seward <jseward>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 3.6 SVN   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: A draft patch for the SIDT support in VEX on x86 and amd64

Description Alexander Potapenko 2010-03-09 12:07:09 UTC
$ uname -a
Linux glider-box 2.6.24-gg804006-generic #1 SMP Tue Dec 22 15:27:33 PST 2009 x86_64 GNU/Linux

$ cat sidt.c
int main() {
  struct {
    unsigned short limit;
    unsigned long base;
  } __attribute__((packed)) idtr;
  __asm__ volatile(
    "sidt %0" : "=m" (idtr)
  );
  return 0;
}

$ gcc sidt.c -o sidt
$ ./sidt
$ valgrind --tool=none ./sidt
==16739== Nulgrind, the minimal Valgrind tool
==16739== Copyright (C) 2002-2009, and GNU GPL'd, by Nicholas Nethercote.
==16739== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
==16739== Command: ./sidt
==16739== 
vex amd64->IR: unhandled instruction bytes: 0xF 0x1 0x4D 0xF0 0xB8 0x0
==16739== valgrind: Unrecognised instruction at address 0x40044c.
...

The instruction 0xF 0x1 0x4D 0xF0 is "sidt -0x10(%rbp)"

Fixing this error would probably also fix the problems with running the threading tests on Snow Leopard, see https://bugs.kde.org/show_bug.cgi?id=205241#c29
Comment 1 Alexander Potapenko 2010-04-06 13:14:45 UTC
Created attachment 42525 [details]
A draft patch for the SIDT support in VEX on x86 and amd64

This is a very raw patch that implements the SIDT support via a dirty helper.
At the moment it's totally undocumented and doesn't decode the opcodes correctly (it does not tell SIDT from SGDT).
Comment 2 Alexander Potapenko 2010-04-06 13:21:04 UTC

*** This bug has been marked as a duplicate of bug 93498 ***