kvm freeze with ipipe patch for kernel 3.x
I'm using an XP guest with qemu+kvm (vmx) on linux host (kernel 3.2.21 + ipipe patch + xenomai version 2.6.2.1) and I'm experiencing many system freezes when the vm is active.
I think then problem is in the 3.x (3.2,3.4,3.5) ipipe patch (ipipe-core-3.2.21-x86-5.patch):
:
arch/x86/kvm/x86.c +0 -0
....
@@ -5749,13 +5795,11 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) */
smp_mb();
- local_irq_disable();
-
if (vcpu->mode == EXITING_GUEST_MODE || vcpu->requests || need_resched() || signal_pending(current)) { vcpu->mode = OUTSIDE_GUEST_MODE; smp_wmb();
- local_irq_enable();
+ hard_cond_local_irq_enable(); preempt_enable(); kvm_x86_ops->cancel_injection(vcpu);
r = 1;
....
local_irq_enable() should be enabled after hard_cond_local_irq_enable (as in the 2.6.38 patch), in this way:
...
- local_irq_disable();
-
if (vcpu->mode == EXITING_GUEST_MODE || vcpu->requests || need_resched() || signal_pending(current)) { vcpu->mode = OUTSIDE_GUEST_MODE; smp_wmb();
+ hard_cond_local_irq_enable(); local_irq_enable();
preempt_enable();
....
I've done some tests and now the system runs fine.
Gabriele Moabiti
Quoted 50 lines · Gabriele Moabiti
I'm using an XP guest with qemu+kvm (vmx) on linux host (kernel 3.2.21 + ipipe patch + xenomai version 2.6.2.1) and I'm experiencing many system freezes when the vm is active.
I think then problem is in the 3.x (3.2,3.4,3.5) ipipe patch (ipipe-core-3.2.21-x86-5.patch)::
arch/x86/kvm/x86.c +1
-3@@ -5749,13 +5795,11 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)*/ smp_mb (); -local_irq_disable (); -if (vcpu->mode ==EXITING_GUEST_MODE || vcpu->requests ||need_resched () ||signal_pending (current)) { vcpu->mode =OUTSIDE_GUEST_MODE ;smp_wmb (); -local_irq_enable (); +hard_cond_local_irq_enable ();preempt_enable (); kvm_x86_ops->cancel_injection (vcpu); r =1 ;
local_irq_enable()should be enabled afterhard_cond_local_irq_enable(as in the 2.6.38 patch), in this way:...
arch/x86/kvm/x86.c +1
-2-local_irq_disable (); -if (vcpu->mode ==EXITING_GUEST_MODE || vcpu->requests ||need_resched () ||signal_pending (current)) { vcpu->mode =OUTSIDE_GUEST_MODE ;smp_wmb (); +hard_cond_local_irq_enable ();local_irq_enable ();preempt_enable ();
Quoted 1 line
I've done some tests and now the system runs fine.
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.
Would be great if you could give it try and report remaining issues.
Jan
[1]
http://git.xenomai.org/?p=ipipe-jki.git;a=shortlog;h=refs/heads/for-upstream/3.5
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.
Not true, just git:// is broken, http:// works, and I was able to push a first update for 3.5. 3.8 will follow later.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.
Does this and other important patches will be backported to 3.2?
Thank you
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130302/28533282/attachment.pgp>
Quoted 13 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
Quoted 7 lines
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Signature · 1 line
Gilles.
Quoted 20 lines · Gilles Chanteperdrix
Quoted 18 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Quoted 8 lines
Quoted 2 lines
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches but testing all the stuff in all necessary combinations. For me it really makes no sense to have n different legacy versions supported if we want to make progress. However, if someone feels like doing serious stable maintenance of I-pipe patches beyond "1 stable, 1 development head", that would surely be welcome.
BTW, 3.4 is also LTS, and there we have those fixes at least (just not yet pulled into the mainline).
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130302/2a549455/attachment.pgp>
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Quoted 6 lines
Quoted 4 lines
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 2 lines
but testing all the stuff
in all necessary combinations.
I can test 4 combinations at once: i686 UP, i686 SMP and x86_64 (UP or SMP), this leaves only one combination to test.
Quoted 2 lines
BTW, 3.4 is also LTS, and there we have those fixes at least (just not yet pulled into the mainline).
Are you sure you have not missed any patches for 3.4?
Signature · 1 line
Gilles.
Quoted 38 lines · Gilles Chanteperdrix
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Quoted 6 lines
Quoted 4 lines
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 6 lines
Quoted 2 lines
but testing all the stuff
in all necessary combinations.I can test 4 combinations at once: i686 UP, i686 SMP and
x86_64(UP or SMP), this leaves only one combination to test.
That's a small subset of the relevant variation. They come with enabling different config options or using certain features. Do you have a test setup for KVM on I-pipe e.g.? I'm not saying we catch them all with the development head, but adding more versions to the test matrix doesn't make it better.
Quoted 6 lines
Quoted 3 lines
BTW, 3.4 is also LTS, and there we have those fixes at least (just not yet pulled into the mainline).
Are you sure you have not missed any patches for 3.4?
I was sure regarding important patches by the time I sent the pull. Didn't check again since then.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130302/cd244cda/attachment.pgp>
Quoted 43 lines · Jan Kiszka
Quoted 42 lines · Gilles Chanteperdrix
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Quoted 6 lines
Quoted 4 lines
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 2 lines
but testing all the stuff
in all necessary combinations.
Quoted 8 lines
Quoted 2 lines
I can test 4 combinations at once: i686 UP, i686 SMP and
x86_64(UP or SMP), this leaves only one combination to test.That's a small subset of the relevant variation. They come with enabling different config options or using certain features. Do you have a test setup for KVM on I-pipe e.g.? I'm not saying we catch them all with the development head, but adding more versions to the test matrix doesn't make it better.
I man 3, not 4 combinations. Anyway, I naïvely test with only one .config, which recently switched from embedded like minimal kernel to debian like config. Do you have a list of the options combinations which necessitate separate tests?
Signature · 1 line
Gilles.
Quoted 55 lines · Gilles Chanteperdrix
Quoted 43 lines · Jan Kiszka
Quoted 42 lines · Gilles Chanteperdrix
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Quoted 6 lines
Quoted 4 lines
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 2 lines
but testing all the stuff
in all necessary combinations.Quoted 8 lines
Quoted 2 lines
I can test 4 combinations at once: i686 UP, i686 SMP and
x86_64(UP or SMP), this leaves only one combination to test.That's a small subset of the relevant variation. They come with enabling different config options or using certain features. Do you have a test setup for KVM on I-pipe e.g.? I'm not saying we catch them all with the development head, but adding more versions to the test matrix doesn't make it better.
Quoted 4 lines
I man 3, not 4 combinations. Anyway, I naïvely test with only one .config, which recently switched from embedded like minimal kernel to debian like config. Do you have a list of the options combinations which necessitate separate tests?
I-pipe/Xenomai on/off, TSC/APIC on/off, instrumentations and tracers should be on for correctness checks, but not when comparing benchmark numbers. I'm not sure about CONFIG_PREEMPT on/off. Long-term, we will also have to test IPIPE_LEGACY on/off.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130303/f1500acd/attachment.pgp>
Quoted 56 lines · Jan Kiszka
Quoted 55 lines · Gilles Chanteperdrix
Quoted 51 lines · Jan Kiszka
Quoted 38 lines · Gilles Chanteperdrix
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 11 lines · Gabriele Moabiti
----- Messaggio originale -----
Da: Jan Kiszka <[email protected]>
Quoted 3 lines · Jan Kiszka
There is more broken, even in latest stable 3.5.7. See the patches at
[1] for a tested version. Unfortunately, I cannot update my tree for 3.8 ATM as git services seem to be down on xenomai.org.Does this and other important patches will be backported to 3.2?
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Quoted 6 lines
Quoted 4 lines
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 6 lines
Quoted 2 lines
but testing all the stuff
in all necessary combinations.I can test 4 combinations at once: i686 UP, i686 SMP and
x86_64(UP or SMP), this leaves only one combination to test.That's a small subset of the relevant variation. They come with enabling different config options or using certain features. Do you have a test setup for KVM on I-pipe e.g.? I'm not saying we catch them all with the development head, but adding more versions to the test matrix doesn't make it better.
Quoted 6 lines
Quoted 4 lines
I man 3, not 4 combinations. Anyway, I naïvely test with only one .config, which recently switched from embedded like minimal kernel to debian like config. Do you have a list of the options combinations which necessitate separate tests?
I-pipe/Xenomai on/off,
That is 3 cases. But we can not really run xeno-regression-test with Xenomai off. So, maybe a build-test for CONFIG_IPIPE alone and CONFIG_IPIPE off would be enough?
Quoted 1 line
TSC/APIC on/off,
I do not think it really matters with TSC/APIC off. We have much worse latencies with TSC off, due to the fact that we read the TSC often, especially with stats enabled, and nobody complained (more exactly, some people complained a long time ago, then discovered they had a tsc, enabled it, then stopped complaining). The point is, if nobody noticed it, it probably means that nobody uses it.
Quoted 3 lines
instrumentations and tracers
should be on for correctness checks, but not when comparing benchmark numbers.
It means we have to run xeno-regression-test with instrumentation on Then xeno-test without instrumentation.
Quoted 1 line
I'm not sure about
CONFIG_PREEMPTon/off.
I routinely use CONFIG_PREEMPT off on ARM, to achieve the best latencies, but since it involves code in assembly, it has to be tested, on each platform.
I also noticed that turning off CONFIG_HIGH_RES reduces latencies, and it certainly involves different code paths in the I-pipe.
Quoted 2 lines
Long-term, we will
also have to testIPIPE_LEGACYon/off.
At this point we do not really care to test anything else than the latest patch on -forge, or we do?
Signature · 1 line
Gilles.
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
Quoted 9 lines
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Again, the problem is not writing the patches
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 2 lines
but testing all the stuff
in all necessary combinations.
So.. does 3.2 or 3.4 (at least an LTS kernel) will be supported or it's better to use only the 3.5.7 (EOL)? I think if a kernel patch has serious problems should be marked as broken or unstable.
Quoted 19 lines · Gabriele Moabiti
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
I'm planning to get them merged into 3.8 first of all, maybe also into 3.5 (as this is our current production baseline). No plans exist beyond that. I'd rather like to leave older kernels alone to reduce maintenance efforts (porting is simple, proper testing takes time).
Quoted 8 lines
Quoted 2 lines
Also note that 3.2 is lacking much more critical fixes than those few around KVM. IOW: Don't use it for anything serious with x86.
Maybe reverting the mprotect/ipipe_pin_vma patches in the 3.2 branch, so as to avoid the zero page corruption, but take some faults sometimes would be a simple, feasible solution? 3.2 seems to have been chosen as a long term stable branch.
Again, the problem is not writing the patches
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
It is easy to forget a patch when (back)porting patches from an I-pipe to the other.
Quoted 2 lines
but testing all the stuff
in all necessary combinations.So.. does 3.2 or 3.4 (at least an LTS kernel) will be supported or it's better to use only the 3.5.7 (EOL)?
For the time being and as you depend on KVM, use my queues/core-3.5 branch.
Quoted 1 line
I think if a kernel patch has serious problems should be marked as broken or unstable.
I agree, and I already requested to remove patches from the Xenomai code base at least that contain known bugs. Should improve over the next releases.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux