diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-20 08:01:23 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:39:07 -0400 |
commit | fe870ab9ce1c3e64c6d6b6ee3fe53d0d029f1044 (patch) | |
tree | ca9dd92f3ebf8648f69243af199f09bca4ad66b9 /arch | |
parent | 2953538ebbd95b145bd3629126fe5af61b88be11 (diff) |
KVM: x86 emulator: avoid using ctxt->vcpu in check_perm() callbacks
Unneeded for register access.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index acb9fcc283ee..0ff7d4bd1bb2 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2720,7 +2720,7 @@ static int check_svme(struct x86_emulate_ctxt *ctxt) | |||
2720 | 2720 | ||
2721 | static int check_svme_pa(struct x86_emulate_ctxt *ctxt) | 2721 | static int check_svme_pa(struct x86_emulate_ctxt *ctxt) |
2722 | { | 2722 | { |
2723 | u64 rax = kvm_register_read(ctxt->vcpu, VCPU_REGS_RAX); | 2723 | u64 rax = ctxt->decode.regs[VCPU_REGS_RAX]; |
2724 | 2724 | ||
2725 | /* Valid physical address? */ | 2725 | /* Valid physical address? */ |
2726 | if (rax & 0xffff000000000000) | 2726 | if (rax & 0xffff000000000000) |
@@ -2742,7 +2742,7 @@ static int check_rdtsc(struct x86_emulate_ctxt *ctxt) | |||
2742 | static int check_rdpmc(struct x86_emulate_ctxt *ctxt) | 2742 | static int check_rdpmc(struct x86_emulate_ctxt *ctxt) |
2743 | { | 2743 | { |
2744 | u64 cr4 = ctxt->ops->get_cr(ctxt, 4); | 2744 | u64 cr4 = ctxt->ops->get_cr(ctxt, 4); |
2745 | u64 rcx = kvm_register_read(ctxt->vcpu, VCPU_REGS_RCX); | 2745 | u64 rcx = ctxt->decode.regs[VCPU_REGS_RCX]; |
2746 | 2746 | ||
2747 | if ((!(cr4 & X86_CR4_PCE) && ctxt->ops->cpl(ctxt)) || | 2747 | if ((!(cr4 & X86_CR4_PCE) && ctxt->ops->cpl(ctxt)) || |
2748 | (rcx > 3)) | 2748 | (rcx > 3)) |