diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-02-16 03:51:48 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-25 05:27:28 -0400 |
commit | 89a27f4d0e042a2fa3391a76b652aec3e16ef200 (patch) | |
tree | d2cf954c066c6f5fbd51a15a439b63d1dba53edd /arch/x86/include/asm | |
parent | 679613442f84702c06a80f2320cb8a50089200bc (diff) |
KVM: use desc_ptr struct instead of kvm private descriptor_table
x86 arch defines desc_ptr for idt/gdt pointers, no need to define
another structure in kvm code.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 06d9e79ca37d..cf392dfb8000 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -461,11 +461,6 @@ struct kvm_vcpu_stat { | |||
461 | u32 nmi_injections; | 461 | u32 nmi_injections; |
462 | }; | 462 | }; |
463 | 463 | ||
464 | struct descriptor_table { | ||
465 | u16 limit; | ||
466 | unsigned long base; | ||
467 | } __attribute__((packed)); | ||
468 | |||
469 | struct kvm_x86_ops { | 464 | struct kvm_x86_ops { |
470 | int (*cpu_has_kvm_support)(void); /* __init */ | 465 | int (*cpu_has_kvm_support)(void); /* __init */ |
471 | int (*disabled_by_bios)(void); /* __init */ | 466 | int (*disabled_by_bios)(void); /* __init */ |
@@ -503,10 +498,10 @@ struct kvm_x86_ops { | |||
503 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); | 498 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); |
504 | void (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); | 499 | void (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); |
505 | void (*set_efer)(struct kvm_vcpu *vcpu, u64 efer); | 500 | void (*set_efer)(struct kvm_vcpu *vcpu, u64 efer); |
506 | void (*get_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); | 501 | void (*get_idt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt); |
507 | void (*set_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); | 502 | void (*set_idt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt); |
508 | void (*get_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); | 503 | void (*get_gdt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt); |
509 | void (*set_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); | 504 | void (*set_gdt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt); |
510 | int (*get_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long *dest); | 505 | int (*get_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long *dest); |
511 | int (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value); | 506 | int (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value); |
512 | void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg); | 507 | void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg); |
@@ -724,12 +719,12 @@ static inline void kvm_load_ldt(u16 sel) | |||
724 | asm("lldt %0" : : "rm"(sel)); | 719 | asm("lldt %0" : : "rm"(sel)); |
725 | } | 720 | } |
726 | 721 | ||
727 | static inline void kvm_get_idt(struct descriptor_table *table) | 722 | static inline void kvm_get_idt(struct desc_ptr *table) |
728 | { | 723 | { |
729 | asm("sidt %0" : "=m"(*table)); | 724 | asm("sidt %0" : "=m"(*table)); |
730 | } | 725 | } |
731 | 726 | ||
732 | static inline void kvm_get_gdt(struct descriptor_table *table) | 727 | static inline void kvm_get_gdt(struct desc_ptr *table) |
733 | { | 728 | { |
734 | asm("sgdt %0" : "=m"(*table)); | 729 | asm("sgdt %0" : "=m"(*table)); |
735 | } | 730 | } |