svn commit: r302538 - in projects/powernv: dev/ofw kern net powerpc/aim powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Mon Jul 11 04:21:40 UTC 2016
Author: nwhitehorn
Date: Mon Jul 11 04:21:38 2016
New Revision: 302538
URL: https://svnweb.freebsd.org/changeset/base/302538
Log:
Mop up a few more bits of the kernel that don't like the BSP having a
non-zero ID.
Modified:
projects/powernv/dev/ofw/ofw_cpu.c
projects/powernv/kern/init_main.c
projects/powernv/net/netisr.c
projects/powernv/powerpc/aim/mmu_oea64.c
projects/powernv/powerpc/powerpc/machdep.c
Modified: projects/powernv/dev/ofw/ofw_cpu.c
==============================================================================
--- projects/powernv/dev/ofw/ofw_cpu.c Mon Jul 11 04:12:15 2016 (r302537)
+++ projects/powernv/dev/ofw/ofw_cpu.c Mon Jul 11 04:21:38 2016 (r302538)
@@ -191,6 +191,10 @@ ofw_cpu_probe(device_t dev)
if (type == NULL || strcmp(type, "cpu") != 0)
return (ENXIO);
+ /* Skip SMT CPUs, which we can't reasonably represent with this code */
+ if (OF_hasprop(ofw_bus_get_node(dev), "ibm,ppc-interrupt-server#s"))
+ return (ENXIO);
+
device_set_desc(dev, "Open Firmware CPU");
return (0);
}
Modified: projects/powernv/kern/init_main.c
==============================================================================
--- projects/powernv/kern/init_main.c Mon Jul 11 04:12:15 2016 (r302537)
+++ projects/powernv/kern/init_main.c Mon Jul 11 04:21:38 2016 (r302538)
@@ -495,7 +495,7 @@ proc0_init(void *dummy __unused)
td->td_lend_user_pri = PRI_MAX;
td->td_priority = PVM;
td->td_base_pri = PVM;
- td->td_oncpu = 0;
+ td->td_oncpu = curcpu;
td->td_flags = TDF_INMEM;
td->td_pflags = TDP_KTHREAD;
td->td_cpuset = cpuset_thread0();
Modified: projects/powernv/net/netisr.c
==============================================================================
--- projects/powernv/net/netisr.c Mon Jul 11 04:12:15 2016 (r302537)
+++ projects/powernv/net/netisr.c Mon Jul 11 04:21:38 2016 (r302538)
@@ -1273,8 +1273,6 @@ netisr_init(void *arg)
struct pcpu *pc;
#endif
- KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__));
-
NETISR_LOCK_INIT();
if (netisr_maxthreads == 0 || netisr_maxthreads < -1 )
netisr_maxthreads = 1; /* default behavior */
Modified: projects/powernv/powerpc/aim/mmu_oea64.c
==============================================================================
--- projects/powernv/powerpc/aim/mmu_oea64.c Mon Jul 11 04:12:15 2016 (r302537)
+++ projects/powernv/powerpc/aim/mmu_oea64.c Mon Jul 11 04:21:38 2016 (r302538)
@@ -853,7 +853,6 @@ moea64_late_bootstrap(mmu_t mmup, vm_off
int i;
vm_offset_t pa, va;
void *dpcpu;
- struct cpuref bsp;
/*
* Set up the Open Firmware pmap and add its mappings if not in real
@@ -952,8 +951,6 @@ moea64_late_bootstrap(mmu_t mmup, vm_off
*/
pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE);
dpcpu = (void *)virtual_avail;
- if (platform_smp_get_bsp(&bsp) != 0)
- bsp.cr_cpuid = 0;
va = virtual_avail;
virtual_avail += DPCPU_SIZE;
while (va < virtual_avail) {
@@ -961,7 +958,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_off
pa += PAGE_SIZE;
va += PAGE_SIZE;
}
- dpcpu_init(dpcpu, bsp.cr_cpuid);
+ dpcpu_init(dpcpu, curcpu);
/*
* Allocate some things for page zeroing. We put this directly
Modified: projects/powernv/powerpc/powerpc/machdep.c
==============================================================================
--- projects/powernv/powerpc/powerpc/machdep.c Mon Jul 11 04:12:15 2016 (r302537)
+++ projects/powernv/powerpc/powerpc/machdep.c Mon Jul 11 04:21:38 2016 (r302538)
@@ -365,6 +365,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_
bsp.cr_cpuid = 0;
pcpu_init(pc, bsp.cr_cpuid, sizeof(struct pcpu));
pc->pc_curthread = &thread0;
+ thread0.td_oncpu = bsp.cr_cpuid;
pc->pc_cpuid = bsp.cr_cpuid;
__asm __volatile("mtsprg 0, %0" :: "r"(pc));
More information about the svn-src-projects
mailing list