add MPX support #defines

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
add synchronize_srcu wrapper

Simply fall back to synchronize_srcu_expedited if compatibility code
is being used for SRCU.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
irqfd fixes for 3.17

kvm_irq_routing_update does not do the assignment anymore.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
introduce ktime_get_boot_ns

This is a first tiny step towards supporting 3.17 in kvm-kmod.
The changes to the timekeeping code were spread all over the place...

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
patch away struct tk_read_base

3.17 introduces a 'struct tk_read_base' and uses it in struct timekeeper.
A lot of fields were moved thus under a 'tkr' struct-typed field, patch
them back to where they used to be.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
add wrappers for nanosecond-based timekeeping

Timekeeping code switched from timespec- to nanosecond-based in 3.17,
and some fields of struct timekeeper thus are new or changed meaning
in that release.

When they are accessed, go through a wrapper function in
external-module-compat.c, the code is tricky enough that we do not
want it in the sync script.

The logic in kvm_get_xtime_nsec is based on the code before
upstream commit cbcf2dd3b3d4d990610259e8d878fc8dc1f17d80, but
I'm retaining most of the changes in that commit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Update source link

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
adjust for upstream timekeeping fixes

In upstream KVM, boot_ns is supposed to contain the wallclock value at
boot time.  Adjust kvm_get_boot_base_ns to compute that, instead of
adding tk->wall_to_monotonic in kvm_get_xtime_nsec.

Also, KVM is now adding tk->xtime_sec separately from the computation
of the kvmclock base (different from commit cbcf2dd3b3d4, x86: kvm:
Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16).
So kvm_get_xtime_nsec need not do that anymore.

With these two changes, there is no need anymore for a special treatment
of tk->tkr.xtime_nsec; removing the "tkr." will suffice.

Finally, the formula for boot_ns changed recently from
base_mono+offs_boot to offs_boot-offs_real.  Look for offs_boot in
the sync script, which will capture both cases.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rhel7