All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Lacombe <goretux@gmail.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [x86] fs, gs purpose & multicore prog
Date: Sat, 6 Sep 2008 01:09:52 +0200	[thread overview]
Message-ID: <200809060109.52419.goretux@gmail.com> (raw)
In-Reply-To: <48C1477B.6060500@goop.org>

Thanks again ;)

On Vendredi 05 Septembre 2008 16:51:39 Jeremy Fitzhardinge wrote:
> Eric Lacombe wrote:
[...]
> >>> - What is the purpose of MSR_FS_BASE and MSR_GS_BASE ?
> >>> (I thought they were filled with "gdt[fs_entry].base")
> >>
> >> On 64-bit, the GDT isn't large enough to hold a 64-bit offset, so it
> >> only stores the low 32-bits.  When you load a segment register with a
> >> selector, it picks up from the gdt.  If you want a full 64-bit offset,
> >> you need to write it to the msr.
> >
> > Ok, I just saw that a 64-bit base in segment descriptor is only available
> > for the system descriptor.
>
> Yes, the IDT has double-wide entries to fit 64-bit values, but they
> didn't extend that to the GDT.  Or something - I last looked at this a
> couple of months ago, and it never sticks in my brain for long.

It seems, there also are the TSS and LDT.

>
> > Ok, but how does the kernel technically run tasks on different processor
> > (or core)? My question was ambiguous, I was not assuming that I knew how
> > multiprocessor works.
>
> That's a very broad question.  A good proportion of the core kernel code
> is dedicated to doing just that.  Very roughly, at boot time it brings
> up all the cpus, and they more or less run independently each looking
> for work to do in the form of processes waiting to run on the run
> queue.  They collectively run the scheduler algorithms to work out who
> runs what when; almost everything run in the kernel is a task - both
> usermode processes and kernel threads.  Except for the stuff which isn't.

I know these things ;) but what I wanted to know is the "x86 architectural 
details". In fact, I saw that during the machine init the BIOS select a cpu on 
the bus to be the BSP (bootstrap proc). The others are then the APs (Appli 
proc). Then the kernel runs on the BSP. What I wonder is how the kernel gives 
execution flow to the APs.

Thanks.

	Eric

>
>     J


  reply	other threads:[~2008-09-05 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03  9:09 [x86] fs, gs purpose & multicore prog Eric Lacombe
2008-09-04 16:49 ` Jeremy Fitzhardinge
2008-09-05 11:17   ` Eric Lacombe
2008-09-05 14:51     ` Jeremy Fitzhardinge
2008-09-05 23:09       ` Eric Lacombe [this message]
2008-09-06  5:38         ` Jeremy Fitzhardinge

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=200809060109.52419.goretux@gmail.com \
    --to=goretux@gmail.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.