diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2009-07-19 00:00:01 +0900 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 08:33:15 +0300 |
commit | b792c344dfd57ee2cf737440e4a9b4a5bc39d1db (patch) | |
tree | f91b48042d1060bd761e7025d2b5c5b2960b4566 /arch/x86/kvm/x86.c | |
parent | 46a359e71526909a18a47aaf4347343d6d1d74b2 (diff) | |
download | lwn-b792c344dfd57ee2cf737440e4a9b4a5bc39d1db.tar.gz lwn-b792c344dfd57ee2cf737440e4a9b4a5bc39d1db.zip |
KVM: x86: use kvm_get_gdt() and kvm_read_ldt()
Use kvm_get_gdt() and kvm_read_ldt() to reduce inline assembly code.
Cc: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6277a316821e..c7ec0c921c01 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -132,13 +132,12 @@ unsigned long segment_base(u16 selector) if (selector == 0) return 0; - asm("sgdt %0" : "=m"(gdt)); + kvm_get_gdt(&gdt); table_base = gdt.base; if (selector & 4) { /* from ldt */ - u16 ldt_selector; + u16 ldt_selector = kvm_read_ldt(); - asm("sldt %0" : "=g"(ldt_selector)); table_base = segment_base(ldt_selector); } d = (struct desc_struct *)(table_base + (selector & ~7)); |