Re: [PATCH 5/5] KVM: x86: Fix wrong masking on relative jump/call

From: Paolo Bonzini
Date: Wed May 07 2014 - 12:00:00 EST


Il 07/05/2014 14:32, Nadav Amit ha scritto:
Relative jumps and calls do the masking according to the operand size, and not
according to the address size as the KVM emulator does today. In 64-bit mode,
the resulting RIP is always 64-bit. Otherwise it is masked according to the
instruction operand-size. Note that when 16-bit address size is used, bits
63:32 are unmodified.

The SDM says "If the operand-size attribute is 16, the upper two bytes of the EIP register are cleared, resulting in a maximum instruction pointer size of 16 bits". I'm not sure whether that should also imply that 63:32 are _not_ unmodified (because you do a 32-bit write not a 16-bit one), but in any case it looks like masked_increment is not the right function.

Paolo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/