Re: why is trampoline.S code copied for each cpu?

From: Philipp Rumpf (prumpf@uzix.org)
Date: Wed Jul 12 2000 - 10:29:28 EST


On Wed, Jul 12, 2000 at 10:05:03AM -0500, James Bottomley wrote:
> > So I looked in trampoline.S and discovered the answer to this
> > question - because each instance writes some magic number a5a5a5a5 to
> > its code. Ok, so then the answer becomes - why does it do that?
>
> If you look lower down in do_boot_cpu(), this is used as a diagnosis of a boot
> failure (the check at phys_to_virt(8192)). If we don't find the signature, we
> know the CPU failed to start, if we do find it, we know it started but got
> stuck somewhere after the switch to protected mode.

No. phys_to_virt(8192) != trampoline_base, at least in the general case.

It really looks like the code in smpboot.c is out of date to me.

> In the latter case, the CPU could happily have trashed the trampoline code
> before disappearing off into hyperspace, so it makes sense to set it up anew
> each time.

This doesn't seem to happen in practice. If it does, we probably want to
panic() anyway - we now have a random CPU executing random code but not
behaving as expected.

        Philipp Rumpf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:14 EST