mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Tejun Heo <htejun@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: unified percpu stuff
Date: Tue, 27 Jan 2009 00:57:57 -0500	[thread overview]
Message-ID: <73c1f2160901262157g3d281e62nb3ebafe01ab1dfe4@mail.gmail.com> (raw)
In-Reply-To: <497E5F76.10301@goop.org>

On Mon, Jan 26, 2009 at 8:12 PM, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> I'm really pleased to see the unified percpu stuff in the kernel, but
> unfortunately its breaking Xen at the moment.
> It looks like this is just a matter of initializing %gs properly in
> xen_start_kernel.  Is there any problem with me doing a load_gs_base(0)
> somewhere early in xen_start_kernel (arch/x86/xen/enlighten.c)?

Some of the changes I did made the assumption that the percpu state is
set up early in head_xx.S, which apparently is skipped for xen.  Is
there documentation anywhere for the xen bootstrap process?

Try this patch (untested):

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index bef941f..b90d061 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1647,6 +1647,8 @@ asmlinkage void __init xen_start_kernel(void)
 	have_vcpu_info_placement = 0;
 #endif

+	switch_to_new_gdt();
+
 	xen_smp_init();

 	/* Get mfn list */
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 7735e3d..00d9265 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -235,6 +235,8 @@ cpu_initialize_context(unsigned int cpu, struct
task_struct *idle)
 	ctxt->user_regs.ss = __KERNEL_DS;
 #ifdef CONFIG_X86_32
 	ctxt->user_regs.fs = __KERNEL_PERCPU;
+#else
+	ctxt->gs_base_kernel = per_cpu_offset(cpu);
 #endif
 	ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
 	ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */

--
Brian Gerst

  parent reply	other threads:[~2009-01-27  5:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27  1:12 Jeremy Fitzhardinge
2009-01-27  4:17 ` Tejun Heo
2009-01-29 10:43   ` Jeremy Fitzhardinge
2009-01-29 11:01     ` Tejun Heo
2009-01-29 13:43     ` [PATCH] x86: pass in cpu number to switch_to_new_gdt() Brian Gerst
2009-01-29 21:36       ` Jeremy Fitzhardinge
2009-01-29 21:36       ` [PATCH 1/2] x86: split loading percpu segments from loading gdt Jeremy Fitzhardinge
2009-01-29 21:36       ` [PATCH 2/2] xen: setup percpu data pointers Jeremy Fitzhardinge
2009-01-30  8:50         ` Tejun Heo
2009-01-30  8:50       ` [PATCH] x86: pass in cpu number to switch_to_new_gdt() Tejun Heo
2009-01-27  5:57 ` Brian Gerst [this message]
2009-01-27  7:24   ` unified percpu stuff Jeremy Fitzhardinge
2009-01-27 12:35     ` Brian Gerst
2009-01-27 17:50       ` Jeremy Fitzhardinge
2009-01-27 19:07         ` Brian Gerst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73c1f2160901262157g3d281e62nb3ebafe01ab1dfe4@mail.gmail.com \
    --to=brgerst@gmail.com \
    --cc=htejun@gmail.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®