summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorRusty Russell2007-09-05 17:21:32 +0200
committerAvi Kivity2007-10-13 10:18:27 +0200
commit1747fb71fd7c9389696e91f354d2f841b5c85790 (patch)
tree8c0658884e62693a94c2ebd35f83331ffa083a7d /drivers/kvm/kvm_main.c
parentKVM: Keep control regs in sync (diff)
downloadkernel-qcow2-linux-1747fb71fd7c9389696e91f354d2f841b5c85790.tar.gz
kernel-qcow2-linux-1747fb71fd7c9389696e91f354d2f841b5c85790.tar.xz
kernel-qcow2-linux-1747fb71fd7c9389696e91f354d2f841b5c85790.zip
KVM: Hoist SVM's get_cs_db_l_bits into core code.
SVM gets the DB and L bits for the cs by decoding the segment. This is in fact the completely generic code, so hoist it for kvm-lite to use. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 7341c0949340..9dffbbea46a7 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2270,6 +2270,16 @@ static int kvm_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
return 0;
}
+void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
+{
+ struct kvm_segment cs;
+
+ get_segment(vcpu, &cs, VCPU_SREG_CS);
+ *db = cs.db;
+ *l = cs.l;
+}
+EXPORT_SYMBOL_GPL(kvm_get_cs_db_l_bits);
+
/*
* List of msr numbers which we expose to userspace through KVM_GET_MSRS
* and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.