* [PATCH] External module compatibility for hrtimer_expires_remaining
@ 2009-01-22 20:05 Alexander Graf
2009-01-22 21:20 ` Alexander Graf
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2009-01-22 20:05 UTC (permalink / raw)
To: kvm; +Cc: avi
Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining,
which is not available on my 2.6.27 kernel.
This patch adds a backwards compatibility layer for it.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
kernel/external-module-compat-comm.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 981dc96..634f717 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -501,6 +501,17 @@ struct timespec kvm_ns_to_timespec(const s64 nsec);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+
+#define hrtimer_expires_remaining kvm_hrtimer_expires_remaining
+
+static inline ktime_t kvm_hrtimer_expires_remaining(const struct hrtimer *timer)
+{
+ return ktime_sub(timer->expires, timer->base->get_time());
+}
+
+#endif
+
/* work_struct lost the 'data' field in 2.6.20 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] External module compatibility for hrtimer_expires_remaining
2009-01-22 20:05 [PATCH] External module compatibility for hrtimer_expires_remaining Alexander Graf
@ 2009-01-22 21:20 ` Alexander Graf
2009-02-04 14:41 ` Avi Kivity
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2009-01-22 21:20 UTC (permalink / raw)
To: kvm; +Cc: avi
Alexander Graf wrote:
> Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining,
> which is not available on my 2.6.27 kernel.
>
> This patch adds a backwards compatibility layer for it.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
>
I just saw that you did one yourself that doesn't work for me. Is the
#define reversed?
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] External module compatibility for hrtimer_expires_remaining
2009-01-22 21:20 ` Alexander Graf
@ 2009-02-04 14:41 ` Avi Kivity
2009-02-04 16:17 ` Alexander Graf
0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2009-02-04 14:41 UTC (permalink / raw)
To: Alexander Graf; +Cc: kvm
Alexander Graf wrote:
> Alexander Graf wrote:
>
>> Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining,
>> which is not available on my 2.6.27 kernel.
>>
>> This patch adds a backwards compatibility layer for it.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>
>>
>
> I just saw that you did one yourself that doesn't work for me. Is the
> #define reversed?
>
See also my change to hack-module.awk. Did you 'make sync' again?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] External module compatibility for hrtimer_expires_remaining
2009-02-04 14:41 ` Avi Kivity
@ 2009-02-04 16:17 ` Alexander Graf
2009-02-04 17:19 ` Avi Kivity
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2009-02-04 16:17 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
Avi Kivity wrote:
> Alexander Graf wrote:
>> Alexander Graf wrote:
>>> Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining,
>>> which is not available on my 2.6.27 kernel.
>>>
>>> This patch adds a backwards compatibility layer for it.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>
>> I just saw that you did one yourself that doesn't work for me. Is the
>> #define reversed?
>
> See also my change to hack-module.awk. Did you 'make sync' again?
On a freshly git pull'ed checkout with a 2.6.27 host kernel:
/dev/shm/x/kvm-userspace/kernel/x86/lapic.c: In function ‘apic_get_tmcct’:
/dev/shm/x/kvm-userspace/kernel/x86/lapic.c:570: error: implicit
declaration of function ‘hrtimer_expires_remaining’
/dev/shm/x/kvm-userspace/kernel/x86/lapic.c:570: error: incompatible
types in assignment
I'd say the problem is the
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
which should be 2.6.28, right?
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] External module compatibility for hrtimer_expires_remaining
2009-02-04 16:17 ` Alexander Graf
@ 2009-02-04 17:19 ` Avi Kivity
0 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2009-02-04 17:19 UTC (permalink / raw)
To: Alexander Graf; +Cc: kvm
Alexander Graf wrote:
> Avi Kivity wrote:
>
>> Alexander Graf wrote:
>>
>>> Alexander Graf wrote:
>>>
>>>> Due to Marcelo's APIC fix we now depend on hrtimer_expires_remaining,
>>>> which is not available on my 2.6.27 kernel.
>>>>
>>>> This patch adds a backwards compatibility layer for it.
>>>>
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>>
>>> I just saw that you did one yourself that doesn't work for me. Is the
>>> #define reversed?
>>>
>> See also my change to hack-module.awk. Did you 'make sync' again?
>>
>
> On a freshly git pull'ed checkout with a 2.6.27 host kernel:
>
> /dev/shm/x/kvm-userspace/kernel/x86/lapic.c: In function ‘apic_get_tmcct’:
> /dev/shm/x/kvm-userspace/kernel/x86/lapic.c:570: error: implicit
> declaration of function ‘hrtimer_expires_remaining’
> /dev/shm/x/kvm-userspace/kernel/x86/lapic.c:570: error: incompatible
> types in assignment
>
> I'd say the problem is the
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
>
> which should be 2.6.28, right?
>
You're right -- will fix.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-04 17:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-22 20:05 [PATCH] External module compatibility for hrtimer_expires_remaining Alexander Graf
2009-01-22 21:20 ` Alexander Graf
2009-02-04 14:41 ` Avi Kivity
2009-02-04 16:17 ` Alexander Graf
2009-02-04 17:19 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox