Date: Wed, 10 Nov 2004 08:02:41 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 64792 for review Message-ID: <200411100802.iAA82fuf094470@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=64792 Change 64792 by marcel@marcel_nfs on 2004/11/10 08:02:21 IFC @64790 Affected files ... .. //depot/projects/uart/alpha/alpha/machdep.c#10 integrate .. //depot/projects/uart/alpha/alpha/mp_machdep.c#9 integrate .. //depot/projects/uart/alpha/conf/GENERIC#6 integrate .. //depot/projects/uart/alpha/conf/NOTES#5 integrate .. //depot/projects/uart/alpha/include/pcpu.h#2 integrate .. //depot/projects/uart/alpha/include/smp.h#2 integrate .. //depot/projects/uart/amd64/amd64/busdma_machdep.c#7 integrate .. //depot/projects/uart/amd64/amd64/mp_machdep.c#2 integrate .. //depot/projects/uart/arm/arm/bcopy_page.S#2 integrate .. //depot/projects/uart/arm/arm/bcopyinout.S#2 integrate .. //depot/projects/uart/arm/arm/bcopyinout_xscale.S#2 integrate .. //depot/projects/uart/arm/arm/blockio.S#2 integrate .. //depot/projects/uart/arm/arm/bus_space_asm_generic.S#2 integrate .. //depot/projects/uart/arm/arm/copystr.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc.c#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_arm3.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_arm67.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_arm7tdmi.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_arm8.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_arm9.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_armv4.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_ixp12x0.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_sa1.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_sa11x0.S#2 integrate .. //depot/projects/uart/arm/arm/cpufunc_asm_xscale.S#2 integrate .. //depot/projects/uart/arm/arm/critical.c#2 integrate .. //depot/projects/uart/arm/arm/elf_machdep.c#2 integrate .. //depot/projects/uart/arm/arm/fiq_subr.S#2 integrate .. //depot/projects/uart/arm/arm/fusu.S#2 integrate .. //depot/projects/uart/arm/arm/identcpu.c#2 integrate .. //depot/projects/uart/arm/arm/in_cksum_arm.S#2 integrate .. //depot/projects/uart/arm/arm/locore.S#2 integrate .. //depot/projects/uart/arm/arm/machdep.c#2 integrate .. //depot/projects/uart/arm/arm/mem.c#1 branch .. //depot/projects/uart/arm/arm/nexus_io_asm.S#2 integrate .. //depot/projects/uart/arm/arm/pmap.c#2 integrate .. //depot/projects/uart/arm/arm/setcpsr.S#2 integrate .. //depot/projects/uart/arm/arm/support.S#2 integrate .. //depot/projects/uart/arm/arm/swtch.S#2 integrate .. //depot/projects/uart/arm/arm/trap.c#2 integrate .. //depot/projects/uart/arm/arm/vm_machdep.c#2 integrate .. //depot/projects/uart/arm/conf/IQ31244#3 integrate .. //depot/projects/uart/arm/conf/SIMICS#3 integrate .. //depot/projects/uart/arm/include/asm.h#2 integrate .. //depot/projects/uart/arm/include/atomic.h#2 integrate .. //depot/projects/uart/arm/include/cpu.h#2 integrate .. //depot/projects/uart/arm/include/cpuconf.h#2 integrate .. //depot/projects/uart/arm/include/cpufunc.h#2 integrate .. //depot/projects/uart/arm/include/endian.h#4 integrate .. //depot/projects/uart/arm/include/memdev.h#1 branch .. //depot/projects/uart/arm/include/param.h#3 integrate .. //depot/projects/uart/arm/include/pcpu.h#2 integrate .. //depot/projects/uart/arm/include/pmap.h#2 integrate .. //depot/projects/uart/arm/include/reg.h#2 integrate .. //depot/projects/uart/arm/xscale/i80321/iq31244_machdep.c#2 integrate .. //depot/projects/uart/boot/forth/loader.conf#4 integrate .. //depot/projects/uart/boot/forth/loader.conf.5#3 integrate .. //depot/projects/uart/boot/i386/boot0/boot0.S#2 integrate .. //depot/projects/uart/boot/i386/libi386/biossmap.c#3 integrate .. //depot/projects/uart/compat/linprocfs/linprocfs.c#10 integrate .. //depot/projects/uart/compat/svr4/svr4_filio.c#3 integrate .. //depot/projects/uart/conf/NOTES#19 integrate .. //depot/projects/uart/conf/files#32 integrate .. //depot/projects/uart/contrib/pf/net/pf.c#2 integrate .. //depot/projects/uart/dev/acpica/acpi_pcib_acpi.c#6 integrate .. //depot/projects/uart/dev/acpica/acpi_video.c#2 integrate .. //depot/projects/uart/dev/ata/ata-card.c#6 integrate .. //depot/projects/uart/dev/bge/if_bge.c#13 integrate .. //depot/projects/uart/dev/fdc/fdc.c#4 integrate .. //depot/projects/uart/dev/firewire/fwmem.c#6 integrate .. //depot/projects/uart/dev/gx/if_gx.c#5 delete .. //depot/projects/uart/dev/gx/if_gxreg.h#2 delete .. //depot/projects/uart/dev/gx/if_gxvar.h#2 delete .. //depot/projects/uart/dev/lge/if_lge.c#6 integrate .. //depot/projects/uart/dev/md/md.c#7 integrate .. //depot/projects/uart/dev/nge/if_nge.c#6 integrate .. //depot/projects/uart/dev/pci/pci.c#14 integrate .. //depot/projects/uart/dev/random/randomdev_soft.c#3 integrate .. //depot/projects/uart/dev/snp/snp.c#4 integrate .. //depot/projects/uart/dev/sound/pci/maestro.c#7 integrate .. //depot/projects/uart/dev/sound/pci/maestro_reg.h#2 integrate .. //depot/projects/uart/dev/usb/ehci.c#6 integrate .. //depot/projects/uart/dev/usb/ohci.c#7 integrate .. //depot/projects/uart/dev/usb/uhci.c#8 integrate .. //depot/projects/uart/dev/usb/uhub.c#7 integrate .. //depot/projects/uart/dev/usb/umass.c#8 integrate .. //depot/projects/uart/dev/usb/usb_port.h#7 integrate .. //depot/projects/uart/dev/vinum/COPYRIGHT#2 delete .. //depot/projects/uart/dev/vinum/makestatetext#2 delete .. //depot/projects/uart/dev/vinum/request.h#2 delete .. //depot/projects/uart/dev/vinum/statetexts.h#2 delete .. //depot/projects/uart/dev/vinum/vinum.c#4 delete .. //depot/projects/uart/dev/vinum/vinumconfig.c#6 delete .. //depot/projects/uart/dev/vinum/vinumdaemon.c#3 delete .. //depot/projects/uart/dev/vinum/vinumext.h#3 delete .. //depot/projects/uart/dev/vinum/vinumhdr.h#3 delete .. //depot/projects/uart/dev/vinum/vinuminterrupt.c#4 delete .. //depot/projects/uart/dev/vinum/vinumio.c#4 delete .. //depot/projects/uart/dev/vinum/vinumio.h#2 delete .. //depot/projects/uart/dev/vinum/vinumioctl.c#4 delete .. //depot/projects/uart/dev/vinum/vinumkw.h#2 delete .. //depot/projects/uart/dev/vinum/vinumlock.c#3 delete .. //depot/projects/uart/dev/vinum/vinummemory.c#4 delete .. //depot/projects/uart/dev/vinum/vinumobj.h#3 delete .. //depot/projects/uart/dev/vinum/vinumparser.c#3 delete .. //depot/projects/uart/dev/vinum/vinumraid5.c#3 delete .. //depot/projects/uart/dev/vinum/vinumrequest.c#5 delete .. //depot/projects/uart/dev/vinum/vinumrevive.c#5 delete .. //depot/projects/uart/dev/vinum/vinumstate.c#3 delete .. //depot/projects/uart/dev/vinum/vinumstate.h#2 delete .. //depot/projects/uart/dev/vinum/vinumutil.c#4 delete .. //depot/projects/uart/dev/vinum/vinumutil.h#2 delete .. //depot/projects/uart/dev/vinum/vinumvar.h#4 delete .. //depot/projects/uart/fs/autofs/autofs_vfsops.c#2 integrate .. //depot/projects/uart/fs/devfs/devfs_vfsops.c#4 integrate .. //depot/projects/uart/fs/devfs/devfs_vnops.c#4 integrate .. //depot/projects/uart/fs/fdescfs/fdesc_vfsops.c#3 integrate .. //depot/projects/uart/fs/fifofs/fifo_vnops.c#3 integrate .. //depot/projects/uart/fs/hpfs/hpfs_vfsops.c#5 integrate .. //depot/projects/uart/fs/msdosfs/msdosfs_vfsops.c#8 integrate .. //depot/projects/uart/fs/ntfs/ntfs_vfsops.c#8 integrate .. //depot/projects/uart/fs/nullfs/null_vfsops.c#3 integrate .. //depot/projects/uart/fs/nwfs/nwfs_vfsops.c#3 integrate .. //depot/projects/uart/fs/portalfs/portal_vfsops.c#3 integrate .. //depot/projects/uart/fs/smbfs/smbfs_vfsops.c#5 integrate .. //depot/projects/uart/fs/umapfs/umap_vfsops.c#3 integrate .. //depot/projects/uart/fs/unionfs/union_vfsops.c#3 integrate .. //depot/projects/uart/geom/geom.h#7 integrate .. //depot/projects/uart/geom/geom_event.c#4 integrate .. //depot/projects/uart/geom/geom_vfs.c#2 integrate .. //depot/projects/uart/geom/mirror/g_mirror.c#2 integrate .. //depot/projects/uart/geom/mirror/g_mirror.h#2 integrate .. //depot/projects/uart/geom/raid3/g_raid3.c#2 integrate .. //depot/projects/uart/geom/raid3/g_raid3.h#2 integrate .. //depot/projects/uart/gnu/ext2fs/ext2_mount.h#4 integrate .. //depot/projects/uart/gnu/ext2fs/ext2_vfsops.c#7 integrate .. //depot/projects/uart/gnu/ext2fs/ext2_vnops.c#5 integrate .. //depot/projects/uart/i386/acpica/acpi_asus.c#3 integrate .. //depot/projects/uart/i386/acpica/acpi_panasonic.c#2 integrate .. //depot/projects/uart/i386/i386/busdma_machdep.c#10 integrate .. //depot/projects/uart/i386/i386/vm_machdep.c#7 integrate .. //depot/projects/uart/i386/include/sysarch.h#4 integrate .. //depot/projects/uart/isofs/cd9660/cd9660_vfsops.c#7 integrate .. //depot/projects/uart/kern/init_main.c#7 integrate .. //depot/projects/uart/kern/kern_descrip.c#9 integrate .. //depot/projects/uart/kern/kern_environment.c#4 integrate .. //depot/projects/uart/kern/kern_exec.c#7 integrate .. //depot/projects/uart/kern/kern_fork.c#6 integrate .. //depot/projects/uart/kern/kern_intr.c#5 integrate .. //depot/projects/uart/kern/kern_mac.c#8 integrate .. //depot/projects/uart/kern/kern_physio.c#6 integrate .. //depot/projects/uart/kern/kern_shutdown.c#4 integrate .. //depot/projects/uart/kern/kern_subr.c#5 integrate .. //depot/projects/uart/kern/kern_switch.c#4 integrate .. //depot/projects/uart/kern/kern_thread.c#12 integrate .. //depot/projects/uart/kern/subr_param.c#6 integrate .. //depot/projects/uart/kern/subr_sleepqueue.c#2 integrate .. //depot/projects/uart/kern/subr_witness.c#7 integrate .. //depot/projects/uart/kern/sys_pipe.c#12 integrate .. //depot/projects/uart/kern/uipc_cow.c#3 integrate .. //depot/projects/uart/kern/uipc_domain.c#5 integrate .. //depot/projects/uart/kern/uipc_socket.c#7 integrate .. //depot/projects/uart/kern/uipc_syscalls.c#7 integrate .. //depot/projects/uart/kern/uipc_usrreq.c#3 integrate .. //depot/projects/uart/kern/vfs_aio.c#5 integrate .. //depot/projects/uart/kern/vfs_bio.c#12 integrate .. //depot/projects/uart/kern/vfs_cluster.c#7 integrate .. //depot/projects/uart/kern/vfs_default.c#5 integrate .. //depot/projects/uart/kern/vfs_mount.c#6 integrate .. //depot/projects/uart/kern/vfs_subr.c#9 integrate .. //depot/projects/uart/kern/vfs_syscalls.c#8 integrate .. //depot/projects/uart/kern/vfs_vnops.c#6 integrate .. //depot/projects/uart/libkern/arm/divsi3.S#2 integrate .. //depot/projects/uart/libkern/arm/ffs.S#2 integrate .. //depot/projects/uart/modules/Makefile#12 integrate .. //depot/projects/uart/modules/gx/Makefile#2 delete .. //depot/projects/uart/modules/vinum/Makefile#2 delete .. //depot/projects/uart/net/if_ppp.c#3 integrate .. //depot/projects/uart/net/if_pppvar.h#2 integrate .. //depot/projects/uart/net/if_sl.c#3 integrate .. //depot/projects/uart/net/if_var.h#5 integrate .. //depot/projects/uart/net/ppp_tty.c#3 integrate .. //depot/projects/uart/net/raw_usrreq.c#4 integrate .. //depot/projects/uart/net/rtsock.c#4 integrate .. //depot/projects/uart/netatalk/ddp_usrreq.c#3 integrate .. //depot/projects/uart/netatm/atm_aal5.c#3 integrate .. //depot/projects/uart/netatm/atm_usrreq.c#4 integrate .. //depot/projects/uart/netgraph/atm/sscop/ng_sscop_cust.h#2 integrate .. //depot/projects/uart/netgraph/atm/uni/ng_uni_cust.h#2 integrate .. //depot/projects/uart/netgraph/bluetooth/socket/ng_btsocket.c#4 integrate .. //depot/projects/uart/netgraph/ng_base.c#4 integrate .. //depot/projects/uart/netgraph/ng_socket.c#3 integrate .. //depot/projects/uart/netinet/ip_divert.c#4 integrate .. //depot/projects/uart/netinet/ip_fastfwd.c#3 integrate .. //depot/projects/uart/netinet/raw_ip.c#9 integrate .. //depot/projects/uart/netinet/tcp_input.c#7 integrate .. //depot/projects/uart/netinet/tcp_subr.c#6 integrate .. //depot/projects/uart/netinet/tcp_usrreq.c#4 integrate .. //depot/projects/uart/netinet/udp_usrreq.c#7 integrate .. //depot/projects/uart/netinet6/ah_core.c#4 integrate .. //depot/projects/uart/netinet6/raw_ip6.c#4 integrate .. //depot/projects/uart/netinet6/udp6_usrreq.c#4 integrate .. //depot/projects/uart/netipsec/keysock.c#4 integrate .. //depot/projects/uart/netipx/ipx_usrreq.c#3 integrate .. //depot/projects/uart/netipx/spx_usrreq.c#4 integrate .. //depot/projects/uart/netkey/key.c#5 integrate .. //depot/projects/uart/netkey/key.h#3 integrate .. //depot/projects/uart/netkey/keydb.h#3 integrate .. //depot/projects/uart/netkey/keysock.c#5 integrate .. //depot/projects/uart/netnatm/natm.c#5 integrate .. //depot/projects/uart/netsmb/smb_dev.c#4 integrate .. //depot/projects/uart/nfs4client/nfs4_vfsops.c#2 integrate .. //depot/projects/uart/nfsclient/nfs_bio.c#5 integrate .. //depot/projects/uart/nfsclient/nfs_vfsops.c#5 integrate .. //depot/projects/uart/pc98/conf/GENERIC#5 integrate .. //depot/projects/uart/pc98/pc98/fd.c#8 integrate .. //depot/projects/uart/pci/if_de.c#4 integrate .. //depot/projects/uart/pci/if_xl.c#11 integrate .. //depot/projects/uart/sparc64/sparc64/vm_machdep.c#8 integrate .. //depot/projects/uart/sys/_types.h#3 integrate .. //depot/projects/uart/sys/buf.h#8 integrate .. //depot/projects/uart/sys/conf.h#7 integrate .. //depot/projects/uart/sys/fdcio.h#3 integrate .. //depot/projects/uart/sys/file.h#3 integrate .. //depot/projects/uart/sys/filedesc.h#3 integrate .. //depot/projects/uart/sys/kernel.h#7 integrate .. //depot/projects/uart/sys/ktr.h#3 integrate .. //depot/projects/uart/sys/mac_policy.h#4 integrate .. //depot/projects/uart/sys/mdioctl.h#3 integrate .. //depot/projects/uart/sys/param.h#14 integrate .. //depot/projects/uart/sys/protosw.h#4 integrate .. //depot/projects/uart/sys/resource.h#3 integrate .. //depot/projects/uart/sys/rman.h#3 integrate .. //depot/projects/uart/sys/sf_buf.h#2 integrate .. //depot/projects/uart/sys/syslog.h#3 integrate .. //depot/projects/uart/sys/vnode.h#6 integrate .. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#7 integrate .. //depot/projects/uart/ufs/ufs/ufs_vnops.c#8 integrate .. //depot/projects/uart/vm/swap_pager.c#13 integrate .. //depot/projects/uart/vm/uma_core.c#13 integrate .. //depot/projects/uart/vm/vm_object.c#10 integrate .. //depot/projects/uart/vm/vm_object.h#4 integrate .. //depot/projects/uart/vm/vm_pageout.c#13 integrate .. //depot/projects/uart/vm/vm_pager.c#5 integrate .. //depot/projects/uart/vm/vm_pager.h#5 integrate .. //depot/projects/uart/vm/vm_param.h#3 integrate .. //depot/projects/uart/vm/vm_zeroidle.c#5 integrate .. //depot/projects/uart/vm/vnode_pager.c#9 integrate Differences ... ==== //depot/projects/uart/alpha/alpha/machdep.c#10 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.223 2004/09/05 02:09:51 julian Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.224 2004/11/05 19:16:43 jhb Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -864,7 +864,8 @@ /* This is not a 'struct user' */ size_t sz = round_page(KSTACK_PAGES * PAGE_SIZE); pcpup = (struct pcpu *) pmap_steal_memory(sz); - pcpu_init(pcpup, alpha_pal_whami(), sz); + pcpu_init(pcpup, 0, sz); + pcpup->pc_pal_id = alpha_pal_whami(); alpha_pal_wrval((u_int64_t) pcpup); PCPU_GET(next_asn) = 1; /* 0 used for proc0 pmap */ PCPU_SET(curthread, &thread0); ==== //depot/projects/uart/alpha/alpha/mp_machdep.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.52 2004/01/07 23:00:20 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.53 2004/11/05 19:16:43 jhb Exp $"); #include "opt_kstack_pages.h" @@ -61,23 +61,23 @@ static struct mtx ap_boot_mtx; -u_int boot_cpu_id; +u_int64_t boot_cpu_id; static void release_aps(void *dummy); static int smp_cpu_enabled(struct pcs *pcsp); extern void smp_init_secondary_glue(void); -static int smp_send_secondary_command(const char *command, int cpuid); -static int smp_start_secondary(int cpuid); +static int smp_send_secondary_command(const char *command, int pal_id); +static int smp_start_secondary(int pal_id, int cpuid); /* * Communicate with a console running on a secondary processor. * Return 1 on failure. */ static int -smp_send_secondary_command(const char *command, int cpuid) +smp_send_secondary_command(const char *command, int pal_id) { - u_int64_t mask = 1L << cpuid; - struct pcs *cpu = LOCATE_PCS(hwrpb, cpuid); + u_int64_t mask = 1L << pal_id; + struct pcs *cpu = LOCATE_PCS(hwrpb, pal_id); int i, len; /* @@ -165,7 +165,7 @@ /* * Set flags in our per-CPU slot in the HWRPB. */ - cpu = LOCATE_PCS(hwrpb, PCPU_GET(cpuid)); + cpu = LOCATE_PCS(hwrpb, PCPU_GET(pal_id)); cpu->pcs_flags &= ~PCS_BIP; cpu->pcs_flags |= PCS_RC; alpha_mb(); @@ -216,9 +216,9 @@ } static int -smp_start_secondary(int cpuid) +smp_start_secondary(int pal_id, int cpuid) { - struct pcs *cpu = LOCATE_PCS(hwrpb, cpuid); + struct pcs *cpu = LOCATE_PCS(hwrpb, pal_id); struct pcs *bootcpu = LOCATE_PCS(hwrpb, boot_cpu_id); struct alpha_pcb *pcb = (struct alpha_pcb *) cpu->pcs_hwpcb; struct pcpu *pcpu; @@ -226,12 +226,12 @@ size_t sz; if ((cpu->pcs_flags & PCS_PV) == 0) { - printf("smp_start_secondary: cpu %d PALcode invalid\n", cpuid); + printf("smp_start_secondary: cpu %d PALcode invalid\n", pal_id); return 0; } if (bootverbose) - printf("smp_start_secondary: starting cpu %d\n", cpuid); + printf("smp_start_secondary: starting cpu %d\n", pal_id); sz = round_page((UAREA_PAGES + KSTACK_PAGES) * PAGE_SIZE); pcpu = malloc(sz, M_TEMP, M_NOWAIT); @@ -241,6 +241,7 @@ } pcpu_init(pcpu, cpuid, sz); + pcpu->pc_pal_id = pal_id; /* * Copy the idle pcb and setup the address to start executing. @@ -270,7 +271,7 @@ /* * Fire it up and hope for the best. */ - if (!smp_send_secondary_command("START\r\n", cpuid)) { + if (!smp_send_secondary_command("START\r\n", pal_id)) { printf("smp_start_secondary: can't send START command\n"); pcpu_destroy(pcpu); free(pcpu, M_TEMP); @@ -296,7 +297,7 @@ * It worked (I think). */ if (bootverbose) - printf("smp_start_secondary: cpu %d started\n", cpuid); + printf("smp_start_secondary: cpu %d started\n", pal_id); return 1; } @@ -329,16 +330,18 @@ void cpu_mp_setmaxid(void) { - int i; + u_int64_t i; mp_maxid = 0; - for (i = 0; i < hwrpb->rpb_pcs_cnt && i < MAXCPU; i++) { - if (i == PCPU_GET(cpuid)) + for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) { + if (i == PCPU_GET(pal_id)) continue; if (!smp_cpu_enabled(LOCATE_PCS(hwrpb, i))) continue; - mp_maxid = i; + mp_maxid++; } + if (mp_maxid > MAXCPU) + mp_maxid = MAXCPU; } int @@ -348,7 +351,7 @@ /* XXX: Need to check for valid platforms here. */ - boot_cpu_id = PCPU_GET(cpuid); + boot_cpu_id = PCPU_GET(pal_id); KASSERT(boot_cpu_id == hwrpb->rpb_primary_cpu_id, ("cpu_mp_probe() called on non-primary CPU")); all_cpus = PCPU_GET(cpumask); @@ -358,12 +361,10 @@ /* Make sure we have at least one secondary CPU. */ cpus = 0; for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) { - if (i == PCPU_GET(cpuid)) + if (i == PCPU_GET(pal_id)) continue; if (!smp_cpu_enabled(LOCATE_PCS(hwrpb, i))) continue; - if (i > MAXCPU) - continue; cpus++; } return (cpus); @@ -372,10 +373,11 @@ void cpu_mp_start(void) { - int i; + int i, cpuid; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); + cpuid = 1; for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) { struct pcs *pcsp; @@ -410,22 +412,30 @@ printf("CPU %d disabled by loader.\n", i); continue; } - all_cpus |= (1 << i); - mp_ncpus++; + if (smp_start_secondary(i, cpuid)) { + all_cpus |= (1 << cpuid); + mp_ncpus++; + cpuid++; + } } PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); - - for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) { - if (i == boot_cpu_id) - continue; - if (!CPU_ABSENT(i)) - smp_start_secondary(i); - } } void cpu_mp_announce(void) { + struct pcpu *pc; + int i; + + /* List CPUs */ + printf(" cpu0 (BSP): PAL ID: %2lu\n", boot_cpu_id); + for (i = 1; i < MAXCPU; i++) { + if (CPU_ABSENT(i)) + continue; + pc = pcpu_find(i); + MPASS(pc != NULL); + printf(" cpu%d (AP): PAL ID: %2lu\n", i, pc->pc_pal_id); + } } /* @@ -446,8 +456,9 @@ if (pcpu) { atomic_set_64(&pcpu->pc_pending_ipis, ipi); alpha_mb(); - CTR1(KTR_SMP, "calling alpha_pal_wripir(%d)", cpuid); - alpha_pal_wripir(cpuid); + CTR1(KTR_SMP, "calling alpha_pal_wripir(%d)", + pcpu->pc_pal_id); + alpha_pal_wripir(pcpu->pc_pal_id); } } } @@ -529,8 +540,8 @@ * requests to provide PALcode to secondaries and to start up new * secondaries that are added to the system on the fly. */ - if (PCPU_GET(cpuid) == boot_cpu_id) { - u_int cpuid; + if (PCPU_GET(pal_id) == boot_cpu_id) { + u_int pal_id; u_int64_t txrdy; #ifdef DIAGNOSTIC struct pcs *cpu; @@ -539,18 +550,18 @@ alpha_mb(); while (hwrpb->rpb_txrdy != 0) { - cpuid = ffs(hwrpb->rpb_txrdy) - 1; + pal_id = ffs(hwrpb->rpb_txrdy) - 1; #ifdef DIAGNOSTIC - cpu = LOCATE_PCS(hwrpb, cpuid); + cpu = LOCATE_PCS(hwrpb, pal_id); bcopy(&cpu->pcs_buffer.txbuf, buf, cpu->pcs_buffer.txlen); buf[cpu->pcs_buffer.txlen] = '\0'; - printf("SMP From CPU%d: %s\n", cpuid, buf); + printf("SMP From CPU%d: %s\n", pal_id, buf); #endif do { txrdy = hwrpb->rpb_txrdy; } while (atomic_cmpset_64(&hwrpb->rpb_txrdy, txrdy, - txrdy & ~(1 << cpuid)) == 0); + txrdy & ~(1 << pal_id)) == 0); } } } ==== //depot/projects/uart/alpha/conf/GENERIC#6 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.180 2004/11/02 20:57:19 andre Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.181 2004/11/09 22:23:34 wilko Exp $ machine alpha cpu EV4 @@ -32,7 +32,6 @@ # Platforms supported options API_UP1000 # UP1000, UP1100 (Nautilus) -options DEC_AXPPCI_33 # UDB, Multia, AXPpci33, NoName options DEC_EB164 # EB164, PC164, PC164LX, PC164SX options DEC_EB64PLUS # EB64+, AlphaPC64, Aspen Alpine, etc options DEC_2100_A50 # AlphaStation 200, 250, 255, 400 @@ -41,8 +40,6 @@ options DEC_ST550 # Personal Workstation 433, 500, 600 options DEC_ST6600 # XP1000, DP264, DS20, DS10, family options DEC_1000A # AlphaServer 1000, 1000A, 800 -# TurboLaser support is broken -# options DEC_KN8AE # AlphaServer 8200/8400 (Turbolaser) options DEC_KN300 # AlphaServer 4100 (Rawhide), # AlphaServer 1200 (Tincup) ==== //depot/projects/uart/alpha/conf/NOTES#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/alpha/conf/NOTES,v 1.155 2004/08/28 21:47:24 wilko Exp $ +# $FreeBSD: src/sys/alpha/conf/NOTES,v 1.156 2004/11/09 22:24:47 wilko Exp $ # # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. @@ -27,7 +27,6 @@ # PLATFORM OPTIONS options API_UP1000 # UP1000, UP1100 (Nautilus) -options DEC_AXPPCI_33 # UDB, Multia, AXPpci33, NoName options DEC_EB164 # EB164, PC164, PC164LX, PC164SX options DEC_EB64PLUS # EB64+, AlphaPC64, Aspen Alpine, etc options DEC_2100_A50 # AlphaStation 200, 250, 255, 400 @@ -36,8 +35,6 @@ options DEC_ST550 # Personal Workstation 433, 500, 600 options DEC_ST6600 # XP1000, DP264, DS20, DS10, family options DEC_1000A # AlphaServer 1000, 1000A, 800 -# TurboLaser support is broken -# options DEC_KN8AE # AlphaServer 8200/8400 (Turbolaser) options DEC_KN300 # AlphaServer 4100 (Rawhide), # AlphaServer 1200 (Tincup) ==== //depot/projects/uart/alpha/include/pcpu.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/pcpu.h,v 1.14 2001/12/11 23:33:39 jhb Exp $ + * $FreeBSD: src/sys/alpha/include/pcpu.h,v 1.15 2004/11/05 19:16:44 jhb Exp $ */ #ifndef _MACHINE_PCPU_H_ @@ -34,6 +34,7 @@ #define PCPU_MD_FIELDS \ struct alpha_pcb pc_idlepcb; /* pcb for idling */ \ + u_int64_t pc_pal_id; /* physical CPU ID */ \ u_int64_t pc_idlepcbphys; /* pa of pc_idlepcb */ \ u_int64_t pc_pending_ipis; /* pending IPI's */ \ u_int32_t pc_next_asn; /* next ASN to alloc */ \ ==== //depot/projects/uart/alpha/include/smp.h#2 (text+ko) ==== @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/sys/alpha/include/smp.h,v 1.6 2001/08/13 22:41:15 jhb Exp $ + * $FreeBSD: src/sys/alpha/include/smp.h,v 1.7 2004/11/05 19:16:44 jhb Exp $ * */ @@ -26,7 +26,7 @@ #ifndef LOCORE -extern u_int boot_cpu_id; +extern u_int64_t boot_cpu_id; void ipi_selected(u_int cpus, u_int64_t ipi); void ipi_all(u_int64_t ipi); ==== //depot/projects/uart/amd64/amd64/busdma_machdep.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.58 2004/09/08 04:54:18 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.60 2004/11/10 03:49:24 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -33,12 +33,14 @@ #include <sys/bus.h> #include <sys/interrupt.h> #include <sys/kernel.h> +#include <sys/ktr.h> #include <sys/lock.h> #include <sys/proc.h> #include <sys/mutex.h> #include <sys/mbuf.h> #include <sys/uio.h> #include <sys/sysctl.h> +#include <sys/ktr.h> #include <vm/vm.h> #include <vm/vm_page.h> @@ -50,6 +52,8 @@ #define MAX_BPAGES 512 +struct bounce_zone; + struct bus_dma_tag { bus_dma_tag_t parent; bus_size_t alignment; @@ -67,6 +71,7 @@ bus_dma_lock_t *lockfunc; void *lockfuncarg; bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; }; struct bounce_page { @@ -79,29 +84,32 @@ int busdma_swi_pending; +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + bus_size_t alignment; + bus_size_t boundary; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + static struct mtx bounce_lock; -static STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; -static int free_bpages; -static int reserved_bpages; -static int active_bpages; static int total_bpages; -static int total_bounced; -static int total_deferred; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; static bus_addr_t bounce_lowaddr = BUS_SPACE_MAXADDR; SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); -SYSCTL_INT(_hw_busdma, OID_AUTO, free_bpages, CTLFLAG_RD, &free_bpages, 0, - "Free bounce pages"); -SYSCTL_INT(_hw_busdma, OID_AUTO, reserved_bpages, CTLFLAG_RD, &reserved_bpages, - 0, "Reserved bounce pages"); -SYSCTL_INT(_hw_busdma, OID_AUTO, active_bpages, CTLFLAG_RD, &active_bpages, 0, - "Active bounce pages"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); -SYSCTL_INT(_hw_busdma, OID_AUTO, total_bounced, CTLFLAG_RD, &total_bounced, 0, - "Total bounce requests"); -SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred, 0, - "Total bounce requests that were deferred"); struct bus_dmamap { struct bp_list bpages; @@ -120,6 +128,7 @@ static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); +static struct bounce_zone * alloc_bounce_zone(bus_dma_tag_t dmat); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit); @@ -217,9 +226,13 @@ /* Return a NULL tag on failure */ *dmat = NULL; - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT); - if (newtag == NULL) + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, + M_ZERO | M_NOWAIT); + if (newtag == NULL) { + CTR3(KTR_BUSDMA, "bus_dma_tag_create returned tag %p tag " + "flags 0x%x error %d", newtag, 0, error); return (ENOMEM); + } newtag->parent = parent; newtag->alignment = alignment; @@ -296,16 +309,26 @@ } else { *dmat = newtag; } + CTR3(KTR_BUSDMA, "bus_dma_tag_create returned tag %p tag flags 0x%x " + "error %d", newtag, (newtag != NULL ? newtag->flags : 0), error); return (error); } int bus_dma_tag_destroy(bus_dma_tag_t dmat) { + bus_dma_tag_t dmat_copy; + int error; + + error = 0; + dmat_copy = dmat; + if (dmat != NULL) { - if (dmat->map_count != 0) - return (EBUSY); + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } while (dmat != NULL) { bus_dma_tag_t parent; @@ -326,7 +349,10 @@ dmat = NULL; } } - return (0); +out: + CTR2(KTR_BUSDMA, "bus_dma_tag_destroy tag %p error %d", dmat_copy, + error); + return (error); } /* @@ -344,8 +370,11 @@ dmat->segments = (bus_dma_segment_t *)malloc( sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_NOWAIT); - if (dmat->segments == NULL) + if (dmat->segments == NULL) { + CTR2(KTR_BUSDMA, "bus_dmamap_create: tag %p error %d", + dmat, ENOMEM); return (ENOMEM); + } } /* @@ -355,13 +384,17 @@ */ if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) || dmat->alignment > 1 || dmat->boundary > 0) { + /* Must bounce */ int maxpages; *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, M_NOWAIT | M_ZERO); - if (*mapp == NULL) + if (*mapp == NULL) { + CTR2(KTR_BUSDMA, "bus_dmamap_create: tag %p error %d", + dmat, ENOMEM); return (ENOMEM); + } /* Initialize the new map */ STAILQ_INIT(&((*mapp)->bpages)); @@ -400,6 +433,8 @@ } if (error == 0) dmat->map_count++; + CTR3(KTR_BUSDMA, "bus_dmamap_create: tag %p tag flags 0x%x error %d", + dmat, dmat->flags, error); return (error); } @@ -411,11 +446,15 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { if (map != NULL && map != &nobounce_dmamap) { - if (STAILQ_FIRST(&map->bpages) != NULL) + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR2(KTR_BUSDMA, "bus_dmamap_destroy: tag %p error %d", + dmat, EBUSY); return (EBUSY); + } free(map, M_DEVBUF); } dmat->map_count--; + CTR1(KTR_BUSDMA, "bus_dmamap_destroy: tag %p error 0", dmat); return (0); } @@ -445,8 +484,11 @@ dmat->segments = (bus_dma_segment_t *)malloc( sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_NOWAIT); - if (dmat->segments == NULL) + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "bus_dmamem_alloc: tag %p tag " + "flags 0x%x error %d", dmat, dmat->flags, ENOMEM); return (ENOMEM); + } } if ((dmat->maxsize <= PAGE_SIZE) && @@ -463,8 +505,13 @@ 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, dmat->boundary); } - if (*vaddr == NULL) + if (*vaddr == NULL) { + CTR3(KTR_BUSDMA, "bus_dmamem_alloc: tag %p tag flags 0x%x " + "error %d", dmat, dmat->flags, ENOMEM); return (ENOMEM); + } + CTR3(KTR_BUSDMA, "bus_dmamem_alloc: tag %p tag flags 0x%x error %d", + dmat, dmat->flags, ENOMEM); return (0); } @@ -487,6 +534,8 @@ else { contigfree(vaddr, dmat->maxsize, M_DEVBUF); } + CTR2(KTR_BUSDMA, "bus_dmamem_free: tag %p flags 0x%x", dmat, + dmat->flags); } /* @@ -495,11 +544,11 @@ * the starting segment on entrace, and the ending segment on exit. * first indicates if this is the first invocation of this function. */ -static int +static __inline int _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_size_t buflen, - struct thread *td, + pmap_t pmap, int flags, bus_addr_t *lastaddrp, int *segp, @@ -512,23 +561,22 @@ bus_addr_t paddr; int needbounce = 0; int seg; - pmap_t pmap; segs = dmat->segments; if (map == NULL) map = &nobounce_dmamap; - if (td != NULL) - pmap = vmspace_pmap(td->td_proc->p_vmspace); - else - pmap = NULL; - - if ((dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) - || dmat->boundary > 0 || dmat->alignment > 1) - && map != &nobounce_dmamap && map->pagesneeded == 0) { + if ((map != &nobounce_dmamap && map->pagesneeded == 0) + && (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) + || dmat->boundary > 0 || dmat->alignment > 1)) { vm_offset_t vendaddr; + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), + dmat->boundary, dmat->alignment); + CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", + map, &nobounce_dmamap, map->pagesneeded); /* * Count the number of bounce pages * needed in order to complete this transfer @@ -544,10 +592,9 @@ } vaddr += PAGE_SIZE; } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } - vaddr = (vm_offset_t)buf; - /* Reserve Necessary Bounce Pages */ if (map->pagesneeded != 0) { mtx_lock(&bounce_lock); @@ -571,6 +618,7 @@ mtx_unlock(&bounce_lock); } + vaddr = (vm_offset_t)buf; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -658,14 +706,19 @@ error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, &lastaddr, &nsegs, 1); - if (error == EINPROGRESS) + if (error == EINPROGRESS) { + CTR3(KTR_BUSDMA, "bus_dmamap_load: tag %p tag flags 0x%x " + "error %d", dmat, dmat->flags, error); return (error); + } if (error) (*callback)(callback_arg, dmat->segments, 0, error); else (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); + CTR2(KTR_BUSDMA, "bus_dmamap_load: tag %p tag flags 0x%x error 0", + dmat, dmat->flags); return (0); } @@ -711,6 +764,8 @@ (*callback)(callback_arg, dmat->segments, nsegs+1, m0->m_pkthdr.len, error); } + CTR3(KTR_BUSDMA, "bus_dmamap_load_mbuf: tag %p tag flags 0x%x " + "error %d", dmat, dmat->flags, error); return (error); } @@ -727,17 +782,18 @@ int nsegs, error, first, i; bus_size_t resid; struct iovec *iov; - struct thread *td = NULL; + pmap_t pmap; flags |= BUS_DMA_NOWAIT; resid = uio->uio_resid; iov = uio->uio_iov; if (uio->uio_segflg == UIO_USERSPACE) { - td = uio->uio_td; - KASSERT(td != NULL, + KASSERT(uio->uio_td != NULL, ("bus_dmamap_load_uio: USERSPACE but no proc")); - } + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = NULL; nsegs = 0; error = 0; @@ -754,7 +810,7 @@ if (minlen > 0) { error = _bus_dmamap_load_buffer(dmat, map, addr, minlen, >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411100802.iAA82fuf094470>