From patchwork Wed Sep 16 09:25:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 47883 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8G9Qhgs009669 for ; Wed, 16 Sep 2009 09:26:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758301AbZIPJ0h (ORCPT ); Wed, 16 Sep 2009 05:26:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932096AbZIPJ0g (ORCPT ); Wed, 16 Sep 2009 05:26:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758281AbZIPJ0L (ORCPT ); Wed, 16 Sep 2009 05:26:11 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8G9QE2Y007976 for ; Wed, 16 Sep 2009 05:26:14 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8G9QDdi011880; Wed, 16 Sep 2009 05:26:14 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 46C2F25005B; Wed, 16 Sep 2009 12:26:11 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti Cc: kvm@vger.kernel.org Subject: [PATCH QEMU-KVM 14/34] test: Mask PIC interrupts before APIC test Date: Wed, 16 Sep 2009 12:25:49 +0300 Message-Id: <1253093169-1423-15-git-send-email-avi@redhat.com> In-Reply-To: <1253093169-1423-1-git-send-email-avi@redhat.com> References: <1253093169-1423-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We aren't ready to handle PIC interrupts, so mask them. Signed-off-by: Avi Kivity --- kvm/user/test/x86/apic.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c index 7794615..b712ef8 100644 --- a/kvm/user/test/x86/apic.c +++ b/kvm/user/test/x86/apic.c @@ -102,6 +102,11 @@ static idt_entry_t idt[256]; static int g_fail; static int g_tests; +static void outb(unsigned char data, unsigned short port) +{ + asm volatile ("out %0, %1" : : "a"(data), "d"(port)); +} + static void report(const char *msg, int pass) { ++g_tests; @@ -325,9 +330,16 @@ static void test_ioapic_simultaneous(void) static void enable_apic(void) { + printf("enabling apic\n"); apic_write(0xf0, 0x1ff); /* spurious vector register */ } +static void mask_pic_interrupts(void) +{ + outb(0xff, 0x21); + outb(0xff, 0xa1); +} + int main() { setup_vm(); @@ -337,6 +349,7 @@ int main() test_lapic_existence(); + mask_pic_interrupts(); enable_apic(); init_idt();