Re: [PATCH] KVM breaks CPU hotplug

Avi Kivity
2007-03-27T06:38:40Z

Li, Shaohua wrote:
> How about take cpu hotplug lock for kvm_vm_ioctl and kvm_vcpu_ioctl?
>
>

That will serialize calls to these functions, and we want parallel
execution of kvm_vcpu_ioctl(). We could make it a reader-writer lock,
but...

I think that adding a

raw_notifier_call_chain(&cpu_chain, CPU_DYING, NULL);

in take_cpu_down() solve the problem. The semantics of that would be
that the chain is executed on the dying cpu, without being allowed to
fail, and requiring atomic execution. I don't know whether that would
acceptable to the cpu hotplug maintainers.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.