aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorIzik Eidus <izike@qumranet.com>2008-03-24 13:38:34 -0400
committerAvi Kivity <avi@qumranet.com>2008-04-27 05:00:38 -0400
commit2e4d2653497856b102c90153f970c9e344ba96c6 (patch)
tree8a1929d5caa1f9436c25a104f75403fb2b3e5e2f /arch/x86/kvm/svm.c
parent4c9fc8ef501790732ed035585b491756b75ea4c6 (diff)
KVM: x86: add functions to get the cpl of vcpu
Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 51741f96e7fb..c1c1b973e80a 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -792,6 +792,13 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
792 var->unusable = !var->present; 792 var->unusable = !var->present;
793} 793}
794 794
795static int svm_get_cpl(struct kvm_vcpu *vcpu)
796{
797 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save;
798
799 return save->cpl;
800}
801
795static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) 802static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
796{ 803{
797 struct vcpu_svm *svm = to_svm(vcpu); 804 struct vcpu_svm *svm = to_svm(vcpu);
@@ -1822,6 +1829,7 @@ static struct kvm_x86_ops svm_x86_ops = {
1822 .get_segment_base = svm_get_segment_base, 1829 .get_segment_base = svm_get_segment_base,
1823 .get_segment = svm_get_segment, 1830 .get_segment = svm_get_segment,
1824 .set_segment = svm_set_segment, 1831 .set_segment = svm_set_segment,
1832 .get_cpl = svm_get_cpl,
1825 .get_cs_db_l_bits = kvm_get_cs_db_l_bits, 1833 .get_cs_db_l_bits = kvm_get_cs_db_l_bits,
1826 .decache_cr4_guest_bits = svm_decache_cr4_guest_bits, 1834 .decache_cr4_guest_bits = svm_decache_cr4_guest_bits,
1827 .set_cr0 = svm_set_cr0, 1835 .set_cr0 = svm_set_cr0,