Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 2002 18:05:53 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Jonathan R Feldkamp <jrf4772@ksu.edu>
Cc:        smp@freebsd.org, jhb@freebsd.org
Subject:   Re: For those with P4 SMP problems..
Message-ID:  <3D8BC5F1.EF365A5@mindspring.com>
References:  <Pine.GSO.4.33L.0209201822240.1440-100000@unix1.cc.ksu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Jonathan R Feldkamp wrote:
> Ok, my start_ap(...) as it is right now is at the bottom of this file.
> 
> I have added to what beemern's work. I set both the physical_cpu and the
> logical_cpu from 1 to 8, if you think it is necessary i'll go clear up to
> 15.  I added a little debugging around the RESETs and STARTUPs just to
> see it, and increased the timeout from 5 seconds to 10 seconds.  All of
> this had basically no effect.  start_ap(...) is always returning 0 because
> mp_ncpus is never being incremented.
> 
> So, the CPU is never being started right?  I take it an interrupt of some
> kind is supposed increment mp_ncpus?  I greped through all of the code in
> /sys/ but couldn't find where it was supposed to happen at.
> 
> What do you think is going on?

He already said: the real CPU IDs don't match the APIC IDs from
the BIOS.

My guess as to why the other systems work is that they start the
CPUs in parallel, which basically means that there are matching
CPUs started at the time of the check, but that the ones which
match are not the ones which were started.

If the APIC ID isn't used again, you could make this "work" by
changing the code that calls start_ap() seperate it into a
"start_ap()" and a "check_ap()", and then:

	for( i = 0; i < NCPU; i++) {
		try |= 1<<i;
		start_ap(i, ...);
	}

    /* wait for it to start */
    set_apic_timer(10000000);/* == *up to* 10 seconds */
    while (read_apic_timer()) {	/* wait for them to start */
	if ((did & try) == try) {
		/* blah blah blah SUCCESS */
		goto go_on_with_life;
	}
    }

    /* blah blah blah FAILED */

    go_on_with_life:

For extra points, you could have each CPU record its real APIC ID
into the array, so more things will work later on.


-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D8BC5F1.EF365A5>