KVM: x86: Move TSC offset writes to common code
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / x86 / include / asm / kvm_host.h
index 502e53f999cf28a25cc2b00f1766bd1ffb2f9ed2..a215153f1ff637b1fe9e7af222d7bcceba7a26f1 100644 (file)
@@ -367,9 +367,9 @@ struct kvm_vcpu_arch {
 };
 
 struct kvm_arch {
-       unsigned int n_free_mmu_pages;
+       unsigned int n_used_mmu_pages;
        unsigned int n_requested_mmu_pages;
-       unsigned int n_alloc_mmu_pages;
+       unsigned int n_max_mmu_pages;
        atomic_t invlpg_counter;
        struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
        /*
@@ -394,8 +394,8 @@ struct kvm_arch {
        gpa_t ept_identity_map_addr;
 
        unsigned long irq_sources_bitmap;
-       u64 vm_init_tsc;
        s64 kvmclock_offset;
+       spinlock_t tsc_write_lock;
 
        struct kvm_xen_hvm_config xen_hvm_config;
 
@@ -522,6 +522,8 @@ struct kvm_x86_ops {
 
        bool (*has_wbinvd_exit)(void);
 
+       void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset);
+
        const struct trace_print_flags *exit_reasons_str;
 };
 
@@ -652,20 +654,6 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
        return (struct kvm_mmu_page *)page_private(page);
 }
 
-static inline u16 kvm_read_fs(void)
-{
-       u16 seg;
-       asm("mov %%fs, %0" : "=g"(seg));
-       return seg;
-}
-
-static inline u16 kvm_read_gs(void)
-{
-       u16 seg;
-       asm("mov %%gs, %0" : "=g"(seg));
-       return seg;
-}
-
 static inline u16 kvm_read_ldt(void)
 {
        u16 ldt;
@@ -673,16 +661,6 @@ static inline u16 kvm_read_ldt(void)
        return ldt;
 }
 
-static inline void kvm_load_fs(u16 sel)
-{
-       asm("mov %0, %%fs" : : "rm"(sel));
-}
-
-static inline void kvm_load_gs(u16 sel)
-{
-       asm("mov %0, %%gs" : : "rm"(sel));
-}
-
 static inline void kvm_load_ldt(u16 sel)
 {
        asm("lldt %0" : : "rm"(sel));