]> git.ipfire.org Git - thirdparty/qemu.git/commit
target-i386: fix SIB decoding with index = 4
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 6 Mar 2010 17:02:31 +0000 (18:02 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 10 Mar 2010 07:52:46 +0000 (08:52 +0100)
commitd2df336c582d74650f4ccc3ef4e84ac86c2868fe
tree4f130f5d89984eea71bd177f9abb05db2dc9071c
parentb299b12b176792db8ff47c4d22fa62e4d64a0614
target-i386: fix SIB decoding with index = 4

A SIB byte with an index of 4 means "no scaled index", even if the scale
value is not 0. In 64-bit mode, if REX.X is used, an index of 4 selects
%r12. This is correctly handled by the computation of the index variable,
which includes the index bits, and also the REX.X prefix:

    index = ((code >> 3) & 7) | REX_X(s);

Thanks to Avi Kivity, Jamie Lokier and Malc for the analysis of the
problem and the initial patch.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit b16f827bdf7444b8cd338b9ecb654b4752f47225)
target-i386/translate.c