summaryrefslogtreecommitdiff
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-09-06 01:21:32 +1000
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:27 +0200
commit1747fb71fd7c9389696e91f354d2f841b5c85790 (patch)
tree8c0658884e62693a94c2ebd35f83331ffa083a7d /drivers/kvm/svm.c
parent81f50e3bfdf864103ef890ca156e7a9c922c7089 (diff)
downloadlwn-1747fb71fd7c9389696e91f354d2f841b5c85790.tar.gz
lwn-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/svm.c')
-rw-r--r--drivers/kvm/svm.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index e51f6b7f8ff3..35f3f83b5c6c 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -724,14 +724,6 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
var->unusable = !var->present;
}
-static void svm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
-{
- struct vmcb_seg *s = svm_seg(vcpu, VCPU_SREG_CS);
-
- *db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1;
- *l = (s->attrib >> SVM_SELECTOR_L_SHIFT) & 1;
-}
-
static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
{
struct vcpu_svm *svm = to_svm(vcpu);
@@ -1771,7 +1763,7 @@ static struct kvm_arch_ops svm_arch_ops = {
.get_segment_base = svm_get_segment_base,
.get_segment = svm_get_segment,
.set_segment = svm_set_segment,
- .get_cs_db_l_bits = svm_get_cs_db_l_bits,
+ .get_cs_db_l_bits = kvm_get_cs_db_l_bits,
.decache_cr4_guest_bits = svm_decache_cr4_guest_bits,
.set_cr0 = svm_set_cr0,
.set_cr3 = svm_set_cr3,