diff options
author | Bandan Das <bsd@redhat.com> | 2014-04-16 12:46:10 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-11 03:14:00 -0400 |
commit | 685bbf4ac406364a84a1d4237b4970dc570fd4cb (patch) | |
tree | ac41b20b2aaedd273872c5542290fd94ffcb8447 /arch/x86/kvm | |
parent | 1498507a47867596de158d4db8728e92385a4919 (diff) |
KVM: emulate: Remove ctxt->intercept and ctxt->check_perm checks
The same information can be gleaned from ctxt->d and avoids having
to zero/NULL initialize intercept and check_perm
Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 851315d93bf7..000fc7398832 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -4599,7 +4599,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) | |||
4599 | fetch_possible_mmx_operand(ctxt, &ctxt->dst); | 4599 | fetch_possible_mmx_operand(ctxt, &ctxt->dst); |
4600 | } | 4600 | } |
4601 | 4601 | ||
4602 | if (unlikely(ctxt->guest_mode) && ctxt->intercept) { | 4602 | if (unlikely(ctxt->guest_mode) && (ctxt->d & Intercept)) { |
4603 | rc = emulator_check_intercept(ctxt, ctxt->intercept, | 4603 | rc = emulator_check_intercept(ctxt, ctxt->intercept, |
4604 | X86_ICPT_PRE_EXCEPT); | 4604 | X86_ICPT_PRE_EXCEPT); |
4605 | if (rc != X86EMUL_CONTINUE) | 4605 | if (rc != X86EMUL_CONTINUE) |
@@ -4619,13 +4619,13 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) | |||
4619 | } | 4619 | } |
4620 | 4620 | ||
4621 | /* Do instruction specific permission checks */ | 4621 | /* Do instruction specific permission checks */ |
4622 | if (ctxt->check_perm) { | 4622 | if (ctxt->d & CheckPerm) { |
4623 | rc = ctxt->check_perm(ctxt); | 4623 | rc = ctxt->check_perm(ctxt); |
4624 | if (rc != X86EMUL_CONTINUE) | 4624 | if (rc != X86EMUL_CONTINUE) |
4625 | goto done; | 4625 | goto done; |
4626 | } | 4626 | } |
4627 | 4627 | ||
4628 | if (unlikely(ctxt->guest_mode) && ctxt->intercept) { | 4628 | if (unlikely(ctxt->guest_mode) && (ctxt->d & Intercept)) { |
4629 | rc = emulator_check_intercept(ctxt, ctxt->intercept, | 4629 | rc = emulator_check_intercept(ctxt, ctxt->intercept, |
4630 | X86_ICPT_POST_EXCEPT); | 4630 | X86_ICPT_POST_EXCEPT); |
4631 | if (rc != X86EMUL_CONTINUE) | 4631 | if (rc != X86EMUL_CONTINUE) |
@@ -4671,7 +4671,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) | |||
4671 | 4671 | ||
4672 | special_insn: | 4672 | special_insn: |
4673 | 4673 | ||
4674 | if (unlikely(ctxt->guest_mode) && ctxt->intercept) { | 4674 | if (unlikely(ctxt->guest_mode) && (ctxt->d & Intercept)) { |
4675 | rc = emulator_check_intercept(ctxt, ctxt->intercept, | 4675 | rc = emulator_check_intercept(ctxt, ctxt->intercept, |
4676 | X86_ICPT_POST_MEMACCESS); | 4676 | X86_ICPT_POST_MEMACCESS); |
4677 | if (rc != X86EMUL_CONTINUE) | 4677 | if (rc != X86EMUL_CONTINUE) |