aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/kvm_host.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-07-10 09:53:33 -0400
committerAvi Kivity <avi@qumranet.com>2008-07-20 05:42:39 -0400
commitd6e88aec07aa8f6c7e4024f5734ec659fd7c5a40 (patch)
tree2f20376a678d720d2be4e5feab3f4049e0477a73 /include/asm-x86/kvm_host.h
parentc65bbfa1d693d375da51f9c8aa9fb26f09fa19ed (diff)
KVM: Prefix some x86 low level function with kvm_, to avoid namespace issues
Fixes compilation with CONFIG_VMI enabled. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/asm-x86/kvm_host.h')
-rw-r--r--include/asm-x86/kvm_host.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index c64d1242762b..f995783b1fdb 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -567,55 +567,53 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
567 return (struct kvm_mmu_page *)page_private(page); 567 return (struct kvm_mmu_page *)page_private(page);
568} 568}
569 569
570static inline u16 read_fs(void) 570static inline u16 kvm_read_fs(void)
571{ 571{
572 u16 seg; 572 u16 seg;
573 asm("mov %%fs, %0" : "=g"(seg)); 573 asm("mov %%fs, %0" : "=g"(seg));
574 return seg; 574 return seg;
575} 575}
576 576
577static inline u16 read_gs(void) 577static inline u16 kvm_read_gs(void)
578{ 578{
579 u16 seg; 579 u16 seg;
580 asm("mov %%gs, %0" : "=g"(seg)); 580 asm("mov %%gs, %0" : "=g"(seg));
581 return seg; 581 return seg;
582} 582}
583 583
584static inline u16 read_ldt(void) 584static inline u16 kvm_read_ldt(void)
585{ 585{
586 u16 ldt; 586 u16 ldt;
587 asm("sldt %0" : "=g"(ldt)); 587 asm("sldt %0" : "=g"(ldt));
588 return ldt; 588 return ldt;
589} 589}
590 590
591static inline void load_fs(u16 sel) 591static inline void kvm_load_fs(u16 sel)
592{ 592{
593 asm("mov %0, %%fs" : : "rm"(sel)); 593 asm("mov %0, %%fs" : : "rm"(sel));
594} 594}
595 595
596static inline void load_gs(u16 sel) 596static inline void kvm_load_gs(u16 sel)
597{ 597{
598 asm("mov %0, %%gs" : : "rm"(sel)); 598 asm("mov %0, %%gs" : : "rm"(sel));
599} 599}
600 600
601#ifndef load_ldt 601static inline void kvm_load_ldt(u16 sel)
602static inline void load_ldt(u16 sel)
603{ 602{
604 asm("lldt %0" : : "rm"(sel)); 603 asm("lldt %0" : : "rm"(sel));
605} 604}
606#endif
607 605
608static inline void get_idt(struct descriptor_table *table) 606static inline void kvm_get_idt(struct descriptor_table *table)
609{ 607{
610 asm("sidt %0" : "=m"(*table)); 608 asm("sidt %0" : "=m"(*table));
611} 609}
612 610
613static inline void get_gdt(struct descriptor_table *table) 611static inline void kvm_get_gdt(struct descriptor_table *table)
614{ 612{
615 asm("sgdt %0" : "=m"(*table)); 613 asm("sgdt %0" : "=m"(*table));
616} 614}
617 615
618static inline unsigned long read_tr_base(void) 616static inline unsigned long kvm_read_tr_base(void)
619{ 617{
620 u16 tr; 618 u16 tr;
621 asm("str %0" : "=g"(tr)); 619 asm("str %0" : "=g"(tr));
@@ -632,17 +630,17 @@ static inline unsigned long read_msr(unsigned long msr)
632} 630}
633#endif 631#endif
634 632
635static inline void fx_save(struct i387_fxsave_struct *image) 633static inline void kvm_fx_save(struct i387_fxsave_struct *image)
636{ 634{
637 asm("fxsave (%0)":: "r" (image)); 635 asm("fxsave (%0)":: "r" (image));
638} 636}
639 637
640static inline void fx_restore(struct i387_fxsave_struct *image) 638static inline void kvm_fx_restore(struct i387_fxsave_struct *image)
641{ 639{
642 asm("fxrstor (%0)":: "r" (image)); 640 asm("fxrstor (%0)":: "r" (image));
643} 641}
644 642
645static inline void fx_finit(void) 643static inline void kvm_fx_finit(void)
646{ 644{
647 asm("finit"); 645 asm("finit");
648} 646}