RE: kernel trap 19 with interrupts disabled

From: Bruce Evans <bde_at_zeta.org.au>
Date: Fri, 11 Jun 2004 05:22:00 +1000 (EST)
On Thu, 10 Jun 2004, Don Bowman wrote:

> Out of curiousity, why not use something like this, so the
> timeout is fixed in time, rather than a #? I used the tsc here.
>
> static int
> my_stop_cpus(u_int map)
> {
>     unsigned long long end_ts = rdtsc() +
>                                 1ULL * tsc_freq;
>     /* send the Xcpustop IPI to all CPUs in map */
>     selected_apic_ipi(map, XCPUSTOP_OFFSET, APIC_DELMODE_FIXED);
>     while ((stopped_cpus & map) != map)
>     {
>        /* Wait 1 second */
>        if ( rdtsc() > end_ts )
>            return 0;
>     }
>     return 1;
> }

I just copied stop_cpus().  rdtsc() and microtime() can't be used
there, and neither can DELAY() if we call stop_cpus() from ddb (which
we do), since some versions of DELAY() use locks and ddb can't use any
public locks since it weould deadlock if it was trapped to from code
that holds a lock that ddb wants to use.

Bruce
Received on Thu Jun 10 2004 - 17:22:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:56 UTC