From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH kvm-unit-tests 3/3] x86/smp: use desc.c for setting up IPI handler Date: Tue, 6 Sep 2011 17:11:36 +0300 Message-ID: <1315318296-22815-4-git-send-email-avi@redhat.com> References: <1315318296-22815-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: Marcelo Tosatti , Lucas Meneghel Rodrigues Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754658Ab1IFOLk (ORCPT ); Tue, 6 Sep 2011 10:11:40 -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.14.4/8.14.4) with ESMTP id p86EBdhh025771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Sep 2011 10:11:39 -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 p86EBc1g017996 for ; Tue, 6 Sep 2011 10:11:39 -0400 In-Reply-To: <1315318296-22815-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This allows other callers to use desc.c without conflict. Fixes apic.flat failure with -smp 2. Signed-off-by: Avi Kivity --- lib/x86/smp.c | 23 ++--------------------- 1 files changed, 2 insertions(+), 21 deletions(-) diff --git a/lib/x86/smp.c b/lib/x86/smp.c index 0d8bae8..d4c8106 100644 --- a/lib/x86/smp.c +++ b/lib/x86/smp.c @@ -42,26 +42,6 @@ asm ( #endif ); - -static void set_ipi_descriptor(void (*ipi_entry)(void)) -{ - unsigned short *desc = (void *)(IPI_VECTOR * sizeof(long) * 2); - unsigned short cs; - unsigned long ipi = (unsigned long)ipi_entry; - - asm ("mov %%cs, %0" : "=r"(cs)); - desc[0] = ipi; - desc[1] = cs; - desc[2] = 0x8e00; - desc[3] = ipi >> 16; -#ifdef __x86_64__ - desc[4] = ipi >> 32; - desc[5] = ipi >> 48; - desc[6] = 0; - desc[7] = 0; -#endif -} - void spin_lock(struct spinlock *lock) { int v = 1; @@ -134,7 +114,8 @@ void smp_init(void) _cpu_count = fwcfg_get_nb_cpus(); - set_ipi_descriptor(ipi_entry); + setup_idt(); + set_idt_entry(IPI_VECTOR, ipi_entry, 0); setup_smp_id(0); for (i = 1; i < cpu_count(); ++i) -- 1.7.6.1