aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-03-18 09:20:05 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:15:57 -0400
commit9c5372445c1ad4fcdb4128957ec89334223b8113 (patch)
tree7b3a8f46941cb1a46da5c9e1764ed078df0fe878 /arch/x86/kvm/x86.c
parent93a152be5af3d651ff0ab5459f5e0f9662b22438 (diff)
KVM: Provide x86_emulate_ctxt callback to get current cpl
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c382e9721099..9cb28a943c9a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3479,6 +3479,11 @@ static void emulator_set_cr(int cr, unsigned long val, struct kvm_vcpu *vcpu)
3479 } 3479 }
3480} 3480}
3481 3481
3482static int emulator_get_cpl(struct kvm_vcpu *vcpu)
3483{
3484 return kvm_x86_ops->get_cpl(vcpu);
3485}
3486
3482static struct x86_emulate_ops emulate_ops = { 3487static struct x86_emulate_ops emulate_ops = {
3483 .read_std = kvm_read_guest_virt_system, 3488 .read_std = kvm_read_guest_virt_system,
3484 .fetch = kvm_fetch_guest_virt, 3489 .fetch = kvm_fetch_guest_virt,
@@ -3487,6 +3492,7 @@ static struct x86_emulate_ops emulate_ops = {
3487 .cmpxchg_emulated = emulator_cmpxchg_emulated, 3492 .cmpxchg_emulated = emulator_cmpxchg_emulated,
3488 .get_cr = emulator_get_cr, 3493 .get_cr = emulator_get_cr,
3489 .set_cr = emulator_set_cr, 3494 .set_cr = emulator_set_cr,
3495 .cpl = emulator_get_cpl,
3490}; 3496};
3491 3497
3492static void cache_all_regs(struct kvm_vcpu *vcpu) 3498static void cache_all_regs(struct kvm_vcpu *vcpu)