diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-03 11:31:19 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:07 -0400 |
commit | 83b8795a29c53a5f9f202933818128aa54c3e8d2 (patch) | |
tree | cb3d43a2d94aa0d88972267e6108bb11d65ad571 /arch/x86/kvm | |
parent | 9fa088f4d24f045d91c37a5e55f0d2be2ef387ad (diff) | |
download | op-kernel-dev-83b8795a29c53a5f9f202933818128aa54c3e8d2.zip op-kernel-dev-83b8795a29c53a5f9f202933818128aa54c3e8d2.tar.gz |
KVM: x86 emulator: pass access size and read/write intent to linearize()
Needed for segment read/write checks.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b46fa37..a2d343c 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -491,6 +491,7 @@ static unsigned seg_override(struct x86_emulate_ctxt *ctxt, static int linearize(struct x86_emulate_ctxt *ctxt, struct segmented_address addr, + unsigned size, bool write, ulong *linear) { struct decode_cache *c = &ctxt->decode; @@ -550,7 +551,7 @@ static int segmented_read_std(struct x86_emulate_ctxt *ctxt, int rc; ulong linear; - rc = linearize(ctxt, addr, &linear); + rc = linearize(ctxt, addr, size, false, &linear); if (rc != X86EMUL_CONTINUE) return rc; return ctxt->ops->read_std(linear, data, size, ctxt->vcpu, @@ -973,7 +974,7 @@ static int segmented_read(struct x86_emulate_ctxt *ctxt, int rc; ulong linear; - rc = linearize(ctxt, addr, &linear); + rc = linearize(ctxt, addr, size, false, &linear); if (rc != X86EMUL_CONTINUE) return rc; return read_emulated(ctxt, ctxt->ops, linear, data, size); @@ -987,7 +988,7 @@ static int segmented_write(struct x86_emulate_ctxt *ctxt, int rc; ulong linear; - rc = linearize(ctxt, addr, &linear); + rc = linearize(ctxt, addr, size, true, &linear); if (rc != X86EMUL_CONTINUE) return rc; return ctxt->ops->write_emulated(linear, data, size, @@ -1002,7 +1003,7 @@ static int segmented_cmpxchg(struct x86_emulate_ctxt *ctxt, int rc; ulong linear; - rc = linearize(ctxt, addr, &linear); + rc = linearize(ctxt, addr, size, true, &linear); if (rc != X86EMUL_CONTINUE) return rc; return ctxt->ops->cmpxchg_emulated(linear, orig_data, data, @@ -2509,7 +2510,7 @@ static int em_invlpg(struct x86_emulate_ctxt *ctxt) int rc; ulong linear; - rc = linearize(ctxt, c->src.addr.mem, &linear); + rc = linearize(ctxt, c->src.addr.mem, 1, false, &linear); if (rc == X86EMUL_CONTINUE) emulate_invlpg(ctxt->vcpu, linear); /* Disable writeback. */ |