Marcelo Tosatti wrote:
On Fri, Apr 11, 2008 at 03:18:19PM +0300, Avi Kivity wrote:
kvm_vcpu_kick() can be called from nonatomic contexts, so the vcpu-cpu
== cpu check is dangerous (and will warn on preemptible kernels, no?)
Doh, right. How's this.
---
KVM: fix
Avi Kivity wrote:
@@ -3944,11 +3950,13 @@ static void vcpu_kick_intr(void *info)
void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
{
int ipi_pcpu = vcpu-cpu;
+int cpu = get_cpu();
if (waitqueue_active(vcpu-wq)) {
wake_up_interruptible(vcpu-wq);
Avi Kivity wrote:
Avi Kivity wrote:
@@ -3944,11 +3950,13 @@ static void vcpu_kick_intr(void *info)
void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
{
int ipi_pcpu = vcpu-cpu;
+int cpu = get_cpu();
if (waitqueue_active(vcpu-wq)) {
wake_up_interruptible(vcpu-wq);
Marcelo Tosatti wrote:
There is a window open between testing of pending IRQ's
and assignment of guest_mode in __vcpu_run.
Injection of IRQ's can race with __vcpu_run as follows:
CPU0CPU1
kvm_x86_ops-run()
vcpu-guest_mode = 0SET_IRQ_LINE
There is a window open between testing of pending IRQ's
and assignment of guest_mode in __vcpu_run.
Injection of IRQ's can race with __vcpu_run as follows:
CPU0CPU1
kvm_x86_ops-run()
vcpu-guest_mode = 0SET_IRQ_LINE ioctl
..