PERFORCE change 94570 for review
Kip Macy
kmacy at FreeBSD.org
Tue Apr 4 01:07:04 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94570
Change 94570 by kmacy at kmacy_storage:sun4v_rwbuf on 2006/04/04 01:06:54
fix MP intrq initialization
Affected files ...
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/conf/GENERIC#9 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/intr_machdep.c#6 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/mp_locore.S#3 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/mp_machdep.c#3 edit
Differences ...
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/conf/GENERIC#9 (text+ko) ====
@@ -71,7 +71,7 @@
#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
# To make an SMP kernel, the next line is needed
-#options SMP # Symmetric MultiProcessor Kernel
+options SMP # Symmetric MultiProcessor Kernel
# Standard busses
device pci
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/intr_machdep.c#6 (text+ko) ====
@@ -417,34 +417,31 @@
uint64_t error;
- pcpup->pc_mondo_data = mondo_data_array + curcpu*INTR_REPORT_SIZE;
+ pcpup->pc_mondo_data = (vm_offset_t *) ((char *)mondo_data_array + curcpu*INTR_REPORT_SIZE);
pcpup->pc_mondo_data_ra = vtophys(pcpup->pc_mondo_data);
-
- pcpup->pc_cpu_list = cpu_list_array + curcpu*cpu_list_size;
- pcpup->pc_cpu_list_ra = vtophys(pcpup->pc_cpu_list);
-
- pcpup->pc_cpu_q = cpu_q_array + curcpu*INTR_CPU_Q_SIZE;
+ pcpup->pc_cpu_q = (vm_offset_t *)((char *)cpu_q_array + curcpu*INTR_CPU_Q_SIZE);
pcpup->pc_cpu_q_ra = vtophys(pcpup->pc_cpu_q);
pcpup->pc_cpu_q_size = INTR_CPU_Q_SIZE;
- pcpup->pc_dev_q = dev_q_array + curcpu*INTR_DEV_Q_SIZE;
+ pcpup->pc_dev_q = (vm_offset_t *)((char *)dev_q_array + curcpu*INTR_DEV_Q_SIZE);
pcpup->pc_dev_q_ra = vtophys(pcpup->pc_dev_q);
pcpup->pc_dev_q_size = INTR_DEV_Q_SIZE;
- pcpup->pc_rq = rq_array + curcpu*2*CPU_RQ_SIZE;
+ pcpup->pc_rq = (vm_offset_t *)((char *)rq_array + curcpu*2*CPU_RQ_SIZE);
pcpup->pc_rq_ra = vtophys(pcpup->pc_rq);
pcpup->pc_rq_size = CPU_RQ_SIZE;
- pcpup->pc_nrq = nrq_array + curcpu*2*CPU_NRQ_SIZE;
+ pcpup->pc_nrq = (vm_offset_t *)((char *)nrq_array + curcpu*2*CPU_NRQ_SIZE);
pcpup->pc_nrq_ra = vtophys(pcpup->pc_nrq);
pcpup->pc_nrq_size = CPU_NRQ_SIZE;
error = hv_cpu_qconf(Q(CPU_MONDO_QUEUE_HEAD), pcpup->pc_cpu_q_ra, cpu_q_entries);
if (error != H_EOK)
- panic("cpu_mondo queue configuration failed: %lu", error);
+ panic("cpu_mondo queue configuration failed: %lu va=%p ra=0x%lx", error,
+ pcpup->pc_cpu_q, pcpup->pc_cpu_q_ra);
error = hv_cpu_qconf(Q(DEV_MONDO_QUEUE_HEAD), pcpup->pc_dev_q_ra, dev_q_entries);
if (error != H_EOK)
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/mp_locore.S#3 (text+ko) ====
@@ -139,19 +139,15 @@
bne %xcc, 2b
nop
- PUTCHAR(0x2e)
/*
* Get onto our per-cpu panic stack, which precedes the struct pcpu
* in the per-cpu page.
*/
ldx [%l0 + CSA_PCPU], %l1
- PUTCHAR(0x2e)
set PCPU_PAGES * PAGE_SIZE - PC_SIZEOF, %l2
add %l1, %l2, %l1
sub %l1, SPOFF + CCFSZ, %sp
- PUTCHAR(0x2e)
wrpr %g0, PSTATE_KERNEL, %pstate
- PUTCHAR(0x2e)
#if KTR_COMPILE & KTR_SMP
CATR(KTR_SMP,
"_mp_start: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx"
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/mp_machdep.c#3 (text+ko) ====
@@ -275,7 +275,6 @@
u_int clock;
int cpuid, bp_skipped;
u_long s;
- printf("cpu_mp_start\n");
mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
root = OF_peer(0);
@@ -318,7 +317,7 @@
pc->pc_node = child;
all_cpus |= 1 << cpuid;
- if (mp_ncpus == 8)
+ if (mp_ncpus == MAXCPU)
break;
}
PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
@@ -350,11 +349,11 @@
pc->pc_curpcb = pc->pc_curthread->td_pcb;
pc->pc_curpmap = kernel_pmap;
csa->csa_state = 0;
-#if 1
- printf("unleashing cpuid=%d\n", pc->pc_cpuid);
-#endif
+ csa->csa_pcpu = TLB_PHYS_TO_DIRECT(vtophys(pc->pc_addr));
+ DELAY(300);
+ /* allow AP to run */
csa->csa_cpuid = pc->pc_cpuid;
- csa->csa_pcpu = TLB_PHYS_TO_DIRECT(vtophys(pc->pc_addr));
+ membar(Sync);
s = intr_disable();
while (csa->csa_state != CPU_BOOTSTRAP)
;
@@ -390,9 +389,9 @@
while (csa->csa_count != 0)
;
#ifdef SIMULATOR
+ DELAY(300*PCPU_GET(cpuid));
+#else
DELAY(300000*PCPU_GET(cpuid));
-#else
- DELAY(300*PCPU_GET(cpuid));
#endif
/* ok, now grab sched_lock and enter the scheduler */
#if 0
More information about the p4-projects
mailing list