From: Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [Patch] Make kvm sleep if eflag is unset
Date: Wed, 24 Oct 2007 18:10:43 +0200 [thread overview]
Message-ID: <471F6E83.7000404@qumranet.com> (raw)
[-- 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
next reply other threads:[~2007-10-24 16:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 16:10 Dor Laor [this message]
[not found] ` <471F6E83.7000404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-25 18:16 ` [Patch] Make kvm sleep if eflag is unset Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=471F6E83.7000404@qumranet.com \
--to=dor.laor-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox