]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: x86/xen: update wallclock region
authorJoao Martins <joao.m.martins@oracle.com>
Thu, 28 Jun 2018 19:06:43 +0000 (15:06 -0400)
committerJoao Martins <joao.m.martins@oracle.com>
Wed, 20 Feb 2019 17:30:52 +0000 (12:30 -0500)
Wallclock on Xen is written in the shared_info page.

To that purpose, export kvm_write_wall_clock() and pass on the GPA of
its location to populate the shared_info wall clock data.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h
arch/x86/kvm/xen.c

index 6eb2afaa2af2688c449c8c020d1b02a43884b8ed..31a102b22042305f114140a2e7bd4062cf7220b4 100644 (file)
@@ -1418,7 +1418,7 @@ void kvm_set_pending_timer(struct kvm_vcpu *vcpu)
        kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
 }
 
-static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
+void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
 {
        int version;
        int r;
index 28406aa1136d7eb772ed712f9df34ffe14290e66..b5f2e66a4c8186f230f3ab365492f7f4933a0fa7 100644 (file)
@@ -256,6 +256,7 @@ static inline bool kvm_check_has_quirk(struct kvm *kvm, u64 quirk)
 }
 
 void kvm_set_pending_timer(struct kvm_vcpu *vcpu);
+void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock);
 int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);
 
 void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr);
index b4bd1949656eb6de7f4af0a41ded6164f91dcef5..879bcfdd7b1d280c4d73a838b9707e0c3d8117b9 100644 (file)
@@ -19,6 +19,7 @@ static int kvm_xen_shared_info_init(struct kvm *kvm, gfn_t gfn)
 {
        struct shared_info *shared_info;
        struct page *page;
+       gpa_t gpa = gfn_to_gpa(gfn);
 
        page = gfn_to_page(kvm, gfn);
        if (is_error_page(page))
@@ -30,6 +31,8 @@ static int kvm_xen_shared_info_init(struct kvm *kvm, gfn_t gfn)
        memset(shared_info, 0, sizeof(struct shared_info));
        kvm->arch.xen.shinfo = shared_info;
 
+       kvm_write_wall_clock(kvm, gpa + offsetof(struct shared_info, wc));
+
        kvm_make_all_cpus_request(kvm, KVM_REQ_MASTERCLOCK_UPDATE);
        return 0;
 }