]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: x86 emulator: avoid using ctxt->vcpu in check_perm() callbacks
authorAvi Kivity <avi@redhat.com>
Wed, 20 Apr 2011 12:01:23 +0000 (15:01 +0300)
committerAvi Kivity <avi@redhat.com>
Wed, 20 Apr 2011 13:01:16 +0000 (16:01 +0300)
Unneeded for register access.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index 55ca5a5259f4e43d96c099606e0c33fc76d44b1a..8020f1ba0cd10a00afe47b5297bf5990221cad31 100644 (file)
@@ -2720,7 +2720,7 @@ static int check_svme(struct x86_emulate_ctxt *ctxt)
 
 static int check_svme_pa(struct x86_emulate_ctxt *ctxt)
 {
-       u64 rax = kvm_register_read(ctxt->vcpu, VCPU_REGS_RAX);
+       u64 rax = ctxt->decode.regs[VCPU_REGS_RAX];
 
        /* Valid physical address? */
        if (rax & 0xffff000000000000)
@@ -2742,7 +2742,7 @@ static int check_rdtsc(struct x86_emulate_ctxt *ctxt)
 static int check_rdpmc(struct x86_emulate_ctxt *ctxt)
 {
        u64 cr4 = ctxt->ops->get_cr(ctxt, 4);
-       u64 rcx = kvm_register_read(ctxt->vcpu, VCPU_REGS_RCX);
+       u64 rcx = ctxt->decode.regs[VCPU_REGS_RCX];
 
        if ((!(cr4 & X86_CR4_PCE) && ctxt->ops->cpl(ctxt)) ||
            (rcx > 3))