[PTLsim-devel] Possible bug with CMPXCHG8B

Stephan Diestelhorst
Fri Jun 15 12:30:34 EDT 2007


Hi,
  I've just started working with PTLsim and have found some possible problem 
with the decoding of the CMPXCHG8B instruction.

It is not decoded properly, but rather shows the following error:

Switching to simulation core 'ooo'...
Stopping after 9223372036854775807 commits
Exception 6 (invalid opcode) @ rip 0x4004ac (101184 commits, 154166 cycles)
Aborting...
Assert false failed in kernel.cpp:1007 (void 
Context::propagate_x86_exception(byte, W32, Waddr)) at 154166 cycles, 154166 
iterations, 101184 user commits

Simple testcase: test-cmpxchg8b.c
int test[2];
int main() {
        asm("cmpxchg8b %0"::"m"(test[0]));
        return 0;
}

Looking through the decoder confirms that.
Opcode 0F C7 /1 is not decoded properly, as the whole group 9 extension 
(denoted by C7) is not decoded at all.
Another issue is that CPUID reports the CMPXCHG8B instruction as present, as 
far as I can tell.

Don't need that instruction, but was rather using the opcode area for my own 
instruction-set extension and just stumbled upon that problem.

Regards,
  Stephan
-- 
Stephan Diestelhorst, AMD Operating System Research Center
stephan.diestelhorst at amd.com




More information about the PTLsim-devel mailing list