From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH kvm-unit-tests] x86: ioapic: add tests around retriggering of level interrupts Date: Thu, 30 Jul 2015 09:13:51 +0200 Message-ID: <55B9CEAF.5040100@redhat.com> References: <1438176493-26033-1-git-send-email-pbonzini@redhat.com> <20150730031448.GB15229@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Steve Rutherford Return-path: Received: from mail-wi0-f171.google.com ([209.85.212.171]:34308 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbbG3HNy (ORCPT ); Thu, 30 Jul 2015 03:13:54 -0400 Received: by wibud3 with SMTP id ud3so8901570wib.1 for ; Thu, 30 Jul 2015 00:13:53 -0700 (PDT) In-Reply-To: <20150730031448.GB15229@google.com> Sender: kvm-owner@vger.kernel.org List-ID: On 30/07/2015 05:14, Steve Rutherford wrote: >> > +static void test_ioapic_level_retrigger(void) >> > +{ >> > + handle_irq(0x9a, ioapic_isr_9a); >> > + set_ioapic_redir(0x0e, 0x9a, LEVEL_TRIGGERED); >> > + >> > + asm volatile ("cli"); >> > + set_irq_line(0x0e, 1); >> > + while (g_isr_9a != 2) >> > + asm volatile ("sti; hlt; cli"); > This seems sketchy. The test should be able to exit this and fail. You're right, this shouldn't take more than 10-15 iterations of the while loop. Paolo