• Avi Kivity's avatar
    [PATCH] KVM: x86 emulator: fix bit string instructions · 038e51de
    Avi Kivity authored
    The various bit string instructions (bts, btc, etc.) fail to adjust the
    address correctly if the bit address is beyond BITS_PER_LONG.
    
    This bug creeped in as the emulator originally relied on cr2 to contain the
    memory address; however we now decode it from the mod r/m bits, and must
    adjust the offset to account for large bit indices.
    
    The patch is rather large because it switches src and dst decoding around, so
    that the bit index is available when decoding the memory address.
    
    This fixes workloads like the FC5 installer.
    Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    038e51de
x86_emulate.c 37.4 KB