Date: Fri, 5 Nov 2004 17:35:54 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 64339 for review Message-ID: <200411051735.iA5HZsUD020450@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=64339 Change 64339 by peter@peter_daintree on 2004/11/05 17:34:55 Integrate i386 changes Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#19 integrate .. //depot/projects/hammer/sys/amd64/amd64/db_trace.c#24 integrate .. //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#30 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#105 integrate .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#75 integrate .. //depot/projects/hammer/sys/amd64/conf/GENERIC#61 integrate .. //depot/projects/hammer/sys/amd64/conf/NOTES#49 integrate .. //depot/projects/hammer/sys/amd64/pci/pci_bus.c#26 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#19 (text+ko) ==== @@ -40,6 +40,7 @@ #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> @@ -534,11 +535,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, @@ -551,23 +552,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 @@ -583,10 +583,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); @@ -610,6 +609,7 @@ mtx_unlock(&bounce_lock); } + vaddr = (vm_offset_t)buf; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -773,17 +773,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; @@ -800,7 +801,7 @@ if (minlen > 0) { error = _bus_dmamap_load_buffer(dmat, map, addr, minlen, - td, flags, &lastaddr, &nsegs, first); + pmap, flags, &lastaddr, &nsegs, first); first = 0; resid -= minlen; ==== //depot/projects/hammer/sys/amd64/amd64/db_trace.c#24 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#30 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#105 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#75 (text+ko) ==== @@ -127,6 +127,7 @@ struct cpu_info { int cpu_present:1; int cpu_bsp:1; + int cpu_disabled:1; } static cpu_info[MAXCPU]; static int cpu_apic_ids[MAXCPU]; @@ -350,7 +351,11 @@ /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x < MAXCPU; x++) { - if (cpu_info[x].cpu_present && !cpu_info[x].cpu_bsp) { + if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) + continue; + if (cpu_info[x].cpu_disabled) + printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); @@ -582,9 +587,19 @@ /* start each AP */ cpu = 0; for (apic_id = 0; apic_id < MAXCPU; apic_id++) { + + /* Ignore non-existent CPUs and the BSP. */ if (!cpu_info[apic_id].cpu_present || cpu_info[apic_id].cpu_bsp) continue; + + /* Don't use this CPU if it has been disabled by a tunable. */ + if (resource_disabled("lapic", apic_id)) { + cpu_info[apic_id].cpu_disabled = 1; + mp_ncpus--; + continue; + } + cpu++; /* save APIC ID for this logical ID */ ==== //depot/projects/hammer/sys/amd64/conf/GENERIC#61 (text+ko) ==== @@ -123,6 +123,7 @@ device amr # AMI MegaRAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options +#device hptmv # Highpoint RocketRAID 182x device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID ==== //depot/projects/hammer/sys/amd64/conf/NOTES#49 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# (XXX from i386:NOTES,v 1.1173) +# (XXX from i386:NOTES,v 1.1174) # $FreeBSD: src/sys/amd64/conf/NOTES,v 1.20 2004/09/22 01:04:54 peter Exp $ # @@ -276,6 +276,11 @@ device aacp # SCSI Passthrough interface (optional, CAM required) # +# Highpoint RocketRAID 182x. This is really just software RAID on a +# Marvell SATA chip. +#device hptmv # Broken, i386-only binary. + +# # IBM (now Adaptec) ServeRAID controllers device ips ==== //depot/projects/hammer/sys/amd64/pci/pci_bus.c#26 (text+ko) ====
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411051735.iA5HZsUD020450>