]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Emulator does not calculate address correctly
authorNadav Amit <namit@cs.technion.ac.il>
Tue, 30 Sep 2014 17:49:19 +0000 (20:49 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Nov 2014 11:07:24 +0000 (12:07 +0100)
commitf4d5dc25f40d9402a7d2b4065019344ec2802ccf
treea73ab7b46108c449f8a288ed1f3a2034047a47c3
parent4ad93d412841eb7d7629a7db1aa4e4407a2506b6
KVM: x86: Emulator does not calculate address correctly

In long-mode, when the address size is 4 bytes, the linear address is not
truncated as the emulator mistakenly does.  Instead, the offset within the
segment (the ea field) should be truncated according to the address size.

As Intel SDM says: "In 64-bit mode, the effective address components are added
and the effective address is truncated ... before adding the full 64-bit
segment base."

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c