Skip to contentSkip to conversation

fix userspace irqchip.

PATCH In review Glauber Costa 3 participants 4 messages Sep 3, 2009 – Sep 6, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix userspace irqchip.

It is broken since main loop reorganization. (6185d8b6)

Problem is that we, the emulator, has nothing to do with the CPU flags. has_work() should not depend on that at all.

---
 qemu-kvm-x86.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
qemu-kvm-x86.c +2 -3
index f80d82b..66ed6b5 100644
@@ -1393,9 +1393,8 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
 
 int kvm_arch_has_work(CPUState *env)
 {
-    if (((env->interrupt_request & CPU_INTERRUPT_HARD) &&
-	 (env->eflags & IF_MASK)) ||
-	(env->interrupt_request & CPU_INTERRUPT_NMI))
+    if (((env->interrupt_request & CPU_INTERRUPT_HARD) || 
+	(env->interrupt_request & CPU_INTERRUPT_NMI)))
 	return 1;
     return 0;
 }
Signature · 1 line
1.6.2.2
#1 lore raw
Quoted 2 lines · Glauber Costa

It is broken since main loop reorganization. (6185d8b6)

What is broken? Boots WindowsXp for me here.

Quoted 2 lines

Problem is that we, the emulator, has nothing to do with the CPU flags. has_work() should not depend on that at all.

IF_MASK flags is set into env->eflags on each exit by function just above kvm_arch_has_work() and contains valid and relevant information. The check your are removing should be there. It ensures that interrupts are ignored if they are blocked by vcpu.

Quoted 25 lines
---
 qemu-kvm-x86.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
qemu-kvm-x86.c +2 -3
index f80d82b..66ed6b5 100644
@@ -1393,9 +1393,8 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
 
 int kvm_arch_has_work(CPUState *env)
 {
-    if (((env->interrupt_request & CPU_INTERRUPT_HARD) &&
-	 (env->eflags & IF_MASK)) ||
-	(env->interrupt_request & CPU_INTERRUPT_NMI))
+    if (((env->interrupt_request & CPU_INTERRUPT_HARD) || 
+	(env->interrupt_request & CPU_INTERRUPT_NMI)))
 	return 1;
     return 0;
 }
Signature · 1 line
1.6.2.2

--
Gleb.

#2 lore raw
Quoted 4 lines · Gleb Natapov
Quoted 2 lines · Glauber Costa

It is broken since main loop reorganization. (6185d8b6)

What is broken? Boots WindowsXp for me here.

Fedora guests don't boot.

Quoted 40 lines
Quoted 2 lines

Problem is that we, the emulator, has nothing to do with the CPU flags. has_work() should not depend on that at all.

IF_MASK flags is set into env->eflags on each exit by function just above kvm_arch_has_work() and contains valid and relevant information. The check your are removing should be there. It ensures that interrupts are ignored if they are blocked by vcpu.

Quoted 24 lines

---
 qemu-kvm-x86.c |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
qemu-kvm-x86.c +2 -4
index f80d82b..66ed6b5 100644
@@ -1393,9 +1393,8 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
 
  int kvm_arch_has_work(CPUState *env)
  {
-    if (((env->interrupt_request & CPU_INTERRUPT_HARD) &&
-      (env->eflags & IF_MASK)) ||
-     (env->interrupt_request & CPU_INTERRUPT_NMI))
+    if (((env->interrupt_request & CPU_INTERRUPT_HARD) ||
+     (env->interrupt_request & CPU_INTERRUPT_NMI)))
       return 1;
      return 0;
  }
--
Quoted 1 line

1.6.2.2

--
                       Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
#3 lore raw
Quoted 8 lines · Glauber Costa
Quoted 4 lines · Gleb Natapov
Quoted 2 lines · Glauber Costa

It is broken since main loop reorganization. (6185d8b6)

What is broken? Boots WindowsXp for me here.

Fedora guests don't boot.

Which one? I tested F10 live cd and F11 beta (both 32 bit). They work fine here with userspace irq chip.

Quoted 32 lines
Quoted 32 lines
Quoted 2 lines

Problem is that we, the emulator, has nothing to do with the CPU flags. has_work() should not depend on that at all.

IF_MASK flags is set into env->eflags on each exit by function just above kvm_arch_has_work() and contains valid and relevant information. The check your are removing should be there. It ensures that interrupts are ignored if they are blocked by vcpu.

Quoted 25 lines

---
 qemu-kvm-x86.c |    5 ++---

 1 files changed, 2 insertions(+), 3 deletions(-)
qemu-kvm-x86.c +2 -4
index f80d82b..66ed6b5 100644
@@ -1393,9 +1393,8 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
 
  int kvm_arch_has_work(CPUState *env)
  {
-    if (((env->interrupt_request & CPU_INTERRUPT_HARD) &&
-      (env->eflags & IF_MASK)) ||
-     (env->interrupt_request & CPU_INTERRUPT_NMI))
+    if (((env->interrupt_request & CPU_INTERRUPT_HARD) ||
+     (env->interrupt_request & CPU_INTERRUPT_NMI)))
       return 1;
      return 0;
  }
--

1.6.2.2

Quoted 17 lines
Quoted 8 lines

--
                       Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."

--
Gleb.