From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM-USER: Fix for CPU interrupts in QEMU Date: Sun, 15 Jul 2007 10:39:24 +0300 Message-ID: <4699CF2C.1060702@qumranet.com> References: <20070712151200.7060.91407.stgit@ghaskins-t60p.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Gregory Haskins Return-path: In-Reply-To: <20070712151200.7060.91407.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Gregory Haskins wrote: > QEMU-KVM has a bug where the interruptibility of the CPU is predicated on > pending interrupts. If the reason that a CPU is interrupted is because we > need to inject interrupts, the current code will just keep looping and miss > the event window. > > This doesnt seem to cause problems with in-trunk KVM. However, once we turn > on in-kernel HALTING, QEMU starts to have some serious problems that were > attributed to this bug. > > Signed-off-by: Gregory Haskins > --- > > qemu/qemu-kvm.c | 5 +---- > 1 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c > index 1849997..5b5c739 100644 > --- a/qemu/qemu-kvm.c > +++ b/qemu/qemu-kvm.c > @@ -452,11 +452,8 @@ void kvm_save_registers(CPUState *env) > int kvm_cpu_exec(CPUState *env) > { > int r; > - int pending = (!env->ready_for_interrupt_injection || > - ((env->interrupt_request & CPU_INTERRUPT_HARD) && > - (env->eflags & IF_MASK))); > > - if (!pending && (env->interrupt_request & CPU_INTERRUPT_EXIT)) { > + if (env->interrupt_request & CPU_INTERRUPT_EXIT) { > env->interrupt_request &= ~CPU_INTERRUPT_EXIT; > env->exception_index = EXCP_INTERRUPT; > cpu_loop_exit(); > > When applied to current HEAD, this doesn't work. Booting windows or Linux, quite soon during boot everything freezes. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/