diff options
author | Avi Kivity <avi@redhat.com> | 2010-11-17 08:28:22 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:29:36 -0500 |
commit | 30b31ab6823988263c72a215fb875edec6161250 (patch) | |
tree | 8385e5888f956d2df04b1dcc91fbe14458082ae7 /arch/x86/kvm/emulate.c | |
parent | 90de84f50b425805bf7ddc430143ed2e224ebd8e (diff) |
KVM: x86 emulator: do not perform address calculations on linear addresses
Linear addresses are supposed to already have segment checks performed on them;
if we play with these addresses the checks become invalid.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e9670554263..bdbbb1839e8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -568,7 +568,8 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt, | |||
568 | ctxt->vcpu, NULL); | 568 | ctxt->vcpu, NULL); |
569 | if (rc != X86EMUL_CONTINUE) | 569 | if (rc != X86EMUL_CONTINUE) |
570 | return rc; | 570 | return rc; |
571 | rc = ops->read_std(linear(ctxt, addr) + 2, address, op_bytes, | 571 | addr.ea += 2; |
572 | rc = ops->read_std(linear(ctxt, addr), address, op_bytes, | ||
572 | ctxt->vcpu, NULL); | 573 | ctxt->vcpu, NULL); |
573 | return rc; | 574 | return rc; |
574 | } | 575 | } |