Date: Sun, 6 Jun 2010 14:31:42 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r208872 - in projects/ppc64: lib/libpmc sys/arm/arm sys/dev/ata sys/dev/ata/chipsets sys/dev/bge sys/dev/hwpmc sys/dev/isp sys/mips/mips sys/netinet sys/powerpc/aim sys/powerpc/booke sy... Message-ID: <201006061431.o56EVgaL068073@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Sun Jun 6 14:31:41 2010 New Revision: 208872 URL: http://svn.freebsd.org/changeset/base/208872 Log: IFC once more @ 208871 Modified: projects/ppc64/lib/libpmc/pmclog.c projects/ppc64/sys/arm/arm/pmap.c projects/ppc64/sys/dev/ata/ata-all.h projects/ppc64/sys/dev/ata/ata-lowlevel.c projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c projects/ppc64/sys/dev/bge/if_bge.c projects/ppc64/sys/dev/bge/if_bgereg.h projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c projects/ppc64/sys/dev/isp/isp.c projects/ppc64/sys/mips/mips/pmap.c projects/ppc64/sys/netinet/sctp_auth.c projects/ppc64/sys/netinet/sctp_bsd_addr.c projects/ppc64/sys/netinet/sctp_indata.c projects/ppc64/sys/netinet/sctp_input.c projects/ppc64/sys/netinet/sctp_output.c projects/ppc64/sys/netinet/sctp_pcb.c projects/ppc64/sys/netinet/sctp_pcb.h projects/ppc64/sys/netinet/sctp_usrreq.c projects/ppc64/sys/netinet/sctputil.c projects/ppc64/sys/powerpc/aim/mmu_oea.c projects/ppc64/sys/powerpc/booke/pmap.c projects/ppc64/sys/powerpc/powermac/macgpio.c projects/ppc64/sys/powerpc/powermac/uninorth.c projects/ppc64/sys/sparc64/sparc64/pmap.c projects/ppc64/sys/sys/pmc.h projects/ppc64/tools/tools/netrate/tcpp/README projects/ppc64/tools/tools/netrate/tcpp/tcpp.c projects/ppc64/tools/tools/netrate/tcpp/tcpp.h projects/ppc64/tools/tools/netrate/tcpp/tcpp_client.c projects/ppc64/tools/tools/netrate/tcpp/tcpp_server.c projects/ppc64/usr.bin/bc/scan.l projects/ppc64/usr.bin/dc/bcode.c projects/ppc64/usr.bin/dc/dc.c projects/ppc64/usr.sbin/pmcstat/pmcpl_calltree.c projects/ppc64/usr.sbin/pmcstat/pmcstat.c projects/ppc64/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: projects/ppc64/ (props changed) projects/ppc64/cddl/contrib/opensolaris/ (props changed) projects/ppc64/contrib/ee/ (props changed) projects/ppc64/contrib/expat/ (props changed) projects/ppc64/contrib/file/ (props changed) projects/ppc64/contrib/gdb/ (props changed) projects/ppc64/contrib/gnu-sort/ (props changed) projects/ppc64/contrib/groff/ (props changed) projects/ppc64/contrib/less/ (props changed) projects/ppc64/contrib/libpcap/ (props changed) projects/ppc64/contrib/ncurses/ (props changed) projects/ppc64/contrib/one-true-awk/ (props changed) projects/ppc64/contrib/openbsm/ (props changed) projects/ppc64/contrib/openpam/ (props changed) projects/ppc64/contrib/pf/ (props changed) projects/ppc64/contrib/tcpdump/ (props changed) projects/ppc64/contrib/tcsh/ (props changed) projects/ppc64/contrib/tzcode/stdtime/ (props changed) projects/ppc64/contrib/tzcode/zic/ (props changed) projects/ppc64/contrib/tzdata/ (props changed) projects/ppc64/contrib/wpa/ (props changed) projects/ppc64/lib/libutil/ (props changed) projects/ppc64/lib/libz/ (props changed) projects/ppc64/sbin/ (props changed) projects/ppc64/sbin/ipfw/ (props changed) projects/ppc64/sys/ (props changed) projects/ppc64/sys/amd64/include/xen/ (props changed) projects/ppc64/sys/cddl/contrib/opensolaris/ (props changed) projects/ppc64/sys/contrib/dev/acpica/ (props changed) projects/ppc64/sys/contrib/x86emu/ (props changed) projects/ppc64/sys/dev/xen/xenpci/ (props changed) projects/ppc64/usr.bin/csup/ (props changed) projects/ppc64/usr.bin/procstat/ (props changed) Modified: projects/ppc64/lib/libpmc/pmclog.c ============================================================================== --- projects/ppc64/lib/libpmc/pmclog.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/lib/libpmc/pmclog.c Sun Jun 6 14:31:41 2010 (r208872) @@ -549,8 +549,10 @@ pmclog_open(int fd) /* allocate space for a work area */ if (ps->ps_fd != PMCLOG_FD_NONE) { - if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL) + if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL) { + free(ps); return NULL; + } } return ps; Modified: projects/ppc64/sys/arm/arm/pmap.c ============================================================================== --- projects/ppc64/sys/arm/arm/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/arm/arm/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3412,7 +3412,8 @@ do_l2b_alloc: if (prot & VM_PROT_WRITE) { npte |= L2_S_PROT_W; - if (m != NULL) + if (m != NULL && + (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) vm_page_flag_set(m, PG_WRITEABLE); } npte |= pte_l2_s_cache_mode; Modified: projects/ppc64/sys/dev/ata/ata-all.h ============================================================================== --- projects/ppc64/sys/dev/ata/ata-all.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/ata-all.h Sun Jun 6 14:31:41 2010 (r208872) @@ -564,6 +564,7 @@ struct ata_channel { #define ATA_CHECKS_CABLE 0x20 #define ATA_NO_ATAPI_DMA 0x40 #define ATA_SATA 0x80 +#define ATA_DMA_BEFORE_CMD 0x100 int pm_level; /* power management level */ int devices; /* what is present */ Modified: projects/ppc64/sys/dev/ata/ata-lowlevel.c ============================================================================== --- projects/ppc64/sys/dev/ata/ata-lowlevel.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/ata-lowlevel.c Sun Jun 6 14:31:41 2010 (r208872) @@ -141,6 +141,14 @@ ata_begin_transaction(struct ata_request goto begin_finished; } + /* start DMA engine if necessary */ + if ((ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { + device_printf(request->parent, "error starting DMA\n"); + request->result = EIO; + goto begin_finished; + } + /* issue command */ if (ch->hw.command(request)) { device_printf(request->parent, "error issuing %s command\n", @@ -150,7 +158,8 @@ ata_begin_transaction(struct ata_request } /* start DMA engine */ - if (ch->dma.start && ch->dma.start(request)) { + if (!(ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; Modified: projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 14:31:41 2010 (r208872) @@ -241,6 +241,16 @@ ata_serverworks_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0); ATA_OUTL(ctlr->r_res2, ch_offset + 0x80, ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000); + + /* + * Some controllers have a bug where they will send the command + * to the drive before seeing a DMA start, and then can begin + * receiving data before the DMA start arrives. The controller + * will then become confused and either corrupt the data or crash. + * Remedy this by starting DMA before sending the drive command. + */ + + ch->flags |= ATA_DMA_BEFORE_CMD; } /* chip does not reliably do 64K DMA transfers */ Modified: projects/ppc64/sys/dev/bge/if_bge.c ============================================================================== --- projects/ppc64/sys/dev/bge/if_bge.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/bge/if_bge.c Sun Jun 6 14:31:41 2010 (r208872) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -922,6 +924,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -979,6 +982,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -991,18 +999,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1014,12 +1026,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1027,7 +1033,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1036,8 +1042,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1079,14 +1085,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3273,6 +3279,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3336,24 +3369,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: projects/ppc64/sys/dev/bge/if_bgereg.h ============================================================================== --- projects/ppc64/sys/dev/bge/if_bgereg.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/bge/if_bgereg.h Sun Jun 6 14:31:41 2010 (r208872) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { Modified: projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1248,7 +1248,7 @@ pmc_process_csw_in(struct thread *td) continue; /* increment PMC runcount */ - atomic_add_rel_32(&pm->pm_runcount, 1); + atomic_add_rel_int(&pm->pm_runcount, 1); /* configure the HWPMC we are going to use. */ pcd = pmc_ri_to_classdep(md, ri, &adjri); @@ -1387,7 +1387,7 @@ pmc_process_csw_out(struct thread *td) pcd->pcd_stop_pmc(cpu, adjri); /* reduce this PMC's runcount */ - atomic_subtract_rel_32(&pm->pm_runcount, 1); + atomic_subtract_rel_int(&pm->pm_runcount, 1); /* * If this PMC is associated with this process, @@ -3252,9 +3252,6 @@ pmc_syscall_handler(struct thread *td, v } } - if (error) - break; - /* * Look for valid values for 'pm_flags' */ @@ -4045,7 +4042,7 @@ pmc_process_interrupt(int cpu, struct pm ("[pmc,%d] pm=%p runcount %d", __LINE__, (void *) pm, pm->pm_runcount)); - atomic_add_rel_32(&pm->pm_runcount, 1); /* hold onto PMC */ + atomic_add_rel_int(&pm->pm_runcount, 1); /* hold onto PMC */ ps->ps_pmc = pm; if ((td = curthread) && td->td_proc) ps->ps_pid = td->td_proc->p_pid; @@ -4246,7 +4243,7 @@ pmc_process_samples(int cpu) entrydone: ps->ps_nsamples = 0; /* mark entry as free */ - atomic_subtract_rel_32(&pm->pm_runcount, 1); + atomic_subtract_rel_int(&pm->pm_runcount, 1); /* increment read pointer, modulo sample size */ if (++ps == psb->ps_fence) @@ -4418,7 +4415,7 @@ pmc_process_exit(void *arg __unused, str mtx_pool_unlock_spin(pmc_mtxpool, pm); } - atomic_subtract_rel_32(&pm->pm_runcount,1); + atomic_subtract_rel_int(&pm->pm_runcount,1); KASSERT((int) pm->pm_runcount >= 0, ("[pmc,%d] runcount is %d", __LINE__, ri)); Modified: projects/ppc64/sys/dev/isp/isp.c ============================================================================== --- projects/ppc64/sys/dev/isp/isp.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/isp/isp.c Sun Jun 6 14:31:41 2010 (r208872) @@ -4184,7 +4184,7 @@ int isp_start(XS_T *xs) { ispsoftc_t *isp; - uint32_t handle; + uint32_t handle, cdblen; uint8_t local[QENTRY_LEN]; ispreq_t *reqp; void *cdbp, *qep; @@ -4369,11 +4369,17 @@ isp_start(XS_T *xs) tptr = &reqp->req_time; + /* + * NB: we do not support long CDBs + */ + cdblen = XS_CDBLEN(xs); + if (IS_SCSI(isp)) { reqp->req_target = target | (XS_CHANNEL(xs) << 7); reqp->req_lun_trn = XS_LUN(xs); - reqp->req_cdblen = XS_CDBLEN(xs); + cdblen = MIN(cdblen, sizeof (reqp->req_cdb)); cdbp = reqp->req_cdb; + reqp->req_cdblen = cdblen; } else if (IS_24XX(isp)) { ispreqt7_t *t7 = (ispreqt7_t *)local; fcportdb_t *lp; @@ -4388,25 +4394,29 @@ isp_start(XS_T *xs) t7->req_lun[0] |= 0x40; } t7->req_lun[1] = XS_LUN(xs); - cdbp = t7->req_cdb; tptr = &t7->req_time; + cdbp = t7->req_cdb; + cdblen = MIN(cdblen, sizeof (t7->req_cdb)); } else if (ISP_CAP_2KLOGIN(isp)) { ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = target; t2e->req_scclun = XS_LUN(xs); cdbp = t2e->req_cdb; + cdblen = MIN(cdblen, sizeof (t2e->req_cdb)); } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_scclun = XS_LUN(xs); cdbp = t2->req_cdb; + cdblen = MIN(cdblen, sizeof (t2->req_cdb)); } else { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_lun_trn = XS_LUN(xs); cdbp = t2->req_cdb; + cdblen = MIN(cdblen, sizeof (t2->req_cdb)); } - ISP_MEMCPY(cdbp, XS_CDBP(xs), XS_CDBLEN(xs)); + ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); *tptr = XS_TIME(xs) / 1000; if (*tptr == 0 && XS_TIME(xs)) { Modified: projects/ppc64/sys/mips/mips/pmap.c ============================================================================== --- projects/ppc64/sys/mips/mips/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/mips/mips/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3072,26 +3072,20 @@ page_is_managed(vm_offset_t pa) static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot) { - int rw = 0; + int rw; if (!(prot & VM_PROT_WRITE)) rw = PTE_ROPAGE; - else { - if (va >= VM_MIN_KERNEL_ADDRESS) { - /* - * Don't bother to trap on kernel writes, just - * record page as dirty. - */ - rw = PTE_RWPAGE; - vm_page_dirty(m); - } else if ((m->md.pv_flags & PV_TABLE_MOD) || - m->dirty == VM_PAGE_BITS_ALL) + else if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->md.pv_flags & PV_TABLE_MOD) != 0) rw = PTE_RWPAGE; else rw = PTE_CWPAGE; vm_page_flag_set(m, PG_WRITEABLE); - } - return rw; + } else + /* Needn't emulate a modified bit for unmanaged pages. */ + rw = PTE_RWPAGE; + return (rw); } /* Modified: projects/ppc64/sys/netinet/sctp_auth.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_auth.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_auth.c Sun Jun 6 14:31:41 2010 (r208872) @@ -895,9 +895,9 @@ static inline int sctp_get_hmac_block_len(uint16_t hmac_algo) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: #ifdef HAVE_SHA224 - case SCTP_AUTH_HMAC_ID_SHA224: + case SCTP_AUTH_HMAC_ID_SHA224: #endif return (64); #ifdef HAVE_SHA2 @@ -918,7 +918,7 @@ static void sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Init(&ctx->sha1); break; #ifdef HAVE_SHA224 @@ -948,7 +948,7 @@ sctp_hmac_update(uint16_t hmac_algo, sct uint8_t * text, uint32_t textlen) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Update(&ctx->sha1, text, textlen); break; #ifdef HAVE_SHA224 @@ -978,7 +978,7 @@ sctp_hmac_final(uint16_t hmac_algo, sctp uint8_t * digest) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Final(digest, &ctx->sha1); break; #ifdef HAVE_SHA224 Modified: projects/ppc64/sys/netinet/sctp_bsd_addr.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_bsd_addr.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_bsd_addr.c Sun Jun 6 14:31:41 2010 (r208872) @@ -140,7 +140,6 @@ sctp_startup_iterator(void) SCTP_KTRHEAD_NAME); } - #ifdef INET6 void Modified: projects/ppc64/sys/netinet/sctp_indata.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_indata.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_indata.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3849,7 +3849,8 @@ sctp_window_probe_recovery(struct sctp_t sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ tp1->sent = SCTP_DATAGRAM_RESEND; - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, tp1->whoTo->flight_size, @@ -4262,7 +4263,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } @@ -5263,7 +5264,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } Modified: projects/ppc64/sys/netinet/sctp_input.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_input.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_input.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3067,7 +3067,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4861,6 +4861,9 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } *offset = length; return (NULL); } @@ -5408,13 +5411,16 @@ sctp_process_ecn_marked_b(struct sctp_tc } #ifdef INVARIANTS -static void -sctp_validate_no_locks(struct sctp_inpcb *inp) +#ifdef __GNUC__ +__attribute__((noinline)) +#endif + void + sctp_validate_no_locks(struct sctp_inpcb *inp) { - struct sctp_tcb *stcb; + struct sctp_tcb *lstcb; - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&stcb->tcb_mtx)) { + LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { + if (mtx_owned(&lstcb->tcb_mtx)) { panic("Own lock on stcb at return from input"); } } Modified: projects/ppc64/sys/netinet/sctp_output.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_output.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_output.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3053,32 +3053,32 @@ sctp_source_address_selection(struct sct * it out * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V4 - *------------------------------------------ + * ------------------------------------------ * source * dest * result * ----------------------------------------- * <a> Private * Global * NAT * ----------------------------------------- * <b> Private * Private * No problem * ----------------------------------------- - * <c> Global * Private * Huh, How will this work? + * <c> Global * Private * Huh, How will this work? * ----------------------------------------- - * <d> Global * Global * No Problem - *------------------------------------------ + * <d> Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V6 - *------------------------------------------ + *------------------------------------------ * source * dest * result * ----------------------------------------- * <a> Linklocal * Global * * ----------------------------------------- * <b> Linklocal * Linklocal * No problem * ----------------------------------------- - * <c> Global * Linklocal * Huh, How will this work? + * <c> Global * Linklocal * Huh, How will this work? * ----------------------------------------- - * <d> Global * Global * No Problem - *------------------------------------------ + * <d> Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - * + * * And then we add to that what happens if there are multiple addresses * assigned to an interface. Remember the ifa on a ifn is a linked * list of addresses. So one interface can have more than one IP @@ -3091,13 +3091,13 @@ sctp_source_address_selection(struct sct * Decisions: * * - count the number of addresses on the interface. - * - if it is one, no problem except case <c>. - * For <a> we will assume a NAT out there. + * - if it is one, no problem except case <c>. + * For <a> we will assume a NAT out there. * - if there are more than one, then we need to worry about scope P * or G. We should prefer G -> G and P -> P if possible. * Then as a secondary fall back to mixed types G->P being a last * ditch one. - * - The above all works for bound all, but bound specific we need to + * - The above all works for bound all, but bound specific we need to * use the same concept but instead only consider the bound * addresses. If the bound set is NOT assigned to the interface then * we must use rotation amongst the bound addresses.. @@ -8913,6 +8913,9 @@ sctp_chunk_retransmission(struct sctp_in if ((chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) || (chk->rec.chunk_id.id == SCTP_STREAM_RESET) || (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)) { + if (chk->sent != SCTP_DATAGRAM_RESEND) { + continue; + } if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { if (chk != asoc->str_reset) { /* @@ -8973,7 +8976,7 @@ sctp_chunk_retransmission(struct sctp_in /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; - /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */ + sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); if (fwd_tsn == 0) { return (0); } else { @@ -13427,6 +13430,13 @@ out_unlocked: } } #endif +#ifdef INVARIANTS + if (inp) { + sctp_validate_no_locks(inp); + } else { + printf("Warning - inp is NULL so cant validate locks\n"); + } +#endif if (top) { sctp_m_freem(top); } Modified: projects/ppc64/sys/netinet/sctp_pcb.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_pcb.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_pcb.c Sun Jun 6 14:31:41 2010 (r208872) @@ -2296,7 +2296,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_asocidhash == NULL) { SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); - return error; + return (ENOBUFS); } #ifdef IPSEC { @@ -3107,29 +3107,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - SCTP_ITERATOR_LOCK(); - - so = inp->sctp_socket; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { - /* been here before.. eeks.. get out of here */ - SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); - SCTP_ITERATOR_UNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 1); -#endif - return; - } - SCTP_ASOC_CREATE_LOCK(inp); - SCTP_INP_INFO_WLOCK(); - - SCTP_INP_WLOCK(inp); - /* First time through we have the socket lock, after that no more. */ if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { /* * Once we are in we can remove the flag from = 1 is only * passed from the actual closing routines that are called * via the sockets layer. */ + SCTP_ITERATOR_LOCK(); inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; @@ -3138,7 +3122,22 @@ sctp_inpcb_free(struct sctp_inpcb *inp, /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); } + so = inp->sctp_socket; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { + /* been here before.. eeks.. get out of here */ + SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 1); +#endif + return; + } + SCTP_ASOC_CREATE_LOCK(inp); + SCTP_INP_INFO_WLOCK(); + + SCTP_INP_WLOCK(inp); + /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3164,8 +3163,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { /* Skip guys being freed */ - /* asoc->sctp_socket = NULL; FIXME MT */ cnt_in_sd++; + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + /* + * Special case - we did not start a + * kill timer on the asoc due to it + * was not closed. So go ahead and + * start it now. + */ + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } SCTP_TCB_UNLOCK(asoc); continue; } @@ -3329,7 +3337,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif @@ -3407,7 +3414,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif @@ -3419,7 +3425,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 4); #endif @@ -3541,7 +3546,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } @@ -4590,8 +4594,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Someone holds a reference OR the socket is unaccepted * yet. */ - if (stcb->asoc.refcnt) + if ((stcb->asoc.refcnt) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + } SCTP_TCB_UNLOCK(stcb); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) Modified: projects/ppc64/sys/netinet/sctp_pcb.h ============================================================================== --- projects/ppc64/sys/netinet/sctp_pcb.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_pcb.h Sun Jun 6 14:31:41 2010 (r208872) @@ -621,5 +621,11 @@ sctp_initiate_iterator(inp_func inpf, struct sctp_inpcb *, uint8_t co_off); +#ifdef INVARIANTS +void + sctp_validate_no_locks(struct sctp_inpcb *inp); + +#endif + #endif /* _KERNEL */ #endif /* !__sctp_pcb_h__ */ Modified: projects/ppc64/sys/netinet/sctp_usrreq.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_usrreq.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_usrreq.c Sun Jun 6 14:31:41 2010 (r208872) @@ -4678,6 +4678,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in *sin; SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; @@ -4691,6 +4693,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in6 *sin6; SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; @@ -4756,6 +4760,8 @@ sctp_ingetaddr(struct socket *so, struct * Do the malloc first in case it blocks. */ SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); inp = (struct sctp_inpcb *)so->so_pcb; @@ -4858,6 +4864,8 @@ sctp_peeraddr(struct socket *so, struct return (ENOTCONN); } SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); Modified: projects/ppc64/sys/netinet/sctputil.c ============================================================================== --- projects/ppc64/sys/netinet/sctputil.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctputil.c Sun Jun 6 14:31:41 2010 (r208872) @@ -53,15 +53,9 @@ __FBSDID("$FreeBSD$"); #define NUMBER_OF_MTU_SIZES 18 -#if defined(__Windows__) && !defined(SCTP_LOCAL_TRACE_BUF) -#include "eventrace_netinet.h" -#include "sctputil.tmh" /* this is the file that will be auto - * generated */ -#else #ifndef KTR_SCTP #define KTR_SCTP KTR_SUBSYS #endif -#endif void sctp_sblog(struct sockbuf *sb, @@ -4207,7 +4201,7 @@ void sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh) { switch (iph->ip_v) { - case IPVERSION: + case IPVERSION: { struct sockaddr_in lsa, fsa; Modified: projects/ppc64/sys/powerpc/aim/mmu_oea.c ============================================================================== --- projects/ppc64/sys/powerpc/aim/mmu_oea.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/aim/mmu_oea.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1786,7 +1786,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) PMAP_UNLOCK(pmap); } if ((m->flags & PG_WRITEABLE) && moea_is_modified(mmu, m)) { - moea_attr_clear(m, LPTE_CHG); + moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); Modified: projects/ppc64/sys/powerpc/booke/pmap.c ============================================================================== --- projects/ppc64/sys/powerpc/booke/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/booke/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1596,7 +1596,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t if (!su) flags |= PTE_UW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((flags & PTE_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } else { /* Handle modified pages, sense modify status. */ @@ -1662,7 +1663,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t if (!su) flags |= PTE_UW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } if (prot & VM_PROT_EXECUTE) { Modified: projects/ppc64/sys/powerpc/powermac/macgpio.c ============================================================================== --- projects/ppc64/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:31:41 2010 (r208872) @@ -98,6 +98,8 @@ static device_method_t macgpio_methods[] DEVMETHOD(bus_deactivate_resource, macgpio_deactivate_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, macgpio_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), Modified: projects/ppc64/sys/powerpc/powermac/uninorth.c ============================================================================== --- projects/ppc64/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:31:41 2010 (r208872) @@ -115,6 +115,8 @@ static device_method_t unin_chip_methods DEVMETHOD(bus_deactivate_resource, unin_chip_deactivate_resource), DEVMETHOD(bus_get_resource_list, unin_chip_get_resource_list), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, unin_chip_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), Modified: projects/ppc64/sys/sparc64/sparc64/pmap.c ============================================================================== --- projects/ppc64/sys/sparc64/sparc64/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/sparc64/sparc64/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1409,7 +1409,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t tp->tte_data |= TD_SW; if (wired) tp->tte_data |= TD_W; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } else if ((data & TD_W) != 0) vm_page_dirty(m); @@ -1429,7 +1430,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t } else { /* * If there is an existing mapping, but its for a different - * phsyical address, delete the old mapping. + * physical address, delete the old mapping. */ if (tp != NULL) { CTR0(KTR_PMAP, "pmap_enter_locked: replace"); @@ -1449,7 +1450,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t data |= TD_P; if ((prot & VM_PROT_WRITE) != 0) { data |= TD_SW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } if (prot & VM_PROT_EXECUTE) { data |= TD_EXEC; Modified: projects/ppc64/sys/sys/pmc.h ============================================================================== --- projects/ppc64/sys/sys/pmc.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/sys/pmc.h Sun Jun 6 14:31:41 2010 (r208872) @@ -680,7 +680,7 @@ struct pmc { enum pmc_event pm_event; /* event being measured */ uint32_t pm_flags; /* additional flags PMC_F_... */ struct pmc_owner *pm_owner; /* owner thread state */ - uint32_t pm_runcount; /* #cpus currently on */ + int pm_runcount; /* #cpus currently on */ enum pmc_state pm_state; /* current PMC state */ /* Modified: projects/ppc64/tools/tools/netrate/tcpp/README ============================================================================== --- projects/ppc64/tools/tools/netrate/tcpp/README Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/tools/tools/netrate/tcpp/README Sun Jun 6 14:31:41 2010 (r208872) @@ -39,6 +39,7 @@ The client has more to configure, with t -c <remoteIP> Select client mode, and specific dest IP -C Print connections/second instead of GBps + -P Pin each worker to a CPU -M <localIPcount> Number of sequential local IPs to use; req. -l -T Include CPU use summary in stats at end of run -b <bytespertcp> Data bytes per connection Modified: projects/ppc64/tools/tools/netrate/tcpp/tcpp.c ============================================================================== --- projects/ppc64/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 14:31:41 2010 (r208872) @@ -51,7 +51,7 @@ struct sockaddr_in remoteip; /* Base target address. */ struct sockaddr_in localipbase; /* Base local address, if -l. */ -int cflag, lflag, mflag, pflag, sflag, tflag, Cflag, Mflag, Tflag; +int cflag, lflag, mflag, pflag, sflag, tflag, Cflag, Mflag, Pflag, Tflag; uint64_t bflag; u_short rflag; @@ -61,24 +61,27 @@ usage(void) fprintf(stderr, "client: tcpp" " -c remoteIP" - " [-CT]" + " [-CPT]" " [-M localIPcount]" " [-l localIPbase]" + "\n\t" " [-b bytespertcp]" " [-m maxtcpsatonce]" - "\n" - "\t" " [-p procs]" " [-t tcpsperproc]" + "\n" + "\t" " [-r baseport]" "\n"); fprintf(stderr, "server: tcpp" " -s" - " [-T]" + " [-PT]" " [-l localIPbase]" " [-m maxtcpsatonce]" " [-p procs]" + "\n" + "\t" " [-r baseport]" "\n"); exit(EX_USAGE); @@ -109,7 +112,7 @@ main(int argc, char *argv[]) rflag = BASEPORT_DEFAULT; tflag = TCPS_DEFAULT; Mflag = 1; - while ((ch = getopt(argc, argv, "b:c:l:m:p:r:st:CM:T")) != -1) { + while ((ch = getopt(argc, argv, "b:c:l:m:p:r:st:CM:PT")) != -1) { switch (ch) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006061431.o56EVgaL068073>