From patchwork Tue Sep 6 14:11:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1126472 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p86EBlV6007108 for ; Tue, 6 Sep 2011 14:11:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754680Ab1IFOLq (ORCPT ); Tue, 6 Sep 2011 10:11:46 -0400 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 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 8509E250B5A; Tue, 6 Sep 2011 17:11:38 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti , Lucas Meneghel Rodrigues Cc: kvm@vger.kernel.org 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> In-Reply-To: <1315318296-22815-1-git-send-email-avi@redhat.com> References: <1315318296-22815-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 06 Sep 2011 14:11:48 +0000 (UTC) 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)