Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
No more comments: I agree. We can move the "&= ~PF_VCPU" to kvm_guest_exit() and remove it from account_system_time(). Moreover it will simplify the code for s390... Regards, Laurent Avi Kivity wrote: Laurent Vivier wrote: Avi Kivity wrote: Laurent Vivier wrote: But if we didn't

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Avi Kivity
Laurent Vivier wrote: Avi Kivity wrote: Laurent Vivier wrote: But if we didn't get an interrupt in that time? We can clear it a bit later, after local_irq_enable() in __vcpu_run(). However we need a nop instruction first because "sti" keeps interrupts disabled for one more instruct

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
Christian Borntraeger wrote: > Am Montag, 15. Oktober 2007 schrieb Laurent Vivier: >>> Any idea how to make this proper on all architectures? I will have a look. >> I think the solution is to have an arch dependent kvm_guest_exit(): empty for >> x86, clearing the bit for s390. > > I think we can m

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Christian Borntraeger
Am Montag, 15. Oktober 2007 schrieb Laurent Vivier: > > Any idea how to make this proper on all architectures? I will have a look. > > I think the solution is to have an arch dependent kvm_guest_exit(): empty for > x86, clearing the bit for s390. I think we can merge your patches, as the userspac

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
Avi Kivity wrote: > Laurent Vivier wrote: > > > >>> But if we didn't get an interrupt in that time? >>> >>> We can clear it a bit later, after local_irq_enable() in >>> __vcpu_run(). However we need a nop instruction first because "sti" >>> keeps interrupts >>> disabled for one more instruction

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Avi Kivity
Laurent Vivier wrote: But if we didn't get an interrupt in that time? We can clear it a bit later, after local_irq_enable() in __vcpu_run(). However we need a nop instruction first because "sti" keeps interrupts disabled for one more instruction. IMHO, I think it is better to let kv

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
Avi Kivity wrote: > Laurent Vivier wrote: >> Avi Kivity wrote: >> >>> Ingo Molnar wrote: >>> * Avi Kivity <[EMAIL PROTECTED]> wrote: > This bit can go; for the external module I can add it back in > external-module-compat.h. No need to pollute mainline wit

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
Christian Borntraeger wrote: > Am Montag, 15. Oktober 2007 schrieb Avi Kivity: >> We can clear it a bit later, after local_irq_enable() in __vcpu_run(). >> However we need a nop instruction first because "sti" keeps interrupts >> disabled for one more instruction. > > Ah, I see. The host interr

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Christian Borntraeger
Am Montag, 15. Oktober 2007 schrieb Avi Kivity: > We can clear it a bit later, after local_irq_enable() in __vcpu_run(). > However we need a nop instruction first because "sti" keeps interrupts > disabled for one more instruction. Ah, I see. The host interrupt behaves different and instead of

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Christian Borntraeger
forgot to CC everybody besides Laurent: Am Montag, 15. Oktober 2007 schrieben Sie: > No, It must not be cleared here because we can't enter in the accounting code > between kvm_guest_enter(void) and kvm_guest_exit(void). > > This is why the accounting code clears it. > > I put a kvm_guest_exit()

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Avi Kivity
Laurent Vivier wrote: Avi Kivity wrote: Ingo Molnar wrote: * Avi Kivity <[EMAIL PROTECTED]> wrote: This bit can go; for the external module I can add it back in external-module-compat.h. No need to pollute mainline with backward compatibility stuff. hm: stati

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Laurent Vivier
Avi Kivity wrote: > Ingo Molnar wrote: >> * Avi Kivity <[EMAIL PROTECTED]> wrote: >> >> >>> This bit can go; for the external module I can add it back in >>> external-module-compat.h. No need to pollute mainline with backward >>> compatibility stuff. >>> >> >> hm: >> >> static inline void k

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Avi Kivity
Ingo Molnar wrote: * Avi Kivity <[EMAIL PROTECTED]> wrote: This bit can go; for the external module I can add it back in external-module-compat.h. No need to pollute mainline with backward compatibility stuff. hm: static inline void kvm_guest_enter(void) { current->flags |=

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > This bit can go; for the external module I can add it back in > external-module-compat.h. No need to pollute mainline with backward > compatibility stuff. hm: static inline void kvm_guest_enter(void) { current->flags |= PF_VCPU; } static inl

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Avi Kivity
Ingo Molnar wrote: int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); +/* + * Compatibility define - PF_VCPU is only available in v2.6.24+ kernels: + */ +#ifndef PF_VCPU +# define PF_VCPU 0 +#endif + This bit can go; for the external module I can add it back in externa

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > Ingo Molnar wrote: > > int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); > > > >+/* > >+ * Compatibility define - PF_VCPU is only available in v2.6.24+ kernels: > >+ */ > >+#ifndef PF_VCPU > >+# define PF_VCPU0 > >+#endif > >+ > > > >

Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-10-15 Thread Ingo Molnar
* Laurent Vivier <[EMAIL PROTECTED]> wrote: > [PATCH 4/4] Modify KVM to update guest time accounting. FYI, KVM abstracted its guest-mode entry code recently so this did not apply - find below the reworked patch. Ingo ---> Subject: sched: guest CPU accounting: maintain

[RESEND 2][PATCH 4/4] Modify KVM to update guest time accounting.

2007-09-10 Thread Laurent Vivier
[PATCH 4/4] Modify KVM to update guest time accounting. Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]> -- - [EMAIL PROTECTED] -- "Software is hard" - Donald Knuth Index: linux-2.6/drivers/kvm/kvm.h ===