summaryrefslogtreecommitdiff
path: root/arch/x86/xen/suspend.c
diff options
context:
space:
mode:
authorJoao Martins <joao.m.martins@oracle.com>2017-11-08 20:19:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 10:13:47 +0300
commit9fb9a5434f1c888e4cd8fd1cb573973939eddfa9 (patch)
treed6f3d58e9ebdc71f89b9cdfc2f6d097b00b744c3 /arch/x86/xen/suspend.c
parent4f3498a06330cfddc29a7876738eca7a497c81e7 (diff)
downloadlinux-9fb9a5434f1c888e4cd8fd1cb573973939eddfa9.tar.xz
x86/xen/time: setup vcpu 0 time info page
commit 2229f70b5bbb025e1394b61007938a68060afbfb upstream. In order to support pvclock vdso on xen we need to setup the time info page for vcpu 0 and register the page with Xen using the VCPUOP_register_vcpu_time_memory_area hypercall. This hypercall will also forcefully update the pvti which will set some of the necessary flags for vdso. Afterwards we check if it supports the PVCLOCK_TSC_STABLE_BIT flag which is mandatory for having vdso/vsyscall support. And if so, it will set the cpu 0 pvti that will be later on used when mapping the vdso image. The xen headers are also updated to include the new hypercall for registering the secondary vcpu_time_info struct. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/xen/suspend.c')
-rw-r--r--arch/x86/xen/suspend.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 3e3a58ea669e..1d83152c761b 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -22,6 +22,8 @@ static DEFINE_PER_CPU(u64, spec_ctrl);
void xen_arch_pre_suspend(void)
{
+ xen_save_time_memory_area();
+
if (xen_pv_domain())
xen_pv_pre_suspend();
}
@@ -32,6 +34,8 @@ void xen_arch_post_suspend(int cancelled)
xen_pv_post_suspend(cancelled);
else
xen_hvm_post_suspend(cancelled);
+
+ xen_restore_time_memory_area();
}
static void xen_vcpu_notify_restore(void *data)