From: Avi Kivity Subject: [PATCH kvm-unit-tests 1/2] apic: use boot idt instead of a locally allocated idt Date: Mon, 1 Nov 2010 23:11:10 +0200 Message-ID: <1288645871-12016-2-git-send-email-avi@redhat.com> References: <1288645871-12016-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18670 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753696Ab0KAVLN (ORCPT ); Mon, 1 Nov 2010 17:11:13 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA1LBDvv002393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Nov 2010 17:11:13 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oA1LBCIe014181 for ; Mon, 1 Nov 2010 17:11:12 -0400 In-Reply-To: <1288645871-12016-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This allows the smp support, which uses the boot idt, to work. Signed-off-by: Avi Kivity --- x86/apic.c | 16 +--------------- 1 files changed, 1 insertions(+), 15 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index 48fa0f7..165f820 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -89,7 +89,7 @@ asm ( #endif ); -static idt_entry_t idt[256]; +static idt_entry_t *idt = 0; static int g_fail; static int g_tests; @@ -127,19 +127,6 @@ void test_enable_x2apic(void) } } -static void init_idt(void) -{ - struct { - u16 limit; - ulong idt; - } __attribute__((packed)) idt_ptr = { - sizeof(idt_entry_t) * 256 - 1, - (ulong)&idt, - }; - - asm volatile("lidt %0" : : "m"(idt_ptr)); -} - static void set_idt_entry(unsigned vec, void (*func)(isr_regs_t *regs)) { u8 *thunk = vmalloc(50); @@ -296,7 +283,6 @@ int main() mask_pic_interrupts(); enable_apic(); test_enable_x2apic(); - init_idt(); test_self_ipi(); -- 1.7.3.1