aboutsummaryrefslogtreecommitdiff
path: root/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-09-16 12:25:49 +0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-09-16 16:00:46 -0300
commit371b2750a5efb68a80265bba700fb0750fca837d (patch)
treeeabe1cccacf9a7b2467d82facdc55a0cda8adb8b /kvm
parenttest: add cr8 latency tests (diff)
downloadqemu-kvm-371b2750a5efb68a80265bba700fb0750fca837d.tar.gz
qemu-kvm-371b2750a5efb68a80265bba700fb0750fca837d.tar.bz2
qemu-kvm-371b2750a5efb68a80265bba700fb0750fca837d.zip
test: Mask PIC interrupts before APIC test
We aren't ready to handle PIC interrupts, so mask them. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm')
-rw-r--r--kvm/user/test/x86/apic.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c
index 77946159d..b712ef8d6 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();