diff options
author | Joao Martins <joao.m.martins@oracle.com> | 2017-11-08 20:19:54 +0300 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-11-09 00:33:14 +0300 |
commit | 001f60e1f662a6dee1630a2915401aaf5959d479 (patch) | |
tree | 1675488b2b8a4e71dcf66edc7ecb7fc3f0cde073 /drivers/ptp/ptp_kvm.c | |
parent | 52847bb79b524c6f6c177d3247e824ad7487b31c (diff) | |
download | linux-001f60e1f662a6dee1630a2915401aaf5959d479.tar.xz |
ptp_kvm: probe for kvm guest availability
In the event of moving pvclock_pvti_cpu0_va() definition to common
pvclock code, this function would return a value on non KVM guests.
Later on this would fail with a GPF on ptp_kvm_init when running on a
Xen guest. Therefore, ptp_kvm_init() should check whether it is running
in a KVM guest.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Acked-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/ptp/ptp_kvm.c')
-rw-r--r-- | drivers/ptp/ptp_kvm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_kvm.c b/drivers/ptp/ptp_kvm.c index 2b1b212c219e..e04d7b2ecb3a 100644 --- a/drivers/ptp/ptp_kvm.c +++ b/drivers/ptp/ptp_kvm.c @@ -178,6 +178,9 @@ static int __init ptp_kvm_init(void) { long ret; + if (!kvm_para_available()) + return -ENODEV; + clock_pair_gpa = slow_virt_to_phys(&clock_pair); hv_clock = pvclock_pvti_cpu0_va(); |