On Tue, 2006-08-22 at 15:02 -0700, Zachary Amsden wrote:
Well, I don't think anything is sufficient for a preemptible kernel. I think that's just plain not going to work. You could have a kernel thread that got preempted in a paravirt-op patch point
Patching over the 6 native cases is actually not that bad: they're
listed below (each one has trailing noops).
push %eax; popf
pushf; pop %eax
pushf; pop %eax; cli
If you're at the first insn you don't have to do anything, since you're
about to replace that code. If you're in the noops, you can just
advance EIP to the end. You can't be preempted between sti and sysexit,
since we only use that when interrupts are already disabled. And
reversing either "push %eax" or "pushf; pop %eax" is fairly easy.
Depending on your hypervisor, you might need to catch those threads who
are currently doing the paravirt_ops function calls, as well. This
introduces more (and more complex) cases.