mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
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>
This commit is contained in:
parent
52847bb79b
commit
001f60e1f6
1 changed files with 3 additions and 0 deletions
|
@ -178,6 +178,9 @@ static int __init ptp_kvm_init(void)
|
||||||
{
|
{
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
|
if (!kvm_para_available())
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
clock_pair_gpa = slow_virt_to_phys(&clock_pair);
|
clock_pair_gpa = slow_virt_to_phys(&clock_pair);
|
||||||
hv_clock = pvclock_pvti_cpu0_va();
|
hv_clock = pvclock_pvti_cpu0_va();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue