public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] Make kvm sleep if eflag is unset
@ 2007-10-24 16:10 Dor Laor
       [not found] ` <471F6E83.7000404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Dor Laor @ 2007-10-24 16:10 UTC (permalink / raw)
  To: kvm-devel

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

[PATCH] Make kvm Sleep if eflag is unset.

The main loop checks whether a sleep is needed (kvm_main_loop_wait).
If there is a need to sleep it polls 10msec for signals and
select input from the devices.
Otherwise it enters guest mode.

In case halt is on and there is pending irq we should also
check if the eflags in set or not.
This fixes spinning on the boot loader when the disk is damanged.

Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 qemu/qemu-kvm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index d857d1c..a0eb43f 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -563,7 +563,8 @@ static int has_work(CPUState *env)
 	return 0;
     if (!(env->hflags & HF_HALTED_MASK))
 	return 1;
-    if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT))
+    if ((env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT)) &&
+	(env->eflags & IF_MASK))
 	return 1;
     return 0;
 }
-- 
1.5.2.2


[-- Attachment #2: 0001-Make-kvm-Sleep-if-eflag-is-unset.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

>From 6daaaada124fde03b253161f2a9a647fde6f1a86 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date: Wed, 24 Oct 2007 17:03:44 +0200
Subject: [PATCH] Make kvm Sleep if eflag is unset.

The main loop checks whether a sleep is needed (kvm_main_loop_wait).
If there is a need to sleep it polls 10msec for signals and
select input from the devices.
Otherwise it enters guest mode.

In case halt is on and there is pending irq we should also
check if the eflags in set or not.
This fixes spinning on the boot loader when the disk is damanged.

Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 qemu/qemu-kvm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index d857d1c..a0eb43f 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -563,7 +563,8 @@ static int has_work(CPUState *env)
 	return 0;
     if (!(env->hflags & HF_HALTED_MASK))
 	return 1;
-    if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT))
+    if ((env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT)) &&
+	(env->eflags & IF_MASK))
 	return 1;
     return 0;
 }
-- 
1.5.2.2


[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] Make kvm sleep if eflag is unset
       [not found] ` <471F6E83.7000404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-10-25 18:16   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-10-25 18:16 UTC (permalink / raw)
  To: dor.laor-atKUWr5tajBWk0Htik3J/w; +Cc: kvm-devel

Dor Laor wrote:
> [PATCH] Make kvm Sleep if eflag is unset.
>
> The main loop checks whether a sleep is needed (kvm_main_loop_wait).
> If there is a need to sleep it polls 10msec for signals and
> select input from the devices.
> Otherwise it enters guest mode.
>
> In case halt is on and there is pending irq we should also
> check if the eflags in set or not.
> This fixes spinning on the boot loader when the disk is damanged.
>

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-25 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 16:10 [Patch] Make kvm sleep if eflag is unset Dor Laor
     [not found] ` <471F6E83.7000404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-25 18:16   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox