From patchwork Mon Sep 21 08:55:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 49008 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 n8L8tk2e027893 for ; Mon, 21 Sep 2009 08:55:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755464AbZIUIzk (ORCPT ); Mon, 21 Sep 2009 04:55:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755463AbZIUIzj (ORCPT ); Mon, 21 Sep 2009 04:55:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51983 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755399AbZIUIzh (ORCPT ); Mon, 21 Sep 2009 04:55:37 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8tfTe025934 for ; Mon, 21 Sep 2009 04:55:41 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8tdi8002138; Mon, 21 Sep 2009 04:55:40 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id C559825004E; Mon, 21 Sep 2009 11:55:38 +0300 (IDT) From: Avi Kivity To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [PATCH QEMU-KVM 2/7] test: set up per-cpu area Date: Mon, 21 Sep 2009 11:55:33 +0300 Message-Id: <1253523338-22784-3-git-send-email-avi@redhat.com> In-Reply-To: <1253523338-22784-1-git-send-email-avi@redhat.com> References: <1253523338-22784-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Currently sharing space with the stack. Signed-off-by: Avi Kivity --- kvm/user/test/x86/cstart64.S | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index e5554ba..f1a9d09 100644 --- a/kvm/user/test/x86/cstart64.S +++ b/kvm/user/test/x86/cstart64.S @@ -80,9 +80,19 @@ mb_flags = 0x0 # multiboot header .long mb_magic, mb_flags, 0 - (mb_magic + mb_flags) +MSR_GS_BASE = 0xc0000101 + +.macro setup_percpu_area + lea -4096(%esp), %eax + mov $0, %edx + mov $MSR_GS_BASE, %ecx + wrmsr +.endm + .globl start start: mov $stacktop, %esp + setup_percpu_area call prepare_64 jmpl $8, $start64 @@ -142,6 +152,7 @@ ap_start32: mov %ax, %ss mov $-4096, %esp lock/xaddl %esp, smp_stacktop + setup_percpu_area call prepare_64 ljmpl $8, $ap_start64