From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 01:09:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47FF0106566B; Sun, 5 Dec 2010 01:09:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 365158FC1E; Sun, 5 Dec 2010 01:09:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB519nKp055057; Sun, 5 Dec 2010 01:09:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB519nfq055055; Sun, 5 Dec 2010 01:09:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012050109.oB519nfq055055@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 5 Dec 2010 01:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216192 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 01:09:49 -0000 Author: bz Date: Sun Dec 5 01:09:48 2010 New Revision: 216192 URL: http://svn.freebsd.org/changeset/base/216192 Log: Use correct field to track statistics counting error as bad header length. This assimilates the code to what ip_input has been doing since r1.1 in this case. Submitted by: Rozhuk Ivan (rozhuk.im gmail.com) MFC after: 4 days Modified: head/sys/netinet/ip_fastfwd.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Sat Dec 4 23:36:40 2010 (r216191) +++ head/sys/netinet/ip_fastfwd.c Sun Dec 5 01:09:48 2010 (r216192) @@ -218,7 +218,7 @@ ip_fastforward(struct mbuf *m) */ hlen = ip->ip_hl << 2; if (hlen < sizeof(struct ip)) { /* minimum header length */ - IPSTAT_INC(ips_badlen); + IPSTAT_INC(ips_badhlen); goto drop; } if (hlen > m->m_len) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 01:17:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF8851065672; Sun, 5 Dec 2010 01:17:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD5DC8FC1C; Sun, 5 Dec 2010 01:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB51Hr4R055671; Sun, 5 Dec 2010 01:17:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB51HrD0055669; Sun, 5 Dec 2010 01:17:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012050117.oB51HrD0055669@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Dec 2010 01:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216193 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 01:17:53 -0000 Author: nwhitehorn Date: Sun Dec 5 01:17:53 2010 New Revision: 216193 URL: http://svn.freebsd.org/changeset/base/216193 Log: Switch which software-reserved bit is used to designate a locked PTE to correspond to the definition used by the PAPR spec so that its PTE insertion algorithm will properly respect it. Modified: head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Sun Dec 5 01:09:48 2010 (r216192) +++ head/sys/powerpc/include/pte.h Sun Dec 5 01:17:53 2010 (r216193) @@ -95,8 +95,8 @@ struct lpteg { /* High quadword: */ #define LPTE_VSID_SHIFT 12 #define LPTE_API 0x0000000000000F80ULL -#define LPTE_WIRED 0x0000000000000010ULL -#define LPTE_LOCKED 0x0000000000000008ULL +#define LPTE_LOCKED 0x0000000000000040ULL +#define LPTE_WIRED 0x0000000000000008ULL #define LPTE_BIG 0x0000000000000004ULL /* 4kb/16Mb page */ #define LPTE_HID 0x0000000000000002ULL #define LPTE_VALID 0x0000000000000001ULL From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 03:20:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B72BD106564A; Sun, 5 Dec 2010 03:20:55 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5508FC08; Sun, 5 Dec 2010 03:20:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB53KtfP065322; Sun, 5 Dec 2010 03:20:55 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB53Ktrt065320; Sun, 5 Dec 2010 03:20:55 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012050320.oB53Ktrt065320@svn.freebsd.org> From: Colin Percival Date: Sun, 5 Dec 2010 03:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216194 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 03:20:55 -0000 Author: cperciva Date: Sun Dec 5 03:20:55 2010 New Revision: 216194 URL: http://svn.freebsd.org/changeset/base/216194 Log: MFamd64 r204214: Enforce stronger alignment semantics (require that the end of segments be aligned, not just the start of segments) in order to allow Xen's blkfront driver to operate correctly. PR: kern/152818 MFC after: 3 days Modified: head/sys/i386/i386/busdma_machdep.c Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Sun Dec 5 01:17:53 2010 (r216193) +++ head/sys/i386/i386/busdma_machdep.c Sun Dec 5 03:20:55 2010 (r216194) @@ -246,8 +246,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->alignment = alignment; newtag->boundary = boundary; newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + - (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; newtag->maxsize = maxsize; @@ -594,15 +593,19 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { + bus_size_t sg_len; + + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); if (pmap) paddr = pmap_extract(pmap, vaddr); else paddr = pmap_kextract(vaddr); if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && run_filter(dmat, paddr) != 0) { + sg_len = roundup2(sg_len, dmat->alignment); map->pagesneeded++; } - vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); + vaddr += sg_len; } CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } @@ -669,6 +672,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm bmask = ~(dmat->boundary - 1); for (seg = *segp; buflen > 0 ; ) { + bus_size_t max_sgsize; + /* * Get the physical address for this segment. */ @@ -680,11 +685,16 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm /* * Compute the segment size, and adjust counts. */ - sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); - if (sgsize > dmat->maxsegsz) - sgsize = dmat->maxsegsz; - if (buflen < sgsize) - sgsize = buflen; + max_sgsize = MIN(buflen, dmat->maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = roundup2(sgsize, dmat->alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } /* * Make sure we don't cross any boundaries. @@ -695,10 +705,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm sgsize = (baddr - curaddr); } - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && run_filter(dmat, curaddr)) - curaddr = add_bounce_page(dmat, map, vaddr, sgsize); - /* * Insert chunk into a segment, coalescing with * previous segment if possible. From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 09:00:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E84B1065694; Sun, 5 Dec 2010 09:00:32 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C9FC8FC0A; Sun, 5 Dec 2010 09:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB590WD3080276; Sun, 5 Dec 2010 09:00:32 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB590WTn080273; Sun, 5 Dec 2010 09:00:32 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012050900.oB590WTn080273@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 5 Dec 2010 09:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216195 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 09:00:32 -0000 Author: bschmidt Date: Sun Dec 5 09:00:32 2010 New Revision: 216195 URL: http://svn.freebsd.org/changeset/base/216195 Log: For 6000 series and newer devices the DC calibration results are no longer requested of the boot firmware. Instead of sending those results to the runtime firmware the firmware is told to do the DC calibration itself. MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Dec 5 03:20:55 2010 (r216194) +++ head/sys/dev/iwn/if_iwn.c Sun Dec 5 09:00:32 2010 (r216195) @@ -223,7 +223,7 @@ static int iwn5000_save_calib_result(str struct iwn_phy_calib *, int, int); static void iwn5000_free_calib_results(struct iwn_softc *); static int iwn5000_chrystal_calib(struct iwn_softc *); -static int iwn5000_send_calib_query(struct iwn_softc *); +static int iwn5000_send_calib_query(struct iwn_softc *, uint32_t); static int iwn5000_rx_calib_result(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static int iwn5000_send_wimax_coex(struct iwn_softc *); @@ -756,6 +756,7 @@ iwn_hal_attach(struct iwn_softc *sc) default: sc->txchainmask = IWN_ANT_ABC; sc->rxchainmask = IWN_ANT_ABC; + sc->calib_runtime = IWN_CALIB_DC; break; } sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | @@ -767,8 +768,9 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn6050fw"; sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_AB; - sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_DC | IWN_CALIB_LO | + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; + sc->calib_runtime = IWN_CALIB_DC; break; case IWN_HW_REV_TYPE_6005: sc->sc_hal = &iwn5000_hal; @@ -778,6 +780,7 @@ iwn_hal_attach(struct iwn_softc *sc) sc->rxchainmask = IWN_ANT_AB; sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; + sc->calib_runtime = IWN_CALIB_DC; break; default: device_printf(sc->sc_dev, "adapter type %d not supported\n", @@ -5316,7 +5319,7 @@ iwn5000_chrystal_calib(struct iwn_softc * only once at first boot. */ static int -iwn5000_send_calib_query(struct iwn_softc *sc) +iwn5000_send_calib_query(struct iwn_softc *sc, uint32_t cfg) { #define CALIB_INIT_CFG 0xffffffff; struct iwn5000_calib_config cmd; @@ -5324,12 +5327,15 @@ iwn5000_send_calib_query(struct iwn_soft memset(&cmd, 0, sizeof cmd); cmd.ucode.once.enable = CALIB_INIT_CFG; - cmd.ucode.once.start = CALIB_INIT_CFG; - cmd.ucode.once.send = CALIB_INIT_CFG; - cmd.ucode.flags = CALIB_INIT_CFG; + if (cfg == 0) { + cmd.ucode.once.start = CALIB_INIT_CFG; + cmd.ucode.once.send = CALIB_INIT_CFG; + cmd.ucode.flags = CALIB_INIT_CFG; + } else + cmd.ucode.once.start = cfg; - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: query calibration results\n", - __func__); + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: query calibration results, cfg %x\n", __func__, cfg); error = iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof cmd, 0); if (error != 0) @@ -5559,7 +5565,7 @@ iwn5000_post_alive(struct iwn_softc *sc) * Query other calibration results from the initialization * firmware. */ - error = iwn5000_send_calib_query(sc); + error = iwn5000_send_calib_query(sc, 0); if (error != 0) { device_printf(sc->sc_dev, "%s: could not query calibration, error=%d\n", @@ -5579,6 +5585,19 @@ iwn5000_post_alive(struct iwn_softc *sc) * firmware to the runtime firmware. */ error = iwn5000_send_calib_results(sc); + + /* + * Tell the runtime firmware to do certain calibration types. + */ + if (sc->calib_runtime != 0) { + error = iwn5000_send_calib_query(sc, sc->calib_runtime); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not send query calibration, " + "error=%d, cfg=%x\n", __func__, error, + sc->calib_runtime); + } + } } return error; } Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun Dec 5 03:20:55 2010 (r216194) +++ head/sys/dev/iwn/if_iwnvar.h Sun Dec 5 09:00:32 2010 (r216195) @@ -264,6 +264,7 @@ struct iwn_softc { int calib_cnt; struct iwn_calib_state calib; u_int calib_init; + u_int calib_runtime; #define IWN_CALIB_XTAL (1 << IWN_CALIB_IDX_XTAL) #define IWN_CALIB_DC (1 << IWN_CALIB_IDX_DC) #define IWN_CALIB_LO (1 << IWN_CALIB_IDX_LO) From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 09:33:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70C50106566C; Sun, 5 Dec 2010 09:33:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3058FC0A; Sun, 5 Dec 2010 09:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB59X4Zw081656; Sun, 5 Dec 2010 09:33:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB59X4xq081654; Sun, 5 Dec 2010 09:33:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012050933.oB59X4xq081654@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 09:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216196 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 09:33:04 -0000 Author: dougb Date: Sun Dec 5 09:33:04 2010 New Revision: 216196 URL: http://svn.freebsd.org/changeset/base/216196 Log: Bring in the change from NetBSD 1.18: "If using stat (the -L flag) and it fails, fall back to lstat(). It may be the case that we're examining a broken symlink, and anything is better than nothing." The changes in 1.14 through 1.17 were not relevant to us. Obtained from: atatat@NetBSD.org Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 09:00:32 2010 (r216195) +++ head/usr.bin/stat/stat.c Sun Dec 5 09:33:04 2010 (r216196) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.13 2003/07/25 03:21:17 atatat Exp $"); +__RCSID("$NetBSD: stat.c,v 1.18 2004/05/28 04:48:31 atatat Exp $"); #endif #endif @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -313,8 +314,17 @@ main(int argc, char *argv[]) rc = fstat(STDIN_FILENO, &st); } else { file = argv[0]; - if (usestat) - rc = stat(file, &st); + if (usestat) { + /* + * Try stat() and if it fails, fall back to + * lstat() just in case we're examining a + * broken symlink. + */ + if ((rc = stat(file, &st)) == -1 && + errno == ENOENT && + (rc = lstat(file, &st)) == -1) + errno = ENOENT; + } else rc = lstat(file, &st); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 09:35:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36EFE106566B; Sun, 5 Dec 2010 09:35:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24C4F8FC15; Sun, 5 Dec 2010 09:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB59Z8QR081737; Sun, 5 Dec 2010 09:35:08 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB59Z8mD081735; Sun, 5 Dec 2010 09:35:08 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012050935.oB59Z8mD081735@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 09:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216197 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 09:35:08 -0000 Author: dougb Date: Sun Dec 5 09:35:07 2010 New Revision: 216197 URL: http://svn.freebsd.org/changeset/base/216197 Log: Add my own documentation for the change in our r216196, aka NetBSD's 1.18 For -L if stat(2) fails, fall back to lstat(2). .Dd purposely not bumped because more changes are coming. Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 09:33:04 2010 (r216196) +++ head/usr.bin/stat/stat.1 Sun Dec 5 09:35:07 2010 (r216197) @@ -107,6 +107,10 @@ will refer to the target of if file is a symbolic link, and not to .Ar file itself. +If the link is broken or the target does not exist, +fall back on +.Xr lstat 2 +and report information about the link. .It Fl n Do not force a newline to appear at the end of each piece of output. .It Fl q From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 10:15:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B771065673; Sun, 5 Dec 2010 10:15:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4C28FC0C; Sun, 5 Dec 2010 10:15:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5AFNFO082883; Sun, 5 Dec 2010 10:15:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5AFNEQ082881; Sun, 5 Dec 2010 10:15:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201012051015.oB5AFNEQ082881@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Dec 2010 10:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216198 - head/sys/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 10:15:23 -0000 Author: ed Date: Sun Dec 5 10:15:23 2010 New Revision: 216198 URL: http://svn.freebsd.org/changeset/base/216198 Log: Use proper bounds checking on VPA. We must check against tp->t_cursor.tp_row, not row, to figure out whether we must clamp the cursor position. Submitted by: luigi MFC after: 3 weeks Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Dec 5 09:35:07 2010 (r216197) +++ head/sys/teken/teken_subr.h Sun Dec 5 10:15:23 2010 (r216198) @@ -1299,10 +1299,9 @@ teken_subr_vertical_position_absolute(te { t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1; - if (row >= t->t_originreg.ts_end) + if (t->t_cursor.tp_row >= t->t_originreg.ts_end) t->t_cursor.tp_row = t->t_originreg.ts_end - 1; - t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 11:41:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1171D1065670; Sun, 5 Dec 2010 11:41:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id A0B7B8FC12; Sun, 5 Dec 2010 11:40:59 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB5Betu7031442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 5 Dec 2010 22:40:57 +1100 Date: Sun, 5 Dec 2010 22:40:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival In-Reply-To: <201012042336.oB4NaeID046811@svn.freebsd.org> Message-ID: <20101205222927.V981@besplex.bde.org> References: <201012042336.oB4NaeID046811@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216191 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 11:41:00 -0000 On Sat, 4 Dec 2010, Colin Percival wrote: > Log: > Remove gratuitous i386/amd64 inconsistency in favour of the less verbose > version of declaring a variable initialized to zero. This is resolved backwardsly. style(9) forbids initializing variables in declarations (except for the bug in it which allows this). > Modified: head/sys/i386/i386/busdma_machdep.c > ============================================================================== > --- head/sys/i386/i386/busdma_machdep.c Sat Dec 4 23:24:35 2010 (r216190) > +++ head/sys/i386/i386/busdma_machdep.c Sat Dec 4 23:36:40 2010 (r216191) > @@ -858,7 +858,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, > bus_dmamap_callback2_t *callback, void *callback_arg, > int flags) > { > - bus_addr_t lastaddr; > + bus_addr_t lastaddr = 0; > int nsegs, error, first, i; > bus_size_t resid; > struct iovec *iov; > @@ -878,7 +878,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, > nsegs = 0; > error = 0; > first = 1; > - lastaddr = (bus_addr_t) 0; Also, here this is inconsisent with all the other initializations, since those actually follow style(9). Other style bugs visible in this patch: - the declarations are totally disordered. The initializations are at least in the same order as the declarations - the cast in the old initialization of `lastaddr' was followed by a space. It is unclear if this cast is needed, and the new initialization doesn't have it. It is not needed if bus_addr_t is a integer or pointer type, but bus_addr_t should be opaque. If it is a pointer type, then the variable is not initialized to zero, but to a null pointer. MD code like this can know what it is, but then you can't copy this code around. Some of the other functions in this file have larger style bugs in declarations/initializations than this. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 16:09:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F39A106564A; Sun, 5 Dec 2010 16:09:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6258FC08; Sun, 5 Dec 2010 16:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5G93HJ099421; Sun, 5 Dec 2010 16:09:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5G93Sq099419; Sun, 5 Dec 2010 16:09:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012051609.oB5G93Sq099419@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Dec 2010 16:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216199 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 16:09:03 -0000 Author: jilles Date: Sun Dec 5 16:09:03 2010 New Revision: 216199 URL: http://svn.freebsd.org/changeset/base/216199 Log: sh: jobs -p: Do not ask the kernel for the pgid. The getpgid() call will fail if the first process in the job has already terminated, resulting in output of "-1". The pgid of a job is always the pid of the first process in the job and other code already relies on this. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 5 10:15:23 2010 (r216198) +++ head/bin/sh/jobs.c Sun Dec 5 16:09:03 2010 (r216199) @@ -308,7 +308,6 @@ showjob(struct job *jp, pid_t pid, int m struct procstat *ps; struct job *j; int col, curr, i, jobno, prev, procno; - pid_t ppid; char c; procno = (mode == SHOWJOBS_PGIDS) ? 1 : jp->nprocs; @@ -323,9 +322,7 @@ showjob(struct job *jp, pid_t pid, int m #endif for (ps = jp->ps ; ; ps++) { /* for each process */ if (mode == SHOWJOBS_PIDS || mode == SHOWJOBS_PGIDS) { - ppid = (mode == SHOWJOBS_PIDS) ? ps->pid : - getpgid(ps->pid); - out1fmt("%d\n", (int)ppid); + out1fmt("%d\n", (int)ps->pid); goto skip; } if (mode != SHOWJOBS_VERBOSE && ps != jp->ps && pid == 0) From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 20:47:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13170106566B; Sun, 5 Dec 2010 20:47:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00F428FC12; Sun, 5 Dec 2010 20:47:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5KlrPk007999; Sun, 5 Dec 2010 20:47:53 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5KlrPB007997; Sun, 5 Dec 2010 20:47:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052047.oB5KlrPB007997@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 20:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216202 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 20:47:54 -0000 Author: dougb Date: Sun Dec 5 20:47:53 2010 New Revision: 216202 URL: http://svn.freebsd.org/changeset/base/216202 Log: Bring in the change from NetBSD 1.22: "Fix a trivial truncation case, and eliminate a corner case that might print a nul character." I am purposely bypassing the following versions: 1.19 A build infrastructure change that does not apply to us 1.20 A feature I am not interested in, but don't object if someone else wants to pick it up 1.21 A build infrastructure change that does not apply to us Obtained from: atatat@NetBSD.org Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 20:47:36 2010 (r216201) +++ head/usr.bin/stat/stat.c Sun Dec 5 20:47:53 2010 (r216202) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.18 2004/05/28 04:48:31 atatat Exp $"); +__RCSID("$NetBSD: stat.c,v 1.22 2005/04/22 03:36:48 atatat Exp $"); #endif #endif @@ -381,7 +381,7 @@ output(const struct stat *st, const char const char *statfmt, int fn, int nonl, int quiet) { int flags, size, prec, ofmt, hilo, what; - char buf[PATH_MAX]; + char buf[PATH_MAX + 4 + 1]; const char *subfmt; int nl, t, i; @@ -550,7 +550,7 @@ output(const struct stat *st, const char buf, sizeof(buf), flags, size, prec, ofmt, hilo, what); - for (i = 0; i < t && i < sizeof(buf); i++) + for (i = 0; i < t && i < sizeof(buf) - 1; i++) addchar(stdout, buf[i], &nl); continue; From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:11:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C7D51065674; Sun, 5 Dec 2010 21:11:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA998FC1C; Sun, 5 Dec 2010 21:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LBkKw008513; Sun, 5 Dec 2010 21:11:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LBjqX008511; Sun, 5 Dec 2010 21:11:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052111.oB5LBjqX008511@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 21:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216203 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:11:46 -0000 Author: dougb Date: Sun Dec 5 21:11:45 2010 New Revision: 216203 URL: http://svn.freebsd.org/changeset/base/216203 Log: Bring in a new feature, adding a -f option to readlink to print the path of the target, similar to realpath(1). See the discussion at: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662 This brings in the following changes: 1.24 "PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't grok -f, and there's no alternative (+fix) Patch applied with minor tweak (%y -> %R, as it was already taken) plus some nits from myself. Thanks!" Obtained from: elad@NetBSD.org 1.25 "Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead fake the filename '(stdin)' like the %N format." Obtained from: mlelstv@NetBSD.org 1.27 "The ofmt variable is actually a bit mask (not the character that was in the format string) so that we can "or" it with the bits in the formats variable. This fixes the missing " -> " in front of the real path (when you use %SR). Also, the ?: needs another space." Obtained from: atatat@NetBSD.org I am purposely omitting the following changes: 1.23 A humanize_number(3) clone that should better be implemented by actually using humanize_number(3) 1.26 This is the removal of license clause 3 and 4, already handled by imp in r203971 Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 20:47:53 2010 (r216202) +++ head/usr.bin/stat/stat.c Sun Dec 5 21:11:45 2010 (r216203) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.22 2005/04/22 03:36:48 atatat Exp $"); +__RCSID("$NetBSD: stat.c,v 1.27 2008/05/16 17:58:33 atatat Exp $"); #endif #endif @@ -153,6 +153,7 @@ __FBSDID("$FreeBSD$"); #define MIDDLE_PIECE 'M' #define LOW_PIECE 'L' +#define SHOW_realpath 'R' #define SHOW_st_dev 'd' #define SHOW_st_ino 'i' #define SHOW_st_mode 'p' @@ -218,8 +219,8 @@ main(int argc, char *argv[]) if (strcmp(getprogname(), "readlink") == 0) { am_readlink = 1; - options = "n"; - synopsis = "[-n] [file ...]"; + options = "fn"; + synopsis = "[-fn] [file ...]"; statfmt = "%Y"; fmtchar = 'f'; quiet = 1; @@ -243,6 +244,10 @@ main(int argc, char *argv[]) quiet = 1; break; case 'f': + if (am_readlink) { + statfmt = "%R"; + break; + } statfmt = optarg; /* FALLTHROUGH */ case 'l': @@ -518,6 +523,7 @@ output(const struct stat *st, const char } switch (*statfmt) { + fmtcase(what, SHOW_realpath); fmtcase(what, SHOW_st_dev); fmtcase(what, SHOW_st_ino); fmtcase(what, SHOW_st_mode); @@ -776,6 +782,26 @@ format1(const struct stat *st, ofmt = FMTF_UNSIGNED; break; #endif /* HAVE_STRUCT_STAT_ST_GEN */ + case SHOW_realpath: + small = 0; + data = 0; + if (file == NULL) { + (void)strncpy(path, "(stdin)", sizeof(path)); + sdata = path; + } else { + snprintf(path, sizeof(path), " -> "); + if (realpath(file, path + 4) == NULL) { + linkfail = 1; + l = 0; + path[0] = '\0'; + } + sdata = path + (ofmt == FMTF_STRING ? 0 : 4); + } + + formats = FMTF_STRING; + if (ofmt == 0) + ofmt = FMTF_STRING; + break; case SHOW_symlink: small = 0; data = 0; From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:17:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 046C0106566B; Sun, 5 Dec 2010 21:17:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6F78FC0A; Sun, 5 Dec 2010 21:17:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LH27H008660; Sun, 5 Dec 2010 21:17:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LH2rd008658; Sun, 5 Dec 2010 21:17:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052117.oB5LH2rd008658@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 21:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216204 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:17:03 -0000 Author: dougb Date: Sun Dec 5 21:17:02 2010 New Revision: 216204 URL: http://svn.freebsd.org/changeset/base/216204 Log: Bring in the update from NetBSD 1.19, the documentation of readlink -f "PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't grok -f, and there's no alternative (+fix) Patch applied with minor tweak (%y -> %R, as it was already taken) plus some nits from myself. Thanks!" Obtained from: elad@NetBSD.org Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 21:11:45 2010 (r216203) +++ head/usr.bin/stat/stat.1 Sun Dec 5 21:17:02 2010 (r216204) @@ -1,4 +1,4 @@ -.\" $NetBSD: stat.1,v 1.11 2003/05/08 13:07:10 wiz Exp $ +.\" $NetBSD: stat.1,v 1.19 2006/10/07 10:41:50 elad Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -43,7 +43,7 @@ .Op Fl t Ar timefmt .Op Ar .Nm readlink -.Op Fl n +.Op Fl fn .Op Ar .Sh DESCRIPTION The @@ -60,9 +60,20 @@ displays information about the file desc When invoked as .Nm readlink , only the target of the symbolic link is printed. -If the given argument is not a symbolic link, +If the given argument is not a symbolic link and the +.Fl f +option is not specified, .Nm readlink will print nothing and exit with an error. +If the +.Fl f +option is specified, the output is canonicalized by following every symlink +in every component of the given path recursively. +.Nm readlink +will resolve both absolute and relative paths, and return the absolute pathname +corresponding to +.Ar file . +In this case, the argument does not need to be a symbolic link. .Pp The information displayed is obtained by calling .Xr lstat 2 @@ -374,13 +385,15 @@ User defined flags for Inode generation number. .El .Pp -The following four field specifiers are not drawn directly from the +The following five field specifiers are not drawn directly from the data in .Vt "struct stat" , but are: .Bl -tag -width indent .It Cm N The name of the file. +.It Cm R +The absolute pathname corresponding to the file. .It Cm T The file type, either as in .Nm ls Fl F From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:29:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9260E106566C; Sun, 5 Dec 2010 21:29:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8169A8FC18; Sun, 5 Dec 2010 21:29:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LTKQ3008980; Sun, 5 Dec 2010 21:29:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LTKcx008978; Sun, 5 Dec 2010 21:29:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052129.oB5LTKcx008978@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 21:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216205 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:29:20 -0000 Author: dougb Date: Sun Dec 5 21:29:20 2010 New Revision: 216205 URL: http://svn.freebsd.org/changeset/base/216205 Log: Bring in the update from NetBSD 1.28: "Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)" Because of code differences I had to hand-apply parts of the patch, so responsibility for errors goes to me. Obtained from: lukem@NetBSD.org Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 21:17:02 2010 (r216204) +++ head/usr.bin/stat/stat.c Sun Dec 5 21:29:20 2010 (r216205) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.27 2008/05/16 17:58:33 atatat Exp $"); +__RCSID("$NetBSD: stat.c,v 1.28 2009/04/13 23:02:36 lukem Exp $"); #endif #endif @@ -188,7 +188,7 @@ int format1(const struct stat *, /* stat char *xfflagstostr(unsigned long); #endif -char *timefmt; +const char *timefmt; int linkfail; #define addchar(s, c, nl) \ @@ -203,7 +203,7 @@ main(int argc, char *argv[]) struct stat st; int ch, rc, errs, am_readlink; int lsF, fmtchar, usestat, fn, nonl, quiet; - char *statfmt, *options, *synopsis; + const char *statfmt, *options, *synopsis; char dname[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; const char *file; @@ -556,7 +556,7 @@ output(const struct stat *st, const char buf, sizeof(buf), flags, size, prec, ofmt, hilo, what); - for (i = 0; i < t && i < sizeof(buf) - 1; i++) + for (i = 0; i < t && i < (int)(sizeof(buf) - 1); i++) addchar(stdout, buf[i], &nl); continue; @@ -583,7 +583,8 @@ format1(const struct stat *st, int hilo, int what) { u_int64_t data; - char *sdata, lfmt[24], tmp[20]; + char *stmp, lfmt[24], tmp[20]; + const char *sdata; char smode[12], sid[12], path[PATH_MAX + 4]; struct passwd *pw; struct group *gr; @@ -644,28 +645,29 @@ format1(const struct stat *st, small = (sizeof(st->st_mode) == 4); data = st->st_mode; strmode(st->st_mode, smode); - sdata = smode; - l = strlen(sdata); - if (sdata[l - 1] == ' ') - sdata[--l] = '\0'; + stmp = smode; + l = strlen(stmp); + if (stmp[l - 1] == ' ') + stmp[--l] = '\0'; if (hilo == HIGH_PIECE) { data >>= 12; - sdata += 1; - sdata[3] = '\0'; + stmp += 1; + stmp[3] = '\0'; hilo = 0; } else if (hilo == MIDDLE_PIECE) { data = (data >> 9) & 07; - sdata += 4; - sdata[3] = '\0'; + stmp += 4; + stmp[3] = '\0'; hilo = 0; } else if (hilo == LOW_PIECE) { data &= 0777; - sdata += 7; - sdata[3] = '\0'; + stmp += 7; + stmp[3] = '\0'; hilo = 0; } + sdata = stmp; formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX | FMTF_STRING; if (ofmt == 0) @@ -827,24 +829,23 @@ format1(const struct stat *st, case SHOW_filetype: small = 0; data = 0; - sdata = smode; - sdata[0] = '\0'; + sdata = ""; if (hilo == 0 || hilo == LOW_PIECE) { switch (st->st_mode & S_IFMT) { - case S_IFIFO: (void)strcat(sdata, "|"); break; - case S_IFDIR: (void)strcat(sdata, "/"); break; + case S_IFIFO: sdata = "|"; break; + case S_IFDIR: sdata = "/"; break; case S_IFREG: if (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) - (void)strcat(sdata, "*"); + sdata = "*"; break; - case S_IFLNK: (void)strcat(sdata, "@"); break; - case S_IFSOCK: (void)strcat(sdata, "="); break; + case S_IFLNK: sdata = "@"; break; + case S_IFSOCK: sdata = "="; break; #ifdef S_IFWHT - case S_IFWHT: (void)strcat(sdata, "%"); break; + case S_IFWHT: sdata = "%"; break; #endif /* S_IFWHT */ #ifdef S_IFDOOR - case S_IFDOOR: (void)strcat(sdata, ">"); break; + case S_IFDOOR: sdata = ">"; break; #endif /* S_IFDOOR */ } hilo = 0; @@ -1001,7 +1002,7 @@ format1(const struct stat *st, * might be required to make up the requested precision. */ l = snprintf(buf, blen, lfmt, ts.tv_sec, ts.tv_nsec); - for (; prec > 9 && l < blen; prec--, l++) + for (; prec > 9 && l < (int)blen; prec--, l++) (void)strcat(buf, "0"); return (l); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:33:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91C181065672; Sun, 5 Dec 2010 21:33:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80EF68FC15; Sun, 5 Dec 2010 21:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LX5Ns009102; Sun, 5 Dec 2010 21:33:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LX5WF009099; Sun, 5 Dec 2010 21:33:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052133.oB5LX5WF009099@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 21:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216206 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:33:05 -0000 Author: dougb Date: Sun Dec 5 21:33:05 2010 New Revision: 216206 URL: http://svn.freebsd.org/changeset/base/216206 Log: Fix an "unused variable" error that gets us all the way to WARNS=6 Modified: head/usr.bin/stat/Makefile head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/Makefile ============================================================================== --- head/usr.bin/stat/Makefile Sun Dec 5 21:29:20 2010 (r216205) +++ head/usr.bin/stat/Makefile Sun Dec 5 21:33:05 2010 (r216206) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= stat -WARNS?= 2 LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 21:29:20 2010 (r216205) +++ head/usr.bin/stat/stat.c Sun Dec 5 21:33:05 2010 (r216206) @@ -177,7 +177,7 @@ __FBSDID("$FreeBSD$"); void usage(const char *); void output(const struct stat *, const char *, - const char *, int, int, int); + const char *, int, int); int format1(const struct stat *, /* stat info */ const char *, /* the file name */ const char *, int, /* the format string itself */ @@ -341,7 +341,7 @@ main(int argc, char *argv[]) warn("%s: stat", file); } else - output(&st, file, statfmt, fn, nonl, quiet); + output(&st, file, statfmt, fn, nonl); argv++; argc--; @@ -383,7 +383,7 @@ usage(const char *synopsis) */ void output(const struct stat *st, const char *file, - const char *statfmt, int fn, int nonl, int quiet) + const char *statfmt, int fn, int nonl) { int flags, size, prec, ofmt, hilo, what; char buf[PATH_MAX + 4 + 1]; From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:53:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F12F1065672; Sun, 5 Dec 2010 21:53:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13CF78FC13; Sun, 5 Dec 2010 21:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LrC2A009481; Sun, 5 Dec 2010 21:53:12 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LrCEt009479; Sun, 5 Dec 2010 21:53:12 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052153.oB5LrCEt009479@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 21:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216207 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:53:13 -0000 Author: dougb Date: Sun Dec 5 21:53:12 2010 New Revision: 216207 URL: http://svn.freebsd.org/changeset/base/216207 Log: Bring in the following changes from NetBSD. See the discussion at: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128 1.29 "Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it successfully prints mtimes after 2038." 1.30 "Improve previous with comments." Obtained from: dholland@NetBSD.org (both) Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun Dec 5 21:33:05 2010 (r216206) +++ head/usr.bin/stat/stat.c Sun Dec 5 21:53:12 2010 (r216207) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.28 2009/04/13 23:02:36 lukem Exp $"); +__RCSID("$NetBSD: stat.c,v 1.30 2010/11/25 04:33:30 dholland Exp $"); #endif #endif @@ -728,7 +728,6 @@ format1(const struct stat *st, ts = *tsp; /* copy so we can muck with it */ small = (sizeof(ts.tv_sec) == 4); data = ts.tv_sec; - small = 1; tm = localtime(&ts.tv_sec); (void)strftime(path, sizeof(path), timefmt, tm); sdata = path; @@ -951,8 +950,9 @@ format1(const struct stat *st, (void)snprintf(tmp, sizeof(tmp), "%d", size); (void)strcat(lfmt, tmp); } - (void)strcat(lfmt, "d"); - return (snprintf(buf, blen, lfmt, ts.tv_sec)); + (void)strcat(lfmt, "lld"); + return (snprintf(buf, blen, lfmt, + (long long)ts.tv_sec)); } /* @@ -975,7 +975,8 @@ format1(const struct stat *st, (void)snprintf(tmp, sizeof(tmp), "%d", size); (void)strcat(lfmt, tmp); } - (void)strcat(lfmt, "d"); + /* Seconds: time_t cast to long long. */ + (void)strcat(lfmt, "lld"); /* * The stuff after the decimal point always needs zero @@ -986,8 +987,10 @@ format1(const struct stat *st, /* * We can "print" at most nine digits of precision. The * rest we will pad on at the end. + * + * Nanoseconds: long. */ - (void)snprintf(tmp, sizeof(tmp), "%dd", prec > 9 ? 9 : prec); + (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 : prec); (void)strcat(lfmt, tmp); /* @@ -1001,7 +1004,7 @@ format1(const struct stat *st, * Use the format, and then tack on any zeroes that * might be required to make up the requested precision. */ - l = snprintf(buf, blen, lfmt, ts.tv_sec, ts.tv_nsec); + l = snprintf(buf, blen, lfmt, (long long)ts.tv_sec, ts.tv_nsec); for (; prec > 9 && l < (int)blen; prec--, l++) (void)strcat(buf, "0"); return (l); From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 21:53:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EA6A1065784; Sun, 5 Dec 2010 21:53:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1848FC1C; Sun, 5 Dec 2010 21:53:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5LrT4W009521; Sun, 5 Dec 2010 21:53:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5LrTVN009519; Sun, 5 Dec 2010 21:53:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012052153.oB5LrTVN009519@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Dec 2010 21:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216208 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 21:53:29 -0000 Author: jilles Date: Sun Dec 5 21:53:29 2010 New Revision: 216208 URL: http://svn.freebsd.org/changeset/base/216208 Log: sh: Avoid marking a job as done before it is fully created. In r208489, I added code to reap zombies when forking new processes, to limit the amount of zombies. However, this can lead to marking a job as done or stopped if it consists of multiple processes and the first process ends very quickly. Fix this by only checking for zombies before forking the first process of a job and not marking any jobs without processes as done or stopped. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 5 21:53:12 2010 (r216207) +++ head/bin/sh/jobs.c Sun Dec 5 21:53:29 2010 (r216208) @@ -766,7 +766,7 @@ forkshell(struct job *jp, union node *n, TRACE(("forkshell(%%%td, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; - if (mode == FORK_BG) + if (mode == FORK_BG && (jp == NULL || jp->nprocs == 0)) checkzombies(); flushall(); pid = fork(); @@ -980,7 +980,7 @@ dowait(int block, struct job *job) INTOFF; thisjob = NULL; for (jp = jobtab ; jp < jobtab + njobs ; jp++) { - if (jp->used) { + if (jp->used && jp->nprocs > 0) { done = 1; stopped = 1; for (sp = jp->ps ; sp < jp->ps + jp->nprocs ; sp++) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:01:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0FE106564A; Sun, 5 Dec 2010 22:01:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A74C8FC18; Sun, 5 Dec 2010 22:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5M11HC009736; Sun, 5 Dec 2010 22:01:01 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5M115N009734; Sun, 5 Dec 2010 22:01:01 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052201.oB5M115N009734@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216209 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:01:01 -0000 Author: dougb Date: Sun Dec 5 22:01:01 2010 New Revision: 216209 URL: http://svn.freebsd.org/changeset/base/216209 Log: Bring in the change from NetBSD 1.12: "document default format." Obtained from: yamt@NetBSD.org Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 21:53:29 2010 (r216208) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:01:01 2010 (r216209) @@ -438,6 +438,13 @@ which default to .Sh EXIT STATUS .Ex -std stat readlink .Sh EXAMPLES +If no options are specified, default format is +"%d %i %Sp %l %Su %Sg %r %z \\"%Sa\\" \\"%Sm\\" \\"%Sc\\" \\"%SB\\" %k %b %#Xf %N". +.Bd -literal -offset indent +\*[Gt] stat /tmp/bar +0 78852 -rw-r--r-- 1 root wheel 0 0 "Jul 8 10:26:03 2004" "Jul 8 10:26:03 2004" "Jul 8 10:28:13 2004" "Jan 1 09:00:00 1970" 16384 0 0 /tmp/bar +.Ed +.Pp Given a symbolic link .Pa foo that points from From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:11:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79D9106566C; Sun, 5 Dec 2010 22:11:03 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D643C8FC0A; Sun, 5 Dec 2010 22:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MB3K8009956; Sun, 5 Dec 2010 22:11:03 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MB3Ca009953; Sun, 5 Dec 2010 22:11:03 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012052211.oB5MB3Ca009953@svn.freebsd.org> From: David Schultz Date: Sun, 5 Dec 2010 22:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216210 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:11:04 -0000 Author: das Date: Sun Dec 5 22:11:03 2010 New Revision: 216210 URL: http://svn.freebsd.org/changeset/base/216210 Log: Add a "kernel" log function, based on e_log.c, which is useful for implementing accurate logarithms in different bases. This is based on an approach bde coded up years ago. This function should always be inlined; it will be used in only a few places, and rudimentary tests show a 40% performance improvement in implementations of log2() and log10() on amd64. The kernel takes a reduced argument x and returns the same polynomial approximation as e_log.c, but omitting the low-order term. The low-order term is much larger than the rest of the approximation, so the caller of the kernel function can scale it to the appropriate base in extra precision and obtain a much more accurate answer than by using log(x)/log(b). Added: head/lib/msun/src/k_log.h - copied, changed from r216174, head/lib/msun/src/e_log.c head/lib/msun/src/k_logf.h - copied, changed from r216174, head/lib/msun/src/e_logf.c Copied and modified: head/lib/msun/src/k_log.h (from r216174, head/lib/msun/src/e_log.c) ============================================================================== --- head/lib/msun/src/e_log.c Sat Dec 4 02:42:52 2010 (r216174, copy source) +++ head/lib/msun/src/k_log.h Sun Dec 5 22:11:03 2010 (r216210) @@ -14,8 +14,13 @@ #include __FBSDID("$FreeBSD$"); -/* __ieee754_log(x) - * Return the logrithm of x +/* __kernel_log(x) + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. + * + * The following describes the overall strategy for computing + * logarithms in base e. The argument reduction and adding the final + * term of the polynomial are done by the caller for increased accuracy + * when different bases are used. * * Method : * 1. Argument Reduction: find k and f such that @@ -65,13 +70,7 @@ __FBSDID("$FreeBSD$"); * to produce the hexadecimal values shown. */ -#include "math.h" -#include "math_private.h" - static const double -ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ -ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ -two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */ Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ @@ -80,48 +79,27 @@ Lg5 = 1.818357216161805012e-01, /* 3FC7 Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ -static const double zero = 0.0; - -double -__ieee754_log(double x) +/* + * We always inline __kernel_log(), since doing so produces a + * substantial performance improvement (~40% on amd64). + */ +static inline double +__kernel_log(double x) { - double hfsq,f,s,z,R,w,t1,t2,dk; - int32_t k,hx,i,j; + double hfsq,f,s,z,R,w,t1,t2; + int32_t hx,i,j; u_int32_t lx; EXTRACT_WORDS(hx,lx,x); - k=0; - if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 54; x *= two54; /* subnormal number, scale up x */ - GET_HIGH_WORD(hx,x); - } - if (hx >= 0x7ff00000) return x+x; - k += (hx>>20)-1023; - hx &= 0x000fffff; - i = (hx+0x95f64)&0x100000; - SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ - k += (i>>20); f = x-1.0; if((0x000fffff&(2+hx))<3) { /* -2**-20 <= f < 2**-20 */ - if(f==zero) { - if(k==0) { - return zero; - } else { - dk=(double)k; - return dk*ln2_hi+dk*ln2_lo; - } - } - R = f*f*(0.5-0.33333333333333333*f); - if(k==0) return f-R; else {dk=(double)k; - return dk*ln2_hi-((R-dk*ln2_lo)-f);} + if(f==0.0) return 0.0; + return f*f*(0.33333333333333333*f-0.5); } s = f/(2.0+f); - dk = (double)k; z = s*s; + hx &= 0x000fffff; i = hx-0x6147a; w = z*z; j = 0x6b851-hx; @@ -129,12 +107,10 @@ __ieee754_log(double x) t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); i |= j; R = t2+t1; - if(i>0) { + if (i>0) { hfsq=0.5*f*f; - if(k==0) return f-(hfsq-s*(hfsq+R)); else - return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); + return s*(hfsq+R) - hfsq; } else { - if(k==0) return f-s*(f-R); else - return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); + return s*(R-f); } } Copied and modified: head/lib/msun/src/k_logf.h (from r216174, head/lib/msun/src/e_logf.c) ============================================================================== --- head/lib/msun/src/e_logf.c Sat Dec 4 02:42:52 2010 (r216174, copy source) +++ head/lib/msun/src/k_logf.h Sun Dec 5 22:11:03 2010 (r216210) @@ -1,7 +1,3 @@ -/* e_logf.c -- float version of e_log.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -16,60 +12,33 @@ #include __FBSDID("$FreeBSD$"); -#include "math.h" -#include "math_private.h" +/* __kernel_logf(x) + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. + */ static const float -ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ -ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ -two25 = 3.355443200e+07, /* 0x4c000000 */ /* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */ Lg2 = 0xccce13.0p-25, /* 0.40000972152 */ Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ -static const float zero = 0.0; - -float -__ieee754_logf(float x) +static inline float +__kernel_logf(float x) { - float hfsq,f,s,z,R,w,t1,t2,dk; - int32_t k,ix,i,j; + float hfsq,f,s,z,R,w,t1,t2; + int32_t ix,i,j; GET_FLOAT_WORD(ix,x); - k=0; - if (ix < 0x00800000) { /* x < 2**-126 */ - if ((ix&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ - if (ix<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ - GET_FLOAT_WORD(ix,x); - } - if (ix >= 0x7f800000) return x+x; - k += (ix>>23)-127; - ix &= 0x007fffff; - i = (ix+(0x95f64<<3))&0x800000; - SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */ - k += (i>>23); f = x-(float)1.0; if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ - if(f==zero) { - if(k==0) { - return zero; - } else { - dk=(float)k; - return dk*ln2_hi+dk*ln2_lo; - } - } - R = f*f*((float)0.5-(float)0.33333333333333333*f); - if(k==0) return f-R; else {dk=(float)k; - return dk*ln2_hi-((R-dk*ln2_lo)-f);} + if(f==0.0) return 0.0; + return f*f*((float)0.33333333333333333*f-(float)0.5); } s = f/((float)2.0+f); - dk = (float)k; z = s*s; + ix &= 0x007fffff; i = ix-(0x6147a<<3); w = z*z; j = (0x6b851<<3)-ix; @@ -79,10 +48,8 @@ __ieee754_logf(float x) R = t2+t1; if(i>0) { hfsq=(float)0.5*f*f; - if(k==0) return f-(hfsq-s*(hfsq+R)); else - return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); + return s*(hfsq+R) - hfsq; } else { - if(k==0) return f-s*(f-R); else - return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); + return s*(R-f); } } From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:11:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830F2106570A; Sun, 5 Dec 2010 22:11:22 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70D0D8FC13; Sun, 5 Dec 2010 22:11:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MBMbS010007; Sun, 5 Dec 2010 22:11:22 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MBM0I009998; Sun, 5 Dec 2010 22:11:22 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012052211.oB5MBM0I009998@svn.freebsd.org> From: David Schultz Date: Sun, 5 Dec 2010 22:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216211 - in head/lib/msun: . man src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:11:22 -0000 Author: das Date: Sun Dec 5 22:11:22 2010 New Revision: 216211 URL: http://svn.freebsd.org/changeset/base/216211 Log: Add log2() and log2f(). Added: head/lib/msun/src/e_log2.c - copied, changed from r216174, head/lib/msun/src/e_log10.c head/lib/msun/src/e_log2f.c - copied, changed from r216174, head/lib/msun/src/e_log10f.c Modified: head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/log.3 head/lib/msun/man/math.3 head/lib/msun/src/math.h head/lib/msun/src/math_private.h Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/Makefile Sun Dec 5 22:11:22 2010 (r216211) @@ -45,7 +45,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \ e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \ - e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \ + e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \ + e_pow.c e_powf.c e_rem_pio2.c \ e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ k_cos.c k_cosf.c k_rem_pio2.c k_sin.c k_sinf.c \ @@ -175,7 +176,7 @@ MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ lgamma.3 tgamma.3 lgamma.3 tgammaf.3 -MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 logf.3 +MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 logf.3 log.3 log2.3 log.3 log2f.3 MLINKS+=lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 llrintl.3 \ lrint.3 lrintf.3 lrint.3 lrintl.3 MLINKS+=lround.3 llround.3 lround.3 llroundf.3 lround.3 llroundl.3 \ Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/Symbol.map Sun Dec 5 22:11:22 2010 (r216211) @@ -222,4 +222,6 @@ FBSD_1.1 { /* First added in 9.0-CURRENT */ FBSD_1.2 { __isnanf; + log2; + log2f; }; Modified: head/lib/msun/man/log.3 ============================================================================== --- head/lib/msun/man/log.3 Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/man/log.3 Sun Dec 5 22:11:22 2010 (r216211) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2008 David Schultz +.\" Copyright (c) 2008-2010 David Schultz .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd December 5, 2010 .Dt LOG 3 .Os .Sh NAME @@ -33,6 +33,8 @@ .Nm logl , .Nm log10 , .Nm log10f , +.Nm log2 , +.Nm log2f , .Nm log1p , .Nm log1pf .Nd logarithm functions @@ -49,6 +51,10 @@ .Ft float .Fn log10f "float x" .Ft double +.Fn log2 "double x" +.Ft float +.Fn log2f "float x" +.Ft double .Fn log1p "double x" .Ft float .Fn log1pf "float x" @@ -65,6 +71,12 @@ The and .Fn log10f functions compute the logarithm base 10 of +.Fa x , +while +.Fn log2 +and +.Fn log2f +compute the logarithm base 2 of .Fa x . .Pp The @@ -97,6 +109,8 @@ The .Fn logf , .Fn log10 , .Fn log10f , +.Fn log2 , +.Fn log2f , .Fn log1p , and .Fn log1pf Modified: head/lib/msun/man/math.3 ============================================================================== --- head/lib/msun/man/math.3 Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/man/math.3 Sun Dec 5 22:11:22 2010 (r216211) @@ -28,7 +28,7 @@ .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91 .\" $FreeBSD$ .\" -.Dd December 16, 2007 +.Dd December 5, 2010 .Dt MATH 3 .Os .Sh NAME @@ -182,7 +182,7 @@ lgamma log gamma function log natural logarithm log10 logarithm to base 10 log1p log(1+x) -.\" log2 base 2 logarithm +log2 base 2 logarithm pow exponential x**y sin trigonometric function sinh hyperbolic function @@ -194,7 +194,7 @@ y1 Bessel function of the second kind of yn Bessel function of the second kind of the order n .El .Pp -Unlike the algebraic functions listed earlier, the routines +The routines in this section may not produce a result that is correctly rounded, so reproducible results cannot be guaranteed across platforms. For most of these functions, however, incorrect rounding occurs @@ -221,18 +221,20 @@ and values, were written for or imported into subsequent versions of FreeBSD. .Sh BUGS The -.Fn log2 -function is missing, and many functions are not available in their +.Fn cbrt +function and many of the transcendental functions +are not available in their .Vt "long double" variants. .Pp Many of the routines to compute transcendental functions produce inaccurate results in other than the default rounding mode. .Pp -On some architectures, trigonometric argument reduction is not -performed accurately, resulting in errors greater than 1 +On the i386 platform, trigonometric argument reduction is not +performed accurately for very large arguments, resulting in errors +greater than 1 .Em ulp -for large arguments to +for such arguments to .Fn cos , .Fn sin , and Copied and modified: head/lib/msun/src/e_log2.c (from r216174, head/lib/msun/src/e_log10.c) ============================================================================== --- head/lib/msun/src/e_log10.c Sat Dec 4 02:42:52 2010 (r216174, copy source) +++ head/lib/msun/src/e_log2.c Sun Dec 5 22:11:22 2010 (r216211) @@ -14,54 +14,25 @@ #include __FBSDID("$FreeBSD$"); -/* __ieee754_log10(x) - * Return the base 10 logarithm of x - * - * Method : - * Let log10_2hi = leading 40 bits of log10(2) and - * log10_2lo = log10(2) - log10_2hi, - * ivln10 = 1/log(10) rounded. - * Then - * n = ilogb(x), - * if(n<0) n = n+1; - * x = scalbn(x,-n); - * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) - * - * Note 1: - * To guarantee log10(10**n)=n, where 10**n is normal, the rounding - * mode must set to Round-to-Nearest. - * Note 2: - * [1/log(10)] rounded to 53 bits has error .198 ulps; - * log10 is monotonic at all binary break points. - * - * Special cases: - * log10(x) is NaN with signal if x < 0; - * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; - * log10(NaN) is that NaN with no signal; - * log10(10**N) = N for N=0,1,...,22. - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. +/* log2(x) + * Return the base 2 logarithm of x. */ #include "math.h" #include "math_private.h" +#include "k_log.h" static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */ -log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ -log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ +ivln2hi = 0x1.71547652000p+0, +ivln2lo = 0x1.705fc2eefa2p-33; static const double zero = 0.0; double -__ieee754_log10(double x) +__ieee754_log2(double x) { - double y,z; + double f,hi,lo; int32_t i,k,hx; u_int32_t lx; @@ -77,10 +48,13 @@ __ieee754_log10(double x) } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x000fffff)|((0x3ff-i)<<20); - y = (double)(k+i); - SET_HIGH_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_log(x); - return z+y*log10_2hi; + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ + k += (i>>20); + f = __kernel_log(x); + hi = x = x - 1; + SET_LOW_WORD(hi,0); + lo = x - hi; + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; } Copied and modified: head/lib/msun/src/e_log2f.c (from r216174, head/lib/msun/src/e_log10f.c) ============================================================================== --- head/lib/msun/src/e_log10f.c Sat Dec 4 02:42:52 2010 (r216174, copy source) +++ head/lib/msun/src/e_log2f.c Sun Dec 5 22:11:22 2010 (r216211) @@ -1,7 +1,3 @@ -/* e_log10f.c -- float version of e_log10.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -18,19 +14,19 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +#include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */ -log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ -log10_2lo = 7.9034151668e-07; /* 0x355427db */ +ivln2hi = 0x1.716p+0f, +ivln2lo = -0x1.7135a8fa03d11p-13; static const float zero = 0.0; float -__ieee754_log10f(float x) +__ieee754_log2f(float x) { - float y,z; + float f,hi,lo; int32_t i,k,hx; GET_FLOAT_WORD(hx,x); @@ -45,10 +41,14 @@ __ieee754_log10f(float x) } if (hx >= 0x7f800000) return x+x; k += (hx>>23)-127; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x007fffff)|((0x7f-i)<<23); - y = (float)(k+i); - SET_FLOAT_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_logf(x); - return z+y*log10_2hi; + hx &= 0x007fffff; + i = (hx+(0x4afb0d))&0x800000; + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ + k += (i>>23); + f = __kernel_logf(x); + x = x - 1; + GET_FLOAT_WORD(hx,x); + SET_FLOAT_WORD(hi,hx&0xfffff000); + lo = x - hi; + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; } Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/src/math.h Sun Dec 5 22:11:22 2010 (r216211) @@ -236,6 +236,7 @@ double lgamma(double); long long llrint(double); long long llround(double); double log1p(double); +double log2(double); double logb(double); long lrint(double); long lround(double); @@ -319,6 +320,7 @@ int ilogbf(float) __pure2; float ldexpf(float, int); float log10f(float); float log1pf(float); +float log2f(float); float logf(float); float modff(float, float *); /* fundamentally !__pure2 */ Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sun Dec 5 22:11:03 2010 (r216210) +++ head/lib/msun/src/math_private.h Sun Dec 5 22:11:22 2010 (r216211) @@ -292,6 +292,7 @@ irint(double x) #define __ieee754_acos acos #define __ieee754_acosh acosh #define __ieee754_log log +#define __ieee754_log2 log2 #define __ieee754_atanh atanh #define __ieee754_asin asin #define __ieee754_atan2 atan2 @@ -330,6 +331,7 @@ irint(double x) #define __ieee754_lgammaf_r lgammaf_r #define __ieee754_gammaf_r gammaf_r #define __ieee754_log10f log10f +#define __ieee754_log2f log2f #define __ieee754_sinhf sinhf #define __ieee754_hypotf hypotf #define __ieee754_j0f j0f From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:12:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B2F106566C; Sun, 5 Dec 2010 22:12:07 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6772A8FC1C; Sun, 5 Dec 2010 22:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MC7Up010058; Sun, 5 Dec 2010 22:12:07 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MC7oC010056; Sun, 5 Dec 2010 22:12:07 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012052212.oB5MC7oC010056@svn.freebsd.org> From: David Schultz Date: Sun, 5 Dec 2010 22:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216212 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:12:07 -0000 Author: das Date: Sun Dec 5 22:12:07 2010 New Revision: 216212 URL: http://svn.freebsd.org/changeset/base/216212 Log: Bump __FreeBSD_version for the addition of log2(). This is mainly for the benefit of ports such as opencity and inkscape that have workarounds for the lack of a log2() in the base system. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 5 22:11:22 2010 (r216211) +++ head/sys/sys/param.h Sun Dec 5 22:12:07 2010 (r216212) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900026 /* Master, propagated to newvers */ +#define __FreeBSD_version 900027 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:16:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53D97106566C; Sun, 5 Dec 2010 22:16:52 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42EE68FC08; Sun, 5 Dec 2010 22:16:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MGqqk010180; Sun, 5 Dec 2010 22:16:52 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MGqka010178; Sun, 5 Dec 2010 22:16:52 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052216.oB5MGqka010178@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216213 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:16:52 -0000 Author: dougb Date: Sun Dec 5 22:16:51 2010 New Revision: 216213 URL: http://svn.freebsd.org/changeset/base/216213 Log: Bring in the changes from NetBSD 1.13 that we did not already have, with some differences. "Sort options. Use more mdoc macros. Some nit fixes. Bump date." Obtained from: wiz@NetBSD.org Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 22:12:07 2010 (r216212) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:16:51 2010 (r216213) @@ -50,7 +50,7 @@ The .Nm utility displays information about the file pointed to by .Ar file . -Read, write or execute permissions of the named file are not required, but +Read, write, or execute permissions of the named file are not required, but all directories listed in the path name leading to the file must be searchable. If no argument is given, @@ -122,6 +122,10 @@ If the link is broken or the target does fall back on .Xr lstat 2 and report information about the link. +.It Fl l +Display output in +.Ic ls Fl lT +format. .It Fl n Do not force a newline to appear at the end of each piece of output. .It Fl q @@ -151,7 +155,8 @@ display the raw, numerical value (for ex epoch, etc.). .It Fl s Display information in -.Dq "shell output" , +.Dq shell output +format, suitable for initializing variables. .It Fl x Display information in a more verbose way as known from some @@ -438,7 +443,7 @@ which default to .Sh EXIT STATUS .Ex -std stat readlink .Sh EXAMPLES -If no options are specified, default format is +If no options are specified, the default format is "%d %i %Sp %l %Su %Sg %r %z \\"%Sa\\" \\"%Sm\\" \\"%Sc\\" \\"%SB\\" %k %b %#Xf %N". .Bd -literal -offset indent \*[Gt] stat /tmp/bar @@ -446,7 +451,7 @@ If no options are specified, default for .Ed .Pp Given a symbolic link -.Pa foo +.Dq foo that points from .Pa /tmp/foo to From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:18:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1E47106566B; Sun, 5 Dec 2010 22:18:35 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFF188FC18; Sun, 5 Dec 2010 22:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MIZ29010246; Sun, 5 Dec 2010 22:18:35 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MIZlA010242; Sun, 5 Dec 2010 22:18:35 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012052218.oB5MIZlA010242@svn.freebsd.org> From: David Schultz Date: Sun, 5 Dec 2010 22:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216214 - head/tools/regression/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:18:36 -0000 Author: das Date: Sun Dec 5 22:18:35 2010 New Revision: 216214 URL: http://svn.freebsd.org/changeset/base/216214 Log: Add regression tests for logarithmic functions in the math library. Added: head/tools/regression/lib/msun/test-logarithm.c - copied, changed from r215587, head/tools/regression/lib/msun/test-exponential.c head/tools/regression/lib/msun/test-logarithm.t - copied unchanged from r215587, head/tools/regression/lib/msun/test-exponential.t Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Sun Dec 5 22:16:51 2010 (r216213) +++ head/tools/regression/lib/msun/Makefile Sun Dec 5 22:18:35 2010 (r216214) @@ -1,7 +1,7 @@ # $FreeBSD$ TESTS= test-conj test-csqrt test-exponential test-fenv test-fma \ - test-fmaxmin test-ilogb test-invtrig test-lrint \ + test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm Copied and modified: head/tools/regression/lib/msun/test-logarithm.c (from r215587, head/tools/regression/lib/msun/test-exponential.c) ============================================================================== --- head/tools/regression/lib/msun/test-exponential.c Sat Nov 20 20:04:29 2010 (r215587, copy source) +++ head/tools/regression/lib/msun/test-logarithm.c Sun Dec 5 22:18:35 2010 (r216214) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008 David Schultz + * Copyright (c) 2008-2010 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ */ /* - * Tests for corner cases in exp*(). + * Tests for corner cases in log*(). */ #include @@ -66,19 +66,20 @@ __FBSDID("$FreeBSD$"); assert(((func), fetestexcept(exceptmask) == (excepts))); \ } while (0) -/* Test all the functions that compute b^x. */ +/* Test all the functions that compute log(x). */ #define testall0(x, result, exceptmask, excepts) do { \ - test(exp, x, result, exceptmask, excepts); \ - test(expf, x, result, exceptmask, excepts); \ - test(exp2, x, result, exceptmask, excepts); \ - test(exp2f, x, result, exceptmask, excepts); \ - test(exp2l, x, result, exceptmask, excepts); \ + test(log, x, result, exceptmask, excepts); \ + test(logf, x, result, exceptmask, excepts); \ + test(log2, x, result, exceptmask, excepts); \ + test(log2f, x, result, exceptmask, excepts); \ + test(log10, x, result, exceptmask, excepts); \ + test(log10f, x, result, exceptmask, excepts); \ } while (0) -/* Test all the functions that compute b^x - 1. */ +/* Test all the functions that compute log(1+x). */ #define testall1(x, result, exceptmask, excepts) do { \ - test(expm1, x, result, exceptmask, excepts); \ - test(expm1f, x, result, exceptmask, excepts); \ + test(log1p, x, result, exceptmask, excepts); \ + test(log1pf, x, result, exceptmask, excepts); \ } while (0) /* @@ -96,54 +97,47 @@ void run_generic_tests(void) { - /* exp(0) == 1, no exceptions raised */ - testall0(0.0, 1.0, ALL_STD_EXCEPT, 0); + /* exp(1) == 0, no exceptions raised */ + testall0(1.0, 0.0, ALL_STD_EXCEPT, 0); testall1(0.0, 0.0, ALL_STD_EXCEPT, 0); - testall0(-0.0, 1.0, ALL_STD_EXCEPT, 0); testall1(-0.0, -0.0, ALL_STD_EXCEPT, 0); - /* exp(NaN) == NaN, no exceptions raised */ + /* log(NaN) == NaN, no exceptions raised */ testall0(NAN, NAN, ALL_STD_EXCEPT, 0); testall1(NAN, NAN, ALL_STD_EXCEPT, 0); - /* exp(Inf) == Inf, no exceptions raised */ + /* log(Inf) == Inf, no exceptions raised */ testall0(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); testall1(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); - /* exp(-Inf) == 0, no exceptions raised */ - testall0(-INFINITY, 0.0, ALL_STD_EXCEPT, 0); - testall1(-INFINITY, -1.0, ALL_STD_EXCEPT, 0); - - /* exp(big) == Inf, overflow exception */ - testall0(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); - testall1(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); - - /* exp(small) == 0, underflow and inexact exceptions */ - testall0(-50000.0, 0.0, ALL_STD_EXCEPT, FE_UNDERFLOW | FE_INEXACT); - testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); + /* log(x) == NaN for x < 0, invalid exception raised */ + testall0(-INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID); + testall1(-INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID); + testall0(-1.0, NAN, ALL_STD_EXCEPT, FE_INVALID); + testall1(-1.5, NAN, ALL_STD_EXCEPT, FE_INVALID); + + /* log(0) == -Inf, divide-by-zero exception */ + testall0(0.0, -INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_DIVBYZERO); + testall0(-0.0, -INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_DIVBYZERO); + testall1(-1.0, -INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_DIVBYZERO); } void -run_exp2_tests(void) +run_log2_tests(void) { int i; /* - * We should insist that exp2() return exactly the correct - * result and not raise an inexact exception for integer - * arguments. + * We should insist that log2() return exactly the correct + * result and not raise an inexact exception for powers of 2. */ feclearexcept(FE_ALL_EXCEPT); for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { - assert(exp2f(i) == ldexpf(1.0, i)); + assert(log2f(ldexpf(1.0, i)) == i); assert(fetestexcept(ALL_STD_EXCEPT) == 0); } for (i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { - assert(exp2(i) == ldexp(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - } - for (i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { - assert(exp2l(i) == ldexpl(1.0, i)); + assert(log2(ldexp(1.0, i)) == i); assert(fetestexcept(ALL_STD_EXCEPT) == 0); } } @@ -152,19 +146,13 @@ int main(int argc, char *argv[]) { - printf("1..3\n"); - - run_generic_tests(); - printf("ok 1 - exponential\n"); + printf("1..2\n"); -#ifdef __i386__ - fpsetprec(FP_PE); run_generic_tests(); -#endif - printf("ok 2 - exponential\n"); + printf("ok 1 - logarithm\n"); - run_exp2_tests(); - printf("ok 3 - exponential\n"); + run_log2_tests(); + printf("ok 2 - logarithm\n"); return (0); } Copied: head/tools/regression/lib/msun/test-logarithm.t (from r215587, head/tools/regression/lib/msun/test-exponential.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-logarithm.t Sun Dec 5 22:18:35 2010 (r216214, copy of r215587, head/tools/regression/lib/msun/test-exponential.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:19:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72941065673; Sun, 5 Dec 2010 22:19:22 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B60E48FC16; Sun, 5 Dec 2010 22:19:21 +0000 (UTC) Received: by bwz2 with SMTP id 2so10485403bwz.13 for ; Sun, 05 Dec 2010 14:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9/YwYYHygomCXcHszo+Ddg/+5klWDb1HHrCcmmNyF7s=; b=UawwO+U5YxqU/lgoHKWLldIm/tZeds9JSgJpFifoumcBr/8seBp9YzKneJa/MMb0Pm LSBELvqBnQaBhev1fukhyk+oAPhVSfi9j0kqPqJDttjFpnLHGedlU2bA3VQkmTJt/wIt 0F7+6Bu4S6+n/fKrY6pGA58LtHEIzGwES2sgg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=wNfn2Uh2/eHm5tCJ2CB6OF+OtpCXZ99QSEfVRf9Ssrb9iU4JkuHtYq7zxYP76t7710 MUKaFZ+uHfNvdsjEbJROfbnIisyuMZYKvqr6twMiWx63cJ/G0rqg+SsEudrWbG+tEkj/ kUwCmFz/+t0a7553NHajGvQ4tTsnPu6B9US0g= MIME-Version: 1.0 Received: by 10.204.56.194 with SMTP id z2mr5018371bkg.129.1291587558859; Sun, 05 Dec 2010 14:19:18 -0800 (PST) Received: by 10.204.23.198 with HTTP; Sun, 5 Dec 2010 14:19:18 -0800 (PST) In-Reply-To: <201012052212.oB5MC7oC010056@svn.freebsd.org> References: <201012052212.oB5MC7oC010056@svn.freebsd.org> Date: Sun, 5 Dec 2010 17:19:18 -0500 Message-ID: From: Ben Kaduk To: David Schultz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216212 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:19:22 -0000 On Sun, Dec 5, 2010 at 5:12 PM, David Schultz wrote: > Author: das > Date: Sun Dec =A05 22:12:07 2010 > New Revision: 216212 > URL: http://svn.freebsd.org/changeset/base/216212 > > Log: > =A0Bump __FreeBSD_version for the addition of log2(). =A0This is mainly f= or the > =A0benefit of ports such as opencity and inkscape that have workarounds f= or > =A0the lack of a log2() in the base system. Awesome; thanks! -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:20:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F111065672; Sun, 5 Dec 2010 22:20:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 754588FC15; Sun, 5 Dec 2010 22:20:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MK8ux010314; Sun, 5 Dec 2010 22:20:08 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MK8po010312; Sun, 5 Dec 2010 22:20:08 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052220.oB5MK8po010312@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216215 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:20:08 -0000 Author: dougb Date: Sun Dec 5 22:20:08 2010 New Revision: 216215 URL: http://svn.freebsd.org/changeset/base/216215 Log: Bring in the changes from NetBSD 1.16 that we did not already have. "Some fixes from jmc@openbsd." Obtained from: wiz@NetBSD.org Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 22:18:35 2010 (r216214) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:20:08 2010 (r216215) @@ -51,7 +51,7 @@ The utility displays information about the file pointed to by .Ar file . Read, write, or execute permissions of the named file are not required, but -all directories listed in the path name leading to the file must be +all directories listed in the pathname leading to the file must be searchable. If no argument is given, .Nm @@ -372,7 +372,7 @@ Device number for character and block de .It Cm a , m , c , B The time .Ar file -was last accessed or modified, of when the inode was last changed, or +was last accessed or modified, or when the inode was last changed, or the birth time of the inode. .It Cm z The size of From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:24:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C774106564A; Sun, 5 Dec 2010 22:24:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BB688FC08; Sun, 5 Dec 2010 22:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MOYK0010499; Sun, 5 Dec 2010 22:24:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MOYPg010497; Sun, 5 Dec 2010 22:24:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052224.oB5MOYPg010497@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216216 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:24:34 -0000 Author: dougb Date: Sun Dec 5 22:24:34 2010 New Revision: 216216 URL: http://svn.freebsd.org/changeset/base/216216 Log: Bring in the change from NetBSD 1.20: "Make sentence easier to parse. From jsing@openbsd via jmc@openbsd." Obtained from: wiz@NetBSD.org Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 22:20:08 2010 (r216215) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:24:34 2010 (r216216) @@ -428,12 +428,12 @@ as an output form, with the exception of .Cm p which defaults to -.Cm O , +.Cm O ; .Cm a , m , and .Cm c which default to -.Cm D , +.Cm D ; and .Cm Y , T , and From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:37:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF8CE106566B; Sun, 5 Dec 2010 22:37:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE3D48FC18; Sun, 5 Dec 2010 22:37:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5Mb1sE011315; Sun, 5 Dec 2010 22:37:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5Mb18x011313; Sun, 5 Dec 2010 22:37:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012052237.oB5Mb18x011313@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Dec 2010 22:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216217 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:37:02 -0000 Author: jilles Date: Sun Dec 5 22:37:01 2010 New Revision: 216217 URL: http://svn.freebsd.org/changeset/base/216217 Log: sh: Improve jobs output of pipelines. If describing the status of a pipeline, write all elements of the pipeline and show the status of the last process (which would also end up in $?). Only write one report per job, not one for every process that exits. To keep some earlier behaviour, if any process started by the shell in a foreground job terminates because of a signal, write a message about the signal (at most one message per job, however). Also, do not write messages about signals in the wait builtin in non-interactive shells. Only true foreground jobs now write such messages (for example, "Terminated"). Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 5 22:24:34 2010 (r216216) +++ head/bin/sh/jobs.c Sun Dec 5 22:37:01 2010 (r216217) @@ -100,7 +100,8 @@ static void setcurjob(struct job *); static void deljob(struct job *); static struct job *getcurjob(struct job *); #endif -static void showjob(struct job *, pid_t, int); +static void printjobcmd(struct job *); +static void showjob(struct job *, int); /* @@ -205,8 +206,7 @@ fgcmd(int argc __unused, char **argv) jp = getjob(argv[1]); if (jp->jobctl == 0) error("job not created under job control"); - out1str(jp->ps[0].cmd); - out1c('\n'); + printjobcmd(jp); flushout(&output); pgrp = jp->ps[0].pid; tcsetpgrp(ttyfd, pgrp); @@ -235,8 +235,7 @@ bgcmd(int argc, char **argv) jp->foreground = 0; fmtstr(s, 64, "[%td] ", jp - jobtab + 1); out1str(s); - out1str(jp->ps[0].cmd); - out1c('\n'); + printjobcmd(jp); } while (--argc > 1); return 0; } @@ -296,15 +295,30 @@ jobscmd(int argc, char *argv[]) showjobs(0, mode); else while ((id = *argv++) != NULL) - showjob(getjob(id), 0, mode); + showjob(getjob(id), mode); return (0); } static void -showjob(struct job *jp, pid_t pid, int mode) +printjobcmd(struct job *jp) +{ + struct procstat *ps; + int i; + + for (ps = jp->ps, i = jp->nprocs ; --i >= 0 ; ps++) { + out1str(ps->cmd); + if (i > 0) + out1str(" | "); + } + out1c('\n'); +} + +static void +showjob(struct job *jp, int mode) { char s[64]; + char statestr[64]; struct procstat *ps; struct job *j; int col, curr, i, jobno, prev, procno; @@ -320,14 +334,44 @@ showjob(struct job *jp, pid_t pid, int m prev = j - jobtab + 1; } #endif + ps = jp->ps + jp->nprocs - 1; + if (jp->state == 0) { + strcpy(statestr, "Running"); +#if JOBS + } else if (jp->state == JOBSTOPPED) { + while (!WIFSTOPPED(ps->status) && ps > jp->ps) + ps--; + if (WIFSTOPPED(ps->status)) + i = WSTOPSIG(ps->status); + else + i = -1; + if (i > 0 && i < sys_nsig && sys_siglist[i]) + strcpy(statestr, sys_siglist[i]); + else + strcpy(statestr, "Suspended"); +#endif + } else if (WIFEXITED(ps->status)) { + if (WEXITSTATUS(ps->status) == 0) + strcpy(statestr, "Done"); + else + fmtstr(statestr, 64, "Done (%d)", + WEXITSTATUS(ps->status)); + } else { + i = WTERMSIG(ps->status); + if (i > 0 && i < sys_nsig && sys_siglist[i]) + strcpy(statestr, sys_siglist[i]); + else + fmtstr(statestr, 64, "Signal %d", i); + if (WCOREDUMP(ps->status)) + strcat(statestr, " (core dumped)"); + } + for (ps = jp->ps ; ; ps++) { /* for each process */ if (mode == SHOWJOBS_PIDS || mode == SHOWJOBS_PGIDS) { out1fmt("%d\n", (int)ps->pid); goto skip; } - if (mode != SHOWJOBS_VERBOSE && ps != jp->ps && pid == 0) - goto skip; - if (pid != 0 && pid != ps->pid) + if (mode != SHOWJOBS_VERBOSE && ps != jp->ps) goto skip; if (jobno == curr && ps == jp->ps) c = '+'; @@ -346,39 +390,19 @@ showjob(struct job *jp, pid_t pid, int m out1str(s); col += strlen(s); } - s[0] = '\0'; - if (ps != jp->ps) { - *s = '\0'; - } else if (ps->status == -1) { - strcpy(s, "Running"); - } else if (WIFEXITED(ps->status)) { - if (WEXITSTATUS(ps->status) == 0) - strcpy(s, "Done"); - else - fmtstr(s, 64, "Done (%d)", - WEXITSTATUS(ps->status)); - } else { -#if JOBS - if (WIFSTOPPED(ps->status)) - i = WSTOPSIG(ps->status); - else -#endif - i = WTERMSIG(ps->status); - if ((i & 0x7F) < sys_nsig && sys_siglist[i & 0x7F]) - scopy(sys_siglist[i & 0x7F], s); - else - fmtstr(s, 64, "Signal %d", i & 0x7F); - if (WCOREDUMP(ps->status)) - strcat(s, " (core dumped)"); + if (ps == jp->ps) { + out1str(statestr); + col += strlen(statestr); } - out1str(s); - col += strlen(s); do { out1c(' '); col++; } while (col < 30); - out1str(ps->cmd); - out1c('\n'); + if (mode == SHOWJOBS_VERBOSE) { + out1str(ps->cmd); + out1c('\n'); + } else + printjobcmd(jp); skip: if (--procno <= 0) break; } @@ -410,7 +434,7 @@ showjobs(int change, int mode) } if (change && ! jp->changed) continue; - showjob(jp, 0, mode); + showjob(jp, mode); jp->changed = 0; /* Hack: discard jobs for which $! has not been referenced * in interactive mode when they terminate. @@ -958,7 +982,7 @@ dowait(int block, struct job *job) int done; int stopped; int sig; - int i; + int coredump; in_dowait++; TRACE(("dowait(%d) called\n", block)); @@ -1017,36 +1041,29 @@ dowait(int block, struct job *job) } } INTON; - if (! rootshell || ! iflag || (job && thisjob == job)) { -#if JOBS - if (WIFSTOPPED(status)) - sig = WSTOPSIG(status); - else -#endif - { - if (WIFEXITED(status)) - sig = 0; + if (!thisjob || thisjob->state == 0) + ; + else if ((!rootshell || !iflag || thisjob == job) && + thisjob->foreground && thisjob->state != JOBSTOPPED) { + sig = 0; + coredump = 0; + for (sp = thisjob->ps; sp < thisjob->ps + thisjob->nprocs; sp++) + if (WIFSIGNALED(sp->status)) { + sig = WTERMSIG(sp->status); + coredump = WCOREDUMP(sp->status); + } + if (sig > 0 && sig != SIGINT && sig != SIGPIPE) { + if (sig < sys_nsig && sys_siglist[sig]) + out1str(sys_siglist[sig]); else - sig = WTERMSIG(status); - } - if (sig != 0 && sig != SIGINT && sig != SIGPIPE) { - if (!mflag || - (thisjob->foreground && !WIFSTOPPED(status))) { - i = WTERMSIG(status); - if ((i & 0x7F) < sys_nsig && sys_siglist[i & 0x7F]) - out1str(sys_siglist[i & 0x7F]); - else - out1fmt("Signal %d", i & 0x7F); - if (WCOREDUMP(status)) - out1str(" (core dumped)"); - out1c('\n'); - } else - showjob(thisjob, pid, SHOWJOBS_DEFAULT); + out1fmt("Signal %d", sig); + if (coredump) + out1str(" (core dumped)"); + out1c('\n'); } } else { TRACE(("Not printing status, rootshell=%d, job=%p\n", rootshell, job)); - if (thisjob) - thisjob->changed = 1; + thisjob->changed = 1; } return pid; } From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:41:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EAF91065674; Sun, 5 Dec 2010 22:41:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D82B8FC0A; Sun, 5 Dec 2010 22:41:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5Mfwog011439; Sun, 5 Dec 2010 22:41:58 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MfwmS011437; Sun, 5 Dec 2010 22:41:58 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052241.oB5MfwmS011437@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216218 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:41:58 -0000 Author: dougb Date: Sun Dec 5 22:41:58 2010 New Revision: 216218 URL: http://svn.freebsd.org/changeset/base/216218 Log: Bring in the following changes from NetBSD: 1.21 "Document the flags displayed by the default format, and mention their short names. From espie@openbsd via jmc@openbsd." 1.24 "Fix three variable names. From Todd T. Fries via Jason McIntyre." Obtained from: wiz@NetBSD.org (previous 2) 1.25 "Be consistent: document the birthtime field of struct stat for the "B" field specifier." Obtained from: reed@NetBSD.org 1.26 "Drop trailing space." Obtained from: wiz@NetBSD.org 1.27 "Since we have st_birthtime in struct stat, it is in default display." Obtained from: enami@NetBSD.org Purposely skipping the following revisions: 1.22 NetBSD-specific change 1.23 Removal of license clauses 3 and 4, already handled by imp in our r203971 Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 22:37:01 2010 (r216217) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:41:58 2010 (r216218) @@ -1,4 +1,4 @@ -.\" $NetBSD: stat.1,v 1.19 2006/10/07 10:41:50 elad Exp $ +.\" $NetBSD: stat.1,v 1.27 2010/03/11 21:37:01 enami Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -68,7 +68,7 @@ will print nothing and exit with an erro If the .Fl f option is specified, the output is canonicalized by following every symlink -in every component of the given path recursively. +in every component of the given path recursively. .Nm readlink will resolve both absolute and relative paths, and return the absolute pathname corresponding to @@ -78,6 +78,24 @@ In this case, the argument does not need The information displayed is obtained by calling .Xr lstat 2 with the given argument and evaluating the returned structure. +The default format displays the +.Fa st_dev , +.Fa st_ino , +.Fa st_mode , +.Fa st_nlink , +.Fa st_uid , +.Fa st_gid , +.Fa st_rdev , +.Fa st_size , +.Fa st_atime , +.Fa st_mtime , +.Fa st_ctime , +.Fa st_birthtime , +.Fa st_blksize , +.Fa st_blocks , +and +.Fa st_flags +fields, in that order. .Pp The options are as follows: .Bl -tag -width indent @@ -354,40 +372,51 @@ A required field specifier, being one of .It Cm d Device upon which .Ar file -resides. +resides +.Pq Fa st_dev . .It Cm i .Ar file Ns 's -inode number. +inode number +.Pq Fa st_ino . .It Cm p -File type and permissions. +File type and permissions +.Pq Fa st_mode . .It Cm l Number of hard links to -.Ar file . +.Ar file +.Pq Fa st_nlink . .It Cm u , g User ID and group ID of .Ar file Ns 's -owner. +owner +.Pq Fa st_uid , st_gid . .It Cm r -Device number for character and block device special files. +Device number for character and block device special files +.Pq Fa st_rdev . .It Cm a , m , c , B The time .Ar file was last accessed or modified, or when the inode was last changed, or -the birth time of the inode. +the birth time of the inode +.Pq Fa st_atime , st_mtime , st_ctime , st_birthtime . .It Cm z The size of .Ar file -in bytes. +in bytes +.Pq Fa st_size . .It Cm b Number of blocks allocated for -.Ar file . +.Ar file +.Pq Fa st_blocks . .It Cm k -Optimal file system I/O operation block size. +Optimal file system I/O operation block size +.Pq Fa st_blksize . .It Cm f User defined flags for .Ar file . .It Cm v -Inode generation number. +Inode generation number +.Pq Fa st_gen . .El .Pp The following five field specifiers are not drawn directly from the From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:47:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFD6106566B; Sun, 5 Dec 2010 22:47:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD2978FC08; Sun, 5 Dec 2010 22:47:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5Ml8pa011649; Sun, 5 Dec 2010 22:47:08 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5Ml8EK011647; Sun, 5 Dec 2010 22:47:08 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012052247.oB5Ml8EK011647@svn.freebsd.org> From: Doug Barton Date: Sun, 5 Dec 2010 22:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216219 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:47:09 -0000 Author: dougb Date: Sun Dec 5 22:47:08 2010 New Revision: 216219 URL: http://svn.freebsd.org/changeset/base/216219 Log: Bring in the change from NetBSD 1.28: "\\ -> \e" Obtained from: joerg@NetBSD.org Bump .Dd because we're now up to date with the latest NetBSD version Modified: head/usr.bin/stat/stat.1 Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun Dec 5 22:41:58 2010 (r216218) +++ head/usr.bin/stat/stat.1 Sun Dec 5 22:47:08 2010 (r216219) @@ -1,4 +1,4 @@ -.\" $NetBSD: stat.1,v 1.27 2010/03/11 21:37:01 enami Exp $ +.\" $NetBSD: stat.1,v 1.28 2010/04/05 21:25:01 joerg Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2010 +.Dd December 5, 2010 .Dt STAT 1 .Os .Sh NAME @@ -473,7 +473,7 @@ which default to .Ex -std stat readlink .Sh EXAMPLES If no options are specified, the default format is -"%d %i %Sp %l %Su %Sg %r %z \\"%Sa\\" \\"%Sm\\" \\"%Sc\\" \\"%SB\\" %k %b %#Xf %N". +"%d %i %Sp %l %Su %Sg %r %z \e"%Sa\e" \e"%Sm\e" \e"%Sc\e" \e"%SB\e" %k %b %#Xf %N". .Bd -literal -offset indent \*[Gt] stat /tmp/bar 0 78852 -rw-r--r-- 1 root wheel 0 0 "Jul 8 10:26:03 2004" "Jul 8 10:26:03 2004" "Jul 8 10:28:13 2004" "Jan 1 09:00:00 1970" 16384 0 0 /tmp/bar From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 22:56:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68AEA1065679; Sun, 5 Dec 2010 22:56:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57EC88FC1B; Sun, 5 Dec 2010 22:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5MukF6011859; Sun, 5 Dec 2010 22:56:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5MukZG011857; Sun, 5 Dec 2010 22:56:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012052256.oB5MukZG011857@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Dec 2010 22:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216220 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 22:56:46 -0000 Author: jilles Date: Sun Dec 5 22:56:46 2010 New Revision: 216220 URL: http://svn.freebsd.org/changeset/base/216220 Log: sh: POSIX says there should not be a space between Done and (exitstatus). (On the other hand, (core dumped) does need a space and so does [1] +.) Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 5 22:47:08 2010 (r216219) +++ head/bin/sh/jobs.c Sun Dec 5 22:56:46 2010 (r216220) @@ -354,7 +354,7 @@ showjob(struct job *jp, int mode) if (WEXITSTATUS(ps->status) == 0) strcpy(statestr, "Done"); else - fmtstr(statestr, 64, "Done (%d)", + fmtstr(statestr, 64, "Done(%d)", WEXITSTATUS(ps->status)); } else { i = WTERMSIG(ps->status); From owner-svn-src-head@FreeBSD.ORG Sun Dec 5 23:50:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56E76106564A; Sun, 5 Dec 2010 23:50:49 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459728FC0C; Sun, 5 Dec 2010 23:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5Nonf2013463; Sun, 5 Dec 2010 23:50:49 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5NonON013461; Sun, 5 Dec 2010 23:50:49 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012052350.oB5NonON013461@svn.freebsd.org> From: David Schultz Date: Sun, 5 Dec 2010 23:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216221 - head/tools/regression/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2010 23:50:49 -0000 Author: das Date: Sun Dec 5 23:50:49 2010 New Revision: 216221 URL: http://svn.freebsd.org/changeset/base/216221 Log: Fix some warnings. Modified: head/tools/regression/lib/msun/test-fmaxmin.c Modified: head/tools/regression/lib/msun/test-fmaxmin.c ============================================================================== --- head/tools/regression/lib/msun/test-fmaxmin.c Sun Dec 5 22:56:46 2010 (r216220) +++ head/tools/regression/lib/msun/test-fmaxmin.c Sun Dec 5 23:50:49 2010 (r216221) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); * fpequal(NaN, NaN) is true * fpequal(+0.0, -0.0) is false */ -inline int +static inline int fpequal(long double x, long double y) { @@ -63,7 +63,7 @@ fpequal(long double x, long double y) feclearexcept(ALL_STD_EXCEPT); \ long double __result = func((__x), (__y)); \ if (fetestexcept(ALL_STD_EXCEPT)) { \ - fprintf(stderr, #func "(%L.20g, %L.20g) raised 0x%x\n", \ + fprintf(stderr, #func "(%.20Lg, %.20Lg) raised 0x%x\n", \ (x), (y), fetestexcept(FE_ALL_EXCEPT)); \ ok = 0; \ } \ @@ -104,7 +104,7 @@ testall_r(long double big, long double s * in all rounding modes and with the arguments in different orders. * The input 'big' must be >= 'small'. */ -int +void testall(int testnum, long double big, long double small) { static const int rmodes[] = { From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 00:02:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C107B1065674; Mon, 6 Dec 2010 00:02:49 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF82D8FC0A; Mon, 6 Dec 2010 00:02:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB602n68013765; Mon, 6 Dec 2010 00:02:49 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB602nmC013758; Mon, 6 Dec 2010 00:02:49 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012060002.oB602nmC013758@svn.freebsd.org> From: David Schultz Date: Mon, 6 Dec 2010 00:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216222 - head/tools/regression/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 00:02:49 -0000 Author: das Date: Mon Dec 6 00:02:49 2010 New Revision: 216222 URL: http://svn.freebsd.org/changeset/base/216222 Log: signbit() returns nonzero for negative arguments, but we shouldn't assume that it always returns the same nonzero value. Modified: head/tools/regression/lib/msun/test-exponential.c head/tools/regression/lib/msun/test-fma.c head/tools/regression/lib/msun/test-fmaxmin.c head/tools/regression/lib/msun/test-invtrig.c head/tools/regression/lib/msun/test-logarithm.c head/tools/regression/lib/msun/test-trig.c Modified: head/tools/regression/lib/msun/test-exponential.c ============================================================================== --- head/tools/regression/lib/msun/test-exponential.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-exponential.c Mon Dec 6 00:02:49 2010 (r216222) @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); int fpequal(long double x, long double y) { - return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y)); + return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y)); } void Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-fma.c Mon Dec 6 00:02:49 2010 (r216222) @@ -85,7 +85,8 @@ int fpequal(long double x, long double y) { - return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y))); + return ((x == y && !signbit(x) == !signbit(y)) + || (isnan(x) && isnan(y))); } static void Modified: head/tools/regression/lib/msun/test-fmaxmin.c ============================================================================== --- head/tools/regression/lib/msun/test-fmaxmin.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-fmaxmin.c Mon Dec 6 00:02:49 2010 (r216222) @@ -50,7 +50,8 @@ static inline int fpequal(long double x, long double y) { - return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y))); + return ((x == y && !signbit(x) == !signbit(y)) + || (isnan(x) && isnan(y))); } /* Modified: head/tools/regression/lib/msun/test-invtrig.c ============================================================================== --- head/tools/regression/lib/msun/test-invtrig.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-invtrig.c Mon Dec 6 00:02:49 2010 (r216222) @@ -118,7 +118,7 @@ fpequal(long double x, long double y, lo if (isnan(x) && isnan(y)) return (1); - if (signbit(x) != signbit(y)) + if (!signbit(x) != !signbit(y)) return (0); if (x == y) return (1); Modified: head/tools/regression/lib/msun/test-logarithm.c ============================================================================== --- head/tools/regression/lib/msun/test-logarithm.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-logarithm.c Mon Dec 6 00:02:49 2010 (r216222) @@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$"); int fpequal(long double x, long double y) { - return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y)); + return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y)); } void Modified: head/tools/regression/lib/msun/test-trig.c ============================================================================== --- head/tools/regression/lib/msun/test-trig.c Sun Dec 5 23:50:49 2010 (r216221) +++ head/tools/regression/lib/msun/test-trig.c Mon Dec 6 00:02:49 2010 (r216222) @@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$"); int fpequal(long double x, long double y) { - return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y)); + return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y)); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 00:19:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A66EF1065670; Mon, 6 Dec 2010 00:19:56 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953C18FC14; Mon, 6 Dec 2010 00:19:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB60Juqk014095; Mon, 6 Dec 2010 00:19:56 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB60JuQd014093; Mon, 6 Dec 2010 00:19:56 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012060019.oB60JuQd014093@svn.freebsd.org> From: David Schultz Date: Mon, 6 Dec 2010 00:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216223 - head/tools/regression/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 00:19:56 -0000 Author: das Date: Mon Dec 6 00:19:56 2010 New Revision: 216223 URL: http://svn.freebsd.org/changeset/base/216223 Log: Work around gcc constant folding bugs. Modified: head/tools/regression/lib/msun/test-lrint.c Modified: head/tools/regression/lib/msun/test-lrint.c ============================================================================== --- head/tools/regression/lib/msun/test-lrint.c Mon Dec 6 00:02:49 2010 (r216222) +++ head/tools/regression/lib/msun/test-lrint.c Mon Dec 6 00:19:56 2010 (r216223) @@ -41,9 +41,14 @@ __FBSDID("$FreeBSD$"); #include #endif +/* + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ #define test(func, x, result, excepts) do { \ + volatile double _d = x; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert((func)(x) == (result) || fetestexcept(FE_INVALID)); \ + assert((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ assert(fetestexcept(FE_ALL_EXCEPT) == (excepts)); \ } while (0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 04:36:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 917A2106566C; Mon, 6 Dec 2010 04:36:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 127C38FC0C; Mon, 6 Dec 2010 04:36:02 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB64a0gS028967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Dec 2010 15:36:01 +1100 Date: Mon, 6 Dec 2010 15:36:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <201012052211.oB5MB3Ca009953@svn.freebsd.org> Message-ID: <20101206153534.M1314@besplex.bde.org> References: <201012052211.oB5MB3Ca009953@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216210 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 04:36:03 -0000 On Sun, 5 Dec 2010, David Schultz wrote: > Log: > Add a "kernel" log function, based on e_log.c, which is useful for > implementing accurate logarithms in different bases. This is based > on an approach bde coded up years ago. Thanks for doing lots of work to make this production quality. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 09:18:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BF01065679; Mon, 6 Dec 2010 09:18:12 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C5A8FC15; Mon, 6 Dec 2010 09:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB69IBms027168; Mon, 6 Dec 2010 09:18:11 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB69IB9L027166; Mon, 6 Dec 2010 09:18:11 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012060918.oB69IB9L027166@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 6 Dec 2010 09:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216224 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 09:18:12 -0000 Author: jh Date: Mon Dec 6 09:18:11 2010 New Revision: 216224 URL: http://svn.freebsd.org/changeset/base/216224 Log: Don't write the terminating NUL past end of buffer. PR: bin/152345 Submitted by: Mateusz Guzik Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Dec 6 00:19:56 2010 (r216223) +++ head/usr.bin/truss/syscalls.c Mon Dec 6 09:18:11 2010 (r216224) @@ -518,7 +518,7 @@ get_string(pid_t pid, void *offset, int buf = realloc(buf, totalsize); size = BLOCKSIZE; } else { - buf[totalsize] = '\0'; + buf[totalsize - 1] = '\0'; return (buf); } } From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 09:37:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288CF106564A; Mon, 6 Dec 2010 09:37:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176688FC13; Mon, 6 Dec 2010 09:37:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB69bu6K027593; Mon, 6 Dec 2010 09:37:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB69buhP027591; Mon, 6 Dec 2010 09:37:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201012060937.oB69buhP027591@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Dec 2010 09:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216225 - head/usr.sbin/rarpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 09:37:57 -0000 Author: glebius Date: Mon Dec 6 09:37:56 2010 New Revision: 216225 URL: http://svn.freebsd.org/changeset/base/216225 Log: Catch up with kernel using time_uptime to drive ARP timeouts. Noticed by: jilles Modified: head/usr.sbin/rarpd/rarpd.c Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Mon Dec 6 09:18:11 2010 (r216224) +++ head/usr.sbin/rarpd/rarpd.c Mon Dec 6 09:37:56 2010 (r216225) @@ -666,6 +666,7 @@ struct { static void update_arptab(u_char *ep, in_addr_t ipaddr) { + struct timespec tp; int cc; struct sockaddr_inarp *ar, *ar2; struct sockaddr_dl *ll, *ll2; @@ -731,7 +732,8 @@ update_arptab(u_char *ep, in_addr_t ipad rt->rtm_version = RTM_VERSION; rt->rtm_addrs = RTA_DST | RTA_GATEWAY; rt->rtm_inits = RTV_EXPIRE; - rt->rtm_rmx.rmx_expire = time(0) + ARPSECS; + clock_gettime(CLOCK_MONOTONIC, &tp); + rt->rtm_rmx.rmx_expire = tp.tv_sec + ARPSECS; rt->rtm_flags = RTF_HOST | RTF_STATIC; rt->rtm_type = RTM_ADD; rt->rtm_seq = ++seq; From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 09:39:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FC6C106566B; Mon, 6 Dec 2010 09:39:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9D38FC12; Mon, 6 Dec 2010 09:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB69dbNQ027665; Mon, 6 Dec 2010 09:39:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB69db2F027663; Mon, 6 Dec 2010 09:39:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201012060939.oB69db2F027663@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Dec 2010 09:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216226 - head/libexec/bootpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 09:39:37 -0000 Author: glebius Date: Mon Dec 6 09:39:36 2010 New Revision: 216226 URL: http://svn.freebsd.org/changeset/base/216226 Log: Catch up with kernel using time_uptime to drive ARP timeouts. Noticed by: jilles Modified: head/libexec/bootpd/rtmsg.c Modified: head/libexec/bootpd/rtmsg.c ============================================================================== --- head/libexec/bootpd/rtmsg.c Mon Dec 6 09:37:56 2010 (r216225) +++ head/libexec/bootpd/rtmsg.c Mon Dec 6 09:39:36 2010 (r216226) @@ -126,7 +126,7 @@ int bsd_arp_set(ia, eaddr, len) register struct sockaddr_dl *sdl; register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); u_char *ea; - struct timeval time; + struct timespec tp; int op = RTM_ADD; getsocket(); @@ -140,8 +140,8 @@ int bsd_arp_set(ia, eaddr, len) doing_proxy = flags = export_only = expire_time = 0; /* make arp entry temporary */ - gettimeofday(&time, 0); - expire_time = time.tv_sec + 20 * 60; + clock_gettime(CLOCK_MONOTONIC, &tp); + expire_time = tp.tv_sec + 20 * 60; tryagain: if (rtmsg(RTM_GET) < 0) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 10:24:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D47D106566C; Mon, 6 Dec 2010 10:24:07 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2F28FC1A; Mon, 6 Dec 2010 10:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6AO66E028716; Mon, 6 Dec 2010 10:24:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6AO6oC028707; Mon, 6 Dec 2010 10:24:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012061024.oB6AO6oC028707@svn.freebsd.org> From: Kevin Lo Date: Mon, 6 Dec 2010 10:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216227 - in head: libexec/mknetid sys/arm/at91 sys/dev/bwn sys/dev/mps sys/dev/siba sys/dev/sis sys/mips/mips usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 10:24:07 -0000 Author: kevlo Date: Mon Dec 6 10:24:06 2010 New Revision: 216227 URL: http://svn.freebsd.org/changeset/base/216227 Log: Fix double ;; Modified: head/libexec/mknetid/parse_group.c head/sys/arm/at91/at91_pmc.c head/sys/dev/bwn/if_bwn.c head/sys/dev/mps/mps.c head/sys/dev/siba/siba_bwn.c head/sys/dev/sis/if_sisreg.h head/sys/mips/mips/mp_machdep.c head/usr.sbin/ac/ac.c Modified: head/libexec/mknetid/parse_group.c ============================================================================== --- head/libexec/mknetid/parse_group.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/libexec/mknetid/parse_group.c Mon Dec 6 10:24:06 2010 (r216227) @@ -126,7 +126,7 @@ grscan(int search, int gid) if (_gr_group.gr_name[0] == '+') continue; if ((_gr_group.gr_passwd = strsep(&bp, ":\n")) == NULL) - break;; + break; if (!(cp = strsep(&bp, ":\n"))) continue; _gr_group.gr_gid = atoi(cp); Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/arm/at91/at91_pmc.c Mon Dec 6 10:24:06 2010 (r216227) @@ -325,7 +325,7 @@ at91_pmc_clock_disable(struct at91_pmc_c static int at91_pmc_pll_rate(struct at91_pmc_clock *clk, uint32_t reg) { - uint32_t mul, div, freq;; + uint32_t mul, div, freq; freq = clk->parent->hz; div = (reg >> clk->pll_div_shift) & clk->pll_div_mask; Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/dev/bwn/if_bwn.c Mon Dec 6 10:24:06 2010 (r216227) @@ -2882,7 +2882,7 @@ bwn_set_channel(struct ieee80211com *ic) error = bwn_switch_band(sc, ic->ic_curchan); if (error) - goto fail;; + goto fail; bwn_mac_suspend(mac); bwn_set_txretry(mac, BWN_RETRY_SHORT, BWN_RETRY_LONG); chan = ieee80211_chan2ieee(ic, ic->ic_curchan); @@ -8260,7 +8260,7 @@ bwn_switch_band(struct bwn_softc *sc, st device_printf(sc->sc_dev, "switching to %s-GHz band\n", IEEE80211_IS_CHAN_2GHZ(chan) ? "2" : "5"); - down_dev = sc->sc_curmac;; + down_dev = sc->sc_curmac; status = down_dev->mac_status; if (status >= BWN_MAC_STATUS_STARTED) bwn_core_stop(down_dev); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/dev/mps/mps.c Mon Dec 6 10:24:06 2010 (r216227) @@ -1282,7 +1282,7 @@ mps_dispatch_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *reply) { struct mps_event_handle *eh; - int event, handled = 0;; + int event, handled = 0; event = reply->Event; TAILQ_FOREACH(eh, &sc->event_list, eh_list) { Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/dev/siba/siba_bwn.c Mon Dec 6 10:24:06 2010 (r216227) @@ -326,7 +326,7 @@ static int siba_bwn_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct siba_dev_softc *sd; - struct siba_softc *siba;; + struct siba_softc *siba; sd = device_get_ivars(child); siba = sd->sd_bus; Modified: head/sys/dev/sis/if_sisreg.h ============================================================================== --- head/sys/dev/sis/if_sisreg.h Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/dev/sis/if_sisreg.h Mon Dec 6 10:24:06 2010 (r216227) @@ -497,7 +497,7 @@ struct sis_softc { int sis_tx_prod; int sis_tx_cons; int sis_tx_cnt; - int sis_rx_cons;; + int sis_rx_cons; bus_addr_t sis_rx_paddr; bus_addr_t sis_tx_paddr; struct callout sis_stat_ch; Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/sys/mips/mips/mp_machdep.c Mon Dec 6 10:24:06 2010 (r216227) @@ -164,7 +164,7 @@ mips_ipi_handler(void *arg) break; case IPI_HARDCLOCK: CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); - hardclockintr();; + hardclockintr(); break; default: panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Mon Dec 6 09:39:36 2010 (r216226) +++ head/usr.sbin/ac/ac.c Mon Dec 6 10:24:06 2010 (r216227) @@ -584,7 +584,7 @@ ac(const char *file) if (!(Flags & AC_W)) usht.ut_tv.tv_sec = time(NULL); else - usht.ut_tv.tv_sec = ut_timecopy;; + usht.ut_tv.tv_sec = ut_timecopy; usht.ut_type = SHUTDOWN_TIME; if (Flags & AC_D) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 11:37:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07A041065675; Mon, 6 Dec 2010 11:37:25 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA9188FC0C; Mon, 6 Dec 2010 11:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6BbOHq031806; Mon, 6 Dec 2010 11:37:24 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6BbOwX031804; Mon, 6 Dec 2010 11:37:24 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012061137.oB6BbOwX031804@svn.freebsd.org> From: Bruce Cran Date: Mon, 6 Dec 2010 11:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216229 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 11:37:25 -0000 Author: brucec Date: Mon Dec 6 11:37:24 2010 New Revision: 216229 URL: http://svn.freebsd.org/changeset/base/216229 Log: Revert r209469: it causes the rest of the function to be bypassed. Reported by: ae Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Mon Dec 6 10:58:13 2010 (r216228) +++ head/usr.sbin/boot0cfg/boot0cfg.c Mon Dec 6 11:37:24 2010 (r216229) @@ -356,8 +356,6 @@ write_mbr(const char *fname, int flags, if (n != mbr_size) errx(1, "%s: short write", fname); return; - } else { - err(1, "write_mbr: %s", fname); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 12:18:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4755D1065694; Mon, 6 Dec 2010 12:18:03 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 352578FC13; Mon, 6 Dec 2010 12:18:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6CI3R5032772; Mon, 6 Dec 2010 12:18:03 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6CI3oW032770; Mon, 6 Dec 2010 12:18:03 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201012061218.oB6CI3oW032770@svn.freebsd.org> From: Ivan Voras Date: Mon, 6 Dec 2010 12:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 12:18:03 -0000 Author: ivoras Date: Mon Dec 6 12:18:02 2010 New Revision: 216230 URL: http://svn.freebsd.org/changeset/base/216230 Log: Use GEOM stripesize field when calculating ashift. This will enable correct alignment on drives with large sector sizes (e.g. 4 KiB) but the implementation might need to be revisited if devices with large stripesizes appear (e.g. if RAID controllers or flash drives start using the field), probably by introducing a physsectorsize field in GEOM providers. Discussed with: mav, mostly silence on freebsd-geom@ and freebsd-fs@ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Dec 6 11:37:24 2010 (r216229) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Dec 6 12:18:02 2010 (r216230) @@ -496,7 +496,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi /* * Determine the device's minimum transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + if (pp->stripesize > pp->sectorsize) + *ashift = highbit(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; + else + *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; /* * Clear the nowritecache bit, so that on a vdev_reopen() we will From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 15:15:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38BF6106566C; Mon, 6 Dec 2010 15:15:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 272968FC1A; Mon, 6 Dec 2010 15:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6FFSmb036772; Mon, 6 Dec 2010 15:15:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6FFSME036770; Mon, 6 Dec 2010 15:15:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012061515.oB6FFSME036770@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Dec 2010 15:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216231 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 15:15:28 -0000 Author: kib Date: Mon Dec 6 15:15:27 2010 New Revision: 216231 URL: http://svn.freebsd.org/changeset/base/216231 Log: Do not leak %rdx value in the previous image to the new image after execve(2). Note that ia32 binaries already handle this properly, since ia32_setregs() resets td_retval[1], but not exec_setregs(). We still do not conform to the amd64 ABI specification, since %rsp on the image startup is not aligned to 16 bytes. PR: amd64/124134 Discussed with: Petr Salinger (who convinced me that there is indeed several bugs) MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Dec 6 12:18:02 2010 (r216230) +++ head/sys/amd64/amd64/machdep.c Mon Dec 6 15:15:27 2010 (r216231) @@ -876,6 +876,7 @@ exec_setregs(struct thread *td, struct i regs->tf_fs = _ufssel; regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; + td->td_retval[1] = 0; /* * Reset the hardware debug registers if they were in use. From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 15:19:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCECB1065672; Mon, 6 Dec 2010 15:19:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA75B8FC0A; Mon, 6 Dec 2010 15:19:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6FJ3ht036890; Mon, 6 Dec 2010 15:19:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6FJ36l036887; Mon, 6 Dec 2010 15:19:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012061519.oB6FJ36l036887@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Dec 2010 15:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216232 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 15:19:03 -0000 Author: jhb Date: Mon Dec 6 15:19:03 2010 New Revision: 216232 URL: http://svn.freebsd.org/changeset/base/216232 Log: Add a manpage for SYSINIT() and SYSUNINIT(). PR: docs/132884 Submitted by: pluknet, hmp Added: head/share/man/man9/SYSINIT.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Dec 6 15:15:27 2010 (r216231) +++ head/share/man/man9/Makefile Mon Dec 6 15:19:03 2010 (r216232) @@ -244,6 +244,7 @@ MAN= accept_filter.9 \ sysctl.9 \ sysctl_add_oid.9 \ sysctl_ctx_init.9 \ + SYSINIT.9 \ taskqueue.9 \ thread_exit.9 \ time.9 \ @@ -1211,6 +1212,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_entry_del.9 \ sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \ sysctl_ctx_init.9 sysctl_ctx_free.9 +MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ Added: head/share/man/man9/SYSINIT.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/SYSINIT.9 Mon Dec 6 15:19:03 2010 (r216232) @@ -0,0 +1,163 @@ +.\" Copyright (c) 2003 Hiten M. Pandya +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 1, 2010 +.Dt SYSINIT 9 +.Os +.Sh NAME +.Nm SYSINIT , +.Nm SYSUNINIT +.Nd a framework for dynamic kernel initialization +.Sh SYNOPSIS +.In sys/param.h +.In sys/kernel.h +.Fn SYSINIT "uniquifier" "enum sysinit_sub_id subsystem" "enum sysinit_elem_order order" "sysinit_cfunc_t func" "const void *ident" +.Fn SYSUNINIT "uniquifier" "enum sysinit_sub_id subsystem" "enum sysinit_elem_order order" "sysinit_cfunc_t func" "const void *ident" +.Sh DESCRIPTION +.Nm +is a mechanism for scheduling the execution of initialization and teardown +routines. +This is similar to init and fini routines with the addition of explicit +ordering metadata. +It allows runtime ordering of subsystem initialization in the kernel as well +as kernel modules (KLDs). +.Pp +The +.Fn SYSINIT +macro creates a +.Vt struct sysinit +and stores it in a startup linker set. +The +.Vt struct sysinit +type as well as the subsystem identifier constants +.Pq Dv SI_SUB_* +and initialization ordering constants +.Pq Dv SI_ORDER_* +are defined in +.In sys/kernel.h : +.Bd -literal +struct sysinit { + enum sysinit_sub_id subsystem; /* subsystem identifier*/ + enum sysinit_elem_order order; /* init order within subsystem*/ + sysinit_cfunc_t func; /* function */ + const void *udata; /* multiplexer/argument */ +}; +.Ed +.Pp +The +.Fn SYSINIT +macro takes a +.Fa uniquifier +argument to identify the particular function dispatch data, +the +.Fa subsystem +type of startup interface, the subsystem element +.Fa order +of initialization within the subsystem, the +.Fa func +function to call, +and the data specified in +.Fa ident +argument to pass the function. +.Pp +The +.Fn SYSUNINIT +macro behaves similarly to the +.Fn SYSINIT +macro except that it adds the data to a shutdown linker set. +.Pp +The startup linker set for the kernel is scanned during boot to build a +sorted list of initialization routines. +The initialization routines are then executed in the sorted order. +The +.Fa subsystem +is used as the primary key and is sorted in ascending order. +The +.Fa order +is used as the secondary key and is sorted in ascending order. +The relative order of two routines that have the same +.Fa subsystem +and +.Fa order +is undefined. +.Pp +The startup linker sets for modules that are loaded together with the kernel +by the boot loader are scanned during the +.Dv SI_SUB_KLD +subsystem initialization. +These modules' initialization routines are sorted and merged into the kernel's +list of startup routines and are executed during boot along with the kernel's +initialization routines. +Note that this has the effect that any initialization routines in a kernel +module that are scheduled earlier than +.Dv SI_SUB_KLD +are not executed until after +.Dv SI_SUB_KLD +during boot. +.Pp +The startup linker set for a kernel module loaded at runtime via +.Xr kldload 2 +is scanned, sorted, and executed when the module is loaded. +.Pp +The shutdown linker set for a kernel module is scanned, sorted, and executed +when a kernel module is unloaded. +The teardown routines are sorted in the reverse order of the initialization +routines. +The teardown routines of the kernel and any loaded modules are +.Sy not +executed during shutdown. +.Sh EXAMPLES +This example shows the SYSINIT which displays the copyright notice during boot: +.Bd -literal -offset indent +static void +print_caddr_t(void *data) +{ + printf("%s", (char *)data); +} +SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, + copyright); +.Ed +.Sh SEE ALSO +.Xr kld 4 , +.Xr DECLARE_MODULE 9 , +.Xr DEV_MODULE 9 , +.Xr DRIVER_MODULE 9 , +.Xr MTX_SYSINIT 9 , +.Xr SYSCALL_MODULE 9 +.Sh HISTORY +The +.Nm +framework first appeared in +.Fx 2.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +framework was written by +.An Terrence Lambert Aq terry@FreeBSD.org . +.Pp +This manual page was written by +.An Hiten Pandya Aq hmp@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 16:39:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D289106566B; Mon, 6 Dec 2010 16:39:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0D38FC1C; Mon, 6 Dec 2010 16:39:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6GdJaq038648; Mon, 6 Dec 2010 16:39:19 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6GdJN2038646; Mon, 6 Dec 2010 16:39:19 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012061639.oB6GdJN2038646@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 6 Dec 2010 16:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216233 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 16:39:19 -0000 Author: trasz Date: Mon Dec 6 16:39:18 2010 New Revision: 216233 URL: http://svn.freebsd.org/changeset/base/216233 Log: Improve readability by factoring out the !RFPROC case. While here, turn K&R function definitions into ANSI. No functional changes. Reviewed by: kib@ Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Dec 6 15:19:03 2010 (r216232) +++ head/sys/kern/kern_fork.c Mon Dec 6 16:39:18 2010 (r216233) @@ -97,9 +97,7 @@ struct fork_args { /* ARGSUSED */ int -fork(td, uap) - struct thread *td; - struct fork_args *uap; +fork(struct thread *td, struct fork_args *uap) { int error; struct proc *p2; @@ -135,9 +133,7 @@ vfork(td, uap) } int -rfork(td, uap) - struct thread *td; - struct rfork_args *uap; +rfork(struct thread *td, struct rfork_args *uap) { struct proc *p2; int error; @@ -197,12 +193,57 @@ sysctl_kern_randompid(SYSCTL_HANDLER_ARG SYSCTL_PROC(_kern, OID_AUTO, randompid, CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_kern_randompid, "I", "Random PID modulus"); +static int +fork_norfproc(struct thread *td, int flags, struct proc **procp) +{ + int error; + struct proc *p1; + + p1 = td->td_proc; + + if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && + (flags & (RFCFDG | RFFDG))) { + PROC_LOCK(p1); + if (thread_single(SINGLE_BOUNDARY)) { + PROC_UNLOCK(p1); + return (ERESTART); + } + PROC_UNLOCK(p1); + } + + error = vm_forkproc(td, NULL, NULL, NULL, flags); + if (error) + goto fail; + + /* + * Close all file descriptors. + */ + if (flags & RFCFDG) { + struct filedesc *fdtmp; + fdtmp = fdinit(td->td_proc->p_fd); + fdfree(td); + p1->p_fd = fdtmp; + } + + /* + * Unshare file descriptors (from parent). + */ + if (flags & RFFDG) + fdunshare(p1, td); + +fail: + if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && + (flags & (RFCFDG | RFFDG))) { + PROC_LOCK(p1); + thread_single_end(); + PROC_UNLOCK(p1); + } + *procp = NULL; + return (error); +} + int -fork1(td, flags, pages, procp) - struct thread *td; - int flags; - int pages; - struct proc **procp; +fork1(struct thread *td, int flags, int pages, struct proc **procp) { struct proc *p1, *p2, *pptr; struct proc *newproc; @@ -227,47 +268,8 @@ fork1(td, flags, pages, procp) * Here we don't create a new process, but we divorce * certain parts of a process from itself. */ - if ((flags & RFPROC) == 0) { - if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && - (flags & (RFCFDG | RFFDG))) { - PROC_LOCK(p1); - if (thread_single(SINGLE_BOUNDARY)) { - PROC_UNLOCK(p1); - return (ERESTART); - } - PROC_UNLOCK(p1); - } - - error = vm_forkproc(td, NULL, NULL, NULL, flags); - if (error) - goto norfproc_fail; - - /* - * Close all file descriptors. - */ - if (flags & RFCFDG) { - struct filedesc *fdtmp; - fdtmp = fdinit(td->td_proc->p_fd); - fdfree(td); - p1->p_fd = fdtmp; - } - - /* - * Unshare file descriptors (from parent). - */ - if (flags & RFFDG) - fdunshare(p1, td); - -norfproc_fail: - if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && - (flags & (RFCFDG | RFFDG))) { - PROC_LOCK(p1); - thread_single_end(); - PROC_UNLOCK(p1); - } - *procp = NULL; - return (error); - } + if ((flags & RFPROC) == 0) + return (fork_norfproc(td, flags, procp)); /* * XXX @@ -798,10 +800,8 @@ fail1: * is called from the MD fork_trampoline() entry point. */ void -fork_exit(callout, arg, frame) - void (*callout)(void *, struct trapframe *); - void *arg; - struct trapframe *frame; +fork_exit(void (*callout)(void *, struct trapframe *), void *arg, + struct trapframe *frame) { struct proc *p; struct thread *td; @@ -855,9 +855,7 @@ fork_exit(callout, arg, frame) * first parameter and is called when returning to a new userland process. */ void -fork_return(td, frame) - struct thread *td; - struct trapframe *frame; +fork_return(struct thread *td, struct trapframe *frame) { userret(td, frame); From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 16:45:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412CD1065673; Mon, 6 Dec 2010 16:45:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC2D38FC16; Mon, 6 Dec 2010 16:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6Gjaad038813; Mon, 6 Dec 2010 16:45:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6GjanD038811; Mon, 6 Dec 2010 16:45:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012061645.oB6GjanD038811@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 6 Dec 2010 16:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216234 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 16:45:37 -0000 Author: trasz Date: Mon Dec 6 16:45:36 2010 New Revision: 216234 URL: http://svn.freebsd.org/changeset/base/216234 Log: Fix style bug introduced by previous commit. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Dec 6 16:39:18 2010 (r216233) +++ head/sys/kern/kern_fork.c Mon Dec 6 16:45:36 2010 (r216234) @@ -233,7 +233,7 @@ fork_norfproc(struct thread *td, int fla fail: if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && - (flags & (RFCFDG | RFFDG))) { + (flags & (RFCFDG | RFFDG))) { PROC_LOCK(p1); thread_single_end(); PROC_UNLOCK(p1); From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 17:02:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64087106566B; Mon, 6 Dec 2010 17:02:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5276B8FC1E; Mon, 6 Dec 2010 17:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6H2umR039214; Mon, 6 Dec 2010 17:02:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6H2uaJ039212; Mon, 6 Dec 2010 17:02:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012061702.oB6H2uaJ039212@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Dec 2010 17:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216235 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 17:02:56 -0000 Author: jhb Date: Mon Dec 6 17:02:56 2010 New Revision: 216235 URL: http://svn.freebsd.org/changeset/base/216235 Log: When masking direct and processor devices during an inquiry, properly preserve the upper bits of the first data byte. While here, shorten a few nearby lines. PR: kern/152768 Reported by: Sascha Wildner saw of online.de Reviewed by: scottl MFC after: 1 week Modified: head/sys/dev/mfi/mfi_cam.c Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Mon Dec 6 16:45:36 2010 (r216234) +++ head/sys/dev/mfi/mfi_cam.c Mon Dec 6 17:02:56 2010 (r216235) @@ -340,14 +340,14 @@ mfip_done(struct mfi_command *cm) ccbh->status = CAM_REQ_CMP; csio->scsi_status = pt->header.scsi_status; if (ccbh->flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; + command = csio->cdb_io.cdb_ptr[0]; else - command = ccb->csio.cdb_io.cdb_bytes[0]; + command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { - device = ccb->csio.data_ptr[0] & 0x1f; + device = csio->data_ptr[0] & 0x1f; if ((device == T_DIRECT) || (device == T_PROCESSOR)) csio->data_ptr[0] = - (device & 0xe0) | T_NODEVICE; + (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } break; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 17:06:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8B34106564A; Mon, 6 Dec 2010 17:06:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C763F8FC15; Mon, 6 Dec 2010 17:06:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6H6Ldu039327; Mon, 6 Dec 2010 17:06:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6H6Lp8039325; Mon, 6 Dec 2010 17:06:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012061706.oB6H6Lp8039325@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Dec 2010 17:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216236 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 17:06:21 -0000 Author: jhb Date: Mon Dec 6 17:06:21 2010 New Revision: 216236 URL: http://svn.freebsd.org/changeset/base/216236 Log: When masking direct and processor devices during an inquiry, properly preserve the upper bits of the first data byte. Reviewed by: scottl MFC after: 1 week Modified: head/sys/dev/aac/aac_cam.c Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Mon Dec 6 17:02:56 2010 (r216235) +++ head/sys/dev/aac/aac_cam.c Mon Dec 6 17:06:21 2010 (r216236) @@ -587,7 +587,8 @@ aac_cam_complete(struct aac_command *cm) (device == T_PROCESSOR) || (sc->flags & AAC_FLAGS_CAM_PASSONLY)) ccb->csio.data_ptr[0] = - ((device & 0xe0) | T_NODEVICE); + ((ccb->csio.data_ptr[0] & 0xe0) | + T_NODEVICE); } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && ccb->ccb_h.target_lun != 0) { /* fix for INQUIRYs on Lun>0 */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 18:28:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD161065673; Mon, 6 Dec 2010 18:28:39 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FC28FC0C; Mon, 6 Dec 2010 18:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6ISdul040985; Mon, 6 Dec 2010 18:28:39 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6ISdjA040983; Mon, 6 Dec 2010 18:28:39 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012061828.oB6ISdjA040983@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 6 Dec 2010 18:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216237 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 18:28:39 -0000 Author: bschmidt Date: Mon Dec 6 18:28:39 2010 New Revision: 216237 URL: http://svn.freebsd.org/changeset/base/216237 Log: Fixes for monitor mode: - Do not call iwn_calib_reset() for monitor mode. We do not want to query information and do runtime calibration while in monitor mode. Poking the firmware with adjustments for calibration results in firmware asserts. This could happened on RUN -> RUN transition only. - Adjust blink rate for monitor mode. It's supposed to not freak out and turn off after a while. - While here, remove one useless assignment of calib.state, it gets overwritten later in the function. Submitted by: Brandon Gooch MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Dec 6 17:06:21 2010 (r216236) +++ head/sys/dev/iwn/if_iwn.c Mon Dec 6 18:28:39 2010 (r216237) @@ -1983,7 +1983,8 @@ iwn_newstate(struct ieee80211vap *vap, e /* * RUN -> RUN transition; Just restart the timers. */ - if (vap->iv_state == IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN && + vap->iv_opmode != IEEE80211_M_MONITOR) { iwn_calib_reset(sc); break; } @@ -4851,11 +4852,9 @@ iwn_run(struct iwn_softc *sc, struct iee struct iwn_node_info node; int error; - sc->calib.state = IWN_CALIB_STATE_INIT; - if (ic->ic_opmode == IEEE80211_M_MONITOR) { /* Link LED blinks while monitoring. */ - iwn_set_led(sc, IWN_LED_LINK, 5, 5); + iwn_set_led(sc, IWN_LED_LINK, 20, 20); return 0; } error = iwn_set_timing(sc, ni); From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 18:45:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507DE106566B; Mon, 6 Dec 2010 18:45:06 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id CBC9B8FC0A; Mon, 6 Dec 2010 18:45:05 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id DD3B045C9B; Mon, 6 Dec 2010 19:45:02 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1175845C89; Mon, 6 Dec 2010 19:44:55 +0100 (CET) Date: Mon, 6 Dec 2010 19:44:53 +0100 From: Pawel Jakub Dawidek To: Ivan Voras Message-ID: <20101206184453.GA1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <201012061218.oB6CI3oW032770@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 18:45:06 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 12:18:03PM +0000, Ivan Voras wrote: > Author: ivoras > Date: Mon Dec 6 12:18:02 2010 > New Revision: 216230 > URL: http://svn.freebsd.org/changeset/base/216230 >=20 > Log: > Use GEOM stripesize field when calculating ashift. This will enable cor= rect > alignment on drives with large sector sizes (e.g. 4 KiB) but the > implementation might need to be revisited if devices with large stripes= izes > appear (e.g. if RAID controllers or flash drives start using the field), > probably by introducing a physsectorsize field in GEOM providers. Please back this out as soon as possible! > Discussed with: mav, mostly silence on freebsd-geom@ and freebsd-fs@ Guess why it wasn't picked up by anyone? > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon D= ec 6 11:37:24 2010 (r216229) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon D= ec 6 12:18:02 2010 (r216230) > @@ -496,7 +496,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi > /* > * Determine the device's minimum transfer size. > */ > - *ashift =3D highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; > + if (pp->stripesize > pp->sectorsize) > + *ashift =3D highbit(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; > + else > + *ashift =3D highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; Even in this chunk there is a comment explaining perfectly what ashift stands for!! --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz9LyUACgkQForvXbEpPzQGzgCfQMaGcITMc8XXPnD+nVk1Pgei /MAAoKDqaJ/5bRNXzlP/wu62guEWpgcg =icls -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:05:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F242106564A; Mon, 6 Dec 2010 19:05:45 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5978FC14; Mon, 6 Dec 2010 19:05:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6J5jBl041920; Mon, 6 Dec 2010 19:05:45 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6J5jok041918; Mon, 6 Dec 2010 19:05:45 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012061905.oB6J5jok041918@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 6 Dec 2010 19:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216238 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:05:45 -0000 Author: bschmidt Date: Mon Dec 6 19:05:44 2010 New Revision: 216238 URL: http://svn.freebsd.org/changeset/base/216238 Log: Fix scanning after loosing a connection. The firmware assumes that as long as an association ID is set any scan is supposed to be a background scan. This implies that the firmware will switch back to the associated channel after a certain threshold, though, we are not notified about that. We currently catch this case by a timer which will reset the firmware after a 'scan timeout', though, upper layers are not notified about that and will simply hang until manual intervention. Fix this by resetting the firmware's knowledge about any association on RUN -> ASSOC and !INIT -> SCAN transitions. Tested by: Zhihao Yuan MFC after: 1 week Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Dec 6 18:28:39 2010 (r216237) +++ head/sys/dev/wpi/if_wpi.c Mon Dec 6 19:05:44 2010 (r216238) @@ -1248,8 +1248,25 @@ wpi_newstate(struct ieee80211vap *vap, e IEEE80211_UNLOCK(ic); WPI_LOCK(sc); - if (nstate == IEEE80211_S_AUTH) { - /* The node must be registered in the firmware before auth */ + if (nstate == IEEE80211_S_SCAN && vap->iv_state != IEEE80211_S_INIT) { + /* + * On !INIT -> SCAN transitions, we need to clear any possible + * knowledge about associations. + */ + error = wpi_config(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: device config failed, error %d\n", + __func__, error); + } + } + if (nstate == IEEE80211_S_AUTH || + (nstate == IEEE80211_S_ASSOC && vap->iv_state == IEEE80211_S_RUN)) { + /* + * The node must be registered in the firmware before auth. + * Also the associd must be cleared on RUN -> ASSOC + * transitions. + */ error = wpi_auth(sc, vap); if (error != 0) { device_printf(sc->sc_dev, From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:12:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2D00106566B; Mon, 6 Dec 2010 19:12:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3B68FC13; Mon, 6 Dec 2010 19:12:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6JCpAl042188; Mon, 6 Dec 2010 19:12:51 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6JCpvu042179; Mon, 6 Dec 2010 19:12:51 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012061912.oB6JCpvu042179@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 6 Dec 2010 19:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216239 - in head/games: bcd caesar factor morse number pom random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:12:51 -0000 Author: uqs Date: Mon Dec 6 19:12:51 2010 New Revision: 216239 URL: http://svn.freebsd.org/changeset/base/216239 Log: Drop advertising clause in manpages. It was done a long time ago for the source code. Discussed with: core Modified: head/games/bcd/bcd.6 head/games/caesar/caesar.6 head/games/caesar/rot13.sh head/games/factor/factor.6 head/games/morse/morse.6 head/games/number/number.6 head/games/pom/pom.6 head/games/random/random.6 Modified: head/games/bcd/bcd.6 ============================================================================== --- head/games/bcd/bcd.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/bcd/bcd.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/caesar/caesar.6 ============================================================================== --- head/games/caesar/caesar.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/caesar/caesar.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/caesar/rot13.sh ============================================================================== --- head/games/caesar/rot13.sh Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/caesar/rot13.sh Mon Dec 6 19:12:51 2010 (r216239) @@ -11,11 +11,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # @@ -32,6 +28,6 @@ # SUCH DAMAGE. # # @(#)rot13.sh 8.1 (Berkeley) 5/31/93 -# +# $FreeBSD$ exec /usr/games/caesar 13 "$@" Modified: head/games/factor/factor.6 ============================================================================== --- head/games/factor/factor.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/factor/factor.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -12,11 +12,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/morse/morse.6 ============================================================================== --- head/games/morse/morse.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/morse/morse.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/number/number.6 ============================================================================== --- head/games/number/number.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/number/number.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/pom/pom.6 ============================================================================== --- head/games/pom/pom.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/pom/pom.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/random/random.6 ============================================================================== --- head/games/random/random.6 Mon Dec 6 19:05:44 2010 (r216238) +++ head/games/random/random.6 Mon Dec 6 19:12:51 2010 (r216239) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgment: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:15:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490E51065673; Mon, 6 Dec 2010 19:15:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 378D18FC1B; Mon, 6 Dec 2010 19:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6JFdZP042301; Mon, 6 Dec 2010 19:15:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6JFdwD042299; Mon, 6 Dec 2010 19:15:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012061915.oB6JFdwD042299@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 6 Dec 2010 19:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216240 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:15:39 -0000 Author: trasz Date: Mon Dec 6 19:15:38 2010 New Revision: 216240 URL: http://svn.freebsd.org/changeset/base/216240 Log: Add a KASSERT to make it obvious when fork_norfproc() is to be called, and set *procp to NULL in all cases. Previously, it was not being set in the ERESTART case. This is effectively no-op, since its value is ignored by callers in the error case. Reviewed by: kib@ Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Dec 6 19:12:51 2010 (r216239) +++ head/sys/kern/kern_fork.c Mon Dec 6 19:15:38 2010 (r216240) @@ -199,7 +199,10 @@ fork_norfproc(struct thread *td, int fla int error; struct proc *p1; + KASSERT((flags & RFPROC) == 0, + ("fork_norfproc called with RFPROC set")); p1 = td->td_proc; + *procp = NULL; if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && (flags & (RFCFDG | RFFDG))) { @@ -238,7 +241,6 @@ fail: thread_single_end(); PROC_UNLOCK(p1); } - *procp = NULL; return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:22:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B004106566B; Mon, 6 Dec 2010 19:22:48 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id EF3918FC12; Mon, 6 Dec 2010 19:22:47 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 820E745C8A; Mon, 6 Dec 2010 20:22:46 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 071B045684; Mon, 6 Dec 2010 20:22:39 +0100 (CET) Date: Mon, 6 Dec 2010 20:22:38 +0100 From: Pawel Jakub Dawidek To: Ivan Voras Message-ID: <20101206192238.GB1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: <20101206184453.GA1936@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:22:48 -0000 --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 07:44:53PM +0100, Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 12:18:03PM +0000, Ivan Voras wrote: > > Author: ivoras > > Date: Mon Dec 6 12:18:02 2010 > > New Revision: 216230 > > URL: http://svn.freebsd.org/changeset/base/216230 > >=20 > > Log: > > Use GEOM stripesize field when calculating ashift. This will enable c= orrect > > alignment on drives with large sector sizes (e.g. 4 KiB) but the > > implementation might need to be revisited if devices with large strip= esizes > > appear (e.g. if RAID controllers or flash drives start using the fiel= d), > > probably by introducing a physsectorsize field in GEOM providers. >=20 > Please back this out as soon as possible! >=20 > > Discussed with: mav, mostly silence on freebsd-geom@ and freebsd-fs@ >=20 > Guess why it wasn't picked up by anyone? In other words... Stop hack around. This is so irritating. If disk lies about its sector size, add quirks at the layer where disk is discovered. Don't hack ZFS, UFS, any other file system and GEOM classes, because its easiest for you. It would be best if you could just leave it to mav@ who knows this area and knows what he is doing. Those drive-by hacks of yours are really doing more evil than good. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz9N/4ACgkQForvXbEpPzTfggCgq7eYEyaWA3WqRf30aTjbXAdz bmgAn02nrHToylxD4400nWV0JlJJ3D7c =MLBv -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:23:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6CB1106564A; Mon, 6 Dec 2010 19:23:26 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 16E808FC0A; Mon, 6 Dec 2010 19:23:25 +0000 (UTC) Received: by vws9 with SMTP id 9so5029517vws.13 for ; Mon, 06 Dec 2010 11:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=ivB32G87nmtPlYbjdm0uRIn0FslCZZvD3MKz7HP8f10=; b=ul0UjI7dbwlUDnCDo5a0ibqTxyGXaCQZfychB8wLTPYrdoFe9W0NeyWMF9PmVlzQoV 8fInXo5RAzPOeAImTlNcXdTXD99UGkQcWo4nyVVqdfO+GvTjNZ9XQ2w7LuP/C+yIEfJ+ P568DqfII86LSON1YNmFUzkuNNZUPtA1fNC2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=PD0LpKjgZAVqbjkxY7Uni2oNSHH6+yZjiaCYs8pO3EMXm2AqvI8E17Vxwy7GHVGPF3 kdzPZhk3/MVbfPCM/aStdyj6y7TOffFOAxyPa9HDUBryVsl6mqwXtJjol3QkqvUrNm5y vAjaxlhtusctH4UwOr5dh5z2kQQ5KjcU4aE5I= Received: by 10.229.228.146 with SMTP id je18mr4879453qcb.47.1291663404130; Mon, 06 Dec 2010 11:23:24 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 11:22:43 -0800 (PST) In-Reply-To: <20101206184453.GA1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> From: Ivan Voras Date: Mon, 6 Dec 2010 20:22:43 +0100 X-Google-Sender-Auth: LiO46Q5s-hfyeopxGNF_cYIEUVs Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:23:26 -0000 On 6 December 2010 19:44, Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 12:18:03PM +0000, Ivan Voras wrote: >> Author: ivoras >> Date: Mon Dec =C2=A06 12:18:02 2010 >> New Revision: 216230 >> URL: http://svn.freebsd.org/changeset/base/216230 >> >> Log: >> =C2=A0 Use GEOM stripesize field when calculating ashift. This will enab= le correct >> =C2=A0 alignment on drives with large sector sizes (e.g. 4 KiB) but the >> =C2=A0 implementation might need to be revisited if devices with large s= tripesizes >> =C2=A0 appear (e.g. if RAID controllers or flash drives start using the = field), >> =C2=A0 probably by introducing a physsectorsize field in GEOM providers. > > Please back this out as soon as possible! Given information such as this: http://www.solarismen.de/archives/5-Solaris-and-the-new-4K-Sector-Disks-e.g= .-WDxxEARS-Part-2.html http://article.gmane.org/gmane.os.solaris.opensolaris.zfs/43986 and my last message on the subject in the thread: http://permalink.gmane.org/gmane.os.freebsd.devel.geom/4376 Can you explain why is it wrong, and what can go wrong with changing ashift in this way? From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:36:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A5DC106566B; Mon, 6 Dec 2010 19:36:18 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 183628FC16; Mon, 6 Dec 2010 19:36:17 +0000 (UTC) Received: by vws9 with SMTP id 9so5041472vws.13 for ; Mon, 06 Dec 2010 11:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=Lq8M+Itiyj1tK91ut9Lx4RUNYajVqqsN0iKkdJ0mIgc=; b=VZ+vJRXnpT0VF27lZWDRs9iui5nBPKkFWjjQfSvz2zr36abjsR6GYwXsqQ6uKE5XN4 AI/Di62sfQqRDSdc6juNFxLPJ+ajtgpu5mSCaJO/56QA1hL8hw5ovK22ET8HqHJukMc7 DBAKXTNORa76nAgYdZSA02BBSbU9aYI8gaT88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=sIASx5q6CO8KHBIXJrHRRvP8JbNauoyAGk99vJpejDcZsuTI66obpqoq6SXgSXbYiR +AMz4/C1aI4Z9zBaesnQ6XBquf80bDdsG9y1sJYtblfSR4zPSgG6i9H5Lth67qU+7/0d +3jbQsBCYz3zbsNMXba2D2v1aLeyYMaPdzX/8= Received: by 10.229.189.72 with SMTP id dd8mr4811513qcb.123.1291664177170; Mon, 06 Dec 2010 11:36:17 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 11:35:36 -0800 (PST) In-Reply-To: <20101206192238.GB1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> From: Ivan Voras Date: Mon, 6 Dec 2010 20:35:36 +0100 X-Google-Sender-Auth: 71oQAA6UuD9viosD3cEO7VOjnCA Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:36:18 -0000 On 6 December 2010 20:22, Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 07:44:53PM +0100, Pawel Jakub Dawidek wrote: >> On Mon, Dec 06, 2010 at 12:18:03PM +0000, Ivan Voras wrote: >> > Author: ivoras >> > Date: Mon Dec =C2=A06 12:18:02 2010 >> > New Revision: 216230 >> > URL: http://svn.freebsd.org/changeset/base/216230 >> > >> > Log: >> > =C2=A0 Use GEOM stripesize field when calculating ashift. This will en= able correct >> > =C2=A0 alignment on drives with large sector sizes (e.g. 4 KiB) but th= e >> > =C2=A0 implementation might need to be revisited if devices with large= stripesizes >> > =C2=A0 appear (e.g. if RAID controllers or flash drives start using th= e field), >> > =C2=A0 probably by introducing a physsectorsize field in GEOM provider= s. >> >> Please back this out as soon as possible! >> >> > =C2=A0 Discussed with: mav, mostly silence on freebsd-geom@ and freebs= d-fs@ >> >> Guess why it wasn't picked up by anyone? > > In other words... Stop hack around. This is so irritating. > > If disk lies about its sector size, add quirks at the layer where disk > is discovered. Don't hack ZFS, UFS, any other file system and GEOM > classes, because its easiest for you. It would be best if you could just > leave it to mav@ who knows this area and knows what he is doing. Those > drive-by hacks of yours are really doing more evil than good. I regard your personal opinion on this topic in little regard, as you have too much of it. Please persuade me on technical grounds why ashift, a property intended for address alignment, should not be set in this way. If your answer is "I don't know but you are still wrong because I say so" I will respect it and back it out but only until I/we discuss the question with upstream ZFS developers. >From my POW, this is similar to changing UFS default fragment size to match stripesize, which is a patch I also intend to commit (after a review by mckusick, or course). From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 19:53:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FDE5106566C; Mon, 6 Dec 2010 19:53:39 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A4D448FC1C; Mon, 6 Dec 2010 19:53:35 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 68DBB45C98; Mon, 6 Dec 2010 20:53:34 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 7611645C9C; Mon, 6 Dec 2010 20:53:28 +0100 (CET) Date: Mon, 6 Dec 2010 20:53:27 +0100 From: Pawel Jakub Dawidek To: Ivan Voras Message-ID: <20101206195327.GD1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SO98HVl1bnMOfKZd" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:53:39 -0000 --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: > Please persuade me on technical grounds why ashift, a property > intended for address alignment, should not be set in this way. If your > answer is "I don't know but you are still wrong because I say so" I > will respect it and back it out but only until I/we discuss the > question with upstream ZFS developers. No. You persuade me why changing ashift in ZFS, which, as the comment clearly states is "device's minimum transfer size" is better and not hackish than presenting the disk with properly configured sector size. This can not only affect disks that still use 512 bytes sectors, but doesn't fix the problem at all. It just works around the problem in ZFS when configured on top of raw disks. What about other file systems? What about other GEOM classes? GELI is great example here, as people use ZFS on top of GELI alot. GELI integrity verification works in a way that not reporting disk sector size properly will have huge negative performance impact. ZFS' ashift won't change that. So you should back this change out, provide technical arguments (if they exist) that this is the right solution to the problem and not "hey, here is a patch, I think it is ok". BTW. ZFS is no longer open-source if you didn't notice. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --SO98HVl1bnMOfKZd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz9PzcACgkQForvXbEpPzSEVwCfSk4NS+AaEQUew40Kmgst5AFU kCYAn2sSXQOCv87u/fEyqonUfNm4/0Uv =4zHn -----END PGP SIGNATURE----- --SO98HVl1bnMOfKZd-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:19:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D9DA1065672; Mon, 6 Dec 2010 20:19:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EFBE78FC13; Mon, 6 Dec 2010 20:19:10 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 91D6346B65; Mon, 6 Dec 2010 15:19:10 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A66898A009; Mon, 6 Dec 2010 15:19:09 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 6 Dec 2010 15:18:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> In-Reply-To: <20101206195327.GD1936@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201012061518.49835.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 06 Dec 2010 15:19:09 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:19:11 -0000 On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: > > Please persuade me on technical grounds why ashift, a property > > intended for address alignment, should not be set in this way. If your > > answer is "I don't know but you are still wrong because I say so" I > > will respect it and back it out but only until I/we discuss the > > question with upstream ZFS developers. > > No. You persuade me why changing ashift in ZFS, which, as the comment > clearly states is "device's minimum transfer size" is better and not > hackish than presenting the disk with properly configured sector size. > This can not only affect disks that still use 512 bytes sectors, but > doesn't fix the problem at all. It just works around the problem in ZFS > when configured on top of raw disks. > > What about other file systems? What about other GEOM classes? GELI is > great example here, as people use ZFS on top of GELI alot. GELI > integrity verification works in a way that not reporting disk sector > size properly will have huge negative performance impact. ZFS' ashift > won't change that. I am mostly on your side here, but I wonder if GELI shouldn't prefer the stripesize anyway? For example, if you ran GELI on top of RAID-5 I imagine it would be far more performant for it to use stripe-size logical blocks instead of individual sectors for the underlying media. The RAID-5 argument also suggests that other filesystems should probably prefer stripe sizes to physical sector sizes when picking block sizes, etc. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:29:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64E21065673; Mon, 6 Dec 2010 20:29:23 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 39E6F8FC1A; Mon, 6 Dec 2010 20:29:22 +0000 (UTC) Received: by qyk8 with SMTP id 8so3693543qyk.13 for ; Mon, 06 Dec 2010 12:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=xbr8q+ENHC6yNo2lsB5L/cS8T9QqWfkgbvoYbzCS0xg=; b=s+ZtcLzD48gHkRYknEyDI8Ai2hSIwmUZYpWAe9CsbqDx4uoKJhnqXaEMdCEFiSlF2e M5ONRdWoA/lihJXY77TRjT1e9nvqeQ6pNoqxgk6+qvruBnBWsi+a2DdeXdM1LiZV47Zc TNn4rKLDxe4quMSjKw/FUvuD+1iLQSahUcLsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=MlhB14xuq48xoOmSlAw8W8f7nXuDxAssXOurWGxa6DYb0i0PQbr1LW98Rtzw258l8J 7oPyFl/1937CFy1ToT2joReTCP65LROd6umGYZ5pA71t9QUFoXpX3qzjpTgeGSec2JYf cM6ue7D9WMrbkigNQdOaqAi2XegGF0SntUVA8= Received: by 10.229.82.70 with SMTP id a6mr4946901qcl.9.1291667362442; Mon, 06 Dec 2010 12:29:22 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 12:28:42 -0800 (PST) In-Reply-To: <20101206195327.GD1936@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> <20101206195327.GD1936@garage.freebsd.pl> From: Ivan Voras Date: Mon, 6 Dec 2010 21:28:42 +0100 X-Google-Sender-Auth: bV3NGUlTNPbUqIRoq7dxS7q6UjE Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:29:23 -0000 Firstly, thank you, your explanations and questions are very good and address the problems in a good way to discuss about it. I respect that you took the time to write this answer! On 6 December 2010 20:53, Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: >> Please persuade me on technical grounds why ashift, a property >> intended for address alignment, should not be set in this way. If your >> answer is "I don't know but you are still wrong because I say so" I >> will respect it and back it out but only until I/we discuss the >> question with upstream ZFS developers. > > No. You persuade me why changing ashift in ZFS, which, as the comment > clearly states is "device's minimum transfer size" is better and not > hackish than presenting the disk with properly configured sector size. You are right, it was, at least originally, defined as the device's minimum transfer size, and it is in this context hackish to change it to something that isn't it. But there are two reasons that I think are important, which resulted in changing this: 1) It is being used out of the original context in the mailing list posts I've referenced - it was being used (and in a worse way, by having a hacked zpool binary) for alignment like I did in the patch, despite that the sectorsize wasn't changed. 2) The solaris "big sector" project, described in http://arc.opensolaris.org/caselog/PSARC/2008/769/final_spec.txt basically blesses ZFS to work with big sectors, and states "ZFS can automatically run on larger sector size disk after the label change and I/O path change." Since the effect of having a larger sectorsize will effectively be only the change in ashift, this is what I've done. I would of course also be happy with simply having drives with sectorsize=4096, but I've given up on this route because of two reasons: mav was essentially against it since it will break compatibility if suddenly changed and the posts on opensolaris mailing lists are basically saying that it is likely that the 512/4096 kludge will remain "forever" and it's unlikely to change. > This can not only affect disks that still use 512 bytes sectors, but > doesn't fix the problem at all. It just works around the problem in ZFS > when configured on top of raw disks. I'm not sure how to parse "can not only affect disks that still use 512 byte sectors" - if you are saying that it can affect disks with 512 byte sectors, I can think of only one case when it can have a serious effect: if the drive (or GEOM) suddenly use 4 KiB sectorsize on a drive which was previously formatted with ZFS as a drive with 512 byte sectors. All other combinations work because ashift is a part of ZFS metadata - this calculation is overriden in case e.g. a zvol created with ashift=12 is imported on a kernel/OS which only sees 512 byte sectors. > What about other file systems? What about other GEOM classes? GELI is > great example here, as people use ZFS on top of GELI alot. GELI > integrity verification works in a way that not reporting disk sector > size properly will have huge negative performance impact. ZFS' ashift > won't change that. Does this mean that, despite that ZFS is correctly aligned, GELI can break this alignment policy so still, at the end, produce wrong alignments for IOs? If so, I understand your concern, but it looks like a problem with GELI, not ZFS. The same problem will occur if any other file system type is created which is "properly aligned" from the POW of the administrator. > So you should back this change out, provide technical arguments (if they > exist) that this is the right solution to the problem and not "hey, here > is a patch, I think it is ok". Thank you, I will try to remember to give more details in commits. > BTW. ZFS is no longer open-source if you didn't notice. I have noticed but I don't understand how it affects FreeBSD. I would like to discuss this sometime but unless you have some urgent interpretation of this information, I think it's best to start another thread about it. I think that, basically, the whole argument boils down to the question like "while ZFS will most likely implement big sector support in this way, it doesn't right now, so should we do it ourselves?" I hope that this information I've written helps explain why I did the patch. If you are still against it, I will back it out. From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:32:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28EF5106564A; Mon, 6 Dec 2010 20:32:24 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 415E98FC16; Mon, 6 Dec 2010 20:32:22 +0000 (UTC) Received: by vws9 with SMTP id 9so5089924vws.13 for ; Mon, 06 Dec 2010 12:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=86PCksk45pXsZIGNQv3jGSy0FeOLVE7JouQIc+Qk2MA=; b=JgApZiOOjT6wlOcXXT9GsChAmQPK4tklMSRcPQyIbYOMZHkyaTF/MMQzMBjAbToSww A6xdcan4gnvcLjPO6r5OXCeVZEq9R8G8eofM8ESJTfzR5JEfN1LyYlKDB2N07OEwo58v zqCG+lPtkQnSp/j1C6xAigB7qVetHoXI1Zci8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=LGwIRPaJM1Aprn9hmHQWR7a7hV4CvoyWGvsZbfWKLNDlIXmG5VRCK3dMo8gwNGlHo1 fuioFdYY6YOhOM7vBpPfHWtnCSLtmIdWTJz+rXo8lmMjKiprS2F8sqF+HAGxIpSY0itZ Qv2dQEkFdvJi4GFMP2tdybtVeJMKtFVdtTrDg= Received: by 10.229.82.70 with SMTP id a6mr4949580qcl.9.1291667540173; Mon, 06 Dec 2010 12:32:20 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 12:31:39 -0800 (PST) In-Reply-To: <201012061518.49835.jhb@freebsd.org> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> From: Ivan Voras Date: Mon, 6 Dec 2010 21:31:39 +0100 X-Google-Sender-Auth: OEQE7951TXo9WJy_Z_hJmPzKt6c Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:32:24 -0000 On 6 December 2010 21:18, John Baldwin wrote: > On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: >> On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: >> > Please persuade me on technical grounds why ashift, a property >> > intended for address alignment, should not be set in this way. If your >> > answer is "I don't know but you are still wrong because I say so" I >> > will respect it and back it out but only until I/we discuss the >> > question with upstream ZFS developers. >> >> No. You persuade me why changing ashift in ZFS, which, as the comment >> clearly states is "device's minimum transfer size" is better and not >> hackish than presenting the disk with properly configured sector size. >> This can not only affect disks that still use 512 bytes sectors, but >> doesn't fix the problem at all. It just works around the problem in ZFS >> when configured on top of raw disks. >> >> What about other file systems? What about other GEOM classes? GELI is >> great example here, as people use ZFS on top of GELI alot. GELI >> integrity verification works in a way that not reporting disk sector >> size properly will have huge negative performance impact. ZFS' ashift >> won't change that. > > I am mostly on your side here, but I wonder if GELI shouldn't prefer the > stripesize anyway? =C2=A0For example, if you ran GELI on top of RAID-5 I = imagine it > would be far more performant for it to use stripe-size logical blocks ins= tead > of individual sectors for the underlying media. > > The RAID-5 argument also suggests that other filesystems should probably > prefer stripe sizes to physical sector sizes when picking block sizes, et= c. For what it's worth, apparently linux has the concept of "physical" and "logical" sector sizes (possibly in addition to "stripe size"), with physical being 4096 and logical 512, for example: # hdparm -I /dev/sde | grep size Logical Sector size: 512 bytes Physical Sector size: 4096 bytes device size with M =3D 1024*1024: 1430799 MBytes device size with M =3D 1000*1000: 1500301 MBytes (1500 GB) From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:40:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311D0106566C; Mon, 6 Dec 2010 20:40:16 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4A98FC1F; Mon, 6 Dec 2010 20:40:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6KeGDu044129; Mon, 6 Dec 2010 20:40:16 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6KeG3V044127; Mon, 6 Dec 2010 20:40:16 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012062040.oB6KeG3V044127@svn.freebsd.org> From: Colin Percival Date: Mon, 6 Dec 2010 20:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216241 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:40:16 -0000 Author: cperciva Date: Mon Dec 6 20:40:15 2010 New Revision: 216241 URL: http://svn.freebsd.org/changeset/base/216241 Log: Set correct maximum I/O length. We can only handle I/O of up to max_request_segments * PAGE_SIZE if the I/O is page-aligned; the largest I/O we can guarantee will work is PAGE_SIZE less than that. This unbreaks 'diskinfo -t'. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Dec 6 19:15:38 2010 (r216240) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Dec 6 20:40:15 2010 (r216241) @@ -508,7 +508,7 @@ blkfront_initialize(struct xb_softc *sc) sc->ring_pages = 1; sc->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE); sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->max_request_size = sc->max_request_segments * PAGE_SIZE; + sc->max_request_size = (sc->max_request_segments - 1) * PAGE_SIZE; sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:54:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574FF106564A; Mon, 6 Dec 2010 20:54:54 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451618FC0A; Mon, 6 Dec 2010 20:54:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6Kssrc044567; Mon, 6 Dec 2010 20:54:54 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6Kss52044561; Mon, 6 Dec 2010 20:54:54 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012062054.oB6Kss52044561@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 6 Dec 2010 20:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216242 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:54:54 -0000 Author: bschmidt Date: Mon Dec 6 20:54:53 2010 New Revision: 216242 URL: http://svn.freebsd.org/changeset/base/216242 Log: Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in newer Ralink drivers. Submitted by: Paul B Mahol Modified: head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/ndis_var.h head/sys/compat/ndis/ntoskrnl_var.h head/sys/compat/ndis/subr_ndis.c head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Mon Dec 6 20:40:15 2010 (r216241) +++ head/sys/compat/ndis/kern_ndis.c Mon Dec 6 20:54:53 2010 (r216242) @@ -433,6 +433,19 @@ ndis_flush_sysctls(arg) return (0); } +void * +ndis_get_routine_address(functbl, name) + struct image_patch_table *functbl; + char *name; +{ + int i; + + for (i = 0; functbl[i].ipt_name != NULL; i++) + if (strcmp(name, functbl[i].ipt_name) == 0) + return (functbl[i].ipt_wrap); + return (NULL); +} + static void ndis_return(dobj, arg) device_object *dobj; Modified: head/sys/compat/ndis/ndis_var.h ============================================================================== --- head/sys/compat/ndis/ndis_var.h Mon Dec 6 20:40:15 2010 (r216241) +++ head/sys/compat/ndis/ndis_var.h Mon Dec 6 20:54:53 2010 (r216242) @@ -1729,6 +1729,7 @@ extern int ndis_mtop(struct mbuf *, ndis extern int ndis_ptom(struct mbuf **, ndis_packet *); extern int ndis_get_info(void *, ndis_oid, void *, int *); extern int ndis_set_info(void *, ndis_oid, void *, int *); +extern void *ndis_get_routine_address(struct image_patch_table *, char *); extern int ndis_get_supported_oids(void *, ndis_oid **, int *); extern int ndis_send_packets(void *, ndis_packet **, int); extern int ndis_send_packet(void *, ndis_packet *); Modified: head/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- head/sys/compat/ndis/ntoskrnl_var.h Mon Dec 6 20:40:15 2010 (r216241) +++ head/sys/compat/ndis/ntoskrnl_var.h Mon Dec 6 20:54:53 2010 (r216242) @@ -1466,6 +1466,7 @@ extern uint32_t IoConnectInterrupt(kinte kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t); extern uint8_t MmIsAddressValid(void *); +extern void *MmGetSystemRoutineAddress(unicode_string *); extern void *MmMapIoSpace(uint64_t, uint32_t, uint32_t); extern void MmUnmapIoSpace(void *, size_t); extern void MmBuildMdlForNonPagedPool(mdl *); Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Mon Dec 6 20:40:15 2010 (r216241) +++ head/sys/compat/ndis/subr_ndis.c Mon Dec 6 20:54:53 2010 (r216242) @@ -197,6 +197,7 @@ static ndis_status NdisMMapIoSpace(void ndis_physaddr, uint32_t); static void NdisMUnmapIoSpace(ndis_handle, void *, uint32_t); static uint32_t NdisGetCacheFillSize(void); +static void *NdisGetRoutineAddress(unicode_string *); static uint32_t NdisMGetDmaAlignment(ndis_handle); static ndis_status NdisMInitializeScatterGatherDma(ndis_handle, uint8_t, uint32_t); @@ -1642,6 +1643,17 @@ NdisGetCacheFillSize(void) return (128); } +static void * +NdisGetRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ndis_functbl, astr.as_buf)); +} + static uint32_t NdisMGetDmaAlignment(handle) ndis_handle handle; @@ -3246,6 +3258,7 @@ image_patch_table ndis_functbl[] = { IMPORT_SFUNC(NdisInitializeString, 2), IMPORT_SFUNC(NdisFreeString, 1), IMPORT_SFUNC(NdisGetCurrentSystemTime, 1), + IMPORT_SFUNC(NdisGetRoutineAddress, 1), IMPORT_SFUNC(NdisGetSystemUpTime, 1), IMPORT_SFUNC(NdisGetVersion, 0), IMPORT_SFUNC(NdisMSynchronizeWithInterrupt, 3), Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Mon Dec 6 20:40:15 2010 (r216241) +++ head/sys/compat/ndis/subr_ntoskrnl.c Mon Dec 6 20:54:53 2010 (r216242) @@ -2589,6 +2589,17 @@ MmGetPhysicalAddress(void *base) return (pmap_extract(kernel_map->pmap, (vm_offset_t)base)); } +void * +MmGetSystemRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ntoskrnl_functbl, astr.as_buf)); +} + uint8_t MmIsAddressValid(vaddr) void *vaddr; @@ -4382,6 +4393,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapLockedPages, 2), IMPORT_SFUNC(MmBuildMdlForNonPagedPool, 1), IMPORT_SFUNC(MmGetPhysicalAddress, 1), + IMPORT_SFUNC(MmGetSystemRoutineAddress, 1), IMPORT_SFUNC(MmIsAddressValid, 1), IMPORT_SFUNC(MmMapIoSpace, 3 + 1), IMPORT_SFUNC(MmUnmapIoSpace, 2), From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 20:55:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5691065670; Mon, 6 Dec 2010 20:55:14 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D7D8FC28; Mon, 6 Dec 2010 20:55:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6KtEtP044628; Mon, 6 Dec 2010 20:55:14 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6KtEc3044625; Mon, 6 Dec 2010 20:55:14 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012062055.oB6KtEc3044625@svn.freebsd.org> From: Bruce Cran Date: Mon, 6 Dec 2010 20:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216243 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 20:55:14 -0000 Author: brucec Date: Mon Dec 6 20:55:14 2010 New Revision: 216243 URL: http://svn.freebsd.org/changeset/base/216243 Log: Ignore any failures with the "local" distribution since it's not present on release CDs and so will normally fail. installCommit() returns a DITEM_ value, not a Boolean. distExtractAll() returns a Boolean, not a DITEM_ value. Reported by: kensmith MFC after: 3 days Modified: head/usr.sbin/sysinstall/dist.c head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/dist.c ============================================================================== --- head/usr.sbin/sysinstall/dist.c Mon Dec 6 20:54:53 2010 (r216242) +++ head/usr.sbin/sysinstall/dist.c Mon Dec 6 20:55:14 2010 (r216243) @@ -757,6 +757,9 @@ distExtract(char *parent, Distribution * canceled = 1; status = FALSE; + } else { + // ignore any failures with DIST_LOCAL + status = TRUE; } } break; @@ -913,7 +916,7 @@ distExtractAll(dialogMenuItem *self) restorescr(w); if (extract_status == FALSE) - status = DITEM_FAILURE; + status = FALSE; return status; } Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Mon Dec 6 20:54:53 2010 (r216242) +++ head/usr.sbin/sysinstall/install.c Mon Dec 6 20:55:14 2010 (r216243) @@ -855,7 +855,7 @@ try_media: i = distExtractAll(self); if (i == FALSE) - return FALSE; + return DITEM_FAILURE; /* When running as init, *now* it's safe to grab the rc.foo vars */ installEnvironment(); From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 21:10:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 207FA1065675; Mon, 6 Dec 2010 21:10:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id CD8338FC0A; Mon, 6 Dec 2010 21:10:42 +0000 (UTC) Received: by fxm16 with SMTP id 16so9837641fxm.13 for ; Mon, 06 Dec 2010 13:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=nTJ0Li8vN3KuCpb8yWFI33G3N5xdVD8lMIjuzXES3YI=; b=WZCEVHZpQNswQlTrc7veCBDNM8JKhzyTzlkkAke2uJQXrid3wJput0K0GoO6mHKHA4 YFtXCmTR5rrXagXK1sv6sMjU9XBr/58515I/ASeT/vyRnacY6qpetqtQPNwfSLr3xToc OBFSVy/BzbBoPdrXSecf5Hab+7KwHxgmAmNuo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=BJ6+moGrhH6dDJuCqGtULwjF9RuAiuSTFh725s/BcucCoF7SLzhrkpOUiUpP878+h6 XVWzFdChcDth5FxLUUUGmrdM+hjLz5L9zk+Q0yYaqqoIEiztCpPJZRsucLYGEgzYUQv0 23JpvciJykVvsJAkGAY4vR91CtGgBx670EJto= Received: by 10.223.74.193 with SMTP id v1mr6153795faj.105.1291669841645; Mon, 06 Dec 2010 13:10:41 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id a2sm1706654faw.22.2010.12.06.13.10.39 (version=SSLv3 cipher=RC4-MD5); Mon, 06 Dec 2010 13:10:40 -0800 (PST) Sender: Alexander Motin Message-ID: <4CFD514E.8010103@FreeBSD.org> Date: Mon, 06 Dec 2010 23:10:38 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> In-Reply-To: <201012061518.49835.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Ivan Voras Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 21:10:44 -0000 On 06.12.2010 22:18, John Baldwin wrote: > On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: >> On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: >>> Please persuade me on technical grounds why ashift, a property >>> intended for address alignment, should not be set in this way. If your >>> answer is "I don't know but you are still wrong because I say so" I >>> will respect it and back it out but only until I/we discuss the >>> question with upstream ZFS developers. >> >> No. You persuade me why changing ashift in ZFS, which, as the comment >> clearly states is "device's minimum transfer size" is better and not >> hackish than presenting the disk with properly configured sector size. >> This can not only affect disks that still use 512 bytes sectors, but >> doesn't fix the problem at all. It just works around the problem in ZFS >> when configured on top of raw disks. Both ATA and SCSI standards implemented support for different logical and physical sector sizes. It is not a hack - it seems to be the way manufacturers decided to go. At least on their words. IMHO hack in this situation would be to report to GEOM some fake sector size, different from one reported by device. In any way it is the main visible disk characteristic, independently of what it's firmware does inside. >> What about other file systems? What about other GEOM classes? GELI is >> great example here, as people use ZFS on top of GELI alot. GELI >> integrity verification works in a way that not reporting disk sector >> size properly will have huge negative performance impact. ZFS' ashift >> won't change that. > > I am mostly on your side here, but I wonder if GELI shouldn't prefer the > stripesize anyway? For example, if you ran GELI on top of RAID-5 I imagine it > would be far more performant for it to use stripe-size logical blocks instead > of individual sectors for the underlying media. > > The RAID-5 argument also suggests that other filesystems should probably > prefer stripe sizes to physical sector sizes when picking block sizes, etc. Looking further I can see use even for several "stripesize" values on that way, unrelated to logical sector size. Let's take an example: 5 disks with 4K physical sectors in RAID5 with 64K strip. We'll have three sizes to align at: 4K, 64K and 256K. Aligning to 4K allow to avoid read-modify-write on disk level; to 64K - avoid request splitting and so increase (up to double) parallel random read performance; to 256K - significantly increase write speed by avoiding read-modify-write on RAID5. How can it be used? We can easily align partition to the biggest of them - 256K, to give maximum chances to any file system to align properly. UFS allocates space and writes data in granularity of blocks - depending on specific situation we may wish to increase block size to 64K, but it's quite a big value, so depends. We can safely increase fragment size to 4K. Also we could make UFS read-ahead and write-back code to align I/Os in run-time to the reported blocks. Depending on situation both 64K and 256K could be reasonable candidates for it. Sure solution is somewhat engineering (not absolute) in each case, but IMHO reasonable. Specific usage for these values (512, 4K, 64K and 256K) depends on abilities of specific partitioning scheme and file system. Neither disk driver nor GEOM may know what will be more usable at each next level. 512 bytes is the only one critically important value in this situation; everything else is only optimization. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 21:16:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A6D1065696; Mon, 6 Dec 2010 21:16:09 +0000 (UTC) (envelope-from brucec@muon.cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id B687F8FC1C; Mon, 6 Dec 2010 21:16:08 +0000 (UTC) Received: by muon.cran.org.uk (Postfix, from userid 1001) id 1A867E7170; Mon, 6 Dec 2010 21:16:08 +0000 (GMT) Date: Mon, 6 Dec 2010 21:16:08 +0000 From: Bruce Cran To: Ivan Voras Message-ID: <20101206211607.GA65110@muon.cran.org.uk> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 21:16:09 -0000 On Mon, Dec 06, 2010 at 09:31:39PM +0100, Ivan Voras wrote: > For what it's worth, apparently linux has the concept of "physical" > and "logical" sector sizes (possibly in addition to "stripe size"), > with physical being 4096 and logical 512, for example: > > # hdparm -I /dev/sde | grep size > Logical Sector size: 512 bytes > Physical Sector size: 4096 bytes > device size with M = 1024*1024: 1430799 MBytes > device size with M = 1000*1000: 1500301 MBytes (1500 GB) So do we, except they're both the same for Advanced Format drives: # camcontrol identify /dev/ada1 ... device model WDC WD10EARS-00Z5B1 ... sector size logical 512, physical 512, offset 0 I don't know if Linux has a quirks list that 'corrects' the physical sector size? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 21:23:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CD2A106564A; Mon, 6 Dec 2010 21:23:17 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f50.google.com (mail-qw0-f50.google.com [209.85.216.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5DFEB8FC18; Mon, 6 Dec 2010 21:23:15 +0000 (UTC) Received: by qwd6 with SMTP id 6so1799570qwd.37 for ; Mon, 06 Dec 2010 13:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=n9Mm3vFyIDneV3G5HHGHDuofN8GKJfFvA8a3lQLILnQ=; b=U3FxDzpP+Rat8RDFC8TAI4n0IncQVF+n3xFeSTstfsJInJKUuMiqeqMQw//HcOmZo5 XRtACN85CFXQWMgSeMqsB8odkQYijzI+Y+cSdZb8brJd5DKr667YT6sQVyKKpXiu8jOq P4oxRW1hQ5lGJzNedRW5IbPm9M2ObiFdDMPKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=YRNMf4eOYgVxvEi6ll+ZC46I53hqgtax+0FCYNhgqHGkNIfKx/DOXEiSPp3ytboB7f 62UWE2/P8k4bV0ZRhZ7gy0eswCW89KfNSev7ENB48X2m9bxmpU0izyPV2tNQQH1WRXJg M2L8dzdreh1Qg9kDrdlL9G7e9bFeEzjZeS0Ro= Received: by 10.229.212.5 with SMTP id gq5mr4782566qcb.275.1291670595472; Mon, 06 Dec 2010 13:23:15 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 13:22:35 -0800 (PST) In-Reply-To: <20101206211607.GA65110@muon.cran.org.uk> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <20101206211607.GA65110@muon.cran.org.uk> From: Ivan Voras Date: Mon, 6 Dec 2010 22:22:35 +0100 X-Google-Sender-Auth: Y9FPzTYYPnbIaKl3gBHFHx1N-U0 Message-ID: To: Bruce Cran Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 21:23:17 -0000 On 6 December 2010 22:16, Bruce Cran wrote: > On Mon, Dec 06, 2010 at 09:31:39PM +0100, Ivan Voras wrote: >> For what it's worth, apparently linux has the concept of "physical" >> and "logical" sector sizes (possibly in addition to "stripe size"), >> with physical being 4096 and logical 512, for example: >> >> # hdparm -I /dev/sde | grep size >> Logical =C2=A0Sector size: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 512 bytes >> Physical Sector size: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A04096 bytes >> device size with M =3D 1024*1024: =C2=A0 =C2=A0 1430799 MBytes >> device size with M =3D 1000*1000: =C2=A0 =C2=A0 1500301 MBytes (1500 GB) > > So do we, except they're both the same for Advanced Format drives: There is a subtle difference here which may be important. We have the concepts of "sectorsize" and "stripesize". I think camcontrol actually reports logical and physical sector sizes as reported by low-level drivers but currently GEOM names "logical sector size" as "sectorsize" and "physical sector size" as "stripesize". The term "stripesize" can be overloaded to mean both the item in question - 4 KiB physical sector sizes and RAID stripe sizes. I think this situation is bad and that the two meanings should be split. > # camcontrol identify /dev/ada1 > ... > device model =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0WDC WD10EARS-00Z5B1 > ... > sector size =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logical 512, physic= al 512, offset 0 Agreed. Some drives lie. From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 21:49:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB087106566C; Mon, 6 Dec 2010 21:49:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id AE9F38FC08; Mon, 6 Dec 2010 21:49:12 +0000 (UTC) Received: by fxm16 with SMTP id 16so9875155fxm.13 for ; Mon, 06 Dec 2010 13:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=bOXoQ0OggPKkxvr0842398cFDUFJqyN0M2bzzZPZQYg=; b=edelWFNaf6o4ojwzxd5MvcVoSZpKpV8zqUHIfbfqPFA7ulrx5/tKpdhHfJIKT9DgXh 0lOCOfmbbwqLihzNfwedpBL8S91zFTEg1kajFt1A0iIs8dlBXPKPiFLv9EhGH6xSGExP bFkEoyVS8fmKQywL8EW/UTIum/M3exfIdZrP8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Xq5DtBgOpc45igwHBV0qjSs/q87tTpNBQXFFIuoyTVBET45O/aGuUKxxS38bX6PWmV PP3xtP4WDVDyVaORMyMaKEJPYXY7S+6f+R9vrb3mKY0bEGkr813ZIGKQR7BSI7LZxyYD LCOfNgXJG/iUZhMWk/7Ce8mzhCXGWYudOdupw= Received: by 10.223.72.202 with SMTP id n10mr6139678faj.74.1291672151628; Mon, 06 Dec 2010 13:49:11 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id o17sm1716697fal.1.2010.12.06.13.49.09 (version=SSLv3 cipher=RC4-MD5); Mon, 06 Dec 2010 13:49:10 -0800 (PST) Sender: Alexander Motin Message-ID: <4CFD5A55.5030702@FreeBSD.org> Date: Mon, 06 Dec 2010 23:49:09 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: Ivan Voras References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <20101206211607.GA65110@muon.cran.org.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 21:49:13 -0000 On 06.12.2010 23:22, Ivan Voras wrote: > On 6 December 2010 22:16, Bruce Cran wrote: >> On Mon, Dec 06, 2010 at 09:31:39PM +0100, Ivan Voras wrote: >>> For what it's worth, apparently linux has the concept of "physical" >>> and "logical" sector sizes (possibly in addition to "stripe size"), >>> with physical being 4096 and logical 512, for example: >>> >>> # hdparm -I /dev/sde | grep size >>> Logical Sector size: 512 bytes >>> Physical Sector size: 4096 bytes >>> device size with M = 1024*1024: 1430799 MBytes >>> device size with M = 1000*1000: 1500301 MBytes (1500 GB) >> >> So do we, except they're both the same for Advanced Format drives: > > There is a subtle difference here which may be important. We have the > concepts of "sectorsize" and "stripesize". It is only question of abstraction. As soon as any our disk device is GEOM abstraction - don't see reason why parameters should be specific. > I think camcontrol actually reports logical and physical sector sizes > as reported by low-level drivers but currently GEOM names "logical > sector size" as "sectorsize" and "physical sector size" as > "stripesize". `camcontrol identify` directly requests IDENTIFY data and parses them. There is nobody between it and the device. To see what GEOM receives from the disk driver use diskinfo. > The term "stripesize" can be overloaded to mean both the item in > question - 4 KiB physical sector sizes and RAID stripe sizes. I think > this situation is bad and that the two meanings should be split. There could be a long list of different "stripesize" sources. It is not a task of the partitioning tool or file system to know all of them. As I have described in previous email - only size matters. >> # camcontrol identify /dev/ada1 >> ... >> device model WDC WD10EARS-00Z5B1 >> ... >> sector size logical 512, physical 512, offset 0 > > Agreed. Some drives lie. "Everybody lies". :) If Linux example was taken from page I've seen - it was external WD USB storage somehow reporting that physical sector size, not the disk itself. I haven't seen proper reporting in any WD drive yet (started to think about adding quirk at ada driver). Now waiting for Seagate 4K disks reports to check how bad things are. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 22:07:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638F21065679; Mon, 6 Dec 2010 22:07:38 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id CD6AE8FC32; Mon, 6 Dec 2010 22:07:35 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oB6M7XeE075943; Mon, 6 Dec 2010 23:07:34 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oB6M7XEV075942; Mon, 6 Dec 2010 23:07:33 +0100 (CET) (envelope-from marius) Date: Mon, 6 Dec 2010 23:07:33 +0100 From: Marius Strobl To: Alan Cox Message-ID: <20101206220733.GG38282@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> <4CF7D711.9040505@rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CF7D711.9040505@rice.edu> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 22:07:38 -0000 On Thu, Dec 02, 2010 at 11:27:45AM -0600, Alan Cox wrote: > Marius Strobl wrote: > >On Wed, Dec 01, 2010 at 12:19:17PM -0600, Alan Cox wrote: > > > >>Marius Strobl wrote: > >> > >>>On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote: > >>> > >>> > >>>>On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: > >>>> > >>>> > >>>>>Marius, > >>>>> > >>>>>On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl > >>>>>wrote: > >>>>> > >>>>>On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > >>>>> > >>>>> > >>>>>>>Author: fjoe > >>>>>>>Date: Sun Nov 28 19:26:20 2010 > >>>>>>>New Revision: 216016 > >>>>>>>URL: http://svn.freebsd.org/changeset/base/216016 > >>>>>>> > >>>>>>>Log: > >>>>>>> Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > >>>>>>> DEBUG_MEMGUARD panics early in kmeminit() with the message > >>>>>>> "kmem_suballoc: bad status return of 1" because of zero "size" > >>>>>>> argument > >>>>>>> passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > >>>>>>> > >>>>>>> The problem also exists on ia64. > >>>>>>> > >>>>>>>Modified: > >>>>>>> head/sys/sparc64/include/vmparam.h > >>>>>>> > >>>>>>>Modified: head/sys/sparc64/include/vmparam.h > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>============================================================================== > >>>>>> > >>>>>> > >>>>>>>--- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 > >>>>>>>2010 > >>>>>>> > >>>>>>> > >>>>>> (r216015) > >>>>>> > >>>>>> > >>>>>>>+++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 > >>>>>>>2010 > >>>>>>> > >>>>>>> > >>>>>> (r216016) > >>>>>> > >>>>>> > >>>>>>>@@ -237,6 +237,14 @@ > >>>>>>>#endif > >>>>>>> > >>>>>>>/* > >>>>>>>+ * Ceiling on amount of kmem_map kva space. > >>>>>>>+ */ > >>>>>>>+#ifndef VM_KMEM_SIZE_MAX > >>>>>>>+#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > >>>>>>>+ VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > >>>>>>>+#endif > >>>>>>>+ > >>>>>>>+/* > >>>>>>> * Initial pagein size of beginning of executable file. > >>>>>>> */ > >>>>>>>#ifndef VM_INITIAL_PAGEIN > >>>>>>> > >>>>>>> > >>>>>>How was that value determined? > >>>>>> > >>>>>> > >>>>>> > >>>>>I've just copied it from amd64 to be non-zero for now. Do you have a > >>>>>better > >>>>>idea of what it should look like? > >>>>> > >>>>> > >>>>> > >>>>Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted > >>>>to the maximum appropriate for the specific CPU during the early cycles > >>>>of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - > >>>>VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what > >>>>the intention of the ceiling provided by that macro actually is though > >>>>In any case, the commit message of r180210 which changed the amd64 > >>>>version to the current one talks about limiting the kmem map to 3.6GB > >>>>and while it also fails to explain where that value comes from it > >>>>looks rather amd64 specific and the formula used by the macro will > >>>>result in a different ceiling on sparc64 and thus inappropriate. I've > >>>>CC'ed alc@ who hopefully can shed some light on this. > >>>>Apart from this the actual bug here seems to be that memguard_fudge() > >>>>can't deal with a km_max being zero or that zero is passed to it as > >>>>kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. > >>>> > >>>> > >>>> > >>>Oops, forgot to actually CC alc@. > >>> > >>> > >>There's nothing particularly amd64-specific about the definition. In > >>general, if you allow the kmem_map, which is basically the kernel's > >>heap, to consume the entire kernel address space as you propose, then > >>you're leaving no room for the buffer cache, thread stacks, pipes, and a > >>few other things. Since the cap on the kmem_map size as defined by > >>r180210 is a fraction of the overall kernel address space size, it > >>scales automatically with the kernel address space size and should be a > >>reasonable cap definition for most architectures. > >> > >>In the specific case of sparc64, I think it's fair to say that the > >>kernel virtual address is sufficiently large and the amount of physical > >>memory in any of the supported machines is small enough in comparison > >>that it hasn't mattered that a kmem_map cap doesn't exist, because most > >>of the aforementioned structures are scaled based on the amount of > >>physical memory. In fact, it probably won't matter any time soon. > >> > >>All of that said, I would suggest fixing memguard_fudge() and reverting > >>r216016 and the follow up change. All I think that is required to fix > >>memguard_fudge() is > >> > >>Index: vm/memguard.c > >>=================================================================== > >>--- vm/memguard.c (revision 216070) > >>+++ vm/memguard.c (working copy) > >>@@ -186,7 +186,7 @@ memguard_fudge(unsigned long km_size, unsigned lon > >> memguard_mapsize = round_page(memguard_mapsize); > >> if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) > >> memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; > >>- if (km_size + memguard_mapsize > km_max) > >>+ if (km_max > 0 && km_size + memguard_mapsize > km_max) > >> return (km_max); > >> return (km_size + memguard_mapsize); > >>} > >> > >> > > > >Thanks but unfortunately this variant then still panics in kmem_suballoc() > >when called by memguard_init(): > >KDB: debugger backends: ddb > >KDB: current backend: ddb > >Copyright (c) 1992-2010 The FreeBSD Project. > >Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > The Regents of the University of California. All rights reserved. > >FreeBSD is a registered trademark of The FreeBSD Foundation. > >FreeBSD 9.0-CURRENT #17 r215249:216120M: Thu Dec 2 15:17:35 CET 2010 > > marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 > >WARNING: WITNESS option enabled, expect reduced performance. > >panic: kmem_suballoc: bad status return of 1 > >cpuid = 0 > >KDB: enter: panic > >[ thread pid 0 tid 0 ] > >Stopped at 0xc03b04c0: ta %xcc, 1 > >db> bt > >Tracing pid 0 tid 0 td 0xc089ca10 > >(null)() at 0xc0371bac > >(null)() at 0xc054d2dc > >(null)() at 0xc0547dc8 > >(null)() at 0xc0359a78 > >(null)() at 0xc031e930 > >(null)() at 0xc0070028 > > > > > > Sorry, I overlooked another use of km_max in memguard_fudge(). Please > try this instead: > > Index: vm/memguard.c > =================================================================== > --- vm/memguard.c (revision 216070) > +++ vm/memguard.c (working copy) > @@ -184,9 +184,10 @@ memguard_fudge(unsigned long km_size, unsigned lon > memguard_mapsize = km_max / vm_memguard_divisor; > /* size must be multiple of PAGE_SIZE */ > memguard_mapsize = round_page(memguard_mapsize); > - if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) > + if (memguard_mapsize == 0 || > + memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) > memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; > - if (km_size + memguard_mapsize > km_max) > + if (km_max > 0 && km_size + memguard_mapsize > km_max) > return (km_max); > return (km_size + memguard_mapsize); > } With that one the kernel now survies memguard_init() but then panics right afterwards when kmeminit() calls kmem_suballoc(): KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec 6 13:27:57 CET 2010 marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 WARNING: WITNESS option enabled, expect reduced performance. panic: kmem_suballoc: bad status return of 3 cpuid = 0 KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at 0xc03b04c0: ta %xcc, 1 db> bt Tracing pid 0 tid 0 td 0xc089ca10 (null)() at 0xc0371bac (null)() at 0xc054d2fc (null)() at 0xc0359a50 (null)() at 0xc031e930 (null)() at 0xc0070028 Note that the status is different now though. Marius From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 22:30:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DC8106564A; Mon, 6 Dec 2010 22:30:02 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 505D08FC16; Mon, 6 Dec 2010 22:30:02 +0000 (UTC) Received: by iwn39 with SMTP id 39so15192329iwn.13 for ; Mon, 06 Dec 2010 14:30:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=eA0llzi/21Sm9zCsm29HTrLfxDuNSdL2NzeUWObQSUo=; b=e2evi3DsTcNLOhc2zMq/VEC6y0aNSvcK3BL9QrDstsJFnhdwz+RvoJNymCWPA/1UHF oe+K0hfgMy/No9zCV5QZt+CthZ8ThHy/rHOEvRUhzhCimGo2oCzH4QSwk+81/ZTjhqmM 5zTpEEToOAnyooEnKaZKliXFmiQPVIPY/BSrI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ZKiJr4NOvmAX35mZVupPSikfG8yOErhl7vh5zYKkD61EuX8a16Yx5j+V4USsFbxKZz 1XQADPpR2Ot7PRpvaxbYWuroykMd46yePbdY+RVzWkDkSYbitAvTDcx7tfIrSRe/cnPX J99I8WLNTlxHuKDKnuMDaJQWCcleS1Ye32Zsw= MIME-Version: 1.0 Received: by 10.231.15.201 with SMTP id l9mr6558175iba.172.1291674601512; Mon, 06 Dec 2010 14:30:01 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.21.35 with HTTP; Mon, 6 Dec 2010 14:30:01 -0800 (PST) In-Reply-To: <20101206220733.GG38282@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> <4CF7D711.9040505@rice.edu> <20101206220733.GG38282@alchemy.franken.de> Date: Mon, 6 Dec 2010 14:30:01 -0800 X-Google-Sender-Auth: obU8ANRhNBRk7ezX4guJY65OJFo Message-ID: From: mdf@FreeBSD.org To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , alc@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 22:30:02 -0000 On Mon, Dec 6, 2010 at 2:07 PM, Marius Strobl w= rote: [lots of snip] > With that one the kernel now survies memguard_init() but then panics > right afterwards when kmeminit() calls kmem_suballoc(): > KDB: debugger backends: ddb > KDB: current backend: ddb > Copyright (c) 1992-2010 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > =A0 =A0 =A0 =A0The Regents of the University of California. All rights re= served. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec =A06 13:27:57 CET 2010 > =A0 =A0marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/u= sr/home/m4 > WARNING: WITNESS option enabled, expect reduced performance. > panic: kmem_suballoc: bad status return of 3 [more snip] Shooting in the dark a little... The bad status of 3 is presumably KERN_NO_SPACE because we attempted to allocate too much space from the kernel_map. What are the actual values of vm_kmem_size, kernel_map->min_offset, kernel_map->max_offset at panic time? How much virtual space does sparc64 support (since earlier it was reported it's computed based on hardware capability, for this specific machine?) Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 22:30:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADDD61065673; Mon, 6 Dec 2010 22:30:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3D18FC26; Mon, 6 Dec 2010 22:30:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1C4A346B0C; Mon, 6 Dec 2010 17:30:49 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9D99D8A009; Mon, 6 Dec 2010 17:30:47 -0500 (EST) From: John Baldwin To: Ivan Voras Date: Mon, 6 Dec 2010 17:00:48 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206211607.GA65110@muon.cran.org.uk> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012061700.49219.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 06 Dec 2010 17:30:47 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 22:30:50 -0000 On Monday, December 06, 2010 4:22:35 pm Ivan Voras wrote: > On 6 December 2010 22:16, Bruce Cran wrote: > > On Mon, Dec 06, 2010 at 09:31:39PM +0100, Ivan Voras wrote: > >> For what it's worth, apparently linux has the concept of "physical" > >> and "logical" sector sizes (possibly in addition to "stripe size"), > >> with physical being 4096 and logical 512, for example: > >> > >> # hdparm -I /dev/sde | grep size > >> Logical Sector size: 512 bytes > >> Physical Sector size: 4096 bytes > >> device size with M = 1024*1024: 1430799 MBytes > >> device size with M = 1000*1000: 1500301 MBytes (1500 GB) > > > > So do we, except they're both the same for Advanced Format drives: > > There is a subtle difference here which may be important. We have the > concepts of "sectorsize" and "stripesize". > > I think camcontrol actually reports logical and physical sector sizes > as reported by low-level drivers but currently GEOM names "logical > sector size" as "sectorsize" and "physical sector size" as > "stripesize". > > The term "stripesize" can be overloaded to mean both the item in > question - 4 KiB physical sector sizes and RAID stripe sizes. I think > this situation is bad and that the two meanings should be split. My understanding in GEOM is that the primary meaning for stripe size is for the RAID use case. It is probably the 4K logical sector size that needs to come up with a new field, not vice versa. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 22:36:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA4EA106566B; Mon, 6 Dec 2010 22:36:42 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E8A038FC0A; Mon, 6 Dec 2010 22:36:40 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA16611; Tue, 07 Dec 2010 00:36:38 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PPjfi-000DZo-JE; Tue, 07 Dec 2010 00:36:38 +0200 Message-ID: <4CFD6575.5040202@freebsd.org> Date: Tue, 07 Dec 2010 00:36:37 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206211607.GA65110@muon.cran.org.uk> <201012061700.49219.jhb@freebsd.org> In-Reply-To: <201012061700.49219.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 22:36:42 -0000 on 07/12/2010 00:00 John Baldwin said the following: > It is probably the 4K logical sector size that needs to > come up with a new field, not vice versa. Just expressing my overall confusion - 4K would be the physical size and 512 would be the logical one? My thinking: on a platter it's a 4K sector, but drive supports data addressing with 512 byte granularity. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 22:40:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF75106566B; Mon, 6 Dec 2010 22:40:55 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f50.google.com (mail-qw0-f50.google.com [209.85.216.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9659F8FC0A; Mon, 6 Dec 2010 22:40:54 +0000 (UTC) Received: by qwd6 with SMTP id 6so1887879qwd.37 for ; Mon, 06 Dec 2010 14:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=aCH5Nq4wJK8+djuqfzoz3+pQWB6xN7jBSQMOHUdmW+I=; b=D2OpiX2ngaK5EKY2ZpnVKlo4XuaYL+JgbcKnzyO5NjIcpn42dLWzYrkVtdyKCj1Q8h 8VaV+HBZRIOe9bj+oQLkzEVI6ggYXPcg8FL2bLYijsMvgcIb13p6E9zy/HnUNjh/r6YB OdTpa62JPv3Fkhn8uGUU9B7O8d2J/cJYqH5l4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=R/l6xyM3jbDncZm6X1dXWI0dMmFNUsNTxYU2G3ZksqGGuph4we88AZKAwvhmTGpxMk aXuC1B8LxKvbQYty6iRT7fDJA4CBmmGuh+AGDG0aQfC0xK715h0stgT+zJbnoW52Dxy3 u5GHFk+/mwLrGS0W53pNJ4A3u77rgRoQCg75o= Received: by 10.229.228.146 with SMTP id je18mr5057964qcb.47.1291675253159; Mon, 06 Dec 2010 14:40:53 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Mon, 6 Dec 2010 14:40:13 -0800 (PST) In-Reply-To: <4CFD6575.5040202@freebsd.org> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206211607.GA65110@muon.cran.org.uk> <201012061700.49219.jhb@freebsd.org> <4CFD6575.5040202@freebsd.org> From: Ivan Voras Date: Mon, 6 Dec 2010 23:40:13 +0100 X-Google-Sender-Auth: HxfCH7tVDDCbDVHFqv9l3luAHzQ Message-ID: To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 22:40:55 -0000 On 6 December 2010 23:36, Andriy Gapon wrote: > on 07/12/2010 00:00 John Baldwin said the following: >> It is probably the 4K logical sector size that needs to >> come up with a new field, not vice versa. > > Just expressing my overall confusion - 4K would be the physical size and = 512 > would be the logical one? =C2=A0My thinking: on a platter it's a 4K secto= r, but drive > supports data addressing with 512 byte granularity. Yes, the whole thing is overly complicated by the need for 512/4096 kludge; The cleanest would be to simply go with One True Sector Size (4 KiB) for the drive which support it but that would break compatibility all over the place (including booting). Upthread I've advocated adding an "physsectorsize" field for this, but basically I'm fine either way. From owner-svn-src-head@FreeBSD.ORG Mon Dec 6 23:49:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4093C106566C; Mon, 6 Dec 2010 23:49:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E0A8FC17; Mon, 6 Dec 2010 23:49:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6NnRl1048349; Mon, 6 Dec 2010 23:49:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6NnRfi048347; Mon, 6 Dec 2010 23:49:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012062349.oB6NnRfi048347@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 6 Dec 2010 23:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216246 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 23:49:28 -0000 Author: jilles Date: Mon Dec 6 23:49:27 2010 New Revision: 216246 URL: http://svn.freebsd.org/changeset/base/216246 Log: sh: Improve internal-representation-to-text code to avoid binary output. The code to translate the internal representation to text did not know about various additions to the internal representation since the original ash and therefore wrote binary stuff to the terminal. The code is used in the jobs command and similar output. Note that the output is far from complete and mostly serves for recognition purposes. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Mon Dec 6 22:45:29 2010 (r216245) +++ head/bin/sh/jobs.c Mon Dec 6 23:49:27 2010 (r216246) @@ -1314,13 +1314,46 @@ cmdputs(const char *s) if (--cmdnleft > 0) *q++ = '{'; subtype = *p++; + if ((subtype & VSTYPE) == VSLENGTH && --cmdnleft > 0) + *q++ = '#'; } else if (c == '=' && subtype != 0) { - *q++ = "}-+?="[(subtype & VSTYPE) - VSNORMAL]; + *q = "}-+?=##%%\0X"[(subtype & VSTYPE) - VSNORMAL]; + if (*q) + q++; + else + cmdnleft++; + if (((subtype & VSTYPE) == VSTRIMLEFTMAX || + (subtype & VSTYPE) == VSTRIMRIGHTMAX) && + --cmdnleft > 0) + *q = q[-1], q++; subtype = 0; } else if (c == CTLENDVAR) { *q++ = '}'; - } else if (c == CTLBACKQ || c == CTLBACKQ+CTLQUOTE) - cmdnleft++; /* ignore it */ + } else if (c == CTLBACKQ || c == CTLBACKQ+CTLQUOTE) { + cmdnleft -= 5; + if (cmdnleft > 0) { + *q++ = '$'; + *q++ = '('; + *q++ = '.'; + *q++ = '.'; + *q++ = '.'; + *q++ = ')'; + } + } else if (c == CTLARI) { + cmdnleft -= 2; + if (cmdnleft > 0) { + *q++ = '$'; + *q++ = '('; + *q++ = '('; + } + p++; + } else if (c == CTLENDARI) { + if (--cmdnleft > 0) { + *q++ = ')'; + *q++ = ')'; + } + } else if (c == CTLQUOTEMARK || c == CTLQUOTEEND) + cmdnleft++; /* ignore */ else *q++ = c; if (--cmdnleft <= 0) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 02:19:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30EC31065670; Tue, 7 Dec 2010 02:19:16 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A838FC14; Tue, 7 Dec 2010 02:19:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB72JG99051399; Tue, 7 Dec 2010 02:19:16 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB72JF1n051394; Tue, 7 Dec 2010 02:19:15 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012070219.oB72JF1n051394@svn.freebsd.org> From: David Schultz Date: Tue, 7 Dec 2010 02:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216247 - in head/lib/msun: man src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 02:19:16 -0000 Author: das Date: Tue Dec 7 02:19:15 2010 New Revision: 216247 URL: http://svn.freebsd.org/changeset/base/216247 Log: Fix various nits in style and comments that were pointed out by bde. Code changes verified with md5. Modified: head/lib/msun/man/math.3 head/lib/msun/src/e_log2.c head/lib/msun/src/e_log2f.c head/lib/msun/src/k_logf.h Modified: head/lib/msun/man/math.3 ============================================================================== --- head/lib/msun/man/math.3 Mon Dec 6 23:49:27 2010 (r216246) +++ head/lib/msun/man/math.3 Tue Dec 7 02:19:15 2010 (r216247) @@ -195,7 +195,7 @@ yn Bessel function of the second kind of .El .Pp The routines -in this section may not produce a result that is correctly rounded, +in this section might not produce a result that is correctly rounded, so reproducible results cannot be guaranteed across platforms. For most of these functions, however, incorrect rounding occurs rarely, and then only in very-close-to-halfway cases. @@ -231,9 +231,8 @@ Many of the routines to compute transcen inaccurate results in other than the default rounding mode. .Pp On the i386 platform, trigonometric argument reduction is not -performed accurately for very large arguments, resulting in errors -greater than 1 -.Em ulp +performed accurately for huge arguments, resulting in +large errors for such arguments to .Fn cos , .Fn sin , Modified: head/lib/msun/src/e_log2.c ============================================================================== --- head/lib/msun/src/e_log2.c Mon Dec 6 23:49:27 2010 (r216246) +++ head/lib/msun/src/e_log2.c Tue Dec 7 02:19:15 2010 (r216247) @@ -14,8 +14,8 @@ #include __FBSDID("$FreeBSD$"); -/* log2(x) - * Return the base 2 logarithm of x. +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. */ #include "math.h" @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln2hi = 0x1.71547652000p+0, -ivln2lo = 0x1.705fc2eefa2p-33; +ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ +ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; Modified: head/lib/msun/src/e_log2f.c ============================================================================== --- head/lib/msun/src/e_log2f.c Mon Dec 6 23:49:27 2010 (r216246) +++ head/lib/msun/src/e_log2f.c Tue Dec 7 02:19:15 2010 (r216247) @@ -12,14 +12,18 @@ #include __FBSDID("$FreeBSD$"); +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. + */ + #include "math.h" #include "math_private.h" #include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln2hi = 0x1.716p+0f, -ivln2lo = -0x1.7135a8fa03d11p-13; +ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ +ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; Modified: head/lib/msun/src/k_logf.h ============================================================================== --- head/lib/msun/src/k_logf.h Mon Dec 6 23:49:27 2010 (r216246) +++ head/lib/msun/src/k_logf.h Tue Dec 7 02:19:15 2010 (r216247) @@ -12,8 +12,8 @@ #include __FBSDID("$FreeBSD$"); -/* __kernel_logf(x) - * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. +/* + * float version of __kernel_log(x). See k_log.c for details. */ static const float @@ -33,7 +33,7 @@ __kernel_logf(float x) f = x-(float)1.0; if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ - if(f==0.0) return 0.0; + if(f==0.0f) return 0.0f; return f*f*((float)0.33333333333333333*f-(float)0.5); } s = f/((float)2.0+f); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 03:29:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD2871065673; Tue, 7 Dec 2010 03:29:36 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE3EE8FC16; Tue, 7 Dec 2010 03:29:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB73Ta1t053005; Tue, 7 Dec 2010 03:29:36 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB73Ta6m053003; Tue, 7 Dec 2010 03:29:36 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012070329.oB73Ta6m053003@svn.freebsd.org> From: David Schultz Date: Tue, 7 Dec 2010 03:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216248 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 03:29:37 -0000 Author: das Date: Tue Dec 7 03:29:36 2010 New Revision: 216248 URL: http://svn.freebsd.org/changeset/base/216248 Log: Another minor nit: Make sure the constant here is a float so the compiler doesn't promote the entire expression to double. Modified: head/lib/msun/src/e_log2f.c Modified: head/lib/msun/src/e_log2f.c ============================================================================== --- head/lib/msun/src/e_log2f.c Tue Dec 7 02:19:15 2010 (r216247) +++ head/lib/msun/src/e_log2f.c Tue Dec 7 03:29:36 2010 (r216248) @@ -50,7 +50,7 @@ __ieee754_log2f(float x) SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ k += (i>>23); f = __kernel_logf(x); - x = x - 1; + x = x - (float)1.0; GET_FLOAT_WORD(hx,x); SET_FLOAT_WORD(hi,hx&0xfffff000); lo = x - hi; From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 08:20:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 777C71065697; Tue, 7 Dec 2010 08:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8D68FC12; Tue, 7 Dec 2010 08:20:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB78KKXg059356; Tue, 7 Dec 2010 08:20:20 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB78KKj2059354; Tue, 7 Dec 2010 08:20:20 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201012070820.oB78KKj2059354@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 7 Dec 2010 08:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216249 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 08:20:21 -0000 Author: hselasky Date: Tue Dec 7 08:20:20 2010 New Revision: 216249 URL: http://svn.freebsd.org/changeset/base/216249 Log: Re-add a status check which sneaked out during r214804. This change can fix some USB error messages showing up during bootup. MFC after: 3 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Dec 7 03:29:36 2010 (r216248) +++ head/sys/dev/usb/usb_request.c Tue Dec 7 08:20:20 2010 (r216249) @@ -793,6 +793,10 @@ usbd_req_reset_port(struct usb_device *u if (err) { goto done; } + /* if the device disappeared, just give up */ + if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + goto done; + } /* check if reset is complete */ if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) { break; From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 09:03:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E578C1065670; Tue, 7 Dec 2010 09:03:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB2278FC18; Tue, 7 Dec 2010 09:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB793HTw060299; Tue, 7 Dec 2010 09:03:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB793HUO060296; Tue, 7 Dec 2010 09:03:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012070903.oB793HUO060296@svn.freebsd.org> From: Andriy Gapon Date: Tue, 7 Dec 2010 09:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216250 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 09:03:18 -0000 Author: avg Date: Tue Dec 7 09:03:17 2010 New Revision: 216250 URL: http://svn.freebsd.org/changeset/base/216250 Log: dtrace_gethrtime_init: pin to master while examining other CPUs Also use pc_cpumask to be future-friendly. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 7 08:20:20 2010 (r216249) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 7 09:03:17 2010 (r216250) @@ -405,6 +405,7 @@ dtrace_gethrtime_init_cpu(void *arg) static void dtrace_gethrtime_init(void *arg) { + struct pcpu *pc; uint64_t tsc_f; cpumask_t map; int i; @@ -437,15 +438,14 @@ dtrace_gethrtime_init(void *arg) nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; /* The current CPU is the reference one. */ + sched_pin(); tsc_skew[curcpu] = 0; - CPU_FOREACH(i) { if (i == curcpu) continue; - map = 0; - map |= (1 << curcpu); - map |= (1 << i); + pc = pcpu_find(i); + map = PCPU_GET(cpumask) | pc->pc_cpumask; smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, dtrace_gethrtime_init_cpu, @@ -453,6 +453,7 @@ dtrace_gethrtime_init(void *arg) tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } + sched_unpin(); } SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 7 08:20:20 2010 (r216249) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 7 09:03:17 2010 (r216250) @@ -405,6 +405,7 @@ dtrace_gethrtime_init_cpu(void *arg) static void dtrace_gethrtime_init(void *arg) { + struct pcpu *pc; uint64_t tsc_f; cpumask_t map; int i; @@ -437,15 +438,14 @@ dtrace_gethrtime_init(void *arg) nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; /* The current CPU is the reference one. */ + sched_pin(); tsc_skew[curcpu] = 0; - CPU_FOREACH(i) { if (i == curcpu) continue; - map = 0; - map |= (1 << curcpu); - map |= (1 << i); + pc = pcpu_find(i); + map = PCPU_GET(cpumask) | pc->pc_cpumask; smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, dtrace_gethrtime_init_cpu, @@ -453,6 +453,7 @@ dtrace_gethrtime_init(void *arg) tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } + sched_unpin(); } SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 09:19:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4771106564A; Tue, 7 Dec 2010 09:19:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89CD48FC14; Tue, 7 Dec 2010 09:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB79JlGW060663; Tue, 7 Dec 2010 09:19:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB79JlkI060659; Tue, 7 Dec 2010 09:19:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012070919.oB79JlkI060659@svn.freebsd.org> From: Andriy Gapon Date: Tue, 7 Dec 2010 09:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216251 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 09:19:47 -0000 Author: avg Date: Tue Dec 7 09:19:47 2010 New Revision: 216251 URL: http://svn.freebsd.org/changeset/base/216251 Log: dtrace_xcall: no need for special handling of curcpu smp_rendezvous_cpus alreadt does the right thing in a very similar fashion, so the code was kind of duplicating that. MFC after: 3 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 7 09:03:17 2010 (r216250) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 7 09:19:47 2010 (r216251) @@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x { cpumask_t cpus; - critical_enter(); - if (cpu == DTRACE_CPUALL) cpus = all_cpus; else - cpus = (cpumask_t) (1 << cpu); - - /* If the current CPU is in the set, call the function directly: */ - if ((cpus & (1 << curcpu)) != 0) { - (*func)(arg); - - /* Mask the current CPU from the set */ - cpus &= ~(1 << curcpu); - } - - /* If there are any CPUs in the set, cross-call to those CPUs */ - if (cpus != 0) - smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg); + cpus = (cpumask_t)1 << cpu; - critical_exit(); + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); } static void Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 7 09:03:17 2010 (r216250) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 7 09:19:47 2010 (r216251) @@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x { cpumask_t cpus; - critical_enter(); - if (cpu == DTRACE_CPUALL) cpus = all_cpus; else - cpus = (cpumask_t) (1 << cpu); - - /* If the current CPU is in the set, call the function directly: */ - if ((cpus & (1 << curcpu)) != 0) { - (*func)(arg); - - /* Mask the current CPU from the set */ - cpus &= ~(1 << curcpu); - } - - /* If there are any CPUs in the set, cross-call to those CPUs */ - if (cpus != 0) - smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg); + cpus = (cpumask_t)1 << cpu; - critical_exit(); + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); } static void From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 09:42:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A5E0106566C; Tue, 7 Dec 2010 09:42:48 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C36AF8FC14; Tue, 7 Dec 2010 09:42:46 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 62F8845E49; Tue, 7 Dec 2010 10:42:45 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id B310D45C9C; Tue, 7 Dec 2010 10:42:39 +0100 (CET) Date: Tue, 7 Dec 2010 10:42:40 +0100 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20101207094240.GB1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="St7VIuEGZ6dlpu13" Content-Disposition: inline In-Reply-To: <201012061518.49835.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 09:42:48 -0000 --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 03:18:49PM -0500, John Baldwin wrote: > On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: > > On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: > > > Please persuade me on technical grounds why ashift, a property > > > intended for address alignment, should not be set in this way. If your > > > answer is "I don't know but you are still wrong because I say so" I > > > will respect it and back it out but only until I/we discuss the > > > question with upstream ZFS developers. > >=20 > > No. You persuade me why changing ashift in ZFS, which, as the comment > > clearly states is "device's minimum transfer size" is better and not > > hackish than presenting the disk with properly configured sector size. > > This can not only affect disks that still use 512 bytes sectors, but > > doesn't fix the problem at all. It just works around the problem in ZFS > > when configured on top of raw disks. > >=20 > > What about other file systems? What about other GEOM classes? GELI is > > great example here, as people use ZFS on top of GELI alot. GELI > > integrity verification works in a way that not reporting disk sector > > size properly will have huge negative performance impact. ZFS' ashift > > won't change that. >=20 > I am mostly on your side here, but I wonder if GELI shouldn't prefer the= =20 > stripesize anyway? For example, if you ran GELI on top of RAID-5 I imagi= ne it=20 > would be far more performant for it to use stripe-size logical blocks ins= tead=20 > of individual sectors for the underlying media. Not exactly. GELI with authentication stores checksum in the same sector as data. This way we have less than 512 bytes of data per sector. To still be able to provide power of 2 sectors GELI and not to lose too much space, GELI has to present larger sector to the upper layers. For example with 512 bytes sectors of the underlying provider, GELI presents 4kB sector to the upper layers, but every 4kB GELI sector is build from nine 512 bytes sector of the underlying provider. I'm not sure if my description is readable:) If you are interested, take a look at the top of g_eli_integrity.c. It might be better described in there. > The RAID-5 argument also suggests that other filesystems should probably > prefer stripe sizes to physical sector sizes when picking block sizes, et= c. I'm not so sure. Stripe size of RAID5 tends to be too large to do that. By using 128kB ashift we will lose way too much space when it comes to smaller files and metadata. Stripesize is just a hit what alignment is optimal, but it is optional - consumer can decide to ignore it if we care more about space than performance, for example. Sectorsize on the other hand is not a hint, but really the smallest block a provider can handle. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --St7VIuEGZ6dlpu13 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz+AY8ACgkQForvXbEpPzQsiACgllXLryvJBUmB0kL+84UCW8nF QucAoMbkjXl44/fOaZA72zK4DGGXOyvY =ZdA3 -----END PGP SIGNATURE----- --St7VIuEGZ6dlpu13-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 09:51:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE1E3106564A; Tue, 7 Dec 2010 09:51:44 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 186558FC13; Tue, 7 Dec 2010 09:51:43 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 857D045C8A; Tue, 7 Dec 2010 10:51:42 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id F408E456B1; Tue, 7 Dec 2010 10:51:36 +0100 (CET) Date: Tue, 7 Dec 2010 10:51:37 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20101207095137.GC1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qtZFehHsKgwS5rPz" Content-Disposition: inline In-Reply-To: <4CFD514E.8010103@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 09:51:45 -0000 --qtZFehHsKgwS5rPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 11:10:38PM +0200, Alexander Motin wrote: > On 06.12.2010 22:18, John Baldwin wrote: > >On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: > >>On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: > >>>Please persuade me on technical grounds why ashift, a property > >>>intended for address alignment, should not be set in this way. If your > >>>answer is "I don't know but you are still wrong because I say so" I > >>>will respect it and back it out but only until I/we discuss the > >>>question with upstream ZFS developers. > >> > >>No. You persuade me why changing ashift in ZFS, which, as the comment > >>clearly states is "device's minimum transfer size" is better and not > >>hackish than presenting the disk with properly configured sector size. > >>This can not only affect disks that still use 512 bytes sectors, but > >>doesn't fix the problem at all. It just works around the problem in ZFS > >>when configured on top of raw disks. >=20 > Both ATA and SCSI standards implemented support for different logical=20 > and physical sector sizes. It is not a hack - it seems to be the way=20 > manufacturers decided to go. At least on their words. IMHO hack in this= =20 > situation would be to report to GEOM some fake sector size, different=20 > from one reported by device. In any way it is the main visible disk=20 > characteristic, independently of what it's firmware does inside. We can be smarter than that, really. We all know the disk presents 512 bytes sectors only(?) because most of the software out there (including Windows, I guess) will simply break when they see disk with 4kB sector. We were trying very hard not to be limited to 512 byte sectors and we actually succedded: GEOM supports any sector size just fine, most (if not all) GEOM classes support power of 2 sectors just fine, even our two main file systems (UFS and ZFS) support !512 sectors. After all this work do we really don't want to take advantage of it? Maybe other operating systems can't deal with 4kB sectors, but we can, we were well prepared for this, why do we want to forget about that? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --qtZFehHsKgwS5rPz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz+A6kACgkQForvXbEpPzRTwwCeOhTQ3y2194aTCzvMvTmXltki SM0AoLcFYqQEWZ/EXPEL813z/68bqItO =IuP1 -----END PGP SIGNATURE----- --qtZFehHsKgwS5rPz-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 10:21:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACB2C1065670; Tue, 7 Dec 2010 10:21:12 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1D21B8FC19; Tue, 7 Dec 2010 10:21:11 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id D47F645C98; Tue, 7 Dec 2010 11:21:10 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 25ECD45683; Tue, 7 Dec 2010 11:21:04 +0100 (CET) Date: Tue, 7 Dec 2010 11:21:04 +0100 From: Pawel Jakub Dawidek To: Ivan Voras Message-ID: <20101207102104.GD1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> <20101206195327.GD1936@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pQhZXvAqiZgbeUkD" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 10:21:12 -0000 --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 06, 2010 at 09:28:42PM +0100, Ivan Voras wrote: > But there are two reasons that I think are important, which resulted > in changing this: >=20 > 1) It is being used out of the original context in the mailing list > posts I've referenced - it was being used (and in a worse way, by > having a hacked zpool binary) for alignment like I did in the patch, > despite that the sectorsize wasn't changed. FreeBSD is not Solaris, really. ZFS has a lot of code that is not needed in FreeBSD. For example we don't need to partition raw disks and use partition, we can simply use raw disks (or any other GEOM provider), thanks to GEOM. I also think that Solaris needs a lot of work to support 4kB sectors. We don't. We are prepared for that for a long time now. As I said many times now, doing such a change in ZFS will of course work for you, but it doesn't solve the problem properly. It doesn't solve the problem for all the other disks consumers. If you want to use hacked zpool binary that's fine by me, but don't commit this. > 2) The solaris "big sector" project, described in > http://arc.opensolaris.org/caselog/PSARC/2008/769/final_spec.txt > basically blesses ZFS to work with big sectors, and states "ZFS can > automatically run on larger sector size disk after the label change > and I/O path change." Since the effect of having a larger sectorsize > will effectively be only the change in ashift, this is what I've done. Hmm, what kind of argument is that? Yes, ZFS can work with larger sectors just fine. I have many such installations where I use ZFS on top of 4kB GELI providers. What this sentence describe is simply that ZFS is 4kB-sector ready. What you did actually suggest that ZFS can work only with 512 byte sectors, so you need to change alignment internally, which is not true - there is no need to modify ZFS, because it can support disks with larger sectors. > > BTW. ZFS is no longer open-source if you didn't notice. >=20 > I have noticed but I don't understand how it affects FreeBSD. I would > like to discuss this sometime but unless you have some urgent > interpretation of this information, I think it's best to start another > thread about it. I'm just saying that discussing anything upstream is much harder now. PS. Do you know your change breaks all current ZFS installation if stripesize is defined for a provider? # zpool create tank ada0 (upgrade FreeBSD so that ada0 now reports 4kB stripesize) # zpool import tank cannot import 'tank': invalid vdev configuration So you change was not only poorly thought out and not reviewed, but also not even minimally tested. Before we go any further, back it out. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --pQhZXvAqiZgbeUkD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz+Co8ACgkQForvXbEpPzSdkwCdHw/l+2bJFHI/wp/lKJoOZHGc QCkAoKAClH+e7mmrTBpZ+iG4MigzviqE =2GlF -----END PGP SIGNATURE----- --pQhZXvAqiZgbeUkD-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 10:26:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38AE2106566B; Tue, 7 Dec 2010 10:26:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C6E128FC18; Tue, 7 Dec 2010 10:26:02 +0000 (UTC) Received: by fxm16 with SMTP id 16so10394340fxm.13 for ; Tue, 07 Dec 2010 02:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=4OeLog5Xz7buH56eNgfASPIujvGmwUg9wkDe+qsBNbg=; b=eYy3sYwDTyYPW6NujezUsuMZrjylHirzERNaN4hkLtGjITX2DXgocj1DB2fd9Mxi5F 7nZL1q4GiT9KpLepP7bnz54AThRlmYE+Bsjf6ZVb0HG4v0g0jAaTN8OaHRMSTEiTANIf vzxYOHGi9nOMM1L6rNcefP07AzNQX9K2w8mxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=HShiyWbxWZxSvphZNPYY376PE3dxcU5kOX58DAKMFJ6+T6+byaZLVpa/HzGaeVZBs/ mTOlip8t+wYRz1aNletB3rbaVQS5BvuEUD3mGAwV0p+LuSpNhk5JD1VhBFK8I05Yjd5v SUDcj1HOntX9c/0HeMIHllyJket/X7e1xEP0M= Received: by 10.223.103.12 with SMTP id i12mr1940754fao.43.1291717561932; Tue, 07 Dec 2010 02:26:01 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 5sm1882611fak.47.2010.12.07.02.25.59 (version=SSLv3 cipher=RC4-MD5); Tue, 07 Dec 2010 02:26:00 -0800 (PST) Sender: Alexander Motin Message-ID: <4CFE0B9E.3060808@FreeBSD.org> Date: Tue, 07 Dec 2010 12:25:34 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> In-Reply-To: <20101207095137.GC1700@garage.freebsd.pl> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 10:26:04 -0000 Pawel Jakub Dawidek wrote: > On Mon, Dec 06, 2010 at 11:10:38PM +0200, Alexander Motin wrote: >> On 06.12.2010 22:18, John Baldwin wrote: >>> On Monday, December 06, 2010 2:53:27 pm Pawel Jakub Dawidek wrote: >>>> On Mon, Dec 06, 2010 at 08:35:36PM +0100, Ivan Voras wrote: >>>>> Please persuade me on technical grounds why ashift, a property >>>>> intended for address alignment, should not be set in this way. If your >>>>> answer is "I don't know but you are still wrong because I say so" I >>>>> will respect it and back it out but only until I/we discuss the >>>>> question with upstream ZFS developers. >>>> No. You persuade me why changing ashift in ZFS, which, as the comment >>>> clearly states is "device's minimum transfer size" is better and not >>>> hackish than presenting the disk with properly configured sector size. >>>> This can not only affect disks that still use 512 bytes sectors, but >>>> doesn't fix the problem at all. It just works around the problem in ZFS >>>> when configured on top of raw disks. >> Both ATA and SCSI standards implemented support for different logical >> and physical sector sizes. It is not a hack - it seems to be the way >> manufacturers decided to go. At least on their words. IMHO hack in this >> situation would be to report to GEOM some fake sector size, different >> from one reported by device. In any way it is the main visible disk >> characteristic, independently of what it's firmware does inside. > > We can be smarter than that, really. We all know the disk presents 512 > bytes sectors only(?) because most of the software out there (including > Windows, I guess) will simply break when they see disk with 4kB sector. > We were trying very hard not to be limited to 512 byte sectors and we > actually succedded: GEOM supports any sector size just fine, most (if > not all) GEOM classes support power of 2 sectors just fine, even our two > main file systems (UFS and ZFS) support !512 sectors. After all this > work do we really don't want to take advantage of it? Maybe other > operating systems can't deal with 4kB sectors, but we can, we were well > prepared for this, why do we want to forget about that? It is really nice that we support bigger sector sizes. But unluckily we are not the only OS in universe. Disks with data may move between systems, partition could be shared, etc. We must keep compatibility -- period. Can you predict what happen if we try to use some FAT partition created by Windows (using 512bytes sectors) after we set disk sector size to 4K? I have feeling that we won't even read partition table properly, not speaking about FAT. Even GEOM classes supporting big sector sizes depend on that size to be constant -- otherwise they will just be unable to locate their own metadata in last sector. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 10:35:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C19A106566B; Tue, 7 Dec 2010 10:35:17 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 282568FC15; Tue, 7 Dec 2010 10:35:17 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 40846E7173; Tue, 7 Dec 2010 10:35:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=WNI2WzNf3a1R /vxfyYr2kxgqNVs=; b=vamxrM9zfnyOHXH++u4+rgkznH3GfZR5IAyzsHo40Jib s3EDnL0agbJSqAYCqT+qKbrvLsLRaa0UmwMhuZDAI7EQkVohD8a4jGGdyhXrSPIe UBH96veSEB6ZhuOG67Bxl62Djs5AszUwxONUAaYTl2acaZq+DJnC9PUZNZqjo3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=lp2n8h bnYsL/NbWaKXNgeoZyLMKwLbcNnWLwoiHZTxNkIsDgflR89fySY5mPXLF5svKiAx ww5ifVDBofLl4WsuWyzYB0j0JtBlUd7uJXvac3gTuKWMyxYc+Nr4TuPbUC6Wceyc vwUnxFq30X1w/qnM33bGR1FQa9hu2V9FZbzEk= Received: from unknown (client-86-25-14-189.oxfd.adsl.virginmedia.com [86.25.14.189]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id B4FECE7172; Tue, 7 Dec 2010 10:35:15 +0000 (GMT) Date: Tue, 7 Dec 2010 10:35:12 +0000 From: Bruce Cran To: Pawel Jakub Dawidek Message-ID: <20101207103512.00006401@unknown> In-Reply-To: <20101207095137.GC1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Voras , Ivan, Alexander Motin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 10:35:17 -0000 On Tue, 7 Dec 2010 10:51:37 +0100 Pawel Jakub Dawidek wrote: > We can be smarter than that, really. We all know the disk presents 512 > bytes sectors only(?) because most of the software out there > (including Windows, I guess) will simply break when they see disk > with 4kB sector. 8 years ago Windows didn't support larger sector sizes; Vista and Windows 7 do. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:04:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7855106564A; Tue, 7 Dec 2010 11:04:17 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 78B708FC0C; Tue, 7 Dec 2010 11:04:16 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id CFC3A45C9B; Tue, 7 Dec 2010 12:04:15 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8790045684; Tue, 7 Dec 2010 12:04:10 +0100 (CET) Date: Tue, 7 Dec 2010 12:04:10 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20101207110410.GE1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="47eKBCiAZYFK5l32" Content-Disposition: inline In-Reply-To: <4CFE0B9E.3060808@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:04:17 -0000 --47eKBCiAZYFK5l32 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 07, 2010 at 12:25:34PM +0200, Alexander Motin wrote: > It is really nice that we support bigger sector sizes. But unluckily we > are not the only OS in universe. Disks with data may move between > systems, partition could be shared, etc. We must keep compatibility -- > period. Can you predict what happen if we try to use some FAT partition > created by Windows (using 512bytes sectors) after we set disk sector > size to 4K? I have feeling that we won't even read partition table > properly, not speaking about FAT. Even GEOM classes supporting big > sector sizes depend on that size to be constant -- otherwise they will > just be unable to locate their own metadata in last sector. First valid argument, thank you:) BTW. What Ivan did changes ashift for existing ZFS pools as well, so it breaks them too. If we decide to align other things to stripesize we can still break compatibility with other operating systems. Also stripesize is really not good idea. For RAID5 it might be like 64kB or larger, which is definiately too large for ashift in ZFS or fragment size in UFS. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --47eKBCiAZYFK5l32 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz+FKUACgkQForvXbEpPzRTkACgl0xUFgpSNplwEEOTzjdITTvS fJUAn0bJw3iKuonr/mRJxkIK+sw9J78f =DTqA -----END PGP SIGNATURE----- --47eKBCiAZYFK5l32-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:26:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8D1106566B; Tue, 7 Dec 2010 11:26:10 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id D519B8FC08; Tue, 7 Dec 2010 11:26:09 +0000 (UTC) Received: by qyk8 with SMTP id 8so4443247qyk.13 for ; Tue, 07 Dec 2010 03:26:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=wsqvDnCmjjohrnE3qQgSFa3/yU/JkwDWD7GohmJffuA=; b=xSKh+vFwpXq0nGAM0foE/hZPuWuD3DXn5U9ra9JAoZpfNZBSRbInokAf3tqqpWFRg3 TOqhKgdBKrCc7odE3VO4edtp6R6LP0gRu+VfqiT1Bu+fLMprdPsqaVnZzg0OmsHNQMd2 MUroQ7Sy5thMs9LPdiV021XcXO1Z0b809a7Ek= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=j8s1j3Q69lrBKWrKfhq4ACGwwRHv76L0jbWGInxJ39Qq1PBDkRveZAaPHJHp1uu3g3 yA48YhTuUpERnugTKFLsE30fqp6qsbiZvSWf+1giEGSH3QgksJLbyLBafLDrAbElJEE+ liqsUE8ixyl2hGHE9a9K6zs3ogwOelgRwQq/o= Received: by 10.229.228.146 with SMTP id je18mr5673790qcb.47.1291721168938; Tue, 07 Dec 2010 03:26:08 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Tue, 7 Dec 2010 03:25:28 -0800 (PST) In-Reply-To: <20101207102104.GD1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> <20101206195327.GD1936@garage.freebsd.pl> <20101207102104.GD1700@garage.freebsd.pl> From: Ivan Voras Date: Tue, 7 Dec 2010 12:25:28 +0100 X-Google-Sender-Auth: t4nGlXLutMez1lV-zFrE3_ZDoIg Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:26:10 -0000 On 7 December 2010 11:21, Pawel Jakub Dawidek wrote: > PS. Do you know your change breaks all current ZFS installation if > stripesize is defined for a provider? > > =C2=A0 =C2=A0 =C2=A0 =C2=A0# zpool create tank ada0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0(upgrade FreeBSD so that ada0 now reports 4kB = stripesize) > =C2=A0 =C2=A0 =C2=A0 =C2=A0# zpool import tank > =C2=A0 =C2=A0 =C2=A0 =C2=A0cannot import 'tank': invalid vdev configurati= on Actually I did test the patch and, similar to the Solaris people, found that ZFS records ashift in metadata and uses the recorded one instead of hardcoded / detected one. What you found here really shouldn't happen. Are you sure only stripesize was increased in your case, not sectorsize? > So you change was not only poorly thought out and not reviewed, but also > not even minimally tested. Before we go any further, back it out. This actually is the first problem that requires backing it out. I will do = it. From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:31:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC0F106564A; Tue, 7 Dec 2010 11:31:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1ABEA8FC13; Tue, 7 Dec 2010 11:31:30 +0000 (UTC) Received: by fxm16 with SMTP id 16so10442882fxm.13 for ; Tue, 07 Dec 2010 03:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=RMVV1vf8qTg0XWZQn3NDatFJi8SjTWWyhc1JAleLw3M=; b=GbWu1jO5VawhIw6/rCwaJpSgvIxE/SmnF+oTiJ14UpoYWyEoJ3s7XBId6pWTmfD44C YIzhNQ5pJos4eOqn4njltQIc1Sd1T6gu4ifVvzlxI3rAQK698P2gxMTGxIrgAA+KpMfn iWrGNauYco0R8gysEf11TT37FZEcMdMjEvRtk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ecuFqYSeGVZLUy07hEvjEN32QXZVLSUTxeQvoLgEPjXKDH3yZU+9Yu7Im2KWyH434H 40boGAHyd+44BzzVB62aYOlXniIb6ypNM5Qfv/m87D1McRbGYPbNfTM4GE1JWePCkmR9 z2EbghWNeDqE8r9ZbPnR5CZonI3ZPTH9gD7AM= Received: by 10.223.81.67 with SMTP id w3mr7035928fak.110.1291721490219; Tue, 07 Dec 2010 03:31:30 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n3sm1876871fax.31.2010.12.07.03.31.27 (version=SSLv3 cipher=RC4-MD5); Tue, 07 Dec 2010 03:31:28 -0800 (PST) Sender: Alexander Motin Message-ID: <4CFE1B0F.90908@FreeBSD.org> Date: Tue, 07 Dec 2010 13:31:27 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> In-Reply-To: <20101207110410.GE1700@garage.freebsd.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras , John Baldwin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:31:32 -0000 On 07.12.2010 13:04, Pawel Jakub Dawidek wrote: > On Tue, Dec 07, 2010 at 12:25:34PM +0200, Alexander Motin wrote: >> It is really nice that we support bigger sector sizes. But unluckily we >> are not the only OS in universe. Disks with data may move between >> systems, partition could be shared, etc. We must keep compatibility -- >> period. Can you predict what happen if we try to use some FAT partition >> created by Windows (using 512bytes sectors) after we set disk sector >> size to 4K? I have feeling that we won't even read partition table >> properly, not speaking about FAT. Even GEOM classes supporting big >> sector sizes depend on that size to be constant -- otherwise they will >> just be unable to locate their own metadata in last sector. > > First valid argument, thank you:) > > BTW. What Ivan did changes ashift for existing ZFS pools as well, so it > breaks them too. I can't say anything about it. Ivan told me that it's not. You may discuss it between yourselves and I'll listen. :) > If we decide to align other things to stripesize we can still break > compatibility with other operating systems. Not necessary. Some places indeed may have some legacy requirements, for example, in theory MBR want partition to be aligned to "track boundary" (but I've seen many pre-formatted SD cards with MBR violating it to align partition to flash sector). Same time for BSD label I see no problem to align partitions any way we want. I also see no problems to make FAT cluster, UFS block/fragment, etc, to match some sizes. > Also stripesize is really not good idea. For RAID5 it might be like > 64kB or larger, which is definiately too large for ashift in ZFS or > fragment size in UFS. I agree that minimal I/O size of 64K or 128K may be too much. In this case I've proposed Ivan to limit maximum used stripesize with some lower value, possibly tunable. But he preferred to not introduce new constants. I think we should not depend that stripesize should be small or big or power-of-2 or anything else. World is not uniform. Even for RAID it can theoretically vary from 1 sector to half of the disk. We have to reconsider it each time we are going to use it, taking to account local limitations and preferences. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:31:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D9E91065695; Tue, 7 Dec 2010 11:31:59 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A2EF08FC1C; Tue, 7 Dec 2010 11:31:58 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 72CEE45D8D; Tue, 7 Dec 2010 12:31:57 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 162CC45C9F; Tue, 7 Dec 2010 12:31:52 +0100 (CET) Date: Tue, 7 Dec 2010 12:31:52 +0100 From: Pawel Jakub Dawidek To: Ivan Voras Message-ID: <20101207113152.GG1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> <20101206195327.GD1936@garage.freebsd.pl> <20101207102104.GD1700@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8bBEDOJVaa9YlTAt" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:31:59 -0000 --8bBEDOJVaa9YlTAt Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 07, 2010 at 12:25:28PM +0100, Ivan Voras wrote: > On 7 December 2010 11:21, Pawel Jakub Dawidek wrote: >=20 > > PS. Do you know your change breaks all current ZFS installation if > > stripesize is defined for a provider? > > > > =A0 =A0 =A0 =A0# zpool create tank ada0 > > =A0 =A0 =A0 =A0(upgrade FreeBSD so that ada0 now reports 4kB stripesize) > > =A0 =A0 =A0 =A0# zpool import tank > > =A0 =A0 =A0 =A0cannot import 'tank': invalid vdev configuration >=20 > Actually I did test the patch and, similar to the Solaris people, > found that ZFS records ashift in metadata and uses the recorded one > instead of hardcoded / detected one. What you found here really > shouldn't happen. Are you sure only stripesize was increased in your > case, not sectorsize? if (pp->stripesize > pp->sectorsize) *ashift =3D highbit(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; else *ashift =3D highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; If stripesize will start to be 4096, the ashift will change. Not sure what you test was, but it only works the other way around - create pool with 4kB ashift and import it when ashift is 512 bytes. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --8bBEDOJVaa9YlTAt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz+GygACgkQForvXbEpPzQjQwCeM42rF9i0vP9vc2hKXvcZd2fH dGAAoOUriQNLSFoCXzqrQYvikHqhM6l+ =zEIN -----END PGP SIGNATURE----- --8bBEDOJVaa9YlTAt-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:51:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D8C5106564A; Tue, 7 Dec 2010 11:51:07 +0000 (UTC) (envelope-from brucec@muon.cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 188B98FC15; Tue, 7 Dec 2010 11:51:07 +0000 (UTC) Received: by muon.cran.org.uk (Postfix, from userid 1001) id 6AE0EE7173; Tue, 7 Dec 2010 11:51:06 +0000 (GMT) Date: Tue, 7 Dec 2010 11:51:06 +0000 From: Bruce Cran To: Alexander Motin Message-ID: <20101207115106.GB68479@muon.cran.org.uk> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CFE1B0F.90908@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:51:07 -0000 On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: > Not necessary. Some places indeed may have some legacy requirements, > for example, in theory MBR want partition to be aligned to "track > boundary" (but I've seen many pre-formatted SD cards with MBR > violating it to align partition to flash sector). Same time for BSD > label I see no problem to align partitions any way we want. I also > see no problems to make FAT cluster, UFS block/fragment, etc, to > match some sizes. >From a new installation of Windows 7 and FreeBSD CURRENT: GEOM: ada0: partition 3 does not start on a track boundary. GEOM: ada0: partition 3 does not end on a track boundary. GEOM: ada0: partition 2 does not start on a track boundary. GEOM: ada0: partition 2 does not end on a track bounary. Partition 2 is the reserved partition while 3 is an NTFS partition, both created in the Windows setup application. Since Windows isn't bothering to align partitions do we still need to warn about it? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 11:57:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F29106564A; Tue, 7 Dec 2010 11:57:10 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C56648FC0A; Tue, 7 Dec 2010 11:57:08 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA00483; Tue, 07 Dec 2010 13:57:05 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PPwAK-000Gqx-VH; Tue, 07 Dec 2010 13:57:05 +0200 Message-ID: <4CFE2110.8020108@freebsd.org> Date: Tue, 07 Dec 2010 13:57:04 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> In-Reply-To: <20101207115106.GB68479@muon.cran.org.uk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org, Alexander Motin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 11:57:10 -0000 on 07/12/2010 13:51 Bruce Cran said the following: > On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: >> Not necessary. Some places indeed may have some legacy requirements, >> for example, in theory MBR want partition to be aligned to "track >> boundary" (but I've seen many pre-formatted SD cards with MBR >> violating it to align partition to flash sector). Same time for BSD >> label I see no problem to align partitions any way we want. I also >> see no problems to make FAT cluster, UFS block/fragment, etc, to >> match some sizes. > >>From a new installation of Windows 7 and FreeBSD CURRENT: > > GEOM: ada0: partition 3 does not start on a track boundary. > GEOM: ada0: partition 3 does not end on a track boundary. > GEOM: ada0: partition 2 does not start on a track boundary. > GEOM: ada0: partition 2 does not end on a track bounary. > > Partition 2 is the reserved partition while 3 is an NTFS partition, both > created in the Windows setup application. > > Since Windows isn't bothering to align partitions do we still need to > warn about it? > No. And another reason is that modern drives do not actually report any CHS parameters, so I don't even know where we get them and how we (pretend to) know we track boundaries are. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:04:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 624C91065674; Tue, 7 Dec 2010 12:04:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5262A8FC13; Tue, 7 Dec 2010 12:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7C46aI065028; Tue, 7 Dec 2010 12:04:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7C46pd065026; Tue, 7 Dec 2010 12:04:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012071204.oB7C46pd065026@svn.freebsd.org> From: Andriy Gapon Date: Tue, 7 Dec 2010 12:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216252 - head/sys/cddl/dev/cyclic/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:04:06 -0000 Author: avg Date: Tue Dec 7 12:04:06 2010 New Revision: 216252 URL: http://svn.freebsd.org/changeset/base/216252 Log: opensolaris cyclic xcall: no need for special handling of curcpu smp_rendezvous_cpus already properly handles current CPU case and non-SMP case. MFC after: 3 weeks Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c ============================================================================== --- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Dec 7 09:19:47 2010 (r216251) +++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Dec 7 12:04:06 2010 (r216252) @@ -121,13 +121,7 @@ static void reprogram(cyb_arg_t arg, hrt static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) { - /* - * If the target CPU is the current one, just call the - * function. This covers the non-SMP case. - */ - if (c == &solaris_cpu[curcpu]) - (*func)(param); - else - smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL, - func, smp_no_rendevous_barrier, param); + + smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL, + func, smp_no_rendevous_barrier, param); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:17:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54D09106567A; Tue, 7 Dec 2010 12:17:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 441098FC23; Tue, 7 Dec 2010 12:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7CHidx065320; Tue, 7 Dec 2010 12:17:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7CHiA4065312; Tue, 7 Dec 2010 12:17:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012071217.oB7CHiA4065312@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Dec 2010 12:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216253 - in head/sys/amd64: amd64 ia32 include linux32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:17:44 -0000 Author: kib Date: Tue Dec 7 12:17:43 2010 New Revision: 216253 URL: http://svn.freebsd.org/changeset/base/216253 Log: Retire write-only PCB_FULLCTX pcb flag on amd64. Reminded by: Petr Salinger Tested by: pho MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/include/pcb.h head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/exception.S Tue Dec 7 12:17:43 2010 (r216253) @@ -380,7 +380,6 @@ IDTVEC(fast_syscall) movq %rsp,%rdi call syscall movq PCPU(CURPCB),%rax - andq $~PCB_FULLCTX,PCB_FLAGS(%rax) MEXITCOUNT jmp doreti Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/genassym.c Tue Dec 7 12:17:43 2010 (r216253) @@ -161,7 +161,6 @@ ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_32BIT, PCB_32BIT); ASSYM(PCB_GS32BIT, PCB_GS32BIT); -ASSYM(PCB_FULLCTX, PCB_FULLCTX); ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0)); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/machdep.c Tue Dec 7 12:17:43 2010 (r216253) @@ -492,7 +492,6 @@ sigreturn(td, uap) #endif kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } @@ -1908,7 +1907,6 @@ set_regs(struct thread *td, struct reg * tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; } - td->td_pcb->pcb_flags |= PCB_FULLCTX; return (0); } @@ -2095,7 +2093,6 @@ set_mcontext(struct thread *td, const mc td->td_pcb->pcb_fsbase = mcp->mc_fsbase; td->td_pcb->pcb_gsbase = mcp->mc_gsbase; } - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (0); } Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:17:43 2010 (r216253) @@ -347,7 +347,6 @@ cpu_set_syscall_retval(struct thread *td */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; - td->td_pcb->pcb_flags |= PCB_FULLCTX; break; case EJUSTRETURN: Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/ia32/ia32_signal.c Tue Dec 7 12:17:43 2010 (r216253) @@ -207,7 +207,6 @@ ia32_set_mcontext(struct thread *td, con tp->tf_rflags = rflags; tp->tf_rsp = mcp->mc_esp; tp->tf_ss = mcp->mc_ss; - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (0); } @@ -743,7 +742,7 @@ ia32_setregs(struct thread *td, struct i fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; td->td_pcb->pcb_full_iret = 1; td->td_retval[1] = 0; Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/include/pcb.h Tue Dec 7 12:17:43 2010 (r216253) @@ -73,7 +73,6 @@ struct pcb { #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ #define PCB_GS32BIT 0x20 /* linux gs switch */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ -#define PCB_FULLCTX 0x80 /* full context restore on sysret */ uint16_t pcb_initial_fpucw; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:17:43 2010 (r216253) @@ -870,7 +870,7 @@ exec_linux_setregs(struct thread *td, st fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; td->td_retval[1] = 0; } From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:24:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A021065675; Tue, 7 Dec 2010 12:24:49 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 859218FC19; Tue, 7 Dec 2010 12:24:48 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA00990; Tue, 07 Dec 2010 14:24:47 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PPwb8-000Gu2-UT; Tue, 07 Dec 2010 14:24:46 +0200 Message-ID: <4CFE278E.5060008@freebsd.org> Date: Tue, 07 Dec 2010 14:24:46 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Andriy Gapon References: <201012071204.oB7C46pd065026@svn.freebsd.org> In-Reply-To: <201012071204.oB7C46pd065026@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216252 - head/sys/cddl/dev/cyclic/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:24:49 -0000 on 07/12/2010 14:04 Andriy Gapon said the following: > Author: avg > Date: Tue Dec 7 12:04:06 2010 > New Revision: 216252 > URL: http://svn.freebsd.org/changeset/base/216252 > > Log: > opensolaris cyclic xcall: no need for special handling of curcpu > > smp_rendezvous_cpus already properly handles current CPU case > and non-SMP case. This could also lead to problems because a thread could be not pinned to its current CPU during direct (*func)(param) call. > MFC after: 3 weeks > > Modified: > head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c > > Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c > ============================================================================== > --- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Dec 7 09:19:47 2010 (r216251) > +++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Dec 7 12:04:06 2010 (r216252) > @@ -121,13 +121,7 @@ static void reprogram(cyb_arg_t arg, hrt > > static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) > { > - /* > - * If the target CPU is the current one, just call the > - * function. This covers the non-SMP case. > - */ > - if (c == &solaris_cpu[curcpu]) > - (*func)(param); > - else > - smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL, > - func, smp_no_rendevous_barrier, param); > + > + smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL, > + func, smp_no_rendevous_barrier, param); > } -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:25:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F7AC1065672; Tue, 7 Dec 2010 12:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E62B8FC19; Tue, 7 Dec 2010 12:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7CPREg065575; Tue, 7 Dec 2010 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7CPRg4065572; Tue, 7 Dec 2010 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012071225.oB7CPRg4065572@svn.freebsd.org> From: Andriy Gapon Date: Tue, 7 Dec 2010 12:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216254 - in head/sys/cddl: compat/opensolaris/sys dev/cyclic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:25:27 -0000 Author: avg Date: Tue Dec 7 12:25:26 2010 New Revision: 216254 URL: http://svn.freebsd.org/changeset/base/216254 Log: opensolaris cyclic: fix deadlock and make a little bit closer to upstream The dealock was caused in the following way: - thread T1 on CPU C1 holds a spin mutex, IPIs CPU C2 and waits for the IPI to be handled - C2 executes timer interrupt filter, thus has interrupts disabled, and gets blocked on the spin mutex held by T1 The problem seems to have been introduced by simplifications made to OpenSolaris code during porting. The problem is fixed by reorganizing the code to more closely resemble the upstream version. Interrupt filter (cyclic_fire) now doesn't acquire any locks, all per-CPU data accesses are performed on a target CPU with preemption and interrupts disabled thus precluding concurrent access to the data. cyp_mtx spin mutex is used to disable preemtion and interrupts; it's not used for classical mutual exclusion, because xcall already serializes calls to a CPU. It's an emulation of OpenSolaris cyb_set_level(CY_HIGH_LEVEL) call, the spin mutexes could probably be reduced to just a spinlock_enter()/_exit() pair. Diff with upstream version is now reduced by ~500 lines, however it still remains quite large - many things that are not needed (at the moment) or are irrelevant on FreeBSD were simply ripped out during porting. Examples of such things: - support for CPU onlining/offlining - support for suspend/resume - support for running callouts at soft interrupt levels - support for callout rebinding from CPU to CPU - support for CPU partitions Tested by: Artem Belevich MFC after: 3 weeks X-MFC with: r216252 Modified: head/sys/cddl/compat/opensolaris/sys/cyclic_impl.h head/sys/cddl/dev/cyclic/cyclic.c Modified: head/sys/cddl/compat/opensolaris/sys/cyclic_impl.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/cyclic_impl.h Tue Dec 7 12:17:43 2010 (r216253) +++ head/sys/cddl/compat/opensolaris/sys/cyclic_impl.h Tue Dec 7 12:25:26 2010 (r216254) @@ -288,7 +288,14 @@ typedef struct cyc_id { typedef struct cyc_xcallarg { cyc_cpu_t *cyx_cpu; - hrtime_t cyx_exp; + cyc_handler_t *cyx_hdlr; + cyc_time_t *cyx_when; + cyc_index_t cyx_ndx; + cyc_index_t *cyx_heap; + cyclic_t *cyx_cyclics; + cyc_index_t cyx_size; + uint16_t cyx_flags; + int cyx_wait; } cyc_xcallarg_t; #define CY_DEFAULT_PERCPU 1 Modified: head/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- head/sys/cddl/dev/cyclic/cyclic.c Tue Dec 7 12:17:43 2010 (r216253) +++ head/sys/cddl/dev/cyclic/cyclic.c Tue Dec 7 12:25:26 2010 (r216254) @@ -473,73 +473,6 @@ cyclic_expire(cyc_cpu_t *cpu, cyc_index_ (*handler)(arg); } -static void -cyclic_enable_xcall(void *v) -{ - cyc_xcallarg_t *argp = v; - cyc_cpu_t *cpu = argp->cyx_cpu; - cyc_backend_t *be = cpu->cyp_backend; - - be->cyb_enable(be->cyb_arg); -} - -static void -cyclic_enable(cyc_cpu_t *cpu) -{ - cyc_backend_t *be = cpu->cyp_backend; - cyc_xcallarg_t arg; - - arg.cyx_cpu = cpu; - - /* Cross call to the target CPU */ - be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_enable_xcall, &arg); -} - -static void -cyclic_disable_xcall(void *v) -{ - cyc_xcallarg_t *argp = v; - cyc_cpu_t *cpu = argp->cyx_cpu; - cyc_backend_t *be = cpu->cyp_backend; - - be->cyb_disable(be->cyb_arg); -} - -static void -cyclic_disable(cyc_cpu_t *cpu) -{ - cyc_backend_t *be = cpu->cyp_backend; - cyc_xcallarg_t arg; - - arg.cyx_cpu = cpu; - - /* Cross call to the target CPU */ - be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_disable_xcall, &arg); -} - -static void -cyclic_reprogram_xcall(void *v) -{ - cyc_xcallarg_t *argp = v; - cyc_cpu_t *cpu = argp->cyx_cpu; - cyc_backend_t *be = cpu->cyp_backend; - - be->cyb_reprogram(be->cyb_arg, argp->cyx_exp); -} - -static void -cyclic_reprogram(cyc_cpu_t *cpu, hrtime_t exp) -{ - cyc_backend_t *be = cpu->cyp_backend; - cyc_xcallarg_t arg; - - arg.cyx_cpu = cpu; - arg.cyx_exp = exp; - - /* Cross call to the target CPU */ - be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_reprogram_xcall, &arg); -} - /* * cyclic_fire(cpu_t *) * @@ -570,17 +503,15 @@ static void cyclic_fire(cpu_t *c) { cyc_cpu_t *cpu = c->cpu_cyclic; - - mtx_lock_spin(&cpu->cyp_mtx); - + cyc_backend_t *be = cpu->cyp_backend; cyc_index_t *heap = cpu->cyp_heap; cyclic_t *cyclic, *cyclics = cpu->cyp_cyclics; + void *arg = be->cyb_arg; hrtime_t now = gethrtime(); hrtime_t exp; if (cpu->cyp_nelems == 0) { /* This is a spurious fire. */ - mtx_unlock_spin(&cpu->cyp_mtx); return; } @@ -631,8 +562,45 @@ cyclic_fire(cpu_t *c) * Now we have a cyclic in the root slot which isn't in the past; * reprogram the interrupt source. */ - cyclic_reprogram(cpu, exp); + be->cyb_reprogram(arg, exp); +} + +static void +cyclic_expand_xcall(cyc_xcallarg_t *arg) +{ + cyc_cpu_t *cpu = arg->cyx_cpu; + cyc_index_t new_size = arg->cyx_size, size = cpu->cyp_size, i; + cyc_index_t *new_heap = arg->cyx_heap; + cyclic_t *cyclics = cpu->cyp_cyclics, *new_cyclics = arg->cyx_cyclics; + + /* Disable preemption and interrupts. */ + mtx_lock_spin(&cpu->cyp_mtx); + + /* + * Assert that the new size is a power of 2. + */ + ASSERT((new_size & (new_size - 1)) == 0); + ASSERT(new_size == (size << 1)); + ASSERT(cpu->cyp_heap != NULL && cpu->cyp_cyclics != NULL); + + bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * size); + bcopy(cyclics, new_cyclics, sizeof (cyclic_t) * size); + + /* + * Set up the free list, and set all of the new cyclics to be CYF_FREE. + */ + for (i = size; i < new_size; i++) { + new_heap[i] = i; + new_cyclics[i].cy_flags = CYF_FREE; + } + /* + * We can go ahead and plow the value of cyp_heap and cyp_cyclics; + * cyclic_expand() has kept a copy. + */ + cpu->cyp_heap = new_heap; + cpu->cyp_cyclics = new_cyclics; + cpu->cyp_size = new_size; mtx_unlock_spin(&cpu->cyp_mtx); } @@ -643,102 +611,70 @@ cyclic_fire(cpu_t *c) static void cyclic_expand(cyc_cpu_t *cpu) { - cyc_index_t new_size, old_size, i; + cyc_index_t new_size, old_size; cyc_index_t *new_heap, *old_heap; cyclic_t *new_cyclics, *old_cyclics; + cyc_xcallarg_t arg; + cyc_backend_t *be = cpu->cyp_backend; ASSERT(MUTEX_HELD(&cpu_lock)); - if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0) + old_heap = cpu->cyp_heap; + old_cyclics = cpu->cyp_cyclics; + + if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0) { new_size = CY_DEFAULT_PERCPU; + ASSERT(old_heap == NULL && old_cyclics == NULL); + } /* * Check that the new_size is a power of 2. */ ASSERT(((new_size - 1) & new_size) == 0); - /* Unlock the mutex while allocating memory so we can wait... */ - mtx_unlock_spin(&cpu->cyp_mtx); - new_heap = malloc(sizeof(cyc_index_t) * new_size, M_CYCLIC, M_WAITOK); new_cyclics = malloc(sizeof(cyclic_t) * new_size, M_CYCLIC, M_ZERO | M_WAITOK); - /* Grab the lock again now we've got the memory... */ - mtx_lock_spin(&cpu->cyp_mtx); - - /* Check if another thread beat us while the mutex was unlocked. */ - if (old_size != cpu->cyp_size) { - /* Oh well, he won. */ - mtx_unlock_spin(&cpu->cyp_mtx); - - free(new_heap, M_CYCLIC); - free(new_cyclics, M_CYCLIC); - - mtx_lock_spin(&cpu->cyp_mtx); - return; - } - - old_heap = cpu->cyp_heap; - old_cyclics = cpu->cyp_cyclics; - - bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * old_size); - bcopy(old_cyclics, new_cyclics, sizeof (cyclic_t) * old_size); - - /* - * Set up the free list, and set all of the new cyclics to be CYF_FREE. - */ - for (i = old_size; i < new_size; i++) { - new_heap[i] = i; - new_cyclics[i].cy_flags = CYF_FREE; - } + arg.cyx_cpu = cpu; + arg.cyx_heap = new_heap; + arg.cyx_cyclics = new_cyclics; + arg.cyx_size = new_size; - /* - * We can go ahead and plow the value of cyp_heap and cyp_cyclics; - * cyclic_expand() has kept a copy. - */ - cpu->cyp_heap = new_heap; - cpu->cyp_cyclics = new_cyclics; - cpu->cyp_size = new_size; + be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, + (cyc_func_t)cyclic_expand_xcall, &arg); if (old_cyclics != NULL) { ASSERT(old_heap != NULL); ASSERT(old_size != 0); - mtx_unlock_spin(&cpu->cyp_mtx); - free(old_cyclics, M_CYCLIC); free(old_heap, M_CYCLIC); - - mtx_lock_spin(&cpu->cyp_mtx); } } -static cyc_index_t -cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr, - cyc_time_t *when, uint16_t flags) +static void +cyclic_add_xcall(cyc_xcallarg_t *arg) { + cyc_cpu_t *cpu = arg->cyx_cpu; + cyc_handler_t *hdlr = arg->cyx_hdlr; + cyc_time_t *when = arg->cyx_when; + cyc_backend_t *be = cpu->cyp_backend; cyc_index_t ndx, nelems; + cyb_arg_t bar = be->cyb_arg; cyclic_t *cyclic; - ASSERT(MUTEX_HELD(&cpu_lock)); - - mtx_lock_spin(&cpu->cyp_mtx); - - ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE)); - ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0); - - while (cpu->cyp_nelems == cpu->cyp_size) - cyclic_expand(cpu); - ASSERT(cpu->cyp_nelems < cpu->cyp_size); + /* Disable preemption and interrupts. */ + mtx_lock_spin(&cpu->cyp_mtx); nelems = cpu->cyp_nelems++; - if (nelems == 0) + if (nelems == 0) { /* * If this is the first element, we need to enable the * backend on this CPU. */ - cyclic_enable(cpu); + be->cyb_enable(bar); + } ndx = cpu->cyp_heap[nelems]; cyclic = &cpu->cyp_cyclics[ndx]; @@ -746,14 +682,20 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand ASSERT(cyclic->cy_flags == CYF_FREE); cyclic->cy_interval = when->cyt_interval; - if (when->cyt_when == 0) - cyclic->cy_expire = gethrtime() + cyclic->cy_interval; - else + if (when->cyt_when == 0) { + /* + * If a start time hasn't been explicitly specified, we'll + * start on the next interval boundary. + */ + cyclic->cy_expire = (gethrtime() / cyclic->cy_interval + 1) * + cyclic->cy_interval; + } else { cyclic->cy_expire = when->cyt_when; + } cyclic->cy_handler = hdlr->cyh_func; cyclic->cy_arg = hdlr->cyh_arg; - cyclic->cy_flags = flags; + cyclic->cy_flags = arg->cyx_flags; if (cyclic_upheap(cpu, nelems)) { hrtime_t exp = cyclic->cy_expire; @@ -762,31 +704,63 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand * If our upheap propagated to the root, we need to * reprogram the interrupt source. */ - cyclic_reprogram(cpu, exp); + be->cyb_reprogram(bar, exp); } - mtx_unlock_spin(&cpu->cyp_mtx); - return (ndx); + arg->cyx_ndx = ndx; } - -static int -cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait) +static cyc_index_t +cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr, + cyc_time_t *when, uint16_t flags) { - cyc_index_t nelems, i; - cyclic_t *cyclic; - cyc_index_t *heap, last; + cyc_backend_t *be = cpu->cyp_backend; + cyb_arg_t bar = be->cyb_arg; + cyc_xcallarg_t arg; ASSERT(MUTEX_HELD(&cpu_lock)); - ASSERT(wait == CY_WAIT || wait == CY_NOWAIT); + ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE)); + ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0); - mtx_lock_spin(&cpu->cyp_mtx); + if (cpu->cyp_nelems == cpu->cyp_size) { + /* + * This is expensive; it will cross call onto the other + * CPU to perform the expansion. + */ + cyclic_expand(cpu); + ASSERT(cpu->cyp_nelems < cpu->cyp_size); + } + + /* + * By now, we know that we're going to be able to successfully + * perform the add. Now cross call over to the CPU of interest to + * actually add our cyclic. + */ + arg.cyx_cpu = cpu; + arg.cyx_hdlr = hdlr; + arg.cyx_when = when; + arg.cyx_flags = flags; + + be->cyb_xcall(bar, cpu->cyp_cpu, (cyc_func_t)cyclic_add_xcall, &arg); + + return (arg.cyx_ndx); +} - heap = cpu->cyp_heap; +static void +cyclic_remove_xcall(cyc_xcallarg_t *arg) +{ + cyc_cpu_t *cpu = arg->cyx_cpu; + cyc_backend_t *be = cpu->cyp_backend; + cyb_arg_t bar = be->cyb_arg; + cyc_index_t ndx = arg->cyx_ndx, nelems = cpu->cyp_nelems, i; + cyc_index_t *heap = cpu->cyp_heap, last; + cyclic_t *cyclic; - nelems = cpu->cyp_nelems; + ASSERT(nelems > 0); + /* Disable preemption and interrupts. */ + mtx_lock_spin(&cpu->cyp_mtx); cyclic = &cpu->cyp_cyclics[ndx]; /* @@ -794,11 +768,17 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i * removed as part of a juggling operation, the expiration time * will be used when the cyclic is added to the new CPU. */ - if (when != NULL) { - when->cyt_when = cyclic->cy_expire; - when->cyt_interval = cyclic->cy_interval; + if (arg->cyx_when != NULL) { + arg->cyx_when->cyt_when = cyclic->cy_expire; + arg->cyx_when->cyt_interval = cyclic->cy_interval; } + /* + * Now set the flags to CYF_FREE. We don't need a membar_enter() + * between zeroing pend and setting the flags because we're at + * CY_HIGH_LEVEL (that is, the zeroing of pend and the setting + * of cy_flags appear atomic to softints). + */ cyclic->cy_flags = CYF_FREE; for (i = 0; i < nelems; i++) { @@ -811,19 +791,21 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i cpu->cyp_nelems = --nelems; - if (nelems == 0) + if (nelems == 0) { /* * If we just removed the last element, then we need to * disable the backend on this CPU. */ - cyclic_disable(cpu); + be->cyb_disable(bar); + } - if (i == nelems) + if (i == nelems) { /* * If we just removed the last element of the heap, then * we don't have to downheap. */ - goto done; + goto out; + } /* * Swap the last element of the heap with the one we want to @@ -833,17 +815,18 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i heap[i] = (last = heap[nelems]); heap[nelems] = ndx; - if (i == 0) + if (i == 0) { cyclic_downheap(cpu, 0); - else { + } else { if (cyclic_upheap(cpu, i) == 0) { /* * The upheap didn't propagate to the root; if it * didn't propagate at all, we need to downheap. */ - if (heap[i] == last) + if (heap[i] == last) { cyclic_downheap(cpu, i); - goto done; + } + goto out; } } @@ -854,10 +837,27 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i cyclic = &cpu->cyp_cyclics[heap[0]]; ASSERT(nelems != 0); - cyclic_reprogram(cpu, cyclic->cy_expire); - -done: + be->cyb_reprogram(bar, cyclic->cy_expire); +out: mtx_unlock_spin(&cpu->cyp_mtx); +} + +static int +cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait) +{ + cyc_backend_t *be = cpu->cyp_backend; + cyc_xcallarg_t arg; + + ASSERT(MUTEX_HELD(&cpu_lock)); + ASSERT(wait == CY_WAIT || wait == CY_NOWAIT); + + arg.cyx_ndx = ndx; + arg.cyx_cpu = cpu; + arg.cyx_when = when; + arg.cyx_wait = wait; + + be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, + (cyc_func_t)cyclic_remove_xcall, &arg); return (1); } @@ -1214,15 +1214,10 @@ cyclic_add_omni(cyc_omni_handler_t *omni idp->cyi_omni_hdlr = *omni; - for (i = 0; i < MAXCPU; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { c = &solaris_cpu[i]; - if ((cpu = c->cpu_cyclic) == NULL) continue; - cyclic_omni_start(idp, cpu); } @@ -1325,12 +1320,8 @@ cyclic_mp_init(void) mutex_enter(&cpu_lock); - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { c = &solaris_cpu[i]; - if (c->cpu_cyclic == NULL) cyclic_configure(c); } @@ -1346,10 +1337,8 @@ cyclic_uninit(void) CPU_FOREACH(id) { c = &solaris_cpu[id]; - if (c->cpu_cyclic == NULL) continue; - cyclic_unconfigure(c); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:26:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CCF81065670 for ; Tue, 7 Dec 2010 12:26:57 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp03.sth.basefarm.net (ch-smtp03.sth.basefarm.net [80.76.149.214]) by mx1.freebsd.org (Postfix) with ESMTP id CB6C68FC17 for ; Tue, 7 Dec 2010 12:26:56 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:15487 helo=falcon.midgard.homeip.net) by ch-smtp03.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1PPwNo-0001Nd-CQ for svn-src-head@freebsd.org; Tue, 07 Dec 2010 13:11:02 +0100 Received: (qmail 58257 invoked from network); 7 Dec 2010 13:10:58 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 7 Dec 2010 13:10:58 +0100 Received: (qmail 53461 invoked by uid 1001); 7 Dec 2010 13:10:58 +0100 Date: Tue, 7 Dec 2010 13:10:58 +0100 From: Erik Trulsson To: Andriy Gapon Message-ID: <20101207121058.GA53449@owl.midgard.homeip.net> References: <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> <4CFE2110.8020108@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CFE2110.8020108@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1PPwNo-0001Nd-CQ. X-Scan-Signature: ch-smtp03.sth.basefarm.net 1PPwNo-0001Nd-CQ 8610b9dbc66e013ae099a496a16f5432 Cc: Bruce Cran , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org, Alexander Motin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:26:57 -0000 On Tue, Dec 07, 2010 at 01:57:04PM +0200, Andriy Gapon wrote: > on 07/12/2010 13:51 Bruce Cran said the following: > > On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: > >> Not necessary. Some places indeed may have some legacy requirements, > >> for example, in theory MBR want partition to be aligned to "track > >> boundary" (but I've seen many pre-formatted SD cards with MBR > >> violating it to align partition to flash sector). Same time for BSD > >> label I see no problem to align partitions any way we want. I also > >> see no problems to make FAT cluster, UFS block/fragment, etc, to > >> match some sizes. > > > >>From a new installation of Windows 7 and FreeBSD CURRENT: > > > > GEOM: ada0: partition 3 does not start on a track boundary. > > GEOM: ada0: partition 3 does not end on a track boundary. > > GEOM: ada0: partition 2 does not start on a track boundary. > > GEOM: ada0: partition 2 does not end on a track bounary. > > > > Partition 2 is the reserved partition while 3 is an NTFS partition, both > > created in the Windows setup application. > > > > Since Windows isn't bothering to align partitions do we still need to > > warn about it? > > > > No. > And another reason is that modern drives do not actually report any CHS > parameters, so I don't even know where we get them and how we (pretend to) know > we track boundaries are. Modern drives do actually report CHS parameters. The values reported rarely (if ever) have any relationship whatsoever to reality, but they are reported. I guess the reason for them still being reported is to satisfy old systems that do not undestand LBA and insist on getting CHS parameters. -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 12:44:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97F2D106564A; Tue, 7 Dec 2010 12:44:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2818FC23; Tue, 7 Dec 2010 12:44:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7CiXgP066048; Tue, 7 Dec 2010 12:44:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7CiXZA066044; Tue, 7 Dec 2010 12:44:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012071244.oB7CiXZA066044@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Dec 2010 12:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216255 - in head/sys/amd64: amd64 linux32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 12:44:33 -0000 Author: kib Date: Tue Dec 7 12:44:33 2010 New Revision: 216255 URL: http://svn.freebsd.org/changeset/base/216255 Log: Update some comments related to use of amd64 full context switch. In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Dec 7 12:25:26 2010 (r216254) +++ head/sys/amd64/amd64/machdep.c Tue Dec 7 12:44:33 2010 (r216255) @@ -1906,6 +1906,7 @@ set_regs(struct thread *td, struct reg * tp->tf_fs = regs->r_fs; tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; + td->td_pcb->pcb_full_iret = 1; } return (0); } Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:25:26 2010 (r216254) +++ head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:44:33 2010 (r216255) @@ -339,10 +339,9 @@ cpu_set_syscall_retval(struct thread *td * Reconstruct pc, we know that 'syscall' is 2 bytes, * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. * We saved this in tf_err. - * We have to do a full context restore so that %r10 - * (which was holding the value of %rcx) is restored + * %r10 (which was holding the value of %rcx) is restored * for the next iteration. - * r10 restore is only required for freebsd/amd64 processes, + * %r10 restore is only required for freebsd/amd64 processes, * but shall be innocent for any ia32 ABI. */ td->td_frame->tf_rip -= td->td_frame->tf_err; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:25:26 2010 (r216254) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:44:33 2010 (r216255) @@ -865,13 +865,13 @@ exec_linux_setregs(struct thread *td, st regs->tf_flags = TF_HASSEGS; regs->tf_cs = _ucode32sel; regs->tf_rbx = imgp->ps_strings; - td->td_pcb->pcb_full_iret = 1; load_cr0(rcr0() | CR0_MP | CR0_TS); fpstate_drop(td); - /* Return via doreti so that we can change to a different %cs */ + /* Do full restore on return so that we can change to a different %cs */ pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; + pcb->pcb_full_iret = 1; td->td_retval[1] = 0; } From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 13:04:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A531F106566B; Tue, 7 Dec 2010 13:04:28 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 873D38FC23; Tue, 7 Dec 2010 13:04:26 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA01648; Tue, 07 Dec 2010 15:04:21 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CFE30D5.5090605@freebsd.org> Date: Tue, 07 Dec 2010 15:04:21 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Erik Trulsson References: <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> <4CFE2110.8020108@freebsd.org> <20101207121058.GA53449@owl.midgard.homeip.net> In-Reply-To: <20101207121058.GA53449@owl.midgard.homeip.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org, Alexander Motin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 13:04:28 -0000 on 07/12/2010 14:10 Erik Trulsson said the following: > On Tue, Dec 07, 2010 at 01:57:04PM +0200, Andriy Gapon wrote: >> And another reason is that modern drives do not actually report any CHS >> parameters, so I don't even know where we get them and how we (pretend to) know >> we track boundaries are. > > Modern drives do actually report CHS parameters. The values reported Hmm, can you give me a reference? That is, a command, a byte, etc... > rarely (if ever) have any relationship whatsoever to reality, but they > are reported. That's without a doubt. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 13:41:12 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA6EA106564A; Tue, 7 Dec 2010 13:41:12 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEFD8FC18; Tue, 7 Dec 2010 13:41:11 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oB7DfAI5081854; Tue, 7 Dec 2010 14:41:10 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oB7DfAtB081853; Tue, 7 Dec 2010 14:41:10 +0100 (CET) (envelope-from marius) Date: Tue, 7 Dec 2010 14:41:09 +0100 From: Marius Strobl To: mdf@FreeBSD.org Message-ID: <20101207134109.GI38282@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> <4CF7D711.9040505@rice.edu> <20101206220733.GG38282@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: src-committers@FreeBSD.org, Alan Cox , alc@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 13:41:12 -0000 On Mon, Dec 06, 2010 at 02:30:01PM -0800, mdf@FreeBSD.org wrote: > On Mon, Dec 6, 2010 at 2:07 PM, Marius Strobl wrote: > [lots of snip] > > > With that one the kernel now survies memguard_init() but then panics > > right afterwards when kmeminit() calls kmem_suballoc(): > > KDB: debugger backends: ddb > > KDB: current backend: ddb > > Copyright (c) 1992-2010 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > ? ? ? ?The Regents of the University of California. All rights reserved. > > FreeBSD is a registered trademark of The FreeBSD Foundation. > > FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec ?6 13:27:57 CET 2010 > > ? ?marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 > > WARNING: WITNESS option enabled, expect reduced performance. > > panic: kmem_suballoc: bad status return of 3 > > [more snip] > > Shooting in the dark a little... > > The bad status of 3 is presumably KERN_NO_SPACE because we attempted > to allocate too much space from the kernel_map. What are the actual > values of vm_kmem_size, kernel_map->min_offset, kernel_map->max_offset > at panic time? vm_kmem_size=5610405888 min_offset=3221225472 max_offset=13958643712 This is on a US3i machine with 16GB RAM. > How much virtual space does sparc64 support (since > earlier it was reported it's computed based on hardware capability, > for this specific machine?) > Currently, the limiting factor is that the kernel TSB is addressed virtually, which means that the TTEs for kernel TSB itself have to be put into locked dTLB slots taking up 1 4MB dTLB slot per 1GB. US3 family CPUs have 16 lockable 4MB dTLB and iTLB slots, which need to be shared between the TSB and the kernel itself though, i.e. a 9MB kernel also takes up 3 slots (US1/2 machines have 64 dTLB and iTLB slots but there these are also used for unlocked TTEs so we don't use more than 32 for kernel plus TSB on these). VM_MAX_KERNEL_ADDRESS is limited according to how many slots are available for the TSB, that's what I was referring to previously. Actually, US3 and later as well as SPARC64 V and later CPUs have a feature allowing the TSB to be addressed physically, circumventing the need to lock the TSB into the TLB, thus allowing the full 64-bit virtual address space to be used. Implementing that is on my TODO list but unfortunately that's not exactly straight forward and also requires some instructions to be patched at runtime so the kernel still works on US1/2 machines. Marius From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 14:01:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FED1065674; Tue, 7 Dec 2010 14:01:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1F95F8FC14; Tue, 7 Dec 2010 14:01:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oB7DtFs8046766; Tue, 7 Dec 2010 06:55:15 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 07 Dec 2010 06:55:15 -0700 (MST) Message-Id: <20101207.065515.41680033.imp@bsdimp.com> To: bruce@cran.org.uk From: Warner Losh In-Reply-To: <20101207115106.GB68479@muon.cran.org.uk> References: <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, pjd@FreeBSD.org, jhb@FreeBSD.org, mav@FreeBSD.org, ivoras@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 14:01:46 -0000 From: Bruce Cran Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Tue, 7 Dec 2010 11:51:06 +0000 > On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: > > Not necessary. Some places indeed may have some legacy requirements, > > for example, in theory MBR want partition to be aligned to "track > > boundary" (but I've seen many pre-formatted SD cards with MBR > > violating it to align partition to flash sector). Same time for BSD > > label I see no problem to align partitions any way we want. I also > > see no problems to make FAT cluster, UFS block/fragment, etc, to > > match some sizes. > > From a new installation of Windows 7 and FreeBSD CURRENT: > > GEOM: ada0: partition 3 does not start on a track boundary. > GEOM: ada0: partition 3 does not end on a track boundary. > GEOM: ada0: partition 2 does not start on a track boundary. > GEOM: ada0: partition 2 does not end on a track bounary. > > Partition 2 is the reserved partition while 3 is an NTFS partition, both > created in the Windows setup application. > > Since Windows isn't bothering to align partitions do we still need to > warn about it? The geom warnings are totally bogus, and no conclusion about anything can be drawn from them other than the disk partitions don't match the *FAKE* geometry cam creates for the disk. Warner From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 14:01:57 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43BA010656B2; Tue, 7 Dec 2010 14:01:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D7EB48FC21; Tue, 7 Dec 2010 14:01:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oB7DvpuP046774; Tue, 7 Dec 2010 06:57:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 07 Dec 2010 06:57:51 -0700 (MST) Message-Id: <20101207.065751.71135474.imp@bsdimp.com> To: ertr1013@student.uu.se From: Warner Losh In-Reply-To: <20101207121058.GA53449@owl.midgard.homeip.net> References: <20101207115106.GB68479@muon.cran.org.uk> <4CFE2110.8020108@freebsd.org> <20101207121058.GA53449@owl.midgard.homeip.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 07 Dec 2010 15:09:02 +0000 Cc: bruce@cran.org.uk, src-committers@FreeBSD.org, pjd@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, ivoras@FreeBSD.org, svn-src-head@FreeBSD.org, mav@FreeBSD.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 14:01:57 -0000 From: Erik Trulsson Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Tue, 7 Dec 2010 13:10:58 +0100 > On Tue, Dec 07, 2010 at 01:57:04PM +0200, Andriy Gapon wrote: > > on 07/12/2010 13:51 Bruce Cran said the following: > > > On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: > > >> Not necessary. Some places indeed may have some legacy requirements, > > >> for example, in theory MBR want partition to be aligned to "track > > >> boundary" (but I've seen many pre-formatted SD cards with MBR > > >> violating it to align partition to flash sector). Same time for BSD > > >> label I see no problem to align partitions any way we want. I also > > >> see no problems to make FAT cluster, UFS block/fragment, etc, to > > >> match some sizes. > > > > > >>From a new installation of Windows 7 and FreeBSD CURRENT: > > > > > > GEOM: ada0: partition 3 does not start on a track boundary. > > > GEOM: ada0: partition 3 does not end on a track boundary. > > > GEOM: ada0: partition 2 does not start on a track boundary. > > > GEOM: ada0: partition 2 does not end on a track bounary. > > > > > > Partition 2 is the reserved partition while 3 is an NTFS partition, both > > > created in the Windows setup application. > > > > > > Since Windows isn't bothering to align partitions do we still need to > > > warn about it? > > > > > > > No. > > And another reason is that modern drives do not actually report any CHS > > parameters, so I don't even know where we get them and how we (pretend to) know > > we track boundaries are. > > Modern drives do actually report CHS parameters. The values reported > rarely (if ever) have any relationship whatsoever to reality, but they > are reported. I guess the reason for them still being reported is to > satisfy old systems that do not undestand LBA and insist on getting CHS > parameters. And even if the CHS parameters are reported, they are molested at many layers so cannot be trusted at all. CF Cards will report one thing if attached via usb adapters and another thing if attached directly to a pata bus, for example. Sometimes this is software (cam lying), other times this is hardware (usb adapter lying). Warner From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 15:24:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDAF3106564A; Tue, 7 Dec 2010 15:24:08 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6528FC17; Tue, 7 Dec 2010 15:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7FO8LI071273; Tue, 7 Dec 2010 15:24:08 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7FO8KC071271; Tue, 7 Dec 2010 15:24:08 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201012071524.oB7FO8KC071271@svn.freebsd.org> From: Ivan Voras Date: Tue, 7 Dec 2010 15:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216256 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 15:24:09 -0000 Author: ivoras Date: Tue Dec 7 15:24:08 2010 New Revision: 216256 URL: http://svn.freebsd.org/changeset/base/216256 Log: Undo r216230: the interaction between saved ashift in metadata and detected ashift does not support this. With this change, pools created while stripesize=512 could not be imported when stripesize becomes larger (on the same drive). Noticed by: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 7 12:44:33 2010 (r216255) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 7 15:24:08 2010 (r216256) @@ -496,10 +496,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi /* * Determine the device's minimum transfer size. */ - if (pp->stripesize > pp->sectorsize) - *ashift = highbit(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; - else - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; /* * Clear the nowritecache bit, so that on a vdev_reopen() we will From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 16:30:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537A11065673; Tue, 7 Dec 2010 16:30:53 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 438EE8FC18; Tue, 7 Dec 2010 16:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7GUrWZ073189; Tue, 7 Dec 2010 16:30:53 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7GUr92073186; Tue, 7 Dec 2010 16:30:53 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201012071630.oB7GUr92073186@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 7 Dec 2010 16:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216257 - head/usr.sbin/fifolog/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 16:30:53 -0000 Author: phk Date: Tue Dec 7 16:30:52 2010 New Revision: 216257 URL: http://svn.freebsd.org/changeset/base/216257 Log: Use a "push" strategy to get data through libz, rather than a "pull" strategy. Modified: head/usr.sbin/fifolog/lib/fifolog_write.h head/usr.sbin/fifolog/lib/fifolog_write_poll.c Modified: head/usr.sbin/fifolog/lib/fifolog_write.h ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write.h Tue Dec 7 15:24:08 2010 (r216256) +++ head/usr.sbin/fifolog/lib/fifolog_write.h Tue Dec 7 16:30:52 2010 (r216257) @@ -44,8 +44,6 @@ struct fifolog_writer { unsigned syncrate; unsigned compression; - unsigned writes_since_sync; - int cleanup; intmax_t cnt[FIFOLOG_NPOINT]; @@ -55,9 +53,11 @@ struct fifolog_writer { int flag; time_t last; + u_int obufsize; + u_char *obuf; + u_int ibufsize; u_char *ibuf; - u_char *iptr; time_t starttime; time_t lastwrite; Modified: head/usr.sbin/fifolog/lib/fifolog_write_poll.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write_poll.c Tue Dec 7 15:24:08 2010 (r216256) +++ head/usr.sbin/fifolog/lib/fifolog_write_poll.c Tue Dec 7 16:30:52 2010 (r216257) @@ -33,6 +33,9 @@ #include #include #include +#if 0 +#include +#endif #include @@ -65,9 +68,8 @@ fifolog_write_assert(const struct fifolo { CHECK_OBJ_NOTNULL(f, FIFOLOG_WRITER_MAGIC); - assert(f->iptr == f->ff->zs->next_in + f->ff->zs->avail_in); assert(f->ff->zs->next_out + f->ff->zs->avail_out == \ - f->ff->recbuf + f->ff->recsize); + f->obuf + f->obufsize); } struct fifolog_writer * @@ -75,8 +77,8 @@ fifolog_write_new(void) { struct fifolog_writer *f; - ALLOC(&f, sizeof *f); - f->magic = FIFOLOG_WRITER_MAGIC; + ALLOC_OBJ(f, FIFOLOG_WRITER_MAGIC); + assert(f != NULL); return (f); } @@ -94,36 +96,11 @@ fifolog_write_close(struct fifolog_write CHECK_OBJ_NOTNULL(f, FIFOLOG_WRITER_MAGIC); fifolog_int_close(&f->ff); free(f->ff); - if (f->ibuf != NULL) - free(f->ibuf); + if (f->obuf != NULL) + free(f->obuf); free(f); } -static void -fifo_prepobuf(struct fifolog_writer *f, time_t now, int flag) -{ - - memset(f->ff->recbuf, 0, f->ff->recsize); - f->ff->zs->next_out = f->ff->recbuf + 5; - f->ff->zs->avail_out = f->ff->recsize - 5; - if (f->recno == 0 && f->seq == 0) { - srandomdev(); - do { - f->seq = random(); - } while (f->seq == 0); - } - be32enc(f->ff->recbuf, f->seq++); - f->ff->recbuf[4] = f->flag; - f->flag = 0; - if (flag) { - f->ff->recbuf[4] |= FIFOLOG_FLG_SYNC; - be32enc(f->ff->recbuf + 5, (u_int)now); - f->ff->zs->next_out += 4; - f->ff->zs->avail_out -= 4; - } - fifolog_write_assert(f); -} - const char * fifolog_write_open(struct fifolog_writer *f, const char *fn, unsigned writerate, unsigned syncrate, int compression) { @@ -164,144 +141,154 @@ fifolog_write_open(struct fifolog_writer f->seq++; } - f->ibufsize = 32768; - ALLOC(&f->ibuf, f->ibufsize); - f->iptr = f->ibuf; - f->ff->zs->next_in = f->iptr; + f->obufsize = f->ff->recsize; + ALLOC(&f->obuf, f->obufsize); + i = deflateInit(f->ff->zs, (int)f->compression); assert(i == Z_OK); f->flag |= FIFOLOG_FLG_RESTART; + f->flag |= FIFOLOG_FLG_SYNC; + f->ff->zs->next_out = f->obuf + 9; + f->ff->zs->avail_out = f->obufsize - 9; time(&now); - fifo_prepobuf(f, now, 1); f->starttime = now; + f->lastsync = now; + f->lastwrite = now; fifolog_write_assert(f); return (NULL); } -static void -fifo_writerec(struct fifolog_writer *f) +static int +fifolog_write_output(struct fifolog_writer *f, int fl, time_t now) { - int i; - time_t t; + long h, l = f->ff->zs->next_out - f->obuf; + int i, w; - fifolog_write_assert(f); - f->writes_since_sync++; + h = 4; /* seq */ + be32enc(f->obuf, f->seq); + f->obuf[h] = f->flag; + h += 1; /* flag */ + if (f->flag & FIFOLOG_FLG_SYNC) { + be32enc(f->obuf + h, now); + h += 4; /* timestamp */ + } - assert(f->recno < f->ff->logsize); - f->cnt[FIFOLOG_PT_BYTES_POST] += f->ff->recsize - f->ff->zs->avail_out; - if (f->ff->zs->avail_out == 0) { - /* nothing */ - } else if (f->ff->zs->avail_out <= 255) { - f->ff->recbuf[f->ff->recsize - 1] = - (u_char)f->ff->zs->avail_out; - f->ff->recbuf[4] |= FIFOLOG_FLG_1BYTE; - } else { - be32enc(f->ff->recbuf + f->ff->recsize - 4, - f->ff->zs->avail_out); - f->ff->recbuf[4] |= FIFOLOG_FLG_4BYTE; + assert(l <= (long)f->ff->recsize); + assert(l >= h); + if (l == h) + return (0); + + + if (h + l < (long)f->ff->recsize && fl == Z_NO_FLUSH) + return (0); + + w = f->ff->recsize - l; + if (w > 255) { + be32enc(f->obuf + f->ff->recsize - 4, w); + f->obuf[4] |= FIFOLOG_FLG_4BYTE; + } else if (w > 0) { + f->obuf[f->ff->recsize - 1] = w; + f->obuf[4] |= FIFOLOG_FLG_1BYTE; } - i = pwrite(f->ff->fd, f->ff->recbuf, f->ff->recsize, - (f->recno + 1) * f->ff->recsize); - assert (i == (int)f->ff->recsize); - if (++f->recno == f->ff->logsize) - f->recno = 0; + + f->cnt[FIFOLOG_PT_BYTES_POST] += w; + +#ifdef DBG +fprintf(stderr, "W: fl=%d h=%ld l=%ld w=%d recno=%jd fx %02x\n", + fl, h, l, w, f->recno, f->obuf[4]); +#endif + + i = pwrite(f->ff->fd, f->obuf, f->ff->recsize, + (f->recno + 1) * f->ff->recsize); + assert(i == (int)f->ff->recsize); + f->cnt[FIFOLOG_PT_WRITES]++; - time(&t); - f->cnt[FIFOLOG_PT_RUNTIME] = t - f->starttime; /*lint !e776 */ - fifolog_write_assert(f); + + f->lastwrite = now; + f->seq++; + f->recno++; +#ifdef DBG +if (f->flag) +fprintf(stderr, "SYNC- %d\n", __LINE__); +#endif + f->flag = 0; + + memset(f->obuf, 0, f->obufsize); + f->ff->zs->next_out = f->obuf + 5; + f->ff->zs->avail_out = f->obufsize - 5; + return (1); } -int -fifolog_write_poll(struct fifolog_writer *f, time_t now) +static void +fifolog_write_gzip(struct fifolog_writer *f, const void *p, int len, time_t now, int fin) { - int i, fl, bo, bf; + int i, fl; - if (now == 0) - time(&now); + f->cnt[FIFOLOG_PT_BYTES_PRE] += len; - fifolog_write_assert(f); - if (f->cleanup || now >= (int)(f->lastsync + f->syncrate)) { - /* - * We always check the sync timer, otherwise a flood of data - * would not get any sync records at all - */ + if (fin == 0) + fl = Z_NO_FLUSH; + else if (f->cleanup || now >= (int)(f->lastsync + f->syncrate)) { f->cleanup = 0; fl = Z_FINISH; - f->lastsync = now; - f->lastwrite = now; f->cnt[FIFOLOG_PT_SYNC]++; - } else if (f->ff->zs->avail_in == 0 && - now >= (int)(f->lastwrite + f->writerate)) { - /* - * We only check for writerate timeouts when the input - * buffer is empty. It would be silly to force a write if - * pending input could cause it to happen on its own. - */ + } else if (now >= (int)(f->lastwrite + f->writerate)) { fl = Z_SYNC_FLUSH; - f->lastwrite = now; f->cnt[FIFOLOG_PT_FLUSH]++; - } else if (f->ff->zs->avail_in == 0) - return (0); /* nothing to do */ + } else if (p == NULL) + return; else fl = Z_NO_FLUSH; - for (;;) { - assert(f->ff->zs->avail_out > 0); - - bf = f->ff->zs->avail_out; + f->ff->zs->avail_in = len; + f->ff->zs->next_in = (void*)(uintptr_t)p; +#ifdef DBG +if (fl != Z_NO_FLUSH) +fprintf(stderr, "Z len %3d fin %d now %ld fl %d ai %u ao %u\n", + len, fin, now, fl, + f->ff->zs->avail_in, + f->ff->zs->avail_out); +#endif + while (1) { i = deflate(f->ff->zs, fl); - assert (i == Z_OK || i == Z_BUF_ERROR || i == Z_STREAM_END); - bo = f->ff->zs->avail_out; +#ifdef DBG +if (i || f->ff->zs->avail_in) +fprintf(stderr, "fl = %d, i = %d ai = %u ao = %u fx=%02x\n", fl, i, + f->ff->zs->avail_in, + f->ff->zs->avail_out, f->flag); +#endif - /* If we have output space and not in a hurry.. */ - if (bo > 0 && fl == Z_NO_FLUSH) - break; - - /* Write output buffer, if anything in it */ - if (bo != bf) - fifo_writerec(f); - - /* If the buffer were full, we need to check again */ - if (bo == 0) { - fifo_prepobuf(f, now, 0); - continue; - } + assert(i == Z_OK || i == Z_BUF_ERROR || i == Z_STREAM_END); + assert(f->ff->zs->avail_in == 0); - if (fl == Z_FINISH) { - /* Make next record a SYNC record */ - fifo_prepobuf(f, now, 1); - /* And reset the zlib engine */ - i = deflateReset(f->ff->zs); - assert(i == Z_OK); - f->writes_since_sync = 0; - } else { - fifo_prepobuf(f, now, 0); - } - break; + if (!fifolog_write_output(f, fl, now)) + break; } - - if (f->ff->zs->avail_in == 0) { - /* Reset input buffer when empty */ - f->iptr = f->ibuf; - f->ff->zs->next_in = f->iptr; + assert(f->ff->zs->avail_in == 0); + if (fl == Z_FINISH) { + f->flag |= FIFOLOG_FLG_SYNC; + f->ff->zs->next_out = f->obuf + 9; + f->ff->zs->avail_out = f->obufsize - 9; + f->lastsync = now; +#ifdef DBG +fprintf(stderr, "SYNC %d\n", __LINE__); +#endif + assert(Z_OK == deflateReset(f->ff->zs)); } - - fifolog_write_assert(f); - return (1); } -static void -fifolog_acct(struct fifolog_writer *f, unsigned bytes) +int +fifolog_write_poll(struct fifolog_writer *f, time_t now) { - - f->ff->zs->avail_in += bytes; - f->iptr += bytes; - f->cnt[FIFOLOG_PT_BYTES_PRE] += bytes; + if (now == 0) + time(&now); + fifolog_write_gzip(f, NULL, 0, now, 1); + return (0); } /* @@ -312,8 +299,8 @@ fifolog_acct(struct fifolog_writer *f, u int fifolog_write_bytes(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, unsigned len) { - u_int l; const unsigned char *p; + uint8_t buf[4]; fifolog_write_assert(f); assert(!(id & (FIFOLOG_TIMESTAMP|FIFOLOG_LENGTH))); @@ -322,46 +309,45 @@ fifolog_write_bytes(struct fifolog_write p = ptr; if (len == 0) { len = strlen(ptr) + 1; - l = 4 + len; /* id */ } else { assert(len <= 255); id |= FIFOLOG_LENGTH; - l = 5 + len; /* id + len */ } - l += 4; /* A timestamp may be necessary */ - /* Now do timestamp, if needed */ if (now == 0) time(&now); - assert(l < f->ibufsize); - - /* Return if there is not enough space */ - if (f->iptr + l > f->ibuf + f->ibufsize) - return (0); - if (now != f->last) { id |= FIFOLOG_TIMESTAMP; f->last = now; } - /* Emit instance+flag and length */ - be32enc(f->iptr, id); - fifolog_acct(f, 4); + /* Emit instance+flag */ + be32enc(buf, id); + fifolog_write_gzip(f, buf, 4, now, 0); if (id & FIFOLOG_TIMESTAMP) { - be32enc(f->iptr, (uint32_t)f->last); - fifolog_acct(f, 4); + be32enc(buf, (uint32_t)f->last); + fifolog_write_gzip(f, buf, 4, now, 0); } if (id & FIFOLOG_LENGTH) { - f->iptr[0] = (u_char)len; - fifolog_acct(f, 1); + buf[0] = (u_char)len; + fifolog_write_gzip(f, buf, 1, now, 0); } assert (len > 0); - memcpy(f->iptr, p, len); - fifolog_acct(f, len); +#if 1 + if (len > f->ibufsize) { + free(f->ibuf); + f->ibufsize = len; + ALLOC(&f->ibuf, f->ibufsize); + } + memcpy(f->ibuf, p, len); + fifolog_write_gzip(f, f->ibuf, len, now, 1); +#else + fifolog_write_gzip(f, p, len, now, 1); +#endif fifolog_write_assert(f); return (1); } @@ -384,7 +370,6 @@ fifolog_write_bytes_poll(struct fifolog_ if (len == 0) { while (!fifolog_write_bytes(f, id, now, ptr, len)) { - (void)fifolog_write_poll(f, now); (void)usleep(10000); } } else { @@ -394,7 +379,6 @@ fifolog_write_bytes_poll(struct fifolog_ if (l > 255) l = 255; while (!fifolog_write_bytes(f, id, now, p, l)) { - (void)fifolog_write_poll(f, now); (void)usleep(10000); } } From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 16:48:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C14D1065670; Tue, 7 Dec 2010 16:48:02 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8978FC16; Tue, 7 Dec 2010 16:48:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7Gm2tM074109; Tue, 7 Dec 2010 16:48:02 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7Gm2xj074105; Tue, 7 Dec 2010 16:48:02 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201012071648.oB7Gm2xj074105@svn.freebsd.org> From: Tim Kientzle Date: Tue, 7 Dec 2010 16:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216258 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 16:48:02 -0000 Author: kientzle Date: Tue Dec 7 16:48:01 2010 New Revision: 216258 URL: http://svn.freebsd.org/changeset/base/216258 Log: Don't write data into an empty "file." In particular, this check avoids a warning when extracting directory entries from certain GNU tar archives that store directory contents. MFC after: 3 days Modified: head/lib/libarchive/archive_read_extract.c head/lib/libarchive/test/Makefile head/lib/libarchive/test/test_acl_freebsd.c Modified: head/lib/libarchive/archive_read_extract.c ============================================================================== --- head/lib/libarchive/archive_read_extract.c Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/archive_read_extract.c Tue Dec 7 16:48:01 2010 (r216258) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" #include "archive_private.h" #include "archive_read_private.h" #include "archive_write_disk_private.h" @@ -107,7 +108,7 @@ archive_read_extract2(struct archive *_a if (r != ARCHIVE_OK) /* If _write_header failed, copy the error. */ archive_copy_error(&a->archive, ad); - else + else if (archive_entry_size(entry) > 0) /* Otherwise, pour data into the entry. */ r = copy_data(_a, ad); r2 = archive_write_finish_entry(ad); Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/test/Makefile Tue Dec 7 16:48:01 2010 (r216258) @@ -2,10 +2,6 @@ # Where to find the libarchive sources LA_SRCDIR=${.CURDIR}/.. -.PATH: ${LA_SRCDIR} - -# Get a list of all libarchive source files -LA_SRCS!=make -f ${LA_SRCDIR}/Makefile -V SRCS TESTS= \ test_acl_basic.c \ @@ -113,8 +109,8 @@ TESTS= \ test_write_open_memory.c -# Build the test program using all libarchive sources + the test sources. -SRCS= ${LA_SRCS} \ +# Build the test program. +SRCS= \ ${TESTS} \ list.h \ main.c \ @@ -125,14 +121,11 @@ NO_MAN=yes PROG=libarchive_test INTERNALPROG=yes # Don't install this; it's just for testing DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML} -CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" -LDADD= -lz -lbz2 -lmd -lcrypto -lbsdxml +LDADD= -L ${.OBJDIR}/.. -larchive +LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml CFLAGS+= -g CFLAGS+= -I${LA_SRCDIR} -I. - -# Uncomment to build and test lzma and xz support via liblzma -#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -#LDADD+= -L/usr/local/lib -llzma +CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc Modified: head/lib/libarchive/test/test_acl_freebsd.c ============================================================================== --- head/lib/libarchive/test/test_acl_freebsd.c Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/test/test_acl_freebsd.c Tue Dec 7 16:48:01 2010 (r216258) @@ -220,6 +220,11 @@ DEFINE_TEST(test_acl_freebsd) skipping("ACL tests require that ACL support be enabled on the filesystem"); return; } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("POSIX.1e ACL tests require that POSIX.1e ACL support be enabled on the filesystem"); + return; + } failure("acl_set_fd(): errno = %d (%s)", errno, strerror(errno)); assertEqualInt(0, n); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 18:49:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A241065675; Tue, 7 Dec 2010 18:49:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F34E8FC1B; Tue, 7 Dec 2010 18:49:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7InBag076964; Tue, 7 Dec 2010 18:49:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7InB4J076962; Tue, 7 Dec 2010 18:49:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012071849.oB7InB4J076962@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Dec 2010 18:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216263 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 18:49:11 -0000 Author: jhb Date: Tue Dec 7 18:49:11 2010 New Revision: 216263 URL: http://svn.freebsd.org/changeset/base/216263 Log: Use proper resource ID's for HPET IRQ resources. This mostly consists of looking to see if there is an existing IRQ resource for a given IRQ provided by the BIOS and using that RID if so. Otherwise, allocate a new RID for the new IRQ. Reviewed by: mav (a while ago) Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Dec 7 18:15:18 2010 (r216262) +++ head/sys/dev/acpica/acpi_hpet.c Tue Dec 7 18:49:11 2010 (r216263) @@ -303,6 +303,23 @@ hpet_find(ACPI_HANDLE handle, UINT32 lev return (AE_OK); } +/* + * Find an existing IRQ resource that matches the requested IRQ range + * and return its RID. If one is not found, use a new RID. + */ +static int +hpet_find_irq_rid(device_t dev, u_long start, u_long end) +{ + u_long irq; + int error, rid; + + for (rid = 0;; rid++) { + error = bus_get_resource(dev, SYS_RES_IRQ, rid, &irq, NULL); + if (error != 0 || (start <= irq && irq <= end)) + return (rid); + } +} + /* Discover the HPET via the ACPI table of the same name. */ static void hpet_identify(driver_t *driver, device_t parent) @@ -540,6 +557,7 @@ hpet_attach(device_t dev) dvectors &= ~(1 << t->irq); } if (t->irq >= 0) { + t->intr_rid = hpet_find_irq_rid(dev, t->irq, t->irq); if (!(t->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &t->intr_rid, t->irq, t->irq, 1, RF_ACTIVE))) { @@ -590,12 +608,12 @@ hpet_attach(device_t dev) } bus_write_4(sc->mem_res, HPET_ISR, 0xffffffff); sc->irq = -1; - sc->intr_rid = -1; /* If at least one timer needs legacy IRQ - set it up. */ if (sc->useirq) { j = i = fls(cvectors) - 1; while (j > 0 && (cvectors & (1 << (j - 1))) != 0) j--; + sc->intr_rid = hpet_find_irq_rid(dev, j, i); if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, j, i, 1, RF_SHAREABLE | RF_ACTIVE))) device_printf(dev,"Can't map interrupt.\n"); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 19:18:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C235106566B; Tue, 7 Dec 2010 19:18:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BBCB8FC0C; Tue, 7 Dec 2010 19:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7JI1mT077676; Tue, 7 Dec 2010 19:18:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7JI0lZ077674; Tue, 7 Dec 2010 19:18:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201012071918.oB7JI0lZ077674@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Dec 2010 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216266 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 19:18:01 -0000 Author: emaste Date: Tue Dec 7 19:18:00 2010 New Revision: 216266 URL: http://svn.freebsd.org/changeset/base/216266 Log: Add a comment to clarify that some BIOSes may clear the hw watchdog indicator bit, preventing us from reporting in that case. X-MFC-with: r215868 Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Tue Dec 7 19:15:33 2010 (r216265) +++ head/sys/dev/ichwd/ichwd.c Tue Dec 7 19:18:00 2010 (r216266) @@ -520,8 +520,9 @@ ichwd_attach(device_t dev) device_get_desc(dev), sc->ich_version); /* - * Determine if we are coming up after a watchdog-induced reset. - * This bit is cleared in ichwd_sts_reset(). + * Determine if we are coming up after a watchdog-induced reset. Some + * BIOSes may clear this bit at bootup, preventing us from reporting + * this case on such systems. We clear this bit in ichwd_sts_reset(). */ if ((ichwd_read_tco_2(sc, TCO2_STS) & TCO_SECOND_TO_STS) != 0) device_printf(dev, From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 19:33:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16D91065672; Tue, 7 Dec 2010 19:33:22 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by mx1.freebsd.org (Postfix) with ESMTP id 37D4C8FC0C; Tue, 7 Dec 2010 19:33:21 +0000 (UTC) Received: by iwn40 with SMTP id 40so254137iwn.17 for ; Tue, 07 Dec 2010 11:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=Z+6vkuDXyyqHaAe7lt/S9d1Oy9uPvTj2ESzvAS8IAbc=; b=elYsjK/gZ+gSg+sl7g5D1cFGUuc2qsJJDYodcYmZdRZNY2WrwTjHsb2pEYxKCsivHr MLp8B3FB42YtPJg6VMjydwORem7zif9j5h/0oCpU+/8tOOX9Yd2kfH6LJVPINQ1tnWQa 375xJRoJT+L/97Qyf7t9CwArkAq9PWePQ54lA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=L2QpRb5j1jaP/Gid8fd9zUNK7v8xtX8XYChM9AeXWtkohE0h7h7sB+tHSJ2sgXxs2m DZqPsSEPQvDhDvjpFDKtE2DOwrNKpDCzv2x56EeZcXa8qsCz0yHff+AvLJzvhs4sciWG bK+z8KqmOrnVTKP21jbSGNe0k5WL0j6juis3Y= MIME-Version: 1.0 Received: by 10.231.15.5 with SMTP id i5mr4286813iba.26.1291750401247; Tue, 07 Dec 2010 11:33:21 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.35.130 with HTTP; Tue, 7 Dec 2010 11:33:21 -0800 (PST) In-Reply-To: <20101207134109.GI38282@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> <4CF7D711.9040505@rice.edu> <20101206220733.GG38282@alchemy.franken.de> <20101207134109.GI38282@alchemy.franken.de> Date: Tue, 7 Dec 2010 11:33:21 -0800 X-Google-Sender-Auth: JRY3zSHWriVsfJ3X7jUDhOumLWU Message-ID: From: mdf@FreeBSD.org To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , alc@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 19:33:22 -0000 On Tue, Dec 7, 2010 at 5:41 AM, Marius Strobl w= rote: > On Mon, Dec 06, 2010 at 02:30:01PM -0800, mdf@FreeBSD.org wrote: >> On Mon, Dec 6, 2010 at 2:07 PM, Marius Strobl wrote: >> [lots of snip] >> >> > With that one the kernel now survies memguard_init() but then panics >> > right afterwards when kmeminit() calls kmem_suballoc(): >> > KDB: debugger backends: ddb >> > KDB: current backend: ddb >> > Copyright (c) 1992-2010 The FreeBSD Project. >> > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 19= 94 >> > ? ? ? ?The Regents of the University of California. All rights reserve= d. >> > FreeBSD is a registered trademark of The FreeBSD Foundation. >> > FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec ?6 13:27:57 CET 2010 >> > ? ?marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/us= r/home/m4 >> > WARNING: WITNESS option enabled, expect reduced performance. >> > panic: kmem_suballoc: bad status return of 3 >> >> [more snip] >> >> Shooting in the dark a little... >> >> The bad status of 3 is presumably KERN_NO_SPACE because we attempted >> to allocate too much space from the kernel_map. =A0What are the actual >> values of vm_kmem_size, kernel_map->min_offset, kernel_map->max_offset >> at panic time? > > vm_kmem_size=3D5610405888 min_offset=3D3221225472 max_offset=3D1395864371= 2 > This is on a US3i machine with 16GB RAM. So kernel_map is from 0xC000_0000 to 0x3_4000_0000, or 0x2_8000_0000 bytes large. Double the vm_kmem_size is 0x2_9CD0_0000, which is why this is failing. This to me says that, for the moment, you need the VM_MAX_KERNEL_ADDRESS define so that memguard does not take up too much virtual space; at the moment this hardware is somewhat constrained on virtual space. Thanks, matthew > >> =A0How much virtual space does sparc64 support (since >> earlier it was reported it's computed based on hardware capability, >> for this specific machine?) >> > > Currently, the limiting factor is that the kernel TSB is addressed > virtually, which means that the TTEs for kernel TSB itself have to be > put into locked dTLB slots taking up 1 4MB dTLB slot per 1GB. US3 > family CPUs have 16 lockable 4MB dTLB and iTLB slots, which need to > be shared between the TSB and the kernel itself though, i.e. a 9MB > kernel also takes up 3 slots (US1/2 machines have 64 dTLB and iTLB > slots but there these are also used for unlocked TTEs so we don't use > more than 32 for kernel plus TSB on these). VM_MAX_KERNEL_ADDRESS is > limited according to how many slots are available for the TSB, that's > what I was referring to previously. > Actually, US3 and later as well as SPARC64 V and later CPUs have > a feature allowing the TSB to be addressed physically, circumventing > the need to lock the TSB into the TLB, thus allowing the full 64-bit > virtual address space to be used. Implementing that is on my TODO > list but unfortunately that's not exactly straight forward and also > requires some instructions to be patched at runtime so the kernel > still works on US1/2 machines. > > Marius > > From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 20:23:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A58DB106564A; Tue, 7 Dec 2010 20:23:47 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A63A8FC0A; Tue, 7 Dec 2010 20:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7KNl8n079065; Tue, 7 Dec 2010 20:23:47 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7KNlPf079061; Tue, 7 Dec 2010 20:23:47 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012072023.oB7KNlPf079061@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Dec 2010 20:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216267 - in head: sbin/ifconfig sys/dev/usb sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 20:23:47 -0000 Author: weongyo Date: Tue Dec 7 20:23:47 2010 New Revision: 216267 URL: http://svn.freebsd.org/changeset/base/216267 Log: Introduces IFF_CANTCONFIG interface flag to point that the interface isn't configurable in a meaningful way. This is for ifconfig(8) or other tools not to change code whenever IFT_USB-like interfaces are registered at the interface list. Reviewed by: brooks No objections: gavin, jkim Modified: head/sbin/ifconfig/ifconfig.c head/sys/dev/usb/usb_pf.c head/sys/net/if.h Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Dec 7 19:18:00 2010 (r216266) +++ head/sbin/ifconfig/ifconfig.c Tue Dec 7 20:23:47 2010 (r216267) @@ -295,8 +295,6 @@ main(int argc, char *argv[]) sdl = (const struct sockaddr_dl *) ifa->ifa_addr; else sdl = NULL; - if (sdl != NULL && sdl->sdl_type == IFT_USB) - continue; if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly) continue; iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); @@ -307,6 +305,8 @@ main(int argc, char *argv[]) } cp = ifa->ifa_name; + if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0) + continue; if (downonly && (ifa->ifa_flags & IFF_UP) != 0) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Tue Dec 7 19:18:00 2010 (r216266) +++ head/sys/dev/usb/usb_pf.c Tue Dec 7 20:23:47 2010 (r216267) @@ -64,6 +64,7 @@ usbpf_attach(struct usb_bus *ubus) ifp = ubus->ifp = if_alloc(IFT_USB); if_initname(ifp, "usbus", device_get_unit(ubus->bdev)); + ifp->if_flags = IFF_CANTCONFIG; if_attach(ifp); if_up(ifp); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Dec 7 19:18:00 2010 (r216266) +++ head/sys/net/if.h Tue Dec 7 20:23:47 2010 (r216267) @@ -145,7 +145,7 @@ struct if_data { #define IFF_LINK2 0x4000 /* per link layer defined bit */ #define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */ #define IFF_MULTICAST 0x8000 /* (i) supports multicast */ -/* 0x10000 */ +#define IFF_CANTCONFIG 0x10000 /* (i) unconfigurable using ioctl(2) */ #define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */ #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 20:31:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C68FD1065670; Tue, 7 Dec 2010 20:31:04 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B68A58FC1B; Tue, 7 Dec 2010 20:31:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7KV4oV079227; Tue, 7 Dec 2010 20:31:04 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7KV4mo079225; Tue, 7 Dec 2010 20:31:04 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012072031.oB7KV4mo079225@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Dec 2010 20:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216268 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 20:31:04 -0000 Author: weongyo Date: Tue Dec 7 20:31:04 2010 New Revision: 216268 URL: http://svn.freebsd.org/changeset/base/216268 Log: Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through ioctl(2). Modified: head/sys/net/if.h Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Dec 7 20:23:47 2010 (r216267) +++ head/sys/net/if.h Tue Dec 7 20:31:04 2010 (r216268) @@ -165,7 +165,7 @@ struct if_data { #define IFF_CANTCHANGE \ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\ IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\ - IFF_DYING) + IFF_DYING|IFF_CANTCONFIG) /* * Values for if_link_state. From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 20:32:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3F2E1065697 for ; Tue, 7 Dec 2010 20:32:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id 55A788FC1C for ; Tue, 7 Dec 2010 20:32:37 +0000 (UTC) Received: (qmail 20468 invoked by uid 399); 7 Dec 2010 20:32:35 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Dec 2010 20:32:35 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4CFE99E1.5030301@FreeBSD.org> Date: Tue, 07 Dec 2010 12:32:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101028 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> In-Reply-To: <20101207115106.GB68479@muon.cran.org.uk> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, Ivan Voras , svn-src-head@freebsd.org, Alexander Motin Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 20:32:38 -0000 On 12/07/2010 03:51, Bruce Cran wrote: > On Tue, Dec 07, 2010 at 01:31:27PM +0200, Alexander Motin wrote: >> Not necessary. Some places indeed may have some legacy requirements, >> for example, in theory MBR want partition to be aligned to "track >> boundary" (but I've seen many pre-formatted SD cards with MBR >> violating it to align partition to flash sector). Same time for BSD >> label I see no problem to align partitions any way we want. I also >> see no problems to make FAT cluster, UFS block/fragment, etc, to >> match some sizes. > > From a new installation of Windows 7 and FreeBSD CURRENT: > > GEOM: ada0: partition 3 does not start on a track boundary. > GEOM: ada0: partition 3 does not end on a track boundary. > GEOM: ada0: partition 2 does not start on a track boundary. > GEOM: ada0: partition 2 does not end on a track bounary. > > Partition 2 is the reserved partition while 3 is an NTFS partition, both > created in the Windows setup application. > > Since Windows isn't bothering to align partitions do we still need to > warn about it? It would be great to remove this warning. I see the same problem with partitions created by Linux, which uses the Windows'y version of CHS. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 20:46:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AC9F106564A; Tue, 7 Dec 2010 20:46:12 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AE5B8FC1D; Tue, 7 Dec 2010 20:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7KkB2Q079557; Tue, 7 Dec 2010 20:46:11 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7KkB4L079555; Tue, 7 Dec 2010 20:46:11 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012072046.oB7KkB4L079555@svn.freebsd.org> From: Bruce Cran Date: Tue, 7 Dec 2010 20:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 20:46:12 -0000 Author: brucec Date: Tue Dec 7 20:46:11 2010 New Revision: 216269 URL: http://svn.freebsd.org/changeset/base/216269 Log: Don't warn if a partition appears not to be aligned on a track boundary. Modern disks use LBA and create a fake CHS geometry that doesn't have any relation to the on-disk layout of data. Modified: head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Dec 7 20:31:04 2010 (r216268) +++ head/sys/geom/part/g_part_mbr.c Tue Dec 7 20:46:11 2010 (r216269) @@ -449,12 +449,6 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_heads = heads; } } - if ((ent.dp_start % basetable->gpt_sectors) != 0) - printf("GEOM: %s: partition %d does not start on a " - "track boundary.\n", pp->name, index + 1); - if ((ent.dp_size % basetable->gpt_sectors) != 0) - printf("GEOM: %s: partition %d does not end on a " - "track boundary.\n", pp->name, index + 1); entry = (struct g_part_mbr_entry *)g_part_new_entry(basetable, index + 1, ent.dp_start, ent.dp_start + ent.dp_size - 1); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 21:54:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79AF51065674; Tue, 7 Dec 2010 21:54:22 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFC98FC1D; Tue, 7 Dec 2010 21:54:20 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA09414; Tue, 07 Dec 2010 23:54:19 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQ5UJ-000Hk9-5Z; Tue, 07 Dec 2010 23:54:19 +0200 Message-ID: <4CFEAD09.30904@freebsd.org> Date: Tue, 07 Dec 2010 23:54:17 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201012072046.oB7KkB4L079555@svn.freebsd.org> In-Reply-To: <201012072046.oB7KkB4L079555@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 21:54:22 -0000 on 07/12/2010 22:46 Bruce Cran said the following: > Don't warn if a partition appears not to be aligned on a track boundary. > Modern disks use LBA and create a fake CHS geometry that doesn't have any > relation to the on-disk layout of data. You repeated that statement, so I am picking on you :-) Can someone show me how/where exactly modern drives fakes CHS geometry? Let me specifically ask that question about modern (S)ATA drives directly connected to a system (controller). My impression is at least since ATA-7 there is no mentioning of anything CHS-related in the specification. The fact that we keep reading and interpreting some historically defined bytes that are now marked as unused/reserved doesn't mean that those bytes actually mean anything. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:12:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5EFA1065694; Tue, 7 Dec 2010 22:12:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60968FC12; Tue, 7 Dec 2010 22:12:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7MC2uT081565; Tue, 7 Dec 2010 22:12:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7MC2q7081560; Tue, 7 Dec 2010 22:12:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012072212.oB7MC2q7081560@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Dec 2010 22:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216272 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:12:03 -0000 Author: jkim Date: Tue Dec 7 22:12:02 2010 New Revision: 216272 URL: http://svn.freebsd.org/changeset/base/216272 Log: Probe P-state invariant TSC from rightful place. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/tsc.c head/sys/i386/i386/identcpu.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:00:48 2010 (r216271) +++ head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:12:02 2010 (r216272) @@ -392,28 +392,6 @@ printcpuinfo(void) * If this CPU supports P-state invariant TSC then * mention the capability. */ - switch (cpu_vendor_id) { - case CPU_VENDOR_AMD: - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - CPUID_TO_FAMILY(cpu_id) >= 0x10 || - cpu_id == 0x60fb2) - tsc_is_invariant = 1; - break; - case CPU_VENDOR_INTEL: - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xe) || - (CPUID_TO_FAMILY(cpu_id) == 0xf && - CPUID_TO_MODEL(cpu_id) >= 0x3)) - tsc_is_invariant = 1; - break; - case CPU_VENDOR_CENTAUR: - if (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xf && - (rdmsr(0x1203) & 0x100000000ULL) == 0) - tsc_is_invariant = 1; - break; - } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Tue Dec 7 22:00:48 2010 (r216271) +++ head/sys/amd64/amd64/tsc.c Tue Dec 7 22:12:02 2010 (r216272) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -94,6 +95,28 @@ init_TSC(void) if (bootverbose) printf("TSC clock: %lu Hz\n", tsc_freq); + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_INTEL: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xe) || + (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x3)) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_CENTAUR: + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf && + (rdmsr(0x1203) & 0x100000000ULL) == 0) + tsc_is_invariant = 1; + break; + } + /* * Inform CPU accounting about our boot-time clock rate. Once the * system is finished booting, we will get the real max clock rate Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Dec 7 22:00:48 2010 (r216271) +++ head/sys/i386/i386/identcpu.c Tue Dec 7 22:12:02 2010 (r216272) @@ -856,28 +856,6 @@ printcpuinfo(void) * If this CPU supports P-state invariant TSC then * mention the capability. */ - switch (cpu_vendor_id) { - case CPU_VENDOR_AMD: - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - CPUID_TO_FAMILY(cpu_id) >= 0x10 || - cpu_id == 0x60fb2) - tsc_is_invariant = 1; - break; - case CPU_VENDOR_INTEL: - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xe) || - (CPUID_TO_FAMILY(cpu_id) == 0xf && - CPUID_TO_MODEL(cpu_id) >= 0x3)) - tsc_is_invariant = 1; - break; - case CPU_VENDOR_CENTAUR: - if (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xf && - (rdmsr(0x1203) & 0x100000000ULL) == 0) - tsc_is_invariant = 1; - break; - } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Dec 7 22:00:48 2010 (r216271) +++ head/sys/i386/i386/tsc.c Tue Dec 7 22:12:02 2010 (r216272) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -103,6 +104,28 @@ init_TSC(void) if (bootverbose) printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_INTEL: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xe) || + (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x3)) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_CENTAUR: + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf && + (rdmsr(0x1203) & 0x100000000ULL) == 0) + tsc_is_invariant = 1; + break; + } + /* * Inform CPU accounting about our boot-time clock rate. Once the * system is finished booting, we will get the real max clock rate From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:14:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9928A10656A6; Tue, 7 Dec 2010 22:14:11 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4BAA18FC14; Tue, 7 Dec 2010 22:14:09 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA09751; Wed, 08 Dec 2010 00:14:06 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQ5nR-000Hme-NO; Wed, 08 Dec 2010 00:14:05 +0200 Message-ID: <4CFEB1AD.70906@freebsd.org> Date: Wed, 08 Dec 2010 00:14:05 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Matthew Jacob References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> In-Reply-To: <4CFEAFA6.4020103@feral.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:14:11 -0000 on 08/12/2010 00:05 Matthew Jacob said the following: > > > On 12/7/2010 1:54 PM, Andriy Gapon wrote: >> on 07/12/2010 22:46 Bruce Cran said the following: >>> Don't warn if a partition appears not to be aligned on a track boundary. >>> Modern disks use LBA and create a fake CHS geometry that doesn't have any >>> relation to the on-disk layout of data. >> You repeated that statement, so I am picking on you :-) >> Can someone show me how/where exactly modern drives fakes CHS geometry? >> > > cf cam_calc_geometry But that's not drive firmware code :-) It's us faking those parameters for ourselves for some unknown reason. Stupid us :-) But not the drives / manufacturers. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:22:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69E44106564A; Tue, 7 Dec 2010 22:22:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8028FC08; Tue, 7 Dec 2010 22:22:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D466746B45; Tue, 7 Dec 2010 17:22:39 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EA6518A009; Tue, 7 Dec 2010 17:22:38 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 7 Dec 2010 17:22:29 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012072212.oB7MC2q7081560@svn.freebsd.org> In-Reply-To: <201012072212.oB7MC2q7081560@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012071722.29481.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 07 Dec 2010 17:22:39 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216272 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:22:40 -0000 On Tuesday, December 07, 2010 5:12:02 pm Jung-uk Kim wrote: > Author: jkim > Date: Tue Dec 7 22:12:02 2010 > New Revision: 216272 > URL: http://svn.freebsd.org/changeset/base/216272 > > Log: > Probe P-state invariant TSC from rightful place. > > Modified: > head/sys/amd64/amd64/identcpu.c > head/sys/amd64/amd64/tsc.c > head/sys/i386/i386/identcpu.c > head/sys/i386/i386/tsc.c > > Modified: head/sys/amd64/amd64/identcpu.c > ============================================================================== > --- head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:00:48 2010 (r216271) > +++ head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:12:02 2010 (r216272) > @@ -392,28 +392,6 @@ printcpuinfo(void) > * If this CPU supports P-state invariant TSC then > * mention the capability. > */ > - switch (cpu_vendor_id) { > - case CPU_VENDOR_AMD: > - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || > - CPUID_TO_FAMILY(cpu_id) >= 0x10 || > - cpu_id == 0x60fb2) > - tsc_is_invariant = 1; > - break; > - case CPU_VENDOR_INTEL: > - if ((amd_pminfo & AMDPM_TSC_INVARIANT) || > - (CPUID_TO_FAMILY(cpu_id) == 0x6 && > - CPUID_TO_MODEL(cpu_id) >= 0xe) || > - (CPUID_TO_FAMILY(cpu_id) == 0xf && > - CPUID_TO_MODEL(cpu_id) >= 0x3)) > - tsc_is_invariant = 1; > - break; > - case CPU_VENDOR_CENTAUR: > - if (CPUID_TO_FAMILY(cpu_id) == 0x6 && > - CPUID_TO_MODEL(cpu_id) >= 0xf && > - (rdmsr(0x1203) & 0x100000000ULL) == 0) > - tsc_is_invariant = 1; > - break; > - } > if (tsc_is_invariant) > printf("\n TSC: P-state invariant"); Doesn't that break this printf? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:23:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA6461065675; Tue, 7 Dec 2010 22:23:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA018FC08; Tue, 7 Dec 2010 22:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7MNQIo081849; Tue, 7 Dec 2010 22:23:26 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7MNQpM081846; Tue, 7 Dec 2010 22:23:26 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012072223.oB7MNQpM081846@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Dec 2010 22:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216274 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:23:26 -0000 Author: jkim Date: Tue Dec 7 22:23:26 2010 New Revision: 216274 URL: http://svn.freebsd.org/changeset/base/216274 Log: Now the P-state invariant TSC is probed early enough, do not register event handlers for CPU freqency changes when it is found P-state invariant. Adjust a comment about non-existent tsc_freq_max() while I am here. Modified: head/sys/amd64/amd64/tsc.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Tue Dec 7 22:16:37 2010 (r216273) +++ head/sys/amd64/amd64/tsc.c Tue Dec 7 22:23:26 2010 (r216274) @@ -118,13 +118,15 @@ init_TSC(void) } /* - * Inform CPU accounting about our boot-time clock rate. Once the - * system is finished booting, we will get the real max clock rate - * via tsc_freq_max(). This also will be updated if someone loads - * a cpufreq driver after boot that discovers a new max frequency. + * Inform CPU accounting about our boot-time clock rate. This will + * be updated if someone loads a cpufreq driver after boot that + * discovers a new max frequency. */ set_cputicker(rdtsc, tsc_freq, 1); + if (tsc_is_invariant) + return; + /* Register to find out about changes in CPU frequency. */ tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); @@ -169,9 +171,6 @@ tsc_levels_changed(void *arg, int unit) int count, error; uint64_t max_freq; - if (tsc_is_invariant) - return; - /* Only use values from the first CPU, assuming all are equal. */ if (unit != 0) return; @@ -205,8 +204,7 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != &tsc_timecounter || - tsc_is_invariant) + if (*status != 0 || timecounter != &tsc_timecounter) return; printf("timecounter TSC must not be in use when " @@ -222,7 +220,7 @@ tsc_freq_changed(void *arg, const struct * If there was an error during the transition or * TSC is P-state invariant, don't do anything. */ - if (status != 0 || tsc_is_invariant) + if (status != 0) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Dec 7 22:16:37 2010 (r216273) +++ head/sys/i386/i386/tsc.c Tue Dec 7 22:23:26 2010 (r216274) @@ -127,13 +127,15 @@ init_TSC(void) } /* - * Inform CPU accounting about our boot-time clock rate. Once the - * system is finished booting, we will get the real max clock rate - * via tsc_freq_max(). This also will be updated if someone loads - * a cpufreq driver after boot that discovers a new max frequency. + * Inform CPU accounting about our boot-time clock rate. This will + * be updated if someone loads a cpufreq driver after boot that + * discovers a new max frequency. */ set_cputicker(rdtsc, tsc_freq, 1); + if (tsc_is_invariant) + return; + /* Register to find out about changes in CPU frequency. */ tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); @@ -197,9 +199,6 @@ tsc_levels_changed(void *arg, int unit) int count, error; uint64_t max_freq; - if (tsc_is_invariant) - return; - /* Only use values from the first CPU, assuming all are equal. */ if (unit != 0) return; @@ -233,8 +232,7 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != &tsc_timecounter || - tsc_is_invariant) + if (*status != 0 || timecounter != &tsc_timecounter) return; printf("timecounter TSC must not be in use when " @@ -250,7 +248,7 @@ tsc_freq_changed(void *arg, const struct * If there was an error during the transition or * TSC is P-state invariant, don't do anything. */ - if (status != 0 || tsc_is_invariant) + if (status != 0) return; /* Total setting for this level gives the new frequency in MHz. */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:24:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EF461065673; Tue, 7 Dec 2010 22:24:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4BC8FC19; Tue, 7 Dec 2010 22:24:36 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CD91946B3B; Tue, 7 Dec 2010 17:24:35 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 082C68A009; Tue, 7 Dec 2010 17:24:35 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 7 Dec 2010 17:24:29 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012072212.oB7MC2q7081560@svn.freebsd.org> <201012071722.29481.jhb@freebsd.org> In-Reply-To: <201012071722.29481.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012071724.29534.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 07 Dec 2010 17:24:35 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216272 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:24:36 -0000 On Tuesday, December 07, 2010 5:22:29 pm John Baldwin wrote: > On Tuesday, December 07, 2010 5:12:02 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Tue Dec 7 22:12:02 2010 > > New Revision: 216272 > > URL: http://svn.freebsd.org/changeset/base/216272 > > > > Log: > > Probe P-state invariant TSC from rightful place. > > > > if (tsc_is_invariant) > > printf("\n TSC: P-state invariant"); > > Doesn't that break this printf? Nevermind. :-P -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:24:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A826106566C; Tue, 7 Dec 2010 22:24:46 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 05FFE8FC08; Tue, 7 Dec 2010 22:24:45 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.4/8.14.3) with ESMTP id oB7M5bY8097333 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 7 Dec 2010 14:05:39 -0800 (PST) (envelope-from mj@feral.com) Message-ID: <4CFEAFA6.4020103@feral.com> Date: Tue, 07 Dec 2010 14:05:26 -0800 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Andriy Gapon References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> In-Reply-To: <4CFEAD09.30904@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.168.221.1]); Tue, 07 Dec 2010 14:05:39 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:24:46 -0000 On 12/7/2010 1:54 PM, Andriy Gapon wrote: > on 07/12/2010 22:46 Bruce Cran said the following: >> Don't warn if a partition appears not to be aligned on a track boundary. >> Modern disks use LBA and create a fake CHS geometry that doesn't have any >> relation to the on-disk layout of data. > You repeated that statement, so I am picking on you :-) > Can someone show me how/where exactly modern drives fakes CHS geometry? > cf cam_calc_geometry From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:31:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB1201065674; Tue, 7 Dec 2010 22:31:32 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 389608FC13; Tue, 7 Dec 2010 22:31:31 +0000 (UTC) Received: by qyk36 with SMTP id 36so437749qyk.13 for ; Tue, 07 Dec 2010 14:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=gM3xcQf50/idnK5RS8caS+E37qu/t8rjq/Xp+jPQu5o=; b=aeFSF65BTkN14vdYh1cPOWBdmLS07JHzykd3InLiJcosXQi+lTQPyI/jq9N8GQ0MwK kdD+i91TcGIH1rn1B6H+TAjDgHsUE0RZmmeMGlxEfpuXKWIgrVtaIJzD95mCHlWxdEEh 1dD0wC9kqh/K+a8r/U4eajVQwrsLGlW8bT/qE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=G8+THg3GEoyr7cvVE9KEGpdg0F/pWA3NWow2rMXBR2f2OtOXU5PUfcjjTPOlNDDZWL PkzdDuVfMbKTCGzc3CgBMRmCOMr8lZYUnhoXusSPF878MNeq5gpZukRllJvbJvUToztU urCaHupuwTRRRSdf0VGRHWk+bCnJV/wHVtyZY= Received: by 10.229.79.135 with SMTP id p7mr6188498qck.85.1291761090781; Tue, 07 Dec 2010 14:31:30 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Tue, 7 Dec 2010 14:30:49 -0800 (PST) In-Reply-To: <20101207113152.GG1700@garage.freebsd.pl> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206184453.GA1936@garage.freebsd.pl> <20101206192238.GB1936@garage.freebsd.pl> <20101206195327.GD1936@garage.freebsd.pl> <20101207102104.GD1700@garage.freebsd.pl> <20101207113152.GG1700@garage.freebsd.pl> From: Ivan Voras Date: Tue, 7 Dec 2010 23:30:49 +0100 X-Google-Sender-Auth: Zq6vzr-0L312nJnbnIPEHgs2XCs Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:31:33 -0000 On 7 December 2010 12:31, Pawel Jakub Dawidek wrote: > On Tue, Dec 07, 2010 at 12:25:28PM +0100, Ivan Voras wrote: >> On 7 December 2010 11:21, Pawel Jakub Dawidek wrote: >> >> > PS. Do you know your change breaks all current ZFS installation if >> > stripesize is defined for a provider? >> > >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0# zpool create tank ada0 >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0(upgrade FreeBSD so that ada0 now reports 4= kB stripesize) >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0# zpool import tank >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0cannot import 'tank': invalid vdev configur= ation >> >> Actually I did test the patch and, similar to the Solaris people, >> found that ZFS records ashift in metadata and uses the recorded one >> instead of hardcoded / detected one. What you found here really >> shouldn't happen. Are you sure only stripesize was increased in your >> case, not sectorsize? > > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (pp->stripesize > pp->sectorsize) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*ashift =3D highbi= t(MIN(pp->stripesize, SPA_MAXBLOCKSIZE)) - 1; > =C2=A0 =C2=A0 =C2=A0 =C2=A0else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*ashift =3D highbi= t(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; > > If stripesize will start to be 4096, the ashift will change. > > Not sure what you test was, but it only works the other way around - > create pool with 4kB ashift and import it when ashift is 512 bytes. My test was flawed, it made me conclude that ashift from metadata would be used in this case (this case is actually one of the more trivial ones - vdev created with ashift=3D9 used on device which is capable of ashift=3D9 but advertises ashift=3D12). In case it would be useful in the future, this is blocked in vdev_open(): http://fxr.watson.org/fxr/source/cddl/contrib/opensolaris/uts/common/fs/zfs= /vdev.c#L1075 I think that to solve this edge case properly, ZFS would have to know that both ashift values are "valid" for the device, i.e. basically it would at this point need to somehow know about our sectorsize and stripesize, not just ashift. OpenSolaris lists mention that pools can be created from devices with different ashift values, which is good news. From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:34:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF2FE1065673; Tue, 7 Dec 2010 22:34:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A43F8FC18; Tue, 7 Dec 2010 22:34:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7MYppU082114; Tue, 7 Dec 2010 22:34:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7MYpor082111; Tue, 7 Dec 2010 22:34:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012072234.oB7MYpor082111@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Dec 2010 22:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216275 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:34:51 -0000 Author: jkim Date: Tue Dec 7 22:34:51 2010 New Revision: 216275 URL: http://svn.freebsd.org/changeset/base/216275 Log: Do not register a event handler for CPU freqency changes when it is found P-state invariant. This is continuation of r216274. Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:23:26 2010 (r216274) +++ head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:34:51 2010 (r216275) @@ -109,6 +109,8 @@ static int hw_clockrate; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); +static eventhandler_tag tsc_post_tag; + static char cpu_brand[48]; static struct { @@ -433,21 +435,31 @@ panicifcpuunsupported(void) /* Update TSC freq with the value indicated by the caller. */ static void -tsc_freq_changed(void *arg, const struct cf_level *level, int status) +tsc_freq_changed(void *arg __unused, const struct cf_level *level, int status) { /* * If there was an error during the transition or * TSC is P-state invariant, don't do anything. */ - if (status != 0 || tsc_is_invariant) + if (status != 0) return; /* Total setting for this level gives the new frequency in MHz. */ hw_clockrate = level->total_set.freq; } -EVENTHANDLER_DEFINE(cpufreq_post_change, tsc_freq_changed, NULL, - EVENTHANDLER_PRI_ANY); +static void +hook_tsc_freq(void *arg __unused) +{ + + if (tsc_is_invariant) + return; + + tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, + tsc_freq_changed, NULL, EVENTHANDLER_PRI_ANY); +} + +SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, SI_ORDER_ANY, hook_tsc_freq, NULL); /* * Final stage of CPU identification. Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Dec 7 22:23:26 2010 (r216274) +++ head/sys/i386/i386/identcpu.c Tue Dec 7 22:34:51 2010 (r216275) @@ -100,6 +100,8 @@ static int hw_clockrate; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); +static eventhandler_tag tsc_post_tag; + static char cpu_brand[48]; #define MAX_BRAND_INDEX 8 @@ -1049,21 +1051,31 @@ identifycyrix(void) /* Update TSC freq with the value indicated by the caller. */ static void -tsc_freq_changed(void *arg, const struct cf_level *level, int status) +tsc_freq_changed(void *arg __unused, const struct cf_level *level, int status) { /* * If there was an error during the transition or * TSC is P-state invariant, don't do anything. */ - if (status != 0 || tsc_is_invariant) + if (status != 0) return; /* Total setting for this level gives the new frequency in MHz. */ hw_clockrate = level->total_set.freq; } -EVENTHANDLER_DEFINE(cpufreq_post_change, tsc_freq_changed, NULL, - EVENTHANDLER_PRI_ANY); +static void +hook_tsc_freq(void *arg __unused) +{ + + if (tsc_is_invariant) + return; + + tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, + tsc_freq_changed, NULL, EVENTHANDLER_PRI_ANY); +} + +SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, SI_ORDER_ANY, hook_tsc_freq, NULL); /* * Final stage of CPU identification. -- Should I check TI? From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:43:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1831065695; Tue, 7 Dec 2010 22:43:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 015478FC14; Tue, 7 Dec 2010 22:43:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7MhPhu082371; Tue, 7 Dec 2010 22:43:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7MhP5L082366; Tue, 7 Dec 2010 22:43:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012072243.oB7MhP5L082366@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Dec 2010 22:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216276 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:43:26 -0000 Author: jkim Date: Tue Dec 7 22:43:25 2010 New Revision: 216276 URL: http://svn.freebsd.org/changeset/base/216276 Log: Remove stale comments about P-state invariant TSC and fix style(9) nits. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/tsc.c head/sys/i386/i386/identcpu.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:34:51 2010 (r216275) +++ head/sys/amd64/amd64/identcpu.c Tue Dec 7 22:43:25 2010 (r216276) @@ -437,10 +437,8 @@ panicifcpuunsupported(void) static void tsc_freq_changed(void *arg __unused, const struct cf_level *level, int status) { - /* - * If there was an error during the transition or - * TSC is P-state invariant, don't do anything. - */ + + /* If there was an error during the transition, don't do anything. */ if (status != 0) return; Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Tue Dec 7 22:34:51 2010 (r216275) +++ head/sys/amd64/amd64/tsc.c Tue Dec 7 22:43:25 2010 (r216276) @@ -216,10 +216,8 @@ tsc_freq_changing(void *arg, const struc static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* - * If there was an error during the transition or - * TSC is P-state invariant, don't do anything. - */ + + /* If there was an error during the transition, don't do anything. */ if (status != 0) return; Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Dec 7 22:34:51 2010 (r216275) +++ head/sys/i386/i386/identcpu.c Tue Dec 7 22:43:25 2010 (r216276) @@ -1053,10 +1053,8 @@ identifycyrix(void) static void tsc_freq_changed(void *arg __unused, const struct cf_level *level, int status) { - /* - * If there was an error during the transition or - * TSC is P-state invariant, don't do anything. - */ + + /* If there was an error during the transition, don't do anything. */ if (status != 0) return; Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Dec 7 22:34:51 2010 (r216275) +++ head/sys/i386/i386/tsc.c Tue Dec 7 22:43:25 2010 (r216276) @@ -244,10 +244,8 @@ tsc_freq_changing(void *arg, const struc static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* - * If there was an error during the transition or - * TSC is P-state invariant, don't do anything. - */ + + /* If there was an error during the transition, don't do anything. */ if (status != 0) return; From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 22:43:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC54010656B6; Tue, 7 Dec 2010 22:43:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92A698FC16; Tue, 7 Dec 2010 22:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7MhThi082408; Tue, 7 Dec 2010 22:43:29 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7MhTZM082406; Tue, 7 Dec 2010 22:43:29 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012072243.oB7MhTZM082406@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 7 Dec 2010 22:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216277 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 22:43:29 -0000 Author: bz Date: Tue Dec 7 22:43:29 2010 New Revision: 216277 URL: http://svn.freebsd.org/changeset/base/216277 Log: Loosen the locking in nd6-free() again after r216022 to avoid a LOR and a recursed lock. Reported by: delphij Tested by: delphij PR: kern/148857 MFC After: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Dec 7 22:43:25 2010 (r216276) +++ head/sys/netinet6/nd6.c Tue Dec 7 22:43:29 2010 (r216277) @@ -1053,15 +1053,6 @@ nd6_free(struct llentry *ln, int gc) return (next); } - if (ln->ln_router || dr) { - /* - * rt6_flush must be called whether or not the neighbor - * is in the Default Router List. - * See a corresponding comment in nd6_na_input(). - */ - rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); - } - if (dr) { /* * Unreachablity of a router might affect the default @@ -1077,8 +1068,28 @@ nd6_free(struct llentry *ln, int gc) * or the entry itself will be deleted. */ ln->ln_state = ND6_LLINFO_INCOMPLETE; + } + + if (ln->ln_router || dr) { /* + * We need to unlock to avoid a LOR with rt6_flush() with the + * rnh and for the calls to pfxlist_onlink_check() and + * defrouter_select() in the block further down for calls + * into nd6_lookup(). We still hold a ref. + */ + LLE_WUNLOCK(ln); + + /* + * rt6_flush must be called whether or not the neighbor + * is in the Default Router List. + * See a corresponding comment in nd6_na_input(). + */ + rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); + } + + if (dr) { + /* * Since defrouter_select() does not affect the * on-link determination and MIP6 needs the check * before the default router selection, we perform @@ -1087,13 +1098,13 @@ nd6_free(struct llentry *ln, int gc) pfxlist_onlink_check(); /* - * Refresh default router list. Have to unlock as - * it calls into nd6_lookup(), still holding a ref. + * Refresh default router list. */ - LLE_WUNLOCK(ln); defrouter_select(); - LLE_WLOCK(ln); } + + if (ln->ln_router || dr) + LLE_WLOCK(ln); } /* From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:06:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 394B4106564A; Tue, 7 Dec 2010 23:06:30 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id BF05E8FC1C; Tue, 7 Dec 2010 23:06:29 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9D6D6E7175; Tue, 7 Dec 2010 23:06:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=2bL7T3v1WxTE DoiideROi1tCgkg=; b=nGUieCCTdL0cxk3C7UNYEd6ejcbUymQvhngbIwbGFNYR cFMz9a35SWjVF4/WKcCBUwBfKZdr3m25wJxbIqHFEN0btyU1XLljO2xdBe8STc5/ 2x62fAJCFRLC8EuFsC/voj652o/xtxkL1/krkfpWVZrIA+ji1Xt1S72p3QlQ7zU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=BYiGNG JUSdUmDKQful/vOZ6rS57kJXP4EWgL4NNhotTdOoMusEanSZ9vn/qDsFakys1IC2 FxNvxRvAwJWh7iVBEG6WB5p3mChD0i92iJ5rPrvwgQVVAeIGKObSp3Kx6YGK0Tiw biEqOjWotNSqN1qmG/47zIjpP372TzIJfmyok= Received: from core.draftnet (client-86-25-14-189.oxfd.adsl.virginmedia.com [86.25.14.189]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 21588E7173; Tue, 7 Dec 2010 23:06:28 +0000 (GMT) Date: Tue, 7 Dec 2010 23:06:24 +0000 From: Bruce Cran To: Andriy Gapon Message-ID: <20101207230624.7b7a83d3@core.draftnet> In-Reply-To: <4CFEAD09.30904@freebsd.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:06:30 -0000 On Tue, 07 Dec 2010 23:54:17 +0200 Andriy Gapon wrote: > You repeated that statement, so I am picking on you :-) > Can someone show me how/where exactly modern drives fakes CHS > geometry? Let me specifically ask that question about modern (S)ATA > drives directly connected to a system (controller). > My impression is at least since ATA-7 there is no mentioning of > anything CHS-related in the specification. The fact that we keep > reading and interpreting some historically defined bytes that are now > marked as unused/reserved doesn't mean that those bytes actually mean > anything. You're right: I last looked at the IDENTIFY data about 7 years ago when those fields were defined; now they're marked as "obsolete". I guess the fields are still defined to keep old tools happy. Both atacontrol and camcontrol are still reading the IDENTIFY data and outputting the CHS fields even on ATA-8 drives, which I guess they shouldn't be. -- Bruce From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:11:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B832106566C; Tue, 7 Dec 2010 23:11:34 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 33BBC8FC20; Tue, 7 Dec 2010 23:11:34 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 53809E7174; Tue, 7 Dec 2010 23:11:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=75yHoC3ZmTMs BishBemzHMo32K4=; b=Xt9zhNuTRQnUJG92cPHoaxN1OFEpmJTAC7PnK2C7eAPZ RHYekrbM6jzTusPrlyCksi5U0iavx1wjZEbJicruj+4Zi94ArauTn0PHkUEC7c06 mTpBnLpm9AyIRzKkzZwC07N6xpi4C55lhjODBDN7dBb+0Gu0mutVUkIwfCujAOk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:cc :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=tF8gRk rf9tY4am9x6Utx7wqTprviI2aFxsvrW24P7v081KFotAy3wwatLBuLABF9fIzV32 C5gt5CXhjWOxecrnbhu0jr/VHIj1cFI7uFdL/vrkfi8z0mb+GPyapop/MevlyXJ5 3CxC9N0Rep3DaEjt8zHyCyjU08FAPCD2UvTiE= Received: from core.draftnet (client-86-25-14-189.oxfd.adsl.virginmedia.com [86.25.14.189]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id D2B88E7173; Tue, 7 Dec 2010 23:11:32 +0000 (GMT) Date: Tue, 7 Dec 2010 23:11:29 +0000 From: Bruce Cran Message-ID: <20101207231129.771422fc@core.draftnet> In-Reply-To: <20101207230624.7b7a83d3@core.draftnet> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <20101207230624.7b7a83d3@core.draftnet> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:11:34 -0000 On Tue, 7 Dec 2010 23:06:24 +0000 Bruce Cran wrote: > I guess the fields are still defined to keep old tools happy. I mean that values are still returned by the drive firmware, while they could be left zero according to the spec. For example a new 1TB ATA-8 drive returns a geometry of 16H/63S/16383C in those fields. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:11:48 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5805D106566B; Tue, 7 Dec 2010 23:11:48 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 03F4D8FC1D; Tue, 7 Dec 2010 23:11:47 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.4/8.14.3) with ESMTP id oB7NBkLQ097908 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 7 Dec 2010 15:11:46 -0800 (PST) (envelope-from mj@feral.com) Message-ID: <4CFEBF27.8010203@feral.com> Date: Tue, 07 Dec 2010 15:11:35 -0800 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Andriy Gapon References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> In-Reply-To: <4CFEB1AD.70906@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.168.221.1]); Tue, 07 Dec 2010 15:11:47 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:11:48 -0000 Geometry is still important. Trying booting a USB flash drive on all BIOS' with a 63/255 geometry instead of a 64/32 geometry. On 12/7/2010 2:14 PM, Andriy Gapon wrote: > on 08/12/2010 00:05 Matthew Jacob said the following: >> >> On 12/7/2010 1:54 PM, Andriy Gapon wrote: >>> on 07/12/2010 22:46 Bruce Cran said the following: >>>> Don't warn if a partition appears not to be aligned on a track boundary. >>>> Modern disks use LBA and create a fake CHS geometry that doesn't have any >>>> relation to the on-disk layout of data. >>> You repeated that statement, so I am picking on you :-) >>> Can someone show me how/where exactly modern drives fakes CHS geometry? >>> >> cf cam_calc_geometry > But that's not drive firmware code :-) > It's us faking those parameters for ourselves for some unknown reason. > Stupid us :-) But not the drives / manufacturers. > From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:19:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9ABA106566C; Tue, 7 Dec 2010 23:19:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA44E8FC1D; Tue, 7 Dec 2010 23:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7NJnHc083229; Tue, 7 Dec 2010 23:19:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7NJnbq083226; Tue, 7 Dec 2010 23:19:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012072319.oB7NJnbq083226@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Dec 2010 23:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216279 - in head/sys/i386: i386 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:19:49 -0000 Author: jkim Date: Tue Dec 7 23:19:49 2010 New Revision: 216279 URL: http://svn.freebsd.org/changeset/base/216279 Log: Use int for 'tsc_present' instead of u_int. It is just a boolean. Modified: head/sys/i386/i386/tsc.c head/sys/i386/include/cpu.h Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Dec 7 23:14:00 2010 (r216278) +++ head/sys/i386/i386/tsc.c Tue Dec 7 23:19:49 2010 (r216279) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_broken; int tsc_is_invariant; -u_int tsc_present; +int tsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, Modified: head/sys/i386/include/cpu.h ============================================================================== --- head/sys/i386/include/cpu.h Tue Dec 7 23:14:00 2010 (r216278) +++ head/sys/i386/include/cpu.h Tue Dec 7 23:19:49 2010 (r216279) @@ -56,7 +56,7 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; -extern u_int tsc_present; +extern int tsc_present; void cpu_halt(void); void cpu_reset(void); From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:33:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE401065672; Tue, 7 Dec 2010 23:33:21 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBCC8FC16; Tue, 7 Dec 2010 23:33:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7NXKDg083549; Tue, 7 Dec 2010 23:33:20 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7NXKTl083547; Tue, 7 Dec 2010 23:33:20 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012072333.oB7NXKTl083547@svn.freebsd.org> From: Colin Percival Date: Tue, 7 Dec 2010 23:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216280 - head/sys/xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:33:21 -0000 Author: cperciva Date: Tue Dec 7 23:33:20 2010 New Revision: 216280 URL: http://svn.freebsd.org/changeset/base/216280 Log: Postpone the unmasking of event channels (aka. interrupts) until after the interrupt handlers have been registered. NULL isn't a very good interrupt handler. Modified: head/sys/xen/evtchn/evtchn.c Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Tue Dec 7 23:19:49 2010 (r216279) +++ head/sys/xen/evtchn/evtchn.c Tue Dec 7 23:33:20 2010 (r216280) @@ -256,7 +256,7 @@ find_unbound_irq(void) } static int -bind_caller_port_to_irq(unsigned int caller_port) +bind_caller_port_to_irq(unsigned int caller_port, int * port) { int irq; @@ -271,7 +271,7 @@ bind_caller_port_to_irq(unsigned int cal } irq_bindcount[irq]++; - unmask_evtchn(caller_port); + *port = caller_port; out: mtx_unlock_spin(&irq_mapping_update_lock); @@ -279,7 +279,7 @@ bind_caller_port_to_irq(unsigned int cal } static int -bind_local_port_to_irq(unsigned int local_port) +bind_local_port_to_irq(unsigned int local_port, int * port) { int irq; @@ -298,7 +298,7 @@ bind_local_port_to_irq(unsigned int loca evtchn_to_irq[local_port] = irq; irq_info[irq] = mk_irq_info(IRQT_LOCAL_PORT, 0, local_port); irq_bindcount[irq]++; - unmask_evtchn(local_port); + *port = local_port; out: mtx_unlock_spin(&irq_mapping_update_lock); @@ -306,7 +306,7 @@ bind_local_port_to_irq(unsigned int loca } static int -bind_listening_port_to_irq(unsigned int remote_domain) +bind_listening_port_to_irq(unsigned int remote_domain, int * port) { struct evtchn_alloc_unbound alloc_unbound; int err; @@ -317,12 +317,12 @@ bind_listening_port_to_irq(unsigned int err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &alloc_unbound); - return err ? : bind_local_port_to_irq(alloc_unbound.port); + return err ? : bind_local_port_to_irq(alloc_unbound.port, port); } static int bind_interdomain_evtchn_to_irq(unsigned int remote_domain, - unsigned int remote_port) + unsigned int remote_port, int * port) { struct evtchn_bind_interdomain bind_interdomain; int err; @@ -333,11 +333,11 @@ bind_interdomain_evtchn_to_irq(unsigned err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain, &bind_interdomain); - return err ? : bind_local_port_to_irq(bind_interdomain.local_port); + return err ? : bind_local_port_to_irq(bind_interdomain.local_port, port); } static int -bind_virq_to_irq(unsigned int virq, unsigned int cpu) +bind_virq_to_irq(unsigned int virq, unsigned int cpu, int * port) { struct evtchn_bind_virq bind_virq; int evtchn = 0, irq; @@ -363,7 +363,7 @@ bind_virq_to_irq(unsigned int virq, unsi } irq_bindcount[irq]++; - unmask_evtchn(evtchn); + *port = evtchn; out: mtx_unlock_spin(&irq_mapping_update_lock); @@ -371,10 +371,8 @@ out: } -extern int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu); - -int -bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) +static int +bind_ipi_to_irq(unsigned int ipi, unsigned int cpu, int * port) { struct evtchn_bind_ipi bind_ipi; int irq; @@ -398,7 +396,7 @@ bind_ipi_to_irq(unsigned int ipi, unsign bind_evtchn_to_cpu(evtchn, cpu); } irq_bindcount[irq]++; - unmask_evtchn(evtchn); + *port = evtchn; out: mtx_unlock_spin(&irq_mapping_update_lock); @@ -449,9 +447,10 @@ bind_caller_port_to_irqhandler(unsigned unsigned long irqflags, unsigned int *irqp) { unsigned int irq; + int port = -1; int error; - irq = bind_caller_port_to_irq(caller_port); + irq = bind_caller_port_to_irq(caller_port, &port); intr_register_source(&xp->xp_pins[irq].xp_intsrc); error = intr_add_handler(devname, irq, NULL, handler, arg, irqflags, &xp->xp_pins[irq].xp_cookie); @@ -460,6 +459,8 @@ bind_caller_port_to_irqhandler(unsigned unbind_from_irq(irq); return (error); } + if (port != -1) + unmask_evtchn(port); if (irqp) *irqp = irq; @@ -473,9 +474,10 @@ bind_listening_port_to_irqhandler(unsign unsigned long irqflags, unsigned int *irqp) { unsigned int irq; + int port = -1; int error; - irq = bind_listening_port_to_irq(remote_domain); + irq = bind_listening_port_to_irq(remote_domain, &port); intr_register_source(&xp->xp_pins[irq].xp_intsrc); error = intr_add_handler(devname, irq, NULL, handler, arg, irqflags, &xp->xp_pins[irq].xp_cookie); @@ -483,6 +485,8 @@ bind_listening_port_to_irqhandler(unsign unbind_from_irq(irq); return (error); } + if (port != -1) + unmask_evtchn(port); if (irqp) *irqp = irq; @@ -496,9 +500,10 @@ bind_interdomain_evtchn_to_irqhandler(un unsigned int *irqp) { unsigned int irq; + int port = -1; int error; - irq = bind_interdomain_evtchn_to_irq(remote_domain, remote_port); + irq = bind_interdomain_evtchn_to_irq(remote_domain, remote_port, &port); intr_register_source(&xp->xp_pins[irq].xp_intsrc); error = intr_add_handler(devname, irq, NULL, handler, arg, irqflags, &xp->xp_pins[irq].xp_cookie); @@ -506,6 +511,8 @@ bind_interdomain_evtchn_to_irqhandler(un unbind_from_irq(irq); return (error); } + if (port != -1) + unmask_evtchn(port); if (irqp) *irqp = irq; @@ -518,9 +525,10 @@ bind_virq_to_irqhandler(unsigned int vir void *arg, unsigned long irqflags, unsigned int *irqp) { unsigned int irq; + int port = -1; int error; - irq = bind_virq_to_irq(virq, cpu); + irq = bind_virq_to_irq(virq, cpu, &port); intr_register_source(&xp->xp_pins[irq].xp_intsrc); error = intr_add_handler(devname, irq, filter, handler, arg, irqflags, &xp->xp_pins[irq].xp_cookie); @@ -528,6 +536,8 @@ bind_virq_to_irqhandler(unsigned int vir unbind_from_irq(irq); return (error); } + if (port != -1) + unmask_evtchn(port); if (irqp) *irqp = irq; @@ -540,9 +550,10 @@ bind_ipi_to_irqhandler(unsigned int ipi, unsigned long irqflags, unsigned int *irqp) { unsigned int irq; + int port = -1; int error; - irq = bind_ipi_to_irq(ipi, cpu); + irq = bind_ipi_to_irq(ipi, cpu, &port); intr_register_source(&xp->xp_pins[irq].xp_intsrc); error = intr_add_handler(devname, irq, filter, NULL, NULL, irqflags, &xp->xp_pins[irq].xp_cookie); @@ -550,6 +561,8 @@ bind_ipi_to_irqhandler(unsigned int ipi, unbind_from_irq(irq); return (error); } + if (port != -1) + unmask_evtchn(port); if (irqp) *irqp = irq; From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:41:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542EE106564A; Tue, 7 Dec 2010 23:41:27 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 035C58FC13; Tue, 7 Dec 2010 23:41:25 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA11473; Wed, 08 Dec 2010 01:41:21 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQ79s-000Hvq-Ug; Wed, 08 Dec 2010 01:41:21 +0200 Message-ID: <4CFEC620.80900@freebsd.org> Date: Wed, 08 Dec 2010 01:41:20 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Matthew Jacob References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <4CFEBF27.8010203@feral.com> In-Reply-To: <4CFEBF27.8010203@feral.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:41:27 -0000 on 08/12/2010 01:11 Matthew Jacob said the following: > Geometry is still important. Trying booting a USB flash drive on all BIOS' with > a 63/255 geometry instead of a 64/32 geometry. Well, I don't know anything about USB... My point about modern HDDs still stands. > On 12/7/2010 2:14 PM, Andriy Gapon wrote: >> on 08/12/2010 00:05 Matthew Jacob said the following: >>> >>> On 12/7/2010 1:54 PM, Andriy Gapon wrote: >>>> on 07/12/2010 22:46 Bruce Cran said the following: >>>>> Don't warn if a partition appears not to be aligned on a track boundary. >>>>> Modern disks use LBA and create a fake CHS geometry that doesn't have any >>>>> relation to the on-disk layout of data. >>>> You repeated that statement, so I am picking on you :-) >>>> Can someone show me how/where exactly modern drives fakes CHS geometry? >>>> >>> cf cam_calc_geometry >> But that's not drive firmware code :-) >> It's us faking those parameters for ourselves for some unknown reason. >> Stupid us :-) But not the drives / manufacturers. >> -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:43:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82017106564A; Tue, 7 Dec 2010 23:43:49 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE2F8FC17; Tue, 7 Dec 2010 23:43:48 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA11503; Wed, 08 Dec 2010 01:43:44 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQ7CC-000Hw5-Kv; Wed, 08 Dec 2010 01:43:44 +0200 Message-ID: <4CFEC6B0.3030802@freebsd.org> Date: Wed, 08 Dec 2010 01:43:44 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <20101207230624.7b7a83d3@core.draftnet> <20101207231129.771422fc@core.draftnet> In-Reply-To: <20101207231129.771422fc@core.draftnet> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:43:49 -0000 on 08/12/2010 01:11 Bruce Cran said the following: > On Tue, 7 Dec 2010 23:06:24 +0000 > Bruce Cran wrote: >> I guess the fields are still defined to keep old tools happy. > > I mean that values are still returned by the drive firmware, > while they could be left zero according to the spec. For example a new > 1TB ATA-8 drive returns a geometry of 16H/63S/16383C in those fields. Right. But we shouldn't bother reading those values, because they are specified as unused. Well, some retarded 10+ years old software should probably be kept happy, but modern FreeBSD is not like that, right? :) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:56:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E763106564A; Tue, 7 Dec 2010 23:56:52 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13DF28FC17; Tue, 7 Dec 2010 23:56:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7NupQ6084069; Tue, 7 Dec 2010 23:56:51 GMT (envelope-from flo@svn.freebsd.org) Received: (from flo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7NupYB084066; Tue, 7 Dec 2010 23:56:51 GMT (envelope-from flo@svn.freebsd.org) Message-Id: <201012072356.oB7NupYB084066@svn.freebsd.org> From: Florian Smeets Date: Tue, 7 Dec 2010 23:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216282 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:56:52 -0000 Author: flo (ports committer) Date: Tue Dec 7 23:56:51 2010 New Revision: 216282 URL: http://svn.freebsd.org/changeset/base/216282 Log: Add myself to calendar.freebsd and committers-ports.dot Approved by: fjoe (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Dec 7 23:44:07 2010 (r216281) +++ head/share/misc/committers-ports.dot Tue Dec 7 23:56:51 2010 (r216282) @@ -80,6 +80,7 @@ eik [label="Oliver Eikemeier\neik@FreeBS erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04"] farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] +flo [label="Florian Smeets\nflo@FreeBSD.org\n2010/12/07"] fluffy [label="Dima Panov\nfluffy@FreeBSD.org\n2009/08/10"] flz [label="Florent Thoumie\nflz@FreeBSD.org\n2005/03/01"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2006/12/05"] @@ -230,6 +231,7 @@ erwin -> lth erwin -> simon fjoe -> danfe +fjoe -> flo fjoe -> krion fjoe -> osa @@ -262,6 +264,7 @@ itetcu -> dryice itetcu -> sahil jadawin -> bapt +jadawin -> flo joerg -> netchild Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Dec 7 23:44:07 2010 (r216281) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Dec 7 23:56:51 2010 (r216282) @@ -159,6 +159,7 @@ 05/25 Tom Rhodes born in Ellwood City, Pennsylvania, United States, 1981 05/25 Roman Divacky born in Brno, Czech Republic, 1983 05/26 Jim Pirzyk born in Chicago, Illinois, United States, 1968 +05/26 Florian Smeets born in Schwerte, Nordrhein-Westfalen, Germany, 1982 05/27 Ollivier Robert born in Paris, France, 1967 05/29 Wilko Bulte born in Arnhem, the Netherlands, 1965 05/29 Seigo Tanimura born in Kitakyushu, Fukuoka, Japan, 1976 From owner-svn-src-head@FreeBSD.ORG Tue Dec 7 23:59:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9FE9E106566B for ; Tue, 7 Dec 2010 23:59:47 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 9601D17A552 for ; Tue, 7 Dec 2010 23:59:46 +0000 (UTC) Received: (qmail 16814 invoked from network); 7 Dec 2010 23:59:46 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2010 23:59:46 -0000 Message-ID: <4CFECA72.1070606@freebsd.org> Date: Tue, 07 Dec 2010 15:59:46 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100803 Thunderbird/3.0.6 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201012072333.oB7NXKTl083547@svn.freebsd.org> In-Reply-To: <201012072333.oB7NXKTl083547@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r216280 - head/sys/xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 23:59:47 -0000 On 12/07/10 15:33, Colin Percival wrote: > Log: > Postpone the unmasking of event channels (aka. interrupts) until after > the interrupt handlers have been registered. NULL isn't a very good > interrupt handler. Forgot to add: While here, make bind_ipi_to_irq static, since it isn't used from any other files in the tree, and all the other bind_*_to_irq functions are already static. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 00:09:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E7E01065675; Wed, 8 Dec 2010 00:09:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C9F78FC17; Wed, 8 Dec 2010 00:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB809OZq084391; Wed, 8 Dec 2010 00:09:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB809OBk084385; Wed, 8 Dec 2010 00:09:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012080009.oB809OBk084385@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Dec 2010 00:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216283 - in head/sys: amd64/amd64 amd64/include conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 00:09:24 -0000 Author: jkim Date: Wed Dec 8 00:09:24 2010 New Revision: 216283 URL: http://svn.freebsd.org/changeset/base/216283 Log: Merge sys/amd64/amd64/tsc.c and sys/i386/i386/tsc.c and move to sys/x86/x86. Discussed with: avg Added: head/sys/x86/x86/tsc.c - copied unchanged from r216279, head/sys/i386/i386/tsc.c Deleted: head/sys/amd64/amd64/tsc.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/include/cpu.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Tue Dec 7 23:56:51 2010 (r216282) +++ head/sys/amd64/include/cpu.h Wed Dec 8 00:09:24 2010 (r216283) @@ -56,6 +56,7 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; +extern int tsc_present; void cpu_halt(void); void cpu_reset(void); Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Dec 7 23:56:51 2010 (r216282) +++ head/sys/conf/files.amd64 Wed Dec 8 00:09:24 2010 (r216283) @@ -126,7 +126,6 @@ amd64/amd64/stack_machdep.c optional ddb amd64/amd64/support.S standard amd64/amd64/sys_machdep.c standard amd64/amd64/trap.c standard -amd64/amd64/tsc.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard @@ -326,3 +325,4 @@ x86/x86/mptable.c optional mptable x86/x86/mptable_pci.c optional mptable pci x86/x86/msi.c optional pci x86/x86/nexus.c standard +x86/x86/tsc.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Dec 7 23:56:51 2010 (r216282) +++ head/sys/conf/files.i386 Wed Dec 8 00:09:24 2010 (r216283) @@ -312,7 +312,6 @@ i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard i386/i386/trap.c standard -i386/i386/tsc.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard @@ -415,3 +414,4 @@ x86/x86/mptable.c optional apic native x86/x86/mptable_pci.c optional apic pci x86/x86/msi.c optional apic pci x86/x86/nexus.c standard +x86/x86/tsc.c standard Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Dec 7 23:56:51 2010 (r216282) +++ head/sys/conf/files.pc98 Wed Dec 8 00:09:24 2010 (r216283) @@ -164,7 +164,6 @@ i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard i386/i386/trap.c standard -i386/i386/tsc.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard @@ -259,3 +258,4 @@ x86/x86/mptable.c optional apic x86/x86/mptable_pci.c optional apic pci x86/x86/msi.c optional apic pci x86/x86/nexus.c standard +x86/x86/tsc.c standard Copied: head/sys/x86/x86/tsc.c (from r216279, head/sys/i386/i386/tsc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/tsc.c Wed Dec 8 00:09:24 2010 (r216283, copy of r216279, head/sys/i386/i386/tsc.c) @@ -0,0 +1,281 @@ +/*- + * Copyright (c) 1998-2003 Poul-Henning Kamp + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_clock.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cpufreq_if.h" + +uint64_t tsc_freq; +int tsc_is_broken; +int tsc_is_invariant; +int tsc_present; +static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; + +SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, + &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); +TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); + +#ifdef SMP +static int smp_tsc; +SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, + "Indicates whether the TSC is safe to use in SMP mode"); +TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc); +#endif + +static void tsc_freq_changed(void *arg, const struct cf_level *level, + int status); +static void tsc_freq_changing(void *arg, const struct cf_level *level, + int *status); +static unsigned tsc_get_timecount(struct timecounter *tc); +static void tsc_levels_changed(void *arg, int unit); + +static struct timecounter tsc_timecounter = { + tsc_get_timecount, /* get_timecount */ + 0, /* no poll_pps */ + ~0u, /* counter_mask */ + 0, /* frequency */ + "TSC", /* name */ + 800, /* quality (adjusted in code) */ +}; + +void +init_TSC(void) +{ + u_int64_t tscval[2]; + + if (cpu_feature & CPUID_TSC) + tsc_present = 1; + else + tsc_present = 0; + + if (!tsc_present) + return; + + if (bootverbose) + printf("Calibrating TSC clock ... "); + + tscval[0] = rdtsc(); + DELAY(1000000); + tscval[1] = rdtsc(); + + tsc_freq = tscval[1] - tscval[0]; + if (bootverbose) + printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); + + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_INTEL: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xe) || + (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x3)) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_CENTAUR: + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf && + (rdmsr(0x1203) & 0x100000000ULL) == 0) + tsc_is_invariant = 1; + break; + } + + /* + * Inform CPU accounting about our boot-time clock rate. This will + * be updated if someone loads a cpufreq driver after boot that + * discovers a new max frequency. + */ + set_cputicker(rdtsc, tsc_freq, 1); + + if (tsc_is_invariant) + return; + + /* Register to find out about changes in CPU frequency. */ + tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, + tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); + tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, + tsc_freq_changed, NULL, EVENTHANDLER_PRI_FIRST); + tsc_levels_tag = EVENTHANDLER_REGISTER(cpufreq_levels_changed, + tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); +} + +void +init_TSC_tc(void) +{ + + if (!tsc_present) + return; + + /* + * We can not use the TSC if we support APM. Precise timekeeping + * on an APM'ed machine is at best a fools pursuit, since + * any and all of the time spent in various SMM code can't + * be reliably accounted for. Reading the RTC is your only + * source of reliable time info. The i8254 loses too, of course, + * but we need to have some kind of time... + * We don't know at this point whether APM is going to be used + * or not, nor when it might be activated. Play it safe. + */ + if (power_pm_get_type() == POWER_PM_TYPE_APM) { + tsc_timecounter.tc_quality = -1000; + if (bootverbose) + printf("TSC timecounter disabled: APM enabled.\n"); + } + +#ifdef SMP + /* + * We can not use the TSC in SMP mode unless the TSCs on all CPUs + * are somehow synchronized. Some hardware configurations do + * this, but we have no way of determining whether this is the + * case, so we do not use the TSC in multi-processor systems + * unless the user indicated (by setting kern.timecounter.smp_tsc + * to 1) that he believes that his TSCs are synchronized. + */ + if (mp_ncpus > 1 && !smp_tsc) + tsc_timecounter.tc_quality = -100; +#endif + + if (tsc_freq != 0 && !tsc_is_broken) { + tsc_timecounter.tc_frequency = tsc_freq; + tc_init(&tsc_timecounter); + } +} + +/* + * When cpufreq levels change, find out about the (new) max frequency. We + * use this to update CPU accounting in case it got a lower estimate at boot. + */ +static void +tsc_levels_changed(void *arg, int unit) +{ + device_t cf_dev; + struct cf_level *levels; + int count, error; + uint64_t max_freq; + + /* Only use values from the first CPU, assuming all are equal. */ + if (unit != 0) + return; + + /* Find the appropriate cpufreq device instance. */ + cf_dev = devclass_get_device(devclass_find("cpufreq"), unit); + if (cf_dev == NULL) { + printf("tsc_levels_changed() called but no cpufreq device?\n"); + return; + } + + /* Get settings from the device and find the max frequency. */ + count = 64; + levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); + if (levels == NULL) + return; + error = CPUFREQ_LEVELS(cf_dev, levels, &count); + if (error == 0 && count != 0) { + max_freq = (uint64_t)levels[0].total_set.freq * 1000000; + set_cputicker(rdtsc, max_freq, 1); + } else + printf("tsc_levels_changed: no max freq found\n"); + free(levels, M_TEMP); +} + +/* + * If the TSC timecounter is in use, veto the pending change. It may be + * possible in the future to handle a dynamically-changing timecounter rate. + */ +static void +tsc_freq_changing(void *arg, const struct cf_level *level, int *status) +{ + + if (*status != 0 || timecounter != &tsc_timecounter) + return; + + printf("timecounter TSC must not be in use when " + "changing frequencies; change denied\n"); + *status = EBUSY; +} + +/* Update TSC freq with the value indicated by the caller. */ +static void +tsc_freq_changed(void *arg, const struct cf_level *level, int status) +{ + + /* If there was an error during the transition, don't do anything. */ + if (status != 0) + return; + + /* Total setting for this level gives the new frequency in MHz. */ + tsc_freq = (uint64_t)level->total_set.freq * 1000000; + tsc_timecounter.tc_frequency = tsc_freq; +} + +static int +sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS) +{ + int error; + uint64_t freq; + + if (tsc_timecounter.tc_frequency == 0) + return (EOPNOTSUPP); + freq = tsc_freq; + error = sysctl_handle_quad(oidp, &freq, 0, req); + if (error == 0 && req->newptr != NULL) { + tsc_freq = freq; + tsc_timecounter.tc_frequency = tsc_freq; + } + return (error); +} + +SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW, + 0, 0, sysctl_machdep_tsc_freq, "QU", ""); + +static unsigned +tsc_get_timecount(struct timecounter *tc) +{ + return (rdtsc()); +} From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 01:24:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BE961065679; Wed, 8 Dec 2010 01:24:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A7398FC18; Wed, 8 Dec 2010 01:24:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB81O5Lf086077; Wed, 8 Dec 2010 01:24:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB81O5Te086075; Wed, 8 Dec 2010 01:24:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012080124.oB81O5Te086075@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 8 Dec 2010 01:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216284 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 01:24:05 -0000 Author: yongari Date: Wed Dec 8 01:24:05 2010 New Revision: 216284 URL: http://svn.freebsd.org/changeset/base/216284 Log: r184610 changed the way how TX frames are handled on AX88178 and AX88772 controllers. ASIX added a new feature for AX88178/AX88772 controllers which allows combining multiple TX frames into a single big frame. This was to overcome one of USB limitation where it can't generate more than 8k interrupts/sec which in turn means USB ethernet controllers can not send more than 8k packets per second. Using ASIX's feature greatly enhanced TX performance(more than 3~4 times) compared to 7.x driver. However it seems r184610 removed boundary checking for buffered frames which in turn caused instability issues under certain conditions. In addition, using ASIX's feature triggered another issue which made USB controller hang under certain conditions. Restarting ethernet controller didn't help under this hang condition and unplugging and replugging the controller was the only solution. I believe there is a silicon bug in TX frame combining feature on AX88178/AX88772 controllers. To address these issues, reintroduce the boundary checking for both AX88178 and AX88772 after copying a frame to USB buffer and do not use ASIX's multiple frame combining feature. Instead, use USB controller's multi-frame transmit capability to enhance TX performance as suggested by Hans[1]. This should fix a long standing axe(4) instability issues reported on AX88772 and AX88178 controllers. While I'm here remove unnecessary TX frame length check since upper stack always guarantee the size of a frame to be less than MCLBYTES. Special thanks to Derrick Brashear who tried numerous patches during last 4 months and waited real fix with patience. Without this enthusiastic support, patience and H/W donation I couldn't fix it since I was not able to trigger the issue on my box. Suggested by: hselasky [1] Tested by: Derrick Brashear (shadow <> gmail dot com> H/W donated by: Derrick Brashear (shadow <> gmail dot com> PR: usb/140883 Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Wed Dec 8 00:09:24 2010 (r216283) +++ head/sys/dev/usb/net/if_axe.c Wed Dec 8 01:24:05 2010 (r216284) @@ -200,7 +200,8 @@ static const struct usb_config axe_confi .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .bufsize = AXE_BULK_BUF_SIZE, + .frames = 16, + .bufsize = 16 * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axe_bulk_write_callback, .timeout = 10000, /* 10 seconds */ @@ -939,7 +940,7 @@ axe_bulk_write_callback(struct usb_xfer struct ifnet *ifp = uether_getifp(&sc->sc_ue); struct usb_page_cache *pc; struct mbuf *m; - int pos; + int nframes, pos; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -956,40 +957,34 @@ tr_setup: */ return; } - pos = 0; - pc = usbd_xfer_get_frame(xfer, 0); - - while (1) { + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - - if (m == NULL) { - if (pos > 0) - break; /* send out data */ - return; - } - if (m->m_pkthdr.len > MCLBYTES) { - m->m_pkthdr.len = MCLBYTES; - } + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + pos = 0; + pc = usbd_xfer_get_frame(xfer, nframes); if (AXE_IS_178_FAMILY(sc)) { - hdr.len = htole16(m->m_pkthdr.len); hdr.ilen = ~hdr.len; - usbd_copy_in(pc, pos, &hdr, sizeof(hdr)); - pos += sizeof(hdr); - - /* - * NOTE: Some drivers force a short packet - * by appending a dummy header with zero - * length at then end of the USB transfer. - * This driver uses the - * USB_FORCE_SHORT_XFER flag instead. - */ + usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); + pos += m->m_pkthdr.len; + if ((pos % 512) == 0) { + hdr.len = 0; + hdr.ilen = 0xffff; + usbd_copy_in(pc, pos, &hdr, + sizeof(hdr)); + pos += sizeof(hdr); + } + } else { + usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); + pos += m->m_pkthdr.len; } - usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); - pos += m->m_pkthdr.len; /* * XXX @@ -1010,22 +1005,16 @@ tr_setup: m_freem(m); - if (AXE_IS_178_FAMILY(sc)) { - if (pos > (AXE_BULK_BUF_SIZE - MCLBYTES - sizeof(hdr))) { - /* send out frame(s) */ - break; - } - } else { - /* send out frame */ - break; - } + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, pos); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } - - usbd_xfer_set_frame_len(xfer, 0, pos); - usbd_transfer_submit(xfer); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; - + /* NOTREACHED */ default: /* Error */ DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 01:24:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C174E1065672; Wed, 8 Dec 2010 01:24:28 +0000 (UTC) Date: Wed, 8 Dec 2010 01:24:28 +0000 From: Alexey Dokuchaev To: John Baldwin Message-ID: <20101208012428.GA33197@FreeBSD.org> References: <201012071849.oB7InB4J076962@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201012071849.oB7InB4J076962@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216263 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 01:24:28 -0000 On Tue, Dec 07, 2010 at 06:49:11PM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Dec 7 18:49:11 2010 > New Revision: 216263 > URL: http://svn.freebsd.org/changeset/base/216263 > > Log: > Use proper resource ID's for HPET IRQ resources. This mostly consists of > looking to see if there is an existing IRQ resource for a given IRQ > provided by the BIOS and using that RID if so. Otherwise, allocate a new > RID for the new IRQ. Could it be related to "device_attach: acpi_hpet0 attach returned 12" messages quite a few of us are seeing by chance? If yes, will it be MFCed to 7/8? ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 01:35:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 932AC106564A; Wed, 8 Dec 2010 01:35:19 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 828508FC0C; Wed, 8 Dec 2010 01:35:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB81ZJQf086342; Wed, 8 Dec 2010 01:35:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB81ZJZt086340; Wed, 8 Dec 2010 01:35:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012080135.oB81ZJZt086340@svn.freebsd.org> From: Kevin Lo Date: Wed, 8 Dec 2010 01:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216285 - head/usr.sbin/cxgbtool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 01:35:19 -0000 Author: kevlo Date: Wed Dec 8 01:35:19 2010 New Revision: 216285 URL: http://svn.freebsd.org/changeset/base/216285 Log: Closing file descriptors when it's done Reviewed by: np Modified: head/usr.sbin/cxgbtool/cxgbtool.c Modified: head/usr.sbin/cxgbtool/cxgbtool.c ============================================================================== --- head/usr.sbin/cxgbtool/cxgbtool.c Wed Dec 8 01:24:05 2010 (r216284) +++ head/usr.sbin/cxgbtool/cxgbtool.c Wed Dec 8 01:35:19 2010 (r216285) @@ -1014,6 +1014,8 @@ load_fw(int argc, char *argv[], int star op.len = len; if (doit(iff_name, CHELSIO_LOAD_FW, &op) < 0) err(1, "load firmware"); + + close(fd); return 0; } @@ -1048,6 +1050,7 @@ load_boot(int argc, char *argv[], int st if (doit(iff_name, CHELSIO_LOAD_BOOT, &op) < 0) err(1, "load boot image"); + close(fd); return 0; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 03:23:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 918D3106564A; Wed, 8 Dec 2010 03:23:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 22E908FC15; Wed, 8 Dec 2010 03:23:29 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB83NKWi015370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 14:23:21 +1100 Date: Wed, 8 Dec 2010 14:23:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Barton In-Reply-To: <4CFE99E1.5030301@FreeBSD.org> Message-ID: <20101208134217.V1149@besplex.bde.org> References: <201012061218.oB6CI3oW032770@svn.freebsd.org> <20101206195327.GD1936@garage.freebsd.pl> <201012061518.49835.jhb@freebsd.org> <4CFD514E.8010103@FreeBSD.org> <20101207095137.GC1700@garage.freebsd.pl> <4CFE0B9E.3060808@FreeBSD.org> <20101207110410.GE1700@garage.freebsd.pl> <4CFE1B0F.90908@FreeBSD.org> <20101207115106.GB68479@muon.cran.org.uk> <4CFE99E1.5030301@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Bruce Cran , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , Alexander Motin , Ivan Voras , svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 03:23:30 -0000 On Tue, 7 Dec 2010, Doug Barton wrote: > On 12/07/2010 03:51, Bruce Cran wrote: >> From a new installation of Windows 7 and FreeBSD CURRENT: >> >> GEOM: ada0: partition 3 does not start on a track boundary. >> GEOM: ada0: partition 3 does not end on a track boundary. >> GEOM: ada0: partition 2 does not start on a track boundary. >> GEOM: ada0: partition 2 does not end on a track bounary. >> >> Partition 2 is the reserved partition while 3 is an NTFS partition, both >> created in the Windows setup application. >> >> Since Windows isn't bothering to align partitions do we still need to >> warn about it? > > It would be great to remove this warning. I see the same problem with > partitions created by Linux, which uses the Windows'y version of CHS. GEOM_PART spews warnings like this (IIRC the same ones) for partitions created by FreeBSD when FreeBSD actually knew the correct (fictitious BIOS) geometry. Killing GEOM_PART stopped them. Note that GEOM_PART is inflicted by conf/DEFAULTS, at least for i386. # Kill bad default options. nooptions GEOM_PART_BSD nooptions GEOM_PART_EBR nooptions GEOM_PART_EBR_COMPAT nooptions GEOM_PART_MBR # Add non-default options. options GEOM_BSD options GEOM_MBR GEOM_PART also gave weirdness for FreeBSD partitions, with multiple device entries for some partitions and other aliasing bugs. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 05:46:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FED4106566B; Wed, 8 Dec 2010 05:46:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 250338FC18; Wed, 8 Dec 2010 05:46:25 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB85kHJw000969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 16:46:18 +1100 Date: Wed, 8 Dec 2010 16:46:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4CFEB1AD.70906@freebsd.org> Message-ID: <20101208153857.H1428@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Matthew Jacob , Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 05:46:26 -0000 On Wed, 8 Dec 2010, Andriy Gapon wrote: > on 08/12/2010 00:05 Matthew Jacob said the following: >> >> >> On 12/7/2010 1:54 PM, Andriy Gapon wrote: >>> on 07/12/2010 22:46 Bruce Cran said the following: >>>> Don't warn if a partition appears not to be aligned on a track boundary. >>>> Modern disks use LBA and create a fake CHS geometry that doesn't have any >>>> relation to the on-disk layout of data. >>> You repeated that statement, so I am picking on you :-) >>> Can someone show me how/where exactly modern drives fakes CHS geometry? >> >> cf cam_calc_geometry > > But that's not drive firmware code :-) Indeed. > It's us faking those parameters for ourselves for some unknown reason. > Stupid us :-) But not the drives / manufacturers. Faking the geometry, and determining the correct fake, goes back at least 20 years to Adaptec SCSI BIOSes for host adaptors. AFAIK, SCSI drives never had any CHS geometry, fake or otherwise. But some O/S's wanted CHS. This was faked in BIOS ROMs for at least the better host adaptors, since booting is too hard if it is only in a driver loaded from a file system. Originally the fake was fairly statically configured using rules like the ones in cam_calc_geometry(), but different adaptor manufacturers used different rules (or maybe there was a jumper or BIOS option to control the behaviour, but this was too confusing for users) so there were large problems changing the adaptor. So BIOSes started attempting to determine the CHS geometry that is actually used by O/S's, according to partition table entries, and supplied that as a fake instead of their default fake. This caused different large problems changing the adaptor, when bugs or differences in the algorithm caused different fakes to be determined. FreeBSD used to try to determine determine the CHS geometry that is actually used by O/S's, using similar algorithms to the BIOSes. This has been lost to GEOM. GEOM now "uses" whatever geometry is supplied by lower layers. I know of the following cases: - for SCSI drives, I think it uses the fake generated by cam_calc_geometry(). This is not too bad. It would have been invariant over the last for 20-30 years if SCSI BIOSes had agreed on it originally. Perhaps the SCSI standard now specifies this. Unfortunately, cam_calc_geometry() has no comment about this. - I think the next case would break pc98, so pc98 uses a hook to supply a more compatible default. - for ATA drives, it uses the "firmware" geometry supplied by the drive firmware. The ATA standard specifies this to be H=16/S=63 for all drives larger than a certain size (IIRC, about 8GB, which is the size at which the better default fake of H=255/S=63 generated by cam_calc_geometry() for drives larger than 1GB, stops working for systems that can't handle more than 1024 fake cylinders. The magic 1GB is the size at which the even better default fake of H=64/S=32 stops working with more than 1024 fake cylinders. cam_calc_geometry() has no comment about this either). Since all modern ATA drives are larger than 8GB, H=16/S=63 is almost hard-coded for ATA. This results in GEOM "using" a geometry that is wrong in many cases for non-pc98 ATA drives, since many were configured with H=255/S=63. The other cases are more compatible. After this commit, GEOM hopefully doesn't actually use the CHS geometry for anything. It should just report it to userland, and should get it right for that. The correct geometry has little to do with the "firmware" geometry. It is whatever the BIOS or disks are using, if anything is still using CHS. Modern BIOSes should "use" CHS in the same way that GEOM should, that is, never, but they should report it for old software to use, and should get it right for that. I don't know how far they have got towards that. Some support H=16/S=63 but default to weird geometries. Some allow this to be configured. I always configure to "LBA" (H=255/S=63) for compatibility. >>> Let me specifically ask that question about modern (S)ATA drives directly >>> connected to a system (controller). >>> My impression is at least since ATA-7 there is no mentioning of anything >>> CHS-related in the specification. The fact that we keep reading and >>> interpreting some historically defined bytes that are now marked as >>> unused/reserved doesn't mean that those bytes actually mean anything. Aren't they optional? Last time I looked at the ATA standard (5-10 years ago), IIRC it said that support for CHS translation mode is optional, but when it is supported all the fields for using it (the default translation mode (always H=16/C=63 for modern drives) and the current translation mode) must be supported. I guess support for it is now so cheap that most manufacturers support it for compatibility. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 06:03:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 116BC106564A; Wed, 8 Dec 2010 06:03:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD748FC12; Wed, 8 Dec 2010 06:03:43 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB863X5K019020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 17:03:34 +1100 Date: Wed, 8 Dec 2010 17:03:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <20101207230624.7b7a83d3@core.draftnet> Message-ID: <20101208164726.T1583@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <20101207230624.7b7a83d3@core.draftnet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 06:03:44 -0000 On Tue, 7 Dec 2010, Bruce Cran wrote: > On Tue, 07 Dec 2010 23:54:17 +0200 > Andriy Gapon wrote: > >> You repeated that statement, so I am picking on you :-) >> Can someone show me how/where exactly modern drives fakes CHS >> geometry? Let me specifically ask that question about modern (S)ATA >> drives directly connected to a system (controller). >> My impression is at least since ATA-7 there is no mentioning of >> anything CHS-related in the specification. The fact that we keep >> reading and interpreting some historically defined bytes that are now >> marked as unused/reserved doesn't mean that those bytes actually mean >> anything. > > You're right: I last looked at the IDENTIFY data about 7 years ago when > those fields were defined; now they're marked as "obsolete". I guess > the fields are still defined to keep old tools happy. Both atacontrol > and camcontrol are still reading the IDENTIFY data and outputting > the CHS fields even on ATA-8 drives, which I guess they shouldn't be. Utilities for reporting capabilities must report capabilities if they are supported. Whether unsupported fields should be reported as integer 0's or in a special format (e.g., not printing anything for unsupported sub-fields) is another question. atacontrol is a bit too simple and inconsistent. It prints CHS values unconditionally. Then it prints "CFA supported" if CFA is supported, else nothing. Then it inconsistently prints "LBA supported " if LBA is supported, else "LBA not supported ". Then it prints the number of sectors supported by LBA, but under a different condition. Then it prints many more things like it prints LBA, using "supported/not supported" or, again inconsistently, "yes/no" instead of "supported"/nothing. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 06:25:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32FF81065670; Wed, 8 Dec 2010 06:25:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id A3C588FC08; Wed, 8 Dec 2010 06:25:38 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB86PUlb024536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 17:25:31 +1100 Date: Wed, 8 Dec 2010 17:25:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4CFEC620.80900@freebsd.org> Message-ID: <20101208170915.B1583@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <4CFEBF27.8010203@feral.com> <4CFEC620.80900@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Matthew Jacob , Bruce Cran Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 06:25:39 -0000 On Wed, 8 Dec 2010, Andriy Gapon wrote: > on 08/12/2010 01:11 Matthew Jacob said the following: >> Geometry is still important. Trying booting a USB flash drive on all BIOS' with >> a 63/255 geometry instead of a 64/32 geometry. > > Well, I don't know anything about USB... > My point about modern HDDs still stands. Hmm, I know how to avoid geometry errors in FreeBSD, but recently had them for Linux, and had problems booting USB drives, which I didn't know might be caused by geometry. One USB drive has the manufacturer's partitioning, which has starting CHS consistent with H=any/C=44 and ending CHS consistent with H=255/S=63. cam gives the default fake geometry of H=255/S=63, and my de-GEOMed kernel doesn't change this since it is consistent enough with the partitioning. This drive is not bootable and I haven't noticed any problems with it. Another USB drive has all partitions configured using the cam default. It boots on some systems only, almost never on one except IIRC it once booted on that too, when the partitioning may have been simpler. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 07:10:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390EA1065672; Wed, 8 Dec 2010 07:10:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293558FC13; Wed, 8 Dec 2010 07:10:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB87AQcl093903; Wed, 8 Dec 2010 07:10:26 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB87AQKN093901; Wed, 8 Dec 2010 07:10:26 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201012080710.oB87AQKN093901@svn.freebsd.org> From: Hiroki Sato Date: Wed, 8 Dec 2010 07:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216288 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 07:10:26 -0000 Author: hrs Date: Wed Dec 8 07:10:25 2010 New Revision: 216288 URL: http://svn.freebsd.org/changeset/base/216288 Log: Fix a typo. Submitted by: Garrett Cooper Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Dec 8 07:00:53 2010 (r216287) +++ head/share/man/man5/rc.conf.5 Wed Dec 8 07:10:25 2010 (r216288) @@ -1293,7 +1293,7 @@ the default address selection policy tab will be IPv4-preferred. .Pp This variable is deprecated. Use -.Va ip6addtctl_policy +.Va ip6addrctl_policy instead. .It Va ipv6_activate_all_interfaces If the variable is From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 07:26:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93EAA106564A; Wed, 8 Dec 2010 07:26:23 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id B9F3E8FC13; Wed, 8 Dec 2010 07:26:22 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=omSrwDgyMf70S47Fr5SNr0rQzcmIOo0IafWlB/wSLLo= c=1 sm=1 a=EQKt_A94TbYA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=wGt0rkJ7ev7f6HlTLv4A:9 a=pWPeusPFLeGuWv8lXEjulvTpUrYA:4 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 59838808; Wed, 08 Dec 2010 08:26:20 +0100 From: Hans Petter Selasky To: Pyun YongHyeon Date: Wed, 8 Dec 2010 08:26:50 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201012080124.oB81O5Te086075@svn.freebsd.org> In-Reply-To: <201012080124.oB81O5Te086075@svn.freebsd.org> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201012080826.50794.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r216284 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 07:26:23 -0000 On Wednesday 08 December 2010 02:24:05 Pyun YongHyeon wrote: > - if (m->m_pkthdr.len > MCLBYTES) { > - m->m_pkthdr.len = MCLBYTES; > - } You are sure that no packets passed to this code is bigger than MCLBYTES minus overhead by AXE protocol ? Even if MTU is changed by ifconfig? --HPS From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 07:46:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1871D106564A; Wed, 8 Dec 2010 07:46:51 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f49.google.com (mail-fx0-f49.google.com [209.85.161.49]) by mx1.freebsd.org (Postfix) with ESMTP id 1CE218FC15; Wed, 8 Dec 2010 07:46:49 +0000 (UTC) Received: by fxm19 with SMTP id 19so729932fxm.36 for ; Tue, 07 Dec 2010 23:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=P8K+j8XkL7o9Htvwz0XtFz36GXoJhNc1YrejSwFJ23A=; b=q2QOXyL9H/TYSGA43hHH9oYry70J5o84y7LPaft8+GRnTRcvvgahW4xLhP4MhD6lZK W6Qhen/x6cAcA4wpK3WzeOvrekGMTAV2HlibeSJY8hl9M8dFo19fCA6U3btCIUIrt7t2 iQHsS/4GdeuR7IwESYe0cTvfrJd40NWyH+gNU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=D5XXfVL0EneFHGg6x23vOZDrM5l5evOzN1oH/TIW8O5NmO4PYHyBCnuCOO2CSa2hIo zmFm7rSuTrovbCN8HtKh/x6tH5BVoZGWIsOk181H6fuRVOEt/THvXipgxgPEeM+1a6LJ 4FdOiHECcg878cTZeF27FxvkaolMNbz9TqFkM= Received: by 10.223.86.194 with SMTP id t2mr8121190fal.40.1291794408755; Tue, 07 Dec 2010 23:46:48 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n2sm61967fam.4.2010.12.07.23.46.46 (version=SSLv3 cipher=RC4-MD5); Tue, 07 Dec 2010 23:46:47 -0800 (PST) Sender: Alexander Motin Message-ID: <4CFF37CB.5040202@FreeBSD.org> Date: Wed, 08 Dec 2010 09:46:19 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Alexey Dokuchaev References: <201012071849.oB7InB4J076962@svn.freebsd.org> <20101208012428.GA33197@FreeBSD.org> In-Reply-To: <20101208012428.GA33197@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r216263 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 07:46:51 -0000 Alexey Dokuchaev wrote: > On Tue, Dec 07, 2010 at 06:49:11PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Tue Dec 7 18:49:11 2010 >> New Revision: 216263 >> URL: http://svn.freebsd.org/changeset/base/216263 >> >> Log: >> Use proper resource ID's for HPET IRQ resources. This mostly consists of >> looking to see if there is an existing IRQ resource for a given IRQ >> provided by the BIOS and using that RID if so. Otherwise, allocate a new >> RID for the new IRQ. > > Could it be related to "device_attach: acpi_hpet0 attach returned 12" > messages quite a few of us are seeing by chance? If yes, will it be > MFCed to 7/8? HPET driver on 7/8 doesn't yet using IRQs at all. If it fails, then for some other reason. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 08:57:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1A2D106566B; Wed, 8 Dec 2010 08:57:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99F928FC08; Wed, 8 Dec 2010 08:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB88vbv5096252; Wed, 8 Dec 2010 08:57:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB88vbH6096250; Wed, 8 Dec 2010 08:57:37 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201012080857.oB88vbH6096250@svn.freebsd.org> From: Martin Matuska Date: Wed, 8 Dec 2010 08:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216291 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 08:57:38 -0000 Author: mm Date: Wed Dec 8 08:57:37 2010 New Revision: 216291 URL: http://svn.freebsd.org/changeset/base/216291 Log: Do not print OpenSolaris hint to use (non-existing) installgrub(1) command if creating a mirror by attaching a new vdev to a root pool. Reported by: James R. Van Artsdalen (on freebsd-fs@freebsd.org) Approved by: delphij (mentor) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Dec 8 08:01:27 2010 (r216290) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Dec 8 08:57:37 2010 (r216291) @@ -48,11 +48,13 @@ static int read_efi_label(nvlist_t *config, diskaddr_t *sb); +#ifdef sun #if defined(__i386) || defined(__amd64) #define BOOTCMD "installgrub(1M)" #else #define BOOTCMD "installboot(1M)" #endif +#endif /* sun */ /* * ==================================================================== @@ -1888,6 +1890,7 @@ zpool_vdev_attach(zpool_handle_t *zhp, zcmd_free_nvlists(&zc); if (ret == 0) { +#ifdef sun if (rootpool) { /* * XXX - This should be removed once we can @@ -1898,6 +1901,7 @@ zpool_vdev_attach(zpool_handle_t *zhp, "be sure to invoke %s to make '%s' bootable.\n"), BOOTCMD, new_disk); } +#endif /* sun */ return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 09:04:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42513106566C; Wed, 8 Dec 2010 09:04:43 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id DF0E28FC0C; Wed, 8 Dec 2010 09:04:42 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 78CFB45CA0; Wed, 8 Dec 2010 10:04:40 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 303DF45C8A; Wed, 8 Dec 2010 10:04:34 +0100 (CET) Date: Wed, 8 Dec 2010 10:04:33 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20101208090433.GB1692@garage.freebsd.pl> References: <201012080857.oB88vbH6096250@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5I6of5zJg18YgZEa" Content-Disposition: inline In-Reply-To: <201012080857.oB88vbH6096250@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216291 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 09:04:43 -0000 --5I6of5zJg18YgZEa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 08, 2010 at 08:57:37AM +0000, Martin Matuska wrote: > Author: mm > Date: Wed Dec 8 08:57:37 2010 > New Revision: 216291 > URL: http://svn.freebsd.org/changeset/base/216291 >=20 > Log: > Do not print OpenSolaris hint to use (non-existing) installgrub(1) comm= and > if creating a mirror by attaching a new vdev to a root pool. This warning is helpful, just incorrect. It should be changed to show steps that are needed on FreeBSD and not just commented out. I left it on purpose as a reminder. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --5I6of5zJg18YgZEa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz/SiEACgkQForvXbEpPzQV7ACfV17XpXh03e/0y9yHVzgj4Ohl wv8An3tUqRoTT07/eIcbLr/aSl+iXtEa =rcWf -----END PGP SIGNATURE----- --5I6of5zJg18YgZEa-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 09:14:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA5CD1065679; Wed, 8 Dec 2010 09:14:16 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3]) by mx1.freebsd.org (Postfix) with ESMTP id 700438FC15; Wed, 8 Dec 2010 09:14:16 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 98B3D12FF27; Wed, 8 Dec 2010 10:14:15 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tTksq2XHnBEp; Wed, 8 Dec 2010 10:14:13 +0100 (CET) Received: from [10.0.3.3] (188-167-67-67.dynamic.chello.sk [188.167.67.67]) by mail.vx.sk (Postfix) with ESMTPSA id 7E8C712FF20; Wed, 8 Dec 2010 10:14:13 +0100 (CET) Message-ID: <4CFF4C65.4030607@FreeBSD.org> Date: Wed, 08 Dec 2010 10:14:13 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201012080857.oB88vbH6096250@svn.freebsd.org> <20101208090433.GB1692@garage.freebsd.pl> In-Reply-To: <20101208090433.GB1692@garage.freebsd.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216291 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 09:14:17 -0000 Here are some arguments: a) it was removed in OpenSolaris rev. 12865:08987220809a b) a root pool does not not have to be a boot pool So if we need a warning here, it should print only some general suggestion because user may attach any vdev (e.g. a file or a memory disk) to make a mirror from a root pool. And as this was removed upstream the warning should be put into perforce as well. Dňa 08.12.2010 10:04, Pawel Jakub Dawidek wrote / napísal(a): > On Wed, Dec 08, 2010 at 08:57:37AM +0000, Martin Matuska wrote: >> Author: mm >> Date: Wed Dec 8 08:57:37 2010 >> New Revision: 216291 >> URL: http://svn.freebsd.org/changeset/base/216291 >> >> Log: >> Do not print OpenSolaris hint to use (non-existing) installgrub(1) command >> if creating a mirror by attaching a new vdev to a root pool. > This warning is helpful, just incorrect. It should be changed to show > steps that are needed on FreeBSD and not just commented out. > I left it on purpose as a reminder. > From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 09:24:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1738910656D7; Wed, 8 Dec 2010 09:24:10 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AF30C8FC42; Wed, 8 Dec 2010 09:24:09 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 54F5745CDC; Wed, 8 Dec 2010 10:24:08 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 0F98B45CD8; Wed, 8 Dec 2010 10:24:03 +0100 (CET) Date: Wed, 8 Dec 2010 10:24:02 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20101208092402.GC1692@garage.freebsd.pl> References: <201012080857.oB88vbH6096250@svn.freebsd.org> <20101208090433.GB1692@garage.freebsd.pl> <4CFF4C65.4030607@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RIYY1s2vRbPFwWeW" Content-Disposition: inline In-Reply-To: <4CFF4C65.4030607@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216291 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 09:24:10 -0000 --RIYY1s2vRbPFwWeW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 08, 2010 at 10:14:13AM +0100, Martin Matuska wrote: > Here are some arguments: >=20 > a) it was removed in OpenSolaris rev. 12865:08987220809a > b) a root pool does not not have to be a boot pool >=20 > So if we need a warning here, it should print only some general > suggestion because > user may attach any vdev (e.g. a file or a memory disk) to make a mirror > from a root pool. > And as this was removed upstream the warning should be put into perforce > as well. Hmm, I think I saw this warning on more recent ZFS. All in all we currently print this when we upgrade root pool we print the following: If you boot from pool 'foo', don't forget to update boot code. Assuming you use GPT partitioning and da0 is your boot disk the following command will do it: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0 (Note, that bootfs property doesn't have to be set to boot from a pool.) We should print similar information when: - We set bootfs property. - Add new vdev(s) to root pool. - Attach new vdev(s) to root pool. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --RIYY1s2vRbPFwWeW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz/TrIACgkQForvXbEpPzQVswCfSm4zSNXnJtB0VncSQk9H9DNc HkwAn35XzoBm4ensov/grw4zAynD4Prx =QbW5 -----END PGP SIGNATURE----- --RIYY1s2vRbPFwWeW-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 10:27:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B641065670; Wed, 8 Dec 2010 10:27:08 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45888FC0C; Wed, 8 Dec 2010 10:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8AR7OC097976; Wed, 8 Dec 2010 10:27:07 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8AR7bj097974; Wed, 8 Dec 2010 10:27:07 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012081027.oB8AR7bj097974@svn.freebsd.org> From: Kevin Lo Date: Wed, 8 Dec 2010 10:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216292 - head/usr.sbin/extattrctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 10:27:08 -0000 Author: kevlo Date: Wed Dec 8 10:27:07 2010 New Revision: 216292 URL: http://svn.freebsd.org/changeset/base/216292 Log: Close fd in initattr() and showattr(). Reviewed by: rwatson Modified: head/usr.sbin/extattrctl/extattrctl.c Modified: head/usr.sbin/extattrctl/extattrctl.c ============================================================================== --- head/usr.sbin/extattrctl/extattrctl.c Wed Dec 8 08:57:37 2010 (r216291) +++ head/usr.sbin/extattrctl/extattrctl.c Wed Dec 8 10:27:07 2010 (r216292) @@ -144,9 +144,11 @@ initattr(int argc, char *argv[]) if (error == -1) { perror(argv[1]); unlink(argv[1]); + close(i); return (-1); } + close(i); return (0); } @@ -168,21 +170,25 @@ showattr(int argc, char *argv[]) i = read(fd, &uef, sizeof(uef)); if (i == -1) { perror(argv[0]); + close(fd); return (-1); } if (i != sizeof(uef)) { fprintf(stderr, "%s: invalid file header\n", argv[0]); + close(fd); return (-1); } if (uef.uef_magic != UFS_EXTATTR_MAGIC) { fprintf(stderr, "%s: bad magic\n", argv[0]); + close(fd); return (-1); } printf("%s: version %d, size %d\n", argv[0], uef.uef_version, uef.uef_size); + close(fd); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 13:51:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED85106566C; Wed, 8 Dec 2010 13:51:25 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0FC8FC27; Wed, 8 Dec 2010 13:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8DpPCB005214; Wed, 8 Dec 2010 13:51:25 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8DpPnr005212; Wed, 8 Dec 2010 13:51:25 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201012081351.oB8DpPnr005212@svn.freebsd.org> From: Martin Matuska Date: Wed, 8 Dec 2010 13:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216293 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 13:51:25 -0000 Author: mm Date: Wed Dec 8 13:51:25 2010 New Revision: 216293 URL: http://svn.freebsd.org/changeset/base/216293 Log: Print message with information about updating the boot code if a new vdev is attached to a root pool (e.g. when creating a mirrored boot pool). Reviewed by: pav Approved by: delphij (mentor) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Dec 8 10:27:07 2010 (r216292) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Dec 8 13:51:25 2010 (r216293) @@ -1890,18 +1890,17 @@ zpool_vdev_attach(zpool_handle_t *zhp, zcmd_free_nvlists(&zc); if (ret == 0) { -#ifdef sun if (rootpool) { - /* - * XXX - This should be removed once we can - * automatically install the bootblocks on the - * newly attached disk. - */ - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Please " - "be sure to invoke %s to make '%s' bootable.\n"), - BOOTCMD, new_disk); + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "If " + "you boot from pool '%s', you may need to update\n" + "boot code on newly attached disk '%s'.\n\n" + "Assuming you use GPT partitioning and 'da0' is " + "your new boot disk\n" + "you may use the following command:\n\n" + "\tgpart bootcode -b /boot/pmbr -p " + "/boot/gptzfsboot -i 1 da0\n\n"), + zhp->zpool_name, new_disk); } -#endif /* sun */ return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 13:51:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073EF1065696; Wed, 8 Dec 2010 13:51:39 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6A118FC19; Wed, 8 Dec 2010 13:51:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8DpcCg005257; Wed, 8 Dec 2010 13:51:38 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8DpcYw005250; Wed, 8 Dec 2010 13:51:38 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012081351.oB8DpcYw005250@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 8 Dec 2010 13:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216294 - in head: contrib/bsnmp/lib contrib/bsnmp/snmp_usm contrib/bsnmp/snmp_vacm contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd usr.sbin/bsnmpd/modules usr.sbin/bsn... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 13:51:39 -0000 Author: syrinx Date: Wed Dec 8 13:51:38 2010 New Revision: 216294 URL: http://svn.freebsd.org/changeset/base/216294 Log: In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). Sponsored by: The FreeBSD Foundation Reviewed by: philip@ (mostly) Approved by: philip@ Added: head/contrib/bsnmp/snmp_usm/ head/contrib/bsnmp/snmp_usm/snmp_usm.3 (contents, props changed) head/contrib/bsnmp/snmp_usm/usm_snmp.c (contents, props changed) head/contrib/bsnmp/snmp_usm/usm_tree.def (contents, props changed) head/contrib/bsnmp/snmp_vacm/ head/contrib/bsnmp/snmp_vacm/snmp_vacm.3 (contents, props changed) head/contrib/bsnmp/snmp_vacm/vacm_snmp.c (contents, props changed) head/contrib/bsnmp/snmp_vacm/vacm_tree.def (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_usm/ head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_vacm/ head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile (contents, props changed) Modified: head/contrib/bsnmp/lib/asn1.c head/contrib/bsnmp/lib/asn1.h head/contrib/bsnmp/lib/bsnmpclient.3 head/contrib/bsnmp/lib/bsnmplib.3 head/contrib/bsnmp/lib/snmp.c head/contrib/bsnmp/lib/snmp.h head/contrib/bsnmp/lib/snmpagent.c head/contrib/bsnmp/lib/snmpclient.c head/contrib/bsnmp/lib/snmpclient.h head/contrib/bsnmp/lib/snmppriv.h head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt head/contrib/bsnmp/snmpd/action.c head/contrib/bsnmp/snmpd/bsnmpd.1 head/contrib/bsnmp/snmpd/config.c head/contrib/bsnmp/snmpd/export.c head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.h head/contrib/bsnmp/snmpd/snmpmod.3 head/contrib/bsnmp/snmpd/snmpmod.h head/contrib/bsnmp/snmpd/trans_lsock.c head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/trap.c head/contrib/bsnmp/snmpd/tree.def head/lib/libbsnmp/libbsnmp/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile head/usr.sbin/bsnmpd/modules/Makefile head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Modified: head/contrib/bsnmp/lib/asn1.c ============================================================================== --- head/contrib/bsnmp/lib/asn1.c Wed Dec 8 13:51:25 2010 (r216293) +++ head/contrib/bsnmp/lib/asn1.c Wed Dec 8 13:51:38 2010 (r216294) @@ -196,7 +196,7 @@ asn_put_temp_header(struct asn_buf *b, u return (ret); } enum asn_err -asn_commit_header(struct asn_buf *b, u_char *ptr) +asn_commit_header(struct asn_buf *b, u_char *ptr, size_t *moved) { asn_len_t len; u_int lenlen, shift; @@ -215,6 +215,8 @@ asn_commit_header(struct asn_buf *b, u_c memmove(ptr + 1 + lenlen, ptr + TEMP_LEN, len); b->asn_ptr -= shift; b->asn_len += shift; + if (moved != NULL) + *moved = shift; } return (ASN_ERR_OK); } @@ -913,6 +915,20 @@ asn_skip(struct asn_buf *b, asn_len_t le } /* + * Add a padding + */ +enum asn_err +asn_pad(struct asn_buf *b, asn_len_t len) +{ + if (b->asn_len < len) + return (ASN_ERR_EOBUF); + b->asn_ptr += len; + b->asn_len -= len; + + return (ASN_ERR_OK); +} + +/* * Compare two OIDs. * * o1 < o2 : -1 Modified: head/contrib/bsnmp/lib/asn1.h ============================================================================== --- head/contrib/bsnmp/lib/asn1.h Wed Dec 8 13:51:25 2010 (r216293) +++ head/contrib/bsnmp/lib/asn1.h Wed Dec 8 13:51:38 2010 (r216294) @@ -93,7 +93,7 @@ enum asn_err asn_get_header(struct asn_b enum asn_err asn_put_header(struct asn_buf *, u_char, asn_len_t); enum asn_err asn_put_temp_header(struct asn_buf *, u_char, u_char **); -enum asn_err asn_commit_header(struct asn_buf *, u_char *); +enum asn_err asn_commit_header(struct asn_buf *, u_char *, size_t *); enum asn_err asn_get_integer_raw(struct asn_buf *, asn_len_t, int32_t *); enum asn_err asn_get_integer(struct asn_buf *, int32_t *); @@ -129,6 +129,7 @@ enum asn_err asn_get_timeticks(struct as enum asn_err asn_put_timeticks(struct asn_buf *, uint32_t); enum asn_err asn_skip(struct asn_buf *, asn_len_t); +enum asn_err asn_pad(struct asn_buf *, asn_len_t); /* * Utility functions for OIDs Modified: head/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmpclient.3 Wed Dec 8 13:51:25 2010 (r216293) +++ head/contrib/bsnmp/lib/bsnmpclient.3 Wed Dec 8 13:51:38 2010 (r216294) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.12 2005/10/04 08:46:50 brandt_h Exp $ .\" -.Dd October 4, 2005 +.Dd September 9, 2010 .Dt BSNMPCLIENT 3 .Os .Sh NAME @@ -52,7 +52,8 @@ .Nm snmp_table_cb_f , .Nm snmp_table_fetch , .Nm snmp_table_fetch_async , -.Nm snmp_dialog +.Nm snmp_dialog , +.Nm snmp_discover_engine .Nd "SNMP client library" .Sh LIBRARY Begemot SNMP library @@ -102,44 +103,56 @@ Begemot SNMP library .Fn snmp_table_fetch_async "const struct snmp_table *descr" "void *list" "snmp_table_cb_f callback" "void *uarg" .Ft int .Fn snmp_dialog "struct snmp_pdu *req" "struct snmp_pdu *resp" +.Ft int +.Fn snmp_discover_engine "void" .Sh DESCRIPTION The SNMP library contains routines to easily build SNMP client applications -that use SNMP versions 1 or 2. +that use SNMP versions 1, 2 or 3. Most of the routines use a .Vt struct snmp_client : .Bd -literal -offset indent struct snmp_client { - enum snmp_version version; - int trans; /* transport type to use */ + enum snmp_version version; + int trans; /* which transport to use */ /* these two are read-only for the application */ - char *cport; /* port number as string */ - char *chost; /* host name or IP address as string */ + char *cport; /* port number as string */ + char *chost; /* host name or IP address as string */ + + char read_community[SNMP_COMMUNITY_MAXLEN + 1]; + char write_community[SNMP_COMMUNITY_MAXLEN + 1]; + + /* SNMPv3 specific fields */ + int32_t identifier; + int32_t security_model; + struct snmp_engine engine; + struct snmp_user user; - char read_community[SNMP_COMMUNITY_MAXLEN + 1]; - char write_community[SNMP_COMMUNITY_MAXLEN + 1]; + /* SNMPv3 Access control - VACM*/ + uint32_t clen; + uint8_t cengine[SNMP_ENGINE_ID_SIZ]; + char cname[SNMP_CONTEXT_NAME_SIZ]; - struct timeval timeout; - u_int retries; + struct timeval timeout; + u_int retries; - int dump_pdus; + int dump_pdus; - size_t txbuflen; - size_t rxbuflen; + size_t txbuflen; + size_t rxbuflen; - int fd; + int fd; - int32_t next_reqid; - int32_t max_reqid; - int32_t min_reqid; + int32_t next_reqid; + int32_t max_reqid; + int32_t min_reqid; - char error[SNMP_STRERROR_LEN]; + char error[SNMP_STRERROR_LEN]; - snmp_timeout_start_f timeout_start; - snmp_timeout_stop_f timeout_stop; + snmp_timeout_start_f timeout_start; + snmp_timeout_stop_f timeout_stop; - /* private */ - char local_path[sizeof(SNMP_LOCAL_PATH)]; + char local_path[sizeof(SNMP_LOCAL_PATH)]; }; .Ed .Pp @@ -194,6 +207,23 @@ The default is The community name to be used for SET requests. The default is .Sq private . +.It Va identifier +The message indentifier value to be used with SNMPv3 PDUs. Incremented with +each transmitted PDU. +.It Va security_model +The security model to be used with SNMPv3 PDUs. Currently only User-Based +Security model specified by RFC 3414 (value 3) is supported. +.It Va engine +The authorative SNMP engine parameters to be used with SNMPv3 PDUs. +.It Va user +The USM SNMP user credentials to be used with SNMPv3 PDUs. +.It Va clen +The length of the context engine id to be used with SNMPv3 PDUs. +.It Va cengine +The context engine id to be used with SNMPv3 PDUs. Default is empty. +.It Va cname +The context name to be used with SNMPv3 PDUs. Default is +.Sq "" . .It Va timeout The maximum time to wait for responses to requests. If the time elapses, the request is resent up to @@ -617,6 +647,21 @@ returns -1. If a response was received 0 is returned. .Pp The function +.Fn snmp_discover_engine +is used to discover the authorative snmpEngineId of a remote SNMPv3 agent. +A request PDU with empty USM user name is sent and the client's engine +parameters are set according to the snmpEngine parameters received in the +response PDU. +If the client is configured to use authentication and/or privacy and the +snmpEngineBoots and/or snmpEngineTime in the response had zero values, an +additional request (possibly encrypted) with the appropriate user credentials +is sent to fetch the missing values. +Note, that the function blocks until the discovery proccess is completed. +If no response could be received after all timeouts and retries, or the +response contained errors the function returns -1. +If the discovery proccess was completed 0 is returned. +.Pp +The function .Fn snmp_parse_server is used to parse an SNMP server specification string and fill in the fields of a Modified: head/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmplib.3 Wed Dec 8 13:51:25 2010 (r216293) +++ head/contrib/bsnmp/lib/bsnmplib.3 Wed Dec 8 13:51:38 2010 (r216294) @@ -1,4 +1,10 @@ .\" +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" Portions of this documentation were written by Shteryana Sotirova Shopova +.\" under sponsorship from the FreeBSD Foundation. +.\" .\" Copyright (c) 2004-2005 .\" Hartmut Brandt. .\" All rights reserved. @@ -31,7 +37,7 @@ .\" .\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.9 2005/10/04 08:46:51 brandt_h Exp $ .\" -.Dd October 4, 2005 +.Dd September 9, 2010 .Dt BSNMPLIB 3 .Os .Sh NAME @@ -39,9 +45,15 @@ .Nm snmp_value_parse , .Nm snmp_value_copy , .Nm snmp_pdu_free , -.Nm snmp_code snmp_pdu_decode , -.Nm snmp_code snmp_pdu_encode , +.Nm snmp_pdu_decode , +.Nm snmp_pdu_encode , +.Nm snmp_pdu_decode_header , +.Nm snmp_pdu_decode_scoped , +.Nm snmp_pdu_decode_secmode , .Nm snmp_pdu_dump , +.Nm snmp_passwd_to_keys , +.Nm snmp_get_local_keys , +.Nm snmp_calc_keychange , .Nm TRUTH_MK , .Nm TRUTH_GET , .Nm TRUTH_OK @@ -64,8 +76,20 @@ Begemot SNMP library .Fn snmp_pdu_decode "struct asn_buf *buf" "struct snmp_pdu *pdu" "int32_t *ip" .Ft enum snmp_code .Fn snmp_pdu_encode "struct snmp_pdu *pdu" "struct asn_buf *buf" +.Ft enum snmp_code +.Fn snmp_pdu_decode_header "struct snmp_pdu *pdu" "struct asn_buf *buf" +.Ft enum snmp_code +.Fn snmp_pdu_decode_scoped "struct asn_buf *buf" "struct snmp_pdu *pdu" "int32_t *ip" +.Ft enum snmp_code +.Fn snmp_pdu_decode_secmode "struct asn_buf *buf" "struct snmp_pdu *pdu" .Ft void .Fn snmp_pdu_dump "const struct snmp_pdu *pdu" +.Ft enum snmp_code +.Fn snmp_passwd_to_keys "struct snmp_user *user" "char *passwd" +.Ft enum snmp_code +.Fn snmp_get_local_keys "struct snmp_user *user" "uint8_t *eid" "uint32_t elen" +.Ft enum snmp_code +.Fn snmp_calc_keychange "struct snmp_user *user" "uint8_t *keychange" .Ft int .Fn TRUTH_MK "F" .Ft int @@ -73,8 +97,8 @@ Begemot SNMP library .Ft int .Fn TRUTH_OK "T" .Sh DESCRIPTION -The SNMP library contains routines to handle SNMP version 1 and 2 PDUs. -There are two basic structures used throughout the library: +The SNMP library contains routines to handle SNMP version 1, 2 and 3 PDUs. +There are several basic structures used throughout the library: .Bd -literal -offset indent struct snmp_value { struct asn_oid var; @@ -134,34 +158,126 @@ is not zero, .Fa v.octetstring.octets points to a string allocated by .Xr malloc 3 . +.Pp +.Bd -literal -offset indent +#define SNMP_ENGINE_ID_SIZ 32 + +struct snmp_engine { + uint8_t engine_id[SNMP_ENGINE_ID_SIZ]; + uint32_t engine_len; + int32_t engine_boots; + int32_t engine_time; + int32_t max_msg_size; +}; +.Ed +.Pp +This structure represents an SNMP engine as specified by the SNMP Management +Architecture described in RFC 3411. +.Pp +.Bd -literal -offset indent +#define SNMP_USM_NAME_SIZ (32 + 1) +#define SNMP_AUTH_KEY_SIZ 40 +#define SNMP_PRIV_KEY_SIZ 32 + +struct snmp_user { + char sec_name[SNMP_USM_NAME_SIZ]; + enum snmp_authentication auth_proto; + enum snmp_privacy priv_proto; + uint8_t auth_key[SNMP_AUTH_KEY_SIZ]; + uint8_t priv_key[SNMP_PRIV_KEY_SIZ]; +}; +.Ed +.Pp +This structure represents an SNMPv3 user as specified by the User-based +Security Model (USM) described in RFC 3414. The field +.Fa sec_name +is a human readable string containing the security user name. +.Fa auth_proto +contains the id of the authentication protocol in use by the user and may be one +of: +.Bd -literal -offset indent +enum snmp_authentication { + SNMP_AUTH_NOAUTH = 0, + SNMP_AUTH_HMAC_MD5, + SNMP_AUTH_HMAC_SHA +}; +.Ed +.Fa priv_proto +contains the id of the privacy protocol in use by the user and may be one +of: +.Bd -literal -offset indent +enum snmp_privacy { + SNMP_PRIV_NOPRIV = 0, + SNMP_PRIV_DES = 1, + SNMP_PRIV_AES +}; +.Ed +.Fa auth_key +and +.Fa priv_key +contain the authentication and privacy keys for the user. +.Pp .Bd -literal -offset indent -#define SNMP_COMMUNITY_MAXLEN 128 -#define SNMP_MAX_BINDINGS 100 +#define SNMP_COMMUNITY_MAXLEN 128 +#define SNMP_MAX_BINDINGS 100 +#define SNMP_CONTEXT_NAME_SIZ (32 + 1) +#define SNMP_TIME_WINDOW 150 + +#define SNMP_USM_AUTH_SIZE 12 +#define SNMP_USM_PRIV_SIZE 8 + +#define SNMP_MSG_AUTH_FLAG 0x1 +#define SNMP_MSG_PRIV_FLAG 0x2 +#define SNMP_MSG_REPORT_FLAG 0x4 + +#define SNMP_SECMODEL_USM 3 struct snmp_pdu { - char community[SNMP_COMMUNITY_MAXLEN + 1]; - enum snmp_version version; - u_int type; + char community[SNMP_COMMUNITY_MAXLEN + 1]; + enum snmp_version version; + u_int type; + + /* SNMPv3 PDU header fields */ + int32_t identifier; + uint8_t flags; + int32_t security_model; + struct snmp_engine engine; + + /* Associated USM user parameters */ + struct snmp_user user; + uint8_t msg_digest[SNMP_USM_AUTH_SIZE]; + uint8_t msg_salt[SNMP_USM_PRIV_SIZE]; + + /* View-based Access Model */ + uint32_t context_engine_len; + uint8_t context_engine[SNMP_ENGINE_ID_SIZ]; + char context_name[SNMP_CONTEXT_NAME_SIZ]; /* trap only */ - struct asn_oid enterprise; - u_char agent_addr[4]; - int32_t generic_trap; - int32_t specific_trap; - u_int32_t time_stamp; + struct asn_oid enterprise; + u_char agent_addr[4]; + int32_t generic_trap; + int32_t specific_trap; + uint32_t time_stamp; /* others */ - int32_t request_id; - int32_t error_status; - int32_t error_index; + int32_t request_id; + int32_t error_status; + int32_t error_index; /* fixes for encoding */ - u_char *outer_ptr; - u_char *pdu_ptr; - u_char *vars_ptr; + size_t outer_len; + size_t scoped_len; + u_char *outer_ptr; + u_char *digest_ptr; + u_char *encrypted_ptr; + u_char *scoped_ptr; + u_char *pdu_ptr; + u_char *vars_ptr; + - struct snmp_value bindings[SNMP_MAX_BINDINGS]; - u_int nbindings; + struct snmp_value bindings[SNMP_MAX_BINDINGS]; + u_int nbindings; }; .Ed This structure contains a decoded SNMP PDU. @@ -172,11 +288,15 @@ enum snmp_version { SNMP_Verr = 0, SNMP_V1 = 1, SNMP_V2c, + SNMP_V3 }; .Ed and .Fa type is the type of the PDU. +.Fa security_model +is the security model used for SNMPv3 PDUs. The only supported +value currently is 3 (User-based Security Model). .Pp The function .Fn snmp_value_free @@ -223,15 +343,60 @@ The function .Fn snmp_pdu_encode encodes the PDU .Fa pdu -into the an octetstring in buffer +into the an octetstring in buffer, and if authentication and privacy are used, +calculates a message digest and encrypts the PDU data in the buffer +.Fa buf . +.Pp +The function +.Fn snmp_pdu_decode_header +decodes the header of the PDU pointed to by +.Fa buf . +The uncoded PDU contents remain in the buffer. +.Pp +The function +.Fn snmp_pdu_decode_scoped +decodes the scoped PDU pointed to by .Fa buf . .Pp The function +.Fn snmp_pdu_decode_secmode +verifies the authentication parameter contained in the PDU (if present) and +if the PDU is encrypted, decrypts the PDU contents pointed to by +.Fa buf . +If successfull, a plain text scoped PDU is stored in the buffer. +.Pp +The function .Fn snmp_pdu_dump dumps the PDU in a human readable form by calling .Fn snmp_printf . .Pp The function +.Fn snmp_passwd_to_keys +calculates a binary private authentication key corresponding to a plain text human +readable password string. The calculated key is placed in the +.Fa auth_key +field of the +.Fa user . +.Pp +The function +.Fn snmp_get_local_keys +calculates a localazied authentication and privacy keys for a specified SNMPv3 +engine. The calculateds keys are placed in the +.Fa auth_key +and +.Fa priv_key +fields of the +.Fa user . +.Pp +The function +.Fn snmp_calc_keychange +calculates a binary key change octet string based on the contents of an old and +a new binary localized key. The rezult is placed in the buffer pointer to by +.Fa keychange +and may be used by an SNMPv3 user who wishes to change his/her password +or localized key. +.Pp +The function .Fn TRUTH_MK takes a C truth value (zero or non-zero) and makes an SNMP truth value (2 or 1). The function @@ -281,6 +446,13 @@ A variable binding value was out of the The PDU is of an unsupported version. .It Bq Er SNMP_CODE_BADENQ There was an ASN.1 value with an unsupported tag. +.It Bq Er SNMP_CODE_BADSECLEVEL +The requested securityLevel contained in the PDU is not supported. +.It Bq Er SNMP_CODE_BADDIGEST +The PDU authentication parameter received in the PDU did not match the +calculated message digest. +.It Bq Er SNMP_CODE_EDECRYPT +Error occured while trying to decrypt the PDU. .El .Pp .Fn snmp_pdu_encode @@ -297,8 +469,21 @@ Encoding failed. .Xr bsnmpagent 3 , .Xr bsnmpclient 3 , .Xr bsnmplib 3 +.Sh CAVEAT +The SNMPv3 message digests, encryption and decryption, and key routines use +the cryptographic functions from +.Xr crypto 3 . +The library may optionally be built without references to the +.Xr crypto 3 +library. In such case only plain text SNMPv3 PDUs without message digests +may be proccessed correctly. .Sh STANDARDS This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS +The Begemot SNMP library was originally written by .An Hartmut Brandt Aq harti@FreeBSD.org +.Pp +.An Shteryana Shopova Aq syrinx@FreeBSD.org +added support for the SNMPv3 message proccessing and User-Based +Security model message authentication and privacy. Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Wed Dec 8 13:51:25 2010 (r216293) +++ head/contrib/bsnmp/lib/snmp.c Wed Dec 8 13:51:38 2010 (r216294) @@ -5,6 +5,12 @@ * * Author: Harti Brandt * + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Shteryana Sotirova Shopova + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -271,47 +277,310 @@ parse_pdus(struct asn_buf *b, struct snm return (err); } + +static enum asn_err +parse_secparams(struct asn_buf *b, struct snmp_pdu *pdu) +{ + asn_len_t octs_len; + u_char buf[256]; /* XXX: calc max possible size here */ + struct asn_buf tb; + + memset(buf, 0, 256); + tb.asn_ptr = buf; + tb.asn_len = 256; + + if (asn_get_octetstring(b, buf, &tb.asn_len) != ASN_ERR_OK) { + snmp_error("cannot parse usm header"); + return (ASN_ERR_FAILED); + } + + if (asn_get_sequence(&tb, &octs_len) != ASN_ERR_OK) { + snmp_error("cannot decode usm header"); + return (ASN_ERR_FAILED); + } + + octs_len = SNMP_ENGINE_ID_SIZ; + if (asn_get_octetstring(&tb, (u_char *)&pdu->engine.engine_id, + &octs_len) != ASN_ERR_OK) { + snmp_error("cannot decode msg engine id"); + return (ASN_ERR_FAILED); + } + pdu->engine.engine_len = octs_len; + + if (asn_get_integer(&tb, &pdu->engine.engine_boots) != ASN_ERR_OK) { + snmp_error("cannot decode msg engine boots"); + return (ASN_ERR_FAILED); + } + + if (asn_get_integer(&tb, &pdu->engine.engine_time) != ASN_ERR_OK) { + snmp_error("cannot decode msg engine time"); + return (ASN_ERR_FAILED); + } + + octs_len = SNMP_ADM_STR32_SIZ - 1; + if (asn_get_octetstring(&tb, (u_char *)&pdu->user.sec_name, &octs_len) + != ASN_ERR_OK) { + snmp_error("cannot decode msg user name"); + return (ASN_ERR_FAILED); + } + pdu->user.sec_name[octs_len] = '\0'; + + octs_len = sizeof(pdu->msg_digest); + if (asn_get_octetstring(&tb, (u_char *)&pdu->msg_digest, &octs_len) != + ASN_ERR_OK || ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0 && + octs_len != sizeof(pdu->msg_digest))) { + snmp_error("cannot decode msg authentication param"); + return (ASN_ERR_FAILED); + } + + octs_len = sizeof(pdu->msg_salt); + if (asn_get_octetstring(&tb, (u_char *)&pdu->msg_salt, &octs_len) != + ASN_ERR_OK ||((pdu->flags & SNMP_MSG_PRIV_FLAG) != 0 && + octs_len != sizeof(pdu->msg_salt))) { + snmp_error("cannot decode msg authentication param"); + return (ASN_ERR_FAILED); + } + + if ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0) { + pdu->digest_ptr = b->asn_ptr - SNMP_USM_AUTH_SIZE; + pdu->digest_ptr -= octs_len + ASN_MAXLENLEN; + } + + return (ASN_ERR_OK); +} + +static enum snmp_code +pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu) +{ + u_char buf[256], *sptr; + struct asn_buf tb; + size_t auth_off, moved = 0; + + auth_off = 0; + memset(buf, 0, 256); + tb.asn_ptr = buf; + tb.asn_len = 256; + + if (asn_put_temp_header(&tb, (ASN_TYPE_SEQUENCE|ASN_TYPE_CONSTRUCTED), + &sptr) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if (asn_put_octetstring(&tb, (u_char *)pdu->engine.engine_id, + pdu->engine.engine_len) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if (asn_put_integer(&tb, pdu->engine.engine_boots) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if (asn_put_integer(&tb, pdu->engine.engine_time) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if (asn_put_octetstring(&tb, (u_char *)pdu->user.sec_name, + strlen(pdu->user.sec_name)) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0) { + auth_off = sizeof(buf) - tb.asn_len + ASN_MAXLENLEN; + if (asn_put_octetstring(&tb, (u_char *)pdu->msg_digest, + sizeof(pdu->msg_digest)) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + } else { + if (asn_put_octetstring(&tb, (u_char *)pdu->msg_digest, 0) + != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + } + + if ((pdu->flags & SNMP_MSG_PRIV_FLAG) != 0) { + if (asn_put_octetstring(&tb, (u_char *)pdu->msg_salt, + sizeof(pdu->msg_salt)) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + } else { + if (asn_put_octetstring(&tb, (u_char *)pdu->msg_salt, 0) + != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + } + + if (asn_commit_header(&tb, sptr, &moved) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + if ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0) + pdu->digest_ptr = b->asn_ptr + auth_off - moved; + + if (asn_put_octetstring(b, buf, sizeof(buf) - tb.asn_len) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + pdu->digest_ptr += ASN_MAXLENLEN; + + if ((pdu->flags & SNMP_MSG_PRIV_FLAG) != 0 && asn_put_temp_header(b, + ASN_TYPE_OCTETSTRING, &pdu->encrypted_ptr) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + + return (SNMP_CODE_OK); +} + /* - * Parse the outer SEQUENCE value. ASN_ERR_TAG means 'bad version'. + * Decode the PDU except for the variable bindings itself. + * If decoding fails because of a bad binding, but the rest can be + * decoded, ip points to the index of the failed variable (errors + * OORANGE, BADLEN or BADVERS). */ -enum asn_err -snmp_parse_message_hdr(struct asn_buf *b, struct snmp_pdu *pdu, asn_len_t *lenp) +enum snmp_code +snmp_pdu_decode(struct asn_buf *b, struct snmp_pdu *pdu, int32_t *ip) +{ + enum snmp_code code; + + if ((code = snmp_pdu_decode_header(b, pdu)) != SNMP_CODE_OK) + return (code); + + if (pdu->version == SNMP_V3) { + if (pdu->security_model != SNMP_SECMODEL_USM) + return (SNMP_CODE_FAILED); + if ((code = snmp_pdu_decode_secmode(b, pdu)) != SNMP_CODE_OK) + return (code); + } + + code = snmp_pdu_decode_scoped(b, pdu, ip); + + switch (code) { + case SNMP_CODE_FAILED: + snmp_pdu_free(pdu); + break; + + case SNMP_CODE_BADENC: + if (pdu->version == SNMP_Verr) + return (SNMP_CODE_BADVERS); + + default: + break; + } + + return (code); +} + +enum snmp_code +snmp_pdu_decode_header(struct asn_buf *b, struct snmp_pdu *pdu) { int32_t version; - u_char type; - u_int comm_len; + u_int octs_len; + asn_len_t len; + + pdu->outer_ptr = b->asn_ptr; + pdu->outer_len = b->asn_len; + + if (asn_get_sequence(b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode pdu header"); + return (SNMP_CODE_FAILED); + } + if (b->asn_len < len) { + snmp_error("outer sequence value too short"); + return (SNMP_CODE_FAILED); + } + if (b->asn_len != len) { + snmp_error("ignoring trailing junk in message"); + b->asn_len = len; + } if (asn_get_integer(b, &version) != ASN_ERR_OK) { snmp_error("cannot decode version"); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } - if (version == 0) { + if (version == 0) pdu->version = SNMP_V1; - } else if (version == 1) { + else if (version == 1) pdu->version = SNMP_V2c; - } else { + else if (version == 3) + pdu->version = SNMP_V3; + else { pdu->version = SNMP_Verr; snmp_error("unsupported SNMP version"); - return (ASN_ERR_TAG); + return (SNMP_CODE_BADENC); } - comm_len = SNMP_COMMUNITY_MAXLEN; - if (asn_get_octetstring(b, (u_char *)pdu->community, - &comm_len) != ASN_ERR_OK) { - snmp_error("cannot decode community"); - return (ASN_ERR_FAILED); + if (pdu->version == SNMP_V3) { + if (asn_get_sequence(b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode pdu global data header"); + return (SNMP_CODE_FAILED); + } + + if (asn_get_integer(b, &pdu->identifier) != ASN_ERR_OK) { + snmp_error("cannot decode msg indetifier"); + return (SNMP_CODE_FAILED); + } + + if (asn_get_integer(b, &pdu->engine.max_msg_size) + != ASN_ERR_OK) { + snmp_error("cannot decode msg size"); + return (SNMP_CODE_FAILED); + } + + octs_len = 1; + if (asn_get_octetstring(b, (u_char *)&pdu->flags, + &octs_len) != ASN_ERR_OK) { + snmp_error("cannot decode msg flags"); + return (SNMP_CODE_FAILED); + } + + if (asn_get_integer(b, &pdu->security_model) != ASN_ERR_OK) { + snmp_error("cannot decode msg size"); + return (SNMP_CODE_FAILED); + } + + if (pdu->security_model != SNMP_SECMODEL_USM) + return (SNMP_CODE_FAILED); + + if (parse_secparams(b, pdu) != ASN_ERR_OK) + return (SNMP_CODE_FAILED); + } else { + octs_len = SNMP_COMMUNITY_MAXLEN; + if (asn_get_octetstring(b, (u_char *)pdu->community, + &octs_len) != ASN_ERR_OK) { + snmp_error("cannot decode community"); + return (SNMP_CODE_FAILED); + } + pdu->community[octs_len] = '\0'; + } + + return (SNMP_CODE_OK); +} + +enum snmp_code +snmp_pdu_decode_scoped(struct asn_buf *b, struct snmp_pdu *pdu, int32_t *ip) +{ + u_char type; + asn_len_t len, trailer; + enum asn_err err; + + if (pdu->version == SNMP_V3) { + if (asn_get_sequence(b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode scoped pdu header"); + return (SNMP_CODE_FAILED); + } + + len = SNMP_ENGINE_ID_SIZ; + if (asn_get_octetstring(b, (u_char *)&pdu->context_engine, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context engine"); + return (SNMP_CODE_FAILED); + } + pdu->context_engine_len = len; + + len = SNMP_CONTEXT_NAME_SIZ; + if (asn_get_octetstring(b, (u_char *)&pdu->context_name, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context name"); + return (SNMP_CODE_FAILED); + } + pdu->context_name[len] = '\0'; } - pdu->community[comm_len] = '\0'; - if (asn_get_header(b, &type, lenp) != ASN_ERR_OK) { + if (asn_get_header(b, &type, &len) != ASN_ERR_OK) { snmp_error("cannot get pdu header"); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } if ((type & ~ASN_TYPE_MASK) != (ASN_TYPE_CONSTRUCTED | ASN_CLASS_CONTEXT)) { snmp_error("bad pdu header tag"); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } pdu->type = type & ASN_TYPE_MASK; @@ -326,7 +595,7 @@ snmp_parse_message_hdr(struct asn_buf *b case SNMP_PDU_TRAP: if (pdu->version != SNMP_V1) { snmp_error("bad pdu type %u", pdu->type); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } break; @@ -336,99 +605,64 @@ snmp_parse_message_hdr(struct asn_buf *b case SNMP_PDU_REPORT: if (pdu->version == SNMP_V1) { snmp_error("bad pdu type %u", pdu->type); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } break; default: snmp_error("bad pdu type %u", pdu->type); - return (ASN_ERR_FAILED); - } - - - if (*lenp > b->asn_len) { - snmp_error("pdu length too long"); - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); } - return (ASN_ERR_OK); -} - -static enum asn_err -parse_message(struct asn_buf *b, struct snmp_pdu *pdu, int32_t *ip) -{ - enum asn_err err; - asn_len_t len, trailer; - - err = snmp_parse_message_hdr(b, pdu, &len); - if (ASN_ERR_STOPPED(err)) - return (err); - trailer = b->asn_len - len; b->asn_len = len; err = parse_pdus(b, pdu, ip); if (ASN_ERR_STOPPED(err)) - return (ASN_ERR_FAILED); + return (SNMP_CODE_FAILED); if (b->asn_len != 0) snmp_error("ignoring trailing junk after pdu"); b->asn_len = trailer; - return (err); + return (SNMP_CODE_OK); } -/* - * Decode the PDU except for the variable bindings itself. - * If decoding fails because of a bad binding, but the rest can be - * decoded, ip points to the index of the failed variable (errors - * OORANGE, BADLEN or BADVERS). - */ enum snmp_code -snmp_pdu_decode(struct asn_buf *b, struct snmp_pdu *pdu, int32_t *ip) +snmp_pdu_decode_secmode(struct asn_buf *b, struct snmp_pdu *pdu) { - asn_len_t len; + u_char type; + enum snmp_code code; + uint8_t digest[SNMP_USM_AUTH_SIZE]; - memset(pdu, 0, sizeof(*pdu)); + if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH && + (pdu->flags & SNMP_MSG_AUTH_FLAG) == 0) + return (SNMP_CODE_BADSECLEVEL); - if (asn_get_sequence(b, &len) != ASN_ERR_OK) { - snmp_error("cannot decode pdu header"); + if ((code = snmp_pdu_calc_digest(b, pdu, digest)) != + SNMP_CODE_OK) return (SNMP_CODE_FAILED); - } - if (b->asn_len < len) { - snmp_error("outer sequence value too short"); + + if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH && + memcmp(digest, pdu->msg_digest, sizeof(pdu->msg_digest)) != 0) + return (SNMP_CODE_BADDIGEST); + + if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV && (asn_get_header(b, &type, + &pdu->scoped_len) != ASN_ERR_OK || type != ASN_TYPE_OCTETSTRING)) { + snmp_error("cannot decode encrypted pdu"); return (SNMP_CODE_FAILED); } - if (b->asn_len != len) { - snmp_error("ignoring trailing junk in message"); - b->asn_len = len; - } - - switch (parse_message(b, pdu, ip)) { + pdu->scoped_ptr = b->asn_ptr; - case ASN_ERR_OK: - return (SNMP_CODE_OK); + if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV && + (pdu->flags & SNMP_MSG_PRIV_FLAG) == 0) + return (SNMP_CODE_BADSECLEVEL); - case ASN_ERR_FAILED: - case ASN_ERR_EOBUF: - snmp_pdu_free(pdu); + if ((code = snmp_pdu_decrypt(b, pdu)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); - case ASN_ERR_BADLEN: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 14:30:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E88871065673; Wed, 8 Dec 2010 14:30:25 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4EC28FC1B; Wed, 8 Dec 2010 14:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8EUPcc006075; Wed, 8 Dec 2010 14:30:25 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8EUP8J006067; Wed, 8 Dec 2010 14:30:25 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012081430.oB8EUP8J006067@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 8 Dec 2010 14:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 14:30:26 -0000 Author: syrinx Date: Wed Dec 8 14:30:25 2010 New Revision: 216295 URL: http://svn.freebsd.org/changeset/base/216295 Log: Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system. Sponsored by: The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005 Reviewed by: philip@ (mostly), bz@ (earlier version based on p4 ch124545) Approved by: philip@ Added: head/usr.sbin/bsnmpd/tools/ head/usr.sbin/bsnmpd/tools/Makefile (contents, props changed) head/usr.sbin/bsnmpd/tools/Makefile.inc (contents, props changed) head/usr.sbin/bsnmpd/tools/bsnmptools/ head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile (contents, props changed) head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 (contents, props changed) head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/ head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.h (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c (contents, props changed) head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h (contents, props changed) Modified: head/usr.sbin/bsnmpd/Makefile Modified: head/usr.sbin/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/Makefile Wed Dec 8 13:51:38 2010 (r216294) +++ head/usr.sbin/bsnmpd/Makefile Wed Dec 8 14:30:25 2010 (r216295) @@ -2,6 +2,7 @@ SUBDIR= gensnmptree \ bsnmpd \ - modules + modules \ + tools .include Added: head/usr.sbin/bsnmpd/tools/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/tools/Makefile Wed Dec 8 14:30:25 2010 (r216295) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# Author: Shteryana Shopova + +SUBDIR= libbsnmptools \ + bsnmptools + +.include Added: head/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/tools/Makefile.inc Wed Dec 8 14:30:25 2010 (r216295) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# Author: Shteryana Shopova + +BINDIR?= /usr/bin + +CFLAGS+= -I. -I${.CURDIR} + +.if exists(${.OBJDIR}/../libbsnmptools) +LIBBSNMPTOOLSDIR= ${.OBJDIR}/../libbsnmptools +.else +LIBBSNMPTOOLSDIR= ${.CURDIR}/../libbsnmptools +.endif +LIBBSNMPTOOLS= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a Added: head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Wed Dec 8 14:30:25 2010 (r216295) @@ -0,0 +1,28 @@ +# $FreeBSD$ +# Author: Shteryana Shopova + +.include + +.PATH: ${.CURDIR} + +PROG= bsnmpget + +DPADD+= ${LIBBSNMP} ${LIBBSNMPTOOLS} +LDADD+= -lbsnmp -lbsnmptools +CFLAGS+= -I${.CURDIR}/../libbsnmptools +LDFLAGS+= -L${LIBBSNMPTOOLSDIR} + +.if ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} +LDADD+= -lcrypto +.endif + +LINKS= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpwalk +LINKS+= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpset + +MAN= bsnmpget.1 + +MLINKS= bsnmpget.1 bsnmpwalk.1 +MLINKS+= bsnmpget.1 bsnmpset.1 + +.include Added: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Wed Dec 8 14:30:25 2010 (r216295) @@ -0,0 +1,401 @@ +.\" +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" Portions of this documentation were written by Shteryana Sotirova Shopova +.\" under sponsorship from the FreeBSD Foundation. +.\" +.\" Copyright (c) 2005-2007 The FreeBSD Project. +.\" All rights reserved. +.\" +.\" Author: Shteryana Shopova +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 17, 2007 +.Dt BSNMPGET 1 +.Os +.Sh NAME +.Nm bsnmpget , +.Nm bsnmpwalk , +.Nm bsnmpset +.Nd "simple tools for querying SNMP agents" +.Sh SYNOPSIS +.Nm +.Op Fl aDdehnK +.Op Fl A Ar options +.Op Fl b Ar buffersize +.Op Fl C Ar options +.Op Fl I Ar options +.Op Fl i Ar filelist +.Op Fl l Ar filename +.Op Fl M Ar max-repetitions +.Op Fl N Ar non-repeaters +.Op Fl o Ar output +.Op Fl P Ar options +.Op Fl p Ar pdu +.Op Fl r Ar retries +.Op Fl s Ar [trans::][community@][server][:port] +.Op Fl t Ar timeout +.Op Fl U Ar options +.Op Fl v Ar version +.Op Ar OID ... +.Pp +.Nm bsnmpwalk +.Op Fl dhnK +.Op Fl A Ar options +.Op Fl b Ar buffersize +.Op Fl C Ar options +.Op Fl I Ar options +.Op Fl i Ar filelist +.Op Fl l Ar filename +.Op Fl o Ar output +.Op Fl P Ar options +.Op Fl r Ar retries +.Op Fl s Ar [trans::][community@][server][:port] +.Op Fl t Ar timeout +.Op Fl U Ar options +.Op Fl v Ar version +.Op Ar OID ... +.Pp +.Nm bsnmpset +.Op Fl adehnK +.Op Fl A Ar options +.Op Fl b Ar buffersize +.Op Fl C Ar options +.Op Fl I Ar options +.Op Fl i Ar filelist +.Op Fl l Ar filename +.Op Fl o Ar output +.Op Fl P Ar options +.Op Fl r Ar retries +.Op Fl s Ar [trans::][community@][server][:port] +.Op Fl t Ar timeout +.Op Fl U Ar options +.Op Fl v Ar version +.Ar OID Ns = Ar syntax Ns : Ns Ar value +.Op Ar OID Ns = Ar syntax Ns : Ns Ar value ... +.Sh DESCRIPTION +.Nm , +.Nm bsnmpwalk +and +.Nm bsnmpset +are simple tools for retrieving management information from and setting +management information to a Simple Network Managment Protocol (SNMP) agent. +.Pp +Depending on the options +.Nm bsnmpget +constructs either a SMNP GetRequest, GetNextRequest +or a GetBulkRequest packet, fills in the object identifiers (OIDs) of the +objects whose values will be retrived, waits for a response and prints it if +received successfully. +.Pp +.Nm Bsnmpwalk +queries an agent with SMNP GetNextRequest packets, +asking for values of OID instances that are a part of the object subtree +rooted at the provided OIDs. +.Pp +.Nm Bsnmpset +constructs a SMNP SetRequest packet, fills in the OIDs (object identifiers), +syntaxes and values of the objects whose values are to be set and waits for a +responce from server. +.Sh OPTIONS +.Pp +The options are as follows (not all apply to all three programs): +.Bl -tag -width ".It Fl D Ar options" +.It Fl A Ar options +Authentication options to use with SNMPv3 PDUs +.Bl -tag -width +.It Cm proto=[md5|sha] +The protocol to use when calculating the PDU message digest. +.It Cm key=authkey +A binary localized authentication key to use when calculating the PDU message +digest. +.El +.Pp +By default SNMPv3 PDUs are sent unauthenticated. +.It Fl a +Skip any sanity checks when adding OIDs to a Protocol Data Unit (PDU): +ingore syntax/access type, allow adding of non-leaf objects for GetPdu and +read-only objects to a SetPDU. +.It Fl b Ar buffersize +Tune the size of buffers used to send and receive packets. +The default size is 10000 bytes which should be enough unless an agent sends +a really large octetstring. +The maximum allowed length is 65535 according to the Structure of Management +Information (SMIv2). +.It Fl C Ar options +The context to query with SNMPv3 PDUs. +.Bl -tag -width +.It Cm context=name +The context name. Default is "" (empty). +.It Cm context-engine=engine-id +The SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as +binary octet string. By default, this is set to the Engine ID of the SNMP agent. +.El +.It Fl D +Perform SNMP USM Engine Discovery, rather than sending a request for the value +of a specific object. +.It Fl d +Turn on debugging. +This option will cause the packets sent and received to be dumped to the +terminal. +.It Fl e +Retry on error. +If an error is returned in the response PDU, resend the request removing the +variable that caused the error until a valid response is received. +This is only usefull for a GetRequest- and a GetNextRequest-PDU. +.It Fl h +Print a short help text with default values for various options. +.It Fl I Ar options +Load each MIB description file from the given list to translate symbolic +object names to their numerical representation and vice versa. +Use the other options to obtain a non-default behaviour: +.Bl -tag -width +.It Cm cut=OID +Specifies the initial OID that was cut by +.Xr gensnmpdef 1 +when producing the MIB description file. +The default value is .iso(1).org(3).dod(6) which is what should have been +used for all the files installed under /usr/share/snmp/defs/ . +Use this only if you generated your own files, providing a '-c' option to +.Xr gensnmpdef 1 . +.It Cm path=filedir +The directory where files in the list will be searched. +The default is +.Pa /usr/share/snmp/defs/ . +.It Cm file=filelist +A comma separated list of files to which the two options above will apply. +.El +.Pp +The file suboption has to come after the other suboptions so that their +non-default values will be applied to the list of files. +The order of the other suboptions before each file suboption can be random. +Suboptions may be separated either by commas or by spaces. +If using spaces make sure the entire option string is one argument, for +example using quotes. +.It Fl i Ar filelist +List of MIB description files produced by +.Xr gensnmpdef 1 which +.Nm bsnmpget , +.Nm bsnmpwalk +or +.Nm bsnmpset +will search to translate numerical OIDs to their symbolic object names. +Multiple files can be provided either giving this option multiple times +or a comma separated list of file names. +If a filename begins with a letter the default directory, +/usr/share/snmp/defs/ , +will be searched. +.It Fl K +Calculate and display the localized authentication and privacy keys +corresponding to a plain text password. The password is obtain via the +environment. Additionally, if one or more OIDs are specified, the calculated +keys are used when processing the SNMPv3 requests. +.It Fl l Ar filename +The path of the posix local (unix domain) socket if local +transport is used. +.It Fl M Ar max-repetitions +The value for the max-repetitions field in a GetBulk PDU. +Default is 1. +.It Fl N Ar non-repeaters +The value for the non-repeaters field in a GetBulk PDU. +Default is 0. +.It Fl n +Only use numerical representations for input and output OIDs and do not +try to resolve symbolic object names. +Note that +.Nm bsnmpget , +.Nm bsnmpwalk +and +.Nm bsnmpset +will print numerical OIDs anyway if the corresponding string representation +is not found in the MIB description files. +.It Fl o Ar [quiet|short|verbose] +The format used to print the received response. +Quiet only prints values, short (default) prints an abbreviated OID +representation and the value. +In addition to the short output verbose prints the type before the value. +.It Fl P Ar options +Privacy options to use with SNMPv3 PDUs +.Bl -tag -width +.It Cm proto=[aes|des] +The protocol to use when encypting/decrypting SNMPv3 PDU data. +.It Cm key=privkey +A binary localized privacy key to use when encypting/decrypting SNMPv3 PDU data. +.El +.Pp +By default plain text SNMPv3 PDUs are sent. +.It Fl p Ar [get|getnext|getbulk] +The PDU type to send by +.Nm bsmpget . +Default is get. +.It Fl r Ar retries +Number of resends of request packets before giving up if the agent does +not respond after the first try. +Default is 3. +.It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port] +Each of the server specification components is optional but at least one +has to be provided if '-s' option is used. +The server specification is constructed in the following manner: +.Bl -tag -width +.It Cm trans:: +Transport type may be one of udp, stream or dgram. +If this option is not provided an udp inet/inet6 socket will be used, which +is the most common. +Stream stands for a posix local stream socket and a posix local datagram +socket will be used if dgram is specified. +.It Cm community@ +Specify an SNMP community string to be used when sending packets. +If the option is skipped the default "public" will be used for +.Nm +and +.Nm bsnmpwalk +and the default "private" community string will be used for +.Nm bsnmpset . +.It Cm server +This might be either the IP address or the hostname where the agent is +listening. +The default is 'localhost'. +.It Cm port +The destination port to send the requests to. +This is useful if the SNMP agent listens on a non-default port. +Default is given by the 'snmp' entry in /etc/services, port 161. +.El +.It Fl t Ar timeout +Number of seconds before resending a request packet if the agent does +not respond. +The default value is 3 seconds. +.It Fl U Ar options +User credentials when sending SNMPv3 PDUs. +.Bl -tag -width +.It Cm engine=id +The Engine ID of the SNMP agent represented as a binary octet string. +.It Cm engine-boots=value +The value of the snmpEngineBoots of the SNMP agent. +.It Cm engine-time=value +The value of the snmpEngineTime of the SNMP agent. +.Pp +If any of the above is not specified, SNMP USM Engine Discovery is attempted. +This is also the default behavior. +.It Cm name=username +The USM user name to include in the SNMPv3 PDUs. By default, the user name is +obtain via the environment +.El +.It Fl v Ar version +The SNMP protocol version to use when sending requests. SNMP versions 1, 2 and +3 are supported. +If no version option is provided +.Nm bsnmpget , +.Nm bsnmpwalk +and +.Nm bsnmpset +will use version 2. +Note that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the +version to 1 is incompatiable with sending a GetBulk PDU. +.It OID +The object identifier whose value to retrive. +At least one OID should be provided for +.Nm bsnmpget +to be able to send a request. +.Pp +For +.Nm bsnmpwalk +this is the root object identifier of the subtree whose values are to be +retrived. +If no OID is provided +.Nm bsnmpwalk +will walk the mib2 subtree rooted +at .iso(1).org(3).dod(6).internet(1).mgmt(2).mib2(1) . +.Pp +Any of the formats used to print a single variable +is valid as input OID: +.Bl -tag -width +.It 1.3.6.1.2.1.25.1.1.0 +.It sysDescr +.It ifPhysAddress.1 +.It ifRcvAddressStatus.2.6.255.255.255.255.255.255 +.It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff] +.It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff] +(requires '-o verbose' option) +.El +.Pp +Square brackets are used to denote an entry's indexes. +When used in an input OID, the square brackets may have to be +escaped or the OID has to be quoted to protect it from the shell. +Note there is no difference between ifName.1 and "ifName[1]". +.It OID Ns = Ns Ar [syntax Ns :] Ns Ar value +The object identifier with its syntax type and value that is to be set. +At least one such string OID=[syntax:]value should be provided to +.Nm bsnmpset +to be able to send a request. +.Bl -tag -width +.It Cm OID +OID may be input as a string, a string followed by a random number of integers +(suboids) separated by dots, a sequence of integers separated by dots - that is +if '-n' options is used - and in such case a syntax is required for every value, +or a string followed by square brackets (used to denote an entry's indexes) and +corresponding indexes. +Any of formats used to print a single variable by +.Nm bsnmpset is +valid for inpit OID as well: +.Bl -tag -width +.It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486 +.It sysLocation=OctetString:"@ Home" (with '-o verbose' option) +.It sysLocation.0="@ Home" +.It 1.3.6.1.2.1.2.2.1.6.1=OctetString:ffffffffffff +.It ifPhysAddress.1="00:02:b3:1d:1c:a3" +.It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1 +.It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1" +(with '-o verbose' option) +.El +.It Cm syntax +where syntax string is one of : +Integer, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64. +.It Cm value +The value to be set - IP address in form of u.u.u.u - for example +1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they +contain any special characters or spaces, all other numeric types don't. +.El +.Sh ENVIRONMENT +.Nm , +.Nm bsnmpwalk +and +.Nm bsnmpset +use the following environment variables: +.Bl -tag -width SNMPAUTH +.It Ev SNMPAUTH +Specifies a default SNMP USM authentication protocol. +.It Ev SNMPPRIV +Specifies a default SNMP USM privacy protocol. +.It Ev SNMPUSER +Specifies a default SNMP USM user name. +.It Ev SNMPPASSWD +Specifies the SNMP USM plain text password to use when calculating localized +authentication and privacy keys. If this variable exists in the environment, +SMNPv3 is the default version to use for outgoing requests. +.Sh SEE ALSO +.Xr gensnmpdef 1 +.Sh AUTHORS +.An Shteryana Shopova Aq syrinx@FreeBSD.org Added: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Wed Dec 8 14:30:25 2010 (r216295) @@ -0,0 +1,1275 @@ +/*- + * Copyright (c) 2005-2006 The FreeBSD Project + * All rights reserved. + * + * Author: Shteryana Shopova + * + * Redistribution of this software and documentation and use in source and + * binary forms, with or without modification, are permitted provided that + * the following conditions are met: + * + * 1. Redistributions of source code or documentation must retain the above + * copyright notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Bsnmpget and bsnmpwalk are simple tools for querying SNMP agents, + * bsnmpset can be used to set MIB objects in an agent. + * + * $FreeBSD$ + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "bsnmptc.h" +#include "bsnmptools.h" + +static const char *program_name = NULL; +static enum program_e { + BSNMPGET, + BSNMPWALK, + BSNMPSET +} program; + +/* ***************************************************************************** + * Common bsnmptools functions. + */ +static void +usage(void) +{ + fprintf(stderr, +"Usage:\n" +"%s %s [-A options] [-b buffersize] [-C options] [-I options]\n" +"\t[-i filelist] [-l filename]%s [-o output] [-P options]\n" +"\t%s[-r retries] [-s [trans::][community@][server][:port]]\n" +"\t[-t timeout] [-U options] [-v version]%s\n", + program_name, + (program == BSNMPGET) ? "[-aDdehnK]" : + (program == BSNMPWALK) ? "[-dhnK]" : + (program == BSNMPSET) ? "[-adehnK]" : + "", + (program == BSNMPGET) ? " [-M max-repetitions] [-N non-repeaters]" : "", + (program == BSNMPGET) ? "[-p pdu] " : "", + (program == BSNMPGET) ? " OID [OID ...]" : + (program == BSNMPWALK || program == BSNMPSET) ? " [OID ...]" : + "" + ); +} + +static int32_t +parse_max_repetitions(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +{ + uint32_t v; + + assert(opt_arg != NULL); + + v = strtoul(opt_arg, (void *) NULL, 10); + + if (v > SNMP_MAX_BINDINGS) { + warnx("Max repetitions value greater than %d maximum allowed.", + SNMP_MAX_BINDINGS); + return (-1); + } + + SET_MAXREP(snmptoolctx, v); + return (2); +} + +static int32_t +parse_non_repeaters(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +{ + uint32_t v; + + assert(opt_arg != NULL); + + v = strtoul(opt_arg, (void *) NULL, 10); + + if (v > SNMP_MAX_BINDINGS) { + warnx("Non repeaters value greater than %d maximum allowed.", + SNMP_MAX_BINDINGS); + return (-1); + } + + SET_NONREP(snmptoolctx, v); + return (2); +} + +static int32_t +parse_pdu_type(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +{ + assert(opt_arg != NULL); + + if (strcasecmp(opt_arg, "getbulk") == 0) + SET_PDUTYPE(snmptoolctx, SNMP_PDU_GETBULK); + else if (strcasecmp(opt_arg, "getnext") == 0) + SET_PDUTYPE(snmptoolctx, SNMP_PDU_GETNEXT); + else if (strcasecmp(opt_arg, "get") == 0) + SET_PDUTYPE(snmptoolctx, SNMP_PDU_GET); + else { + warnx("PDU type '%s' not supported.", opt_arg); + return (-1); + } + + return (2); +} + +static int32_t +snmptool_parse_options(struct snmp_toolinfo *snmptoolctx, int argc, char **argv) +{ + int32_t count, optnum = 0; + int ch; + const char *opts; + + switch (program) { + case BSNMPWALK: + opts = "dhnKA:b:C:I:i:l:o:P:r:s:t:U:v:"; + break; + case BSNMPGET: + opts = "aDdehnKA:b:C:I:i:l:M:N:o:P:p:r:s:t:U:v:"; + break; + case BSNMPSET: + opts = "adehnKA:b:C:I:i:l:o:P:r:s:t:U:v:"; + break; + default: + return (-1); + } + + while ((ch = getopt(argc, argv, opts)) != EOF) { + switch (ch) { + case 'A': + count = parse_authentication(snmptoolctx, optarg); + break; + case 'a': + count = parse_skip_access(snmptoolctx); + break; + case 'b': + count = parse_buflen(optarg); + break; + case 'D': + count = parse_discovery(snmptoolctx); + break; + case 'd': + count = parse_debug(); + break; + case 'e': + count = parse_errors(snmptoolctx); + break; + case 'h': + usage(); + return (-2); + case 'C': + count = parse_context(snmptoolctx, optarg); + break; + case 'I': + count = parse_include(snmptoolctx, optarg); + break; + case 'i': + count = parse_file(snmptoolctx, optarg); + break; + case 'K': + count = parse_local_key(snmptoolctx); + break; + case 'l': + count = parse_local_path(optarg); + break; + case 'M': + count = parse_max_repetitions(snmptoolctx, optarg); + break; + case 'N': + count = parse_non_repeaters(snmptoolctx, optarg); + break; + case 'n': + count = parse_num_oids(snmptoolctx); + break; + case 'o': + count = parse_output(snmptoolctx, optarg); + break; + case 'P': + count = parse_privacy(snmptoolctx, optarg); + break; + case 'p': + count = parse_pdu_type(snmptoolctx, optarg); + break; + case 'r': + count = parse_retry(optarg); + break; + case 's': + count = parse_server(optarg); + break; + case 't': + count = parse_timeout(optarg); + break; + case 'U': + count = parse_user_security(snmptoolctx, optarg); + break; + case 'v': + count = parse_version(optarg); + break; + case '?': + default: + usage(); + return (-1); + } + if (count < 0) + return (-1); + optnum += count; + } + + return (optnum); +} + +/* + * Read user input OID - one of following formats: + * 1) 1.2.1.1.2.1.0 - that is if option numeric was giveni; + * 2) string - in such case append .0 to the asn_oid subs; + * 3) string.1 - no additional proccessing required in such case. + */ +static char * +snmptools_parse_stroid(struct snmp_toolinfo *snmptoolctx, + struct snmp_object *obj, char *argv) +{ + char string[MAXSTR], *str; + int32_t i = 0; + struct asn_oid in_oid; + + str = argv; + + if (*str == '.') + str++; + + while (isalpha(*str) || *str == '_' || (i != 0 && isdigit(*str))) { + str++; + i++; + } + + if (i <= 0 || i >= MAXSTR) + return (NULL); + + memset(&in_oid, 0, sizeof(struct asn_oid)); + if ((str = snmp_parse_suboid((argv + i), &in_oid)) == NULL) { + warnx("Invalid OID - %s", argv); + return (NULL); + } + + strlcpy(string, argv, i + 1); + if (snmp_lookup_oidall(snmptoolctx, obj, string) < 0) { + warnx("No entry for %s in mapping lists", string); + return (NULL); + } + + /* If OID given on command line append it. */ + if (in_oid.len > 0) + asn_append_oid(&(obj->val.var), &in_oid); + else if (*str == '[') { + if ((str = snmp_parse_index(snmptoolctx, str + 1, obj)) == NULL) + return (NULL); + } else if (obj->val.syntax > 0 && GET_PDUTYPE(snmptoolctx) == + SNMP_PDU_GET) { + if (snmp_suboid_append(&(obj->val.var), (asn_subid_t) 0) < 0) + return (NULL); + } + + return (str); +} + +static int32_t +snmptools_parse_oid(struct snmp_toolinfo *snmptoolctx, + struct snmp_object *obj, char *argv) +{ + if (argv == NULL) + return (-1); + + if (ISSET_NUMERIC(snmptoolctx)) { + if (snmp_parse_numoid(argv, &(obj->val.var)) < 0) + return (-1); + } else { + if (snmptools_parse_stroid(snmptoolctx, obj, argv) == NULL && + snmp_parse_numoid(argv, &(obj->val.var)) < 0) + return (-1); + } + + return (1); +} + +static int32_t +snmptool_add_vbind(struct snmp_pdu *pdu, struct snmp_object *obj) +{ + if (obj->error > 0) + return (0); + + asn_append_oid(&(pdu->bindings[pdu->nbindings].var), &(obj->val.var)); + pdu->nbindings++; + + return (pdu->nbindings); +} + +/* ***************************************************************************** + * bsnmpget private functions. + */ +static int32_t +snmpget_verify_vbind(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, + struct snmp_object *obj) +{ + if (pdu->version == SNMP_V1 && obj->val.syntax == + SNMP_SYNTAX_COUNTER64) { + warnx("64-bit counters are not supported in SNMPv1 PDU"); + return (-1); + } + + if (ISSET_NUMERIC(snmptoolctx) || pdu->type == SNMP_PDU_GETNEXT || + pdu->type == SNMP_PDU_GETBULK) + return (1); + + if (pdu->type == SNMP_PDU_GET && obj->val.syntax == SNMP_SYNTAX_NULL) { + warnx("Only leaf object values can be added to GET PDU"); + return (-1); + } + + return (1); +} + +/* + * In case of a getbulk PDU, the error_status and error_index fields are used by + * libbsnmp to hold the values of the non-repeaters and max-repetitions fields + * that are present only in the getbulk - so before sending the PDU make sure + * these have correct values as well. + */ +static void +snmpget_fix_getbulk(struct snmp_pdu *pdu, uint32_t max_rep, uint32_t non_rep) +{ + assert(pdu != NULL); + + if (pdu->nbindings < non_rep) + pdu->error_status = pdu->nbindings; + else + pdu->error_status = non_rep; + + if (max_rep > 0) + pdu->error_index = max_rep; + else + pdu->error_index = 1; +} + +static int +snmptool_get(struct snmp_toolinfo *snmptoolctx) +{ + struct snmp_pdu req, resp; + + snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); + + while ((snmp_pdu_add_bindings(snmptoolctx, snmpget_verify_vbind, + snmptool_add_vbind, &req, SNMP_MAX_BINDINGS)) > 0) { + + if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK) + snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), + GET_NONREP(snmptoolctx)); + + if (snmp_dialog(&req, &resp) == -1) { + warnx("Snmp dialog - %s", strerror(errno)); + break; + } + + if (snmp_parse_resp(&resp, &req) >= 0) { + snmp_output_resp(snmptoolctx, &resp); + break; + } + + snmp_output_err_resp(snmptoolctx, &resp); + if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK || + !ISSET_RETRY(snmptoolctx)) + break; + + /* + * Loop through the object list and set object->error to the + * varbinding that caused the error. + */ + if (snmp_object_seterror(snmptoolctx, + &(resp.bindings[resp.error_index - 1]), + resp.error_status) <= 0) + break; + + fprintf(stderr, "Retrying...\n"); + snmp_pdu_free(&resp); + snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); + } + + snmp_pdu_free(&resp); + + return (0); +} + + +/* ***************************************************************************** + * bsnmpwalk private functions. + */ +/* The default tree to walk. */ +static const struct asn_oid snmp_mibII_OID = { + 6 , { 1, 3, 6, 1, 2, 1 } +}; + +static int32_t +snmpwalk_add_default(struct snmp_toolinfo *snmptoolctx __unused, + struct snmp_object *obj, char *string __unused) +{ + asn_append_oid(&(obj->val.var), &snmp_mibII_OID); + return (1); +} + +/* + * Prepare the next GetNext/Get PDU to send. + */ +static void +snmpwalk_nextpdu_create(uint32_t op, struct asn_oid *var, struct snmp_pdu *pdu) +{ + snmp_pdu_create(pdu, op); + asn_append_oid(&(pdu->bindings[0].var), var); + pdu->nbindings = 1; +} + +static int +snmptool_walk(struct snmp_toolinfo *snmptoolctx) +{ + struct snmp_pdu req, resp; + struct asn_oid root; /* Keep the inital oid. */ + int32_t outputs, rc; + + snmp_pdu_create(&req, SNMP_PDU_GETNEXT); + + while ((rc = snmp_pdu_add_bindings(snmptoolctx, NULL, + snmptool_add_vbind, &req, 1)) > 0) { + + /* Remember the root where the walk started from. */ + memset(&root, 0, sizeof(struct asn_oid)); + asn_append_oid(&root, &(req.bindings[0].var)); + + outputs = 0; + while (snmp_dialog(&req, &resp) >= 0) { + if ((snmp_parse_resp(&resp, &req)) < 0) { + snmp_output_err_resp(snmptoolctx, &resp); + snmp_pdu_free(&resp); + outputs = -1; + break; + } + + if (!(asn_is_suboid(&root, &(resp.bindings[0].var)))) { + snmp_pdu_free(&resp); + break; + } + + if (snmp_output_resp(snmptoolctx, &resp)!= 0) { + snmp_pdu_free(&resp); + outputs = -1; + break; + } + outputs++; + snmp_pdu_free(&resp); + + snmpwalk_nextpdu_create(SNMP_PDU_GETNEXT, + &(resp.bindings[0].var), &req); + } + + /* Just in case our root was a leaf. */ + if (outputs == 0) { + snmpwalk_nextpdu_create(SNMP_PDU_GET, &root, &req); + if (snmp_dialog(&req, &resp) == SNMP_CODE_OK) { + if (snmp_parse_resp(&resp,&req) < 0) + snmp_output_err_resp(snmptoolctx, &resp); + else + snmp_output_resp(snmptoolctx, &(resp)); + + snmp_pdu_free(&resp); + } else + warnx("Snmp dialog - %s", strerror(errno)); + } + + if (snmp_object_remove(snmptoolctx, &root) < 0) { + warnx("snmp_object_remove"); + break; + } + + snmp_pdu_create(&req, SNMP_PDU_GETNEXT); + } + + if (rc == 0) + return (0); + else + return (1); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 15:10:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2D91065673; Wed, 8 Dec 2010 15:10:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BC388FC1A; Wed, 8 Dec 2010 15:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8FAR2g006949; Wed, 8 Dec 2010 15:10:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8FARGT006947; Wed, 8 Dec 2010 15:10:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201012081510.oB8FARGT006947@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 8 Dec 2010 15:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216296 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 15:10:27 -0000 Author: glebius Date: Wed Dec 8 15:10:27 2010 New Revision: 216296 URL: http://svn.freebsd.org/changeset/base/216296 Log: Add RTM_IEEE80211 to array of route message descriptions. PR: 151664 Submitted by: Alexey Illarionov Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Dec 8 14:30:25 2010 (r216295) +++ head/sbin/route/route.c Wed Dec 8 15:10:27 2010 (r216296) @@ -1306,6 +1306,7 @@ const char *msgtypes[] = { "RTM_NEWMADDR: new multicast group membership on iface", "RTM_DELMADDR: multicast group membership removed from iface", "RTM_IFANNOUNCE: interface arrival/departure", + "RTM_IEEE80211: IEEE 802.11 wireless event", 0, }; From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 15:12:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F3CC1065672; Wed, 8 Dec 2010 15:12:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA5B8FC17; Wed, 8 Dec 2010 15:12:09 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1A06746B17; Wed, 8 Dec 2010 10:12:09 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 236F18A01D; Wed, 8 Dec 2010 10:12:08 -0500 (EST) From: John Baldwin To: Alexey Dokuchaev Date: Wed, 8 Dec 2010 09:30:12 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012071849.oB7InB4J076962@svn.freebsd.org> <20101208012428.GA33197@FreeBSD.org> In-Reply-To: <20101208012428.GA33197@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201012080930.12548.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 08 Dec 2010 10:12:08 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216263 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 15:12:09 -0000 On Tuesday, December 07, 2010 8:24:28 pm Alexey Dokuchaev wrote: > On Tue, Dec 07, 2010 at 06:49:11PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Tue Dec 7 18:49:11 2010 > > New Revision: 216263 > > URL: http://svn.freebsd.org/changeset/base/216263 > > > > Log: > > Use proper resource ID's for HPET IRQ resources. This mostly consists of > > looking to see if there is an existing IRQ resource for a given IRQ > > provided by the BIOS and using that RID if so. Otherwise, allocate a new > > RID for the new IRQ. > > Could it be related to "device_attach: acpi_hpet0 attach returned 12" > messages quite a few of us are seeing by chance? If yes, will it be > MFCed to 7/8? Likely not. This is a prerequisite for IRQ resources to still work after I commit some other changes to the ACPI bus driver itself. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 15:12:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D4FE1065670; Wed, 8 Dec 2010 15:12:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C0C68FC23; Wed, 8 Dec 2010 15:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8FCb10007046; Wed, 8 Dec 2010 15:12:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8FCblT007044; Wed, 8 Dec 2010 15:12:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201012081512.oB8FCblT007044@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 8 Dec 2010 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216297 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 15:12:37 -0000 Author: glebius Date: Wed Dec 8 15:12:37 2010 New Revision: 216297 URL: http://svn.freebsd.org/changeset/base/216297 Log: - Fix array bounds checking. [1] - Add message length checking. PR: 151664 [1] Submitted by: Alexey Illarionov [1] Reviewed by: yar Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Dec 8 15:10:27 2010 (r216296) +++ head/sbin/route/route.c Wed Dec 8 15:12:37 2010 (r216297) @@ -115,11 +115,11 @@ static void mask_addr(void); static void monitor(void); static const char *netname(struct sockaddr *); static void newroute(int, char **); -static void pmsg_addrs(char *, int); -static void pmsg_common(struct rt_msghdr *); +static void pmsg_addrs(char *, int, size_t); +static void pmsg_common(struct rt_msghdr *, size_t); static int prefixlen(const char *); static void print_getmsg(struct rt_msghdr *, int); -static void print_rtmsg(struct rt_msghdr *, int); +static void print_rtmsg(struct rt_msghdr *, size_t); static const char *routename(struct sockaddr *); static int rtmsg(int, int); static void set_metric(char *, int); @@ -1307,7 +1307,6 @@ const char *msgtypes[] = { "RTM_DELMADDR: multicast group membership removed from iface", "RTM_IFANNOUNCE: interface arrival/departure", "RTM_IEEE80211: IEEE 802.11 wireless event", - 0, }; char metricnames[] = @@ -1325,8 +1324,11 @@ char ifnetflags[] = char addrnames[] = "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD"; +static const char errfmt[] = +"\n%s: truncated route message, only %zu bytes left\n"; + static void -print_rtmsg(struct rt_msghdr *rtm, int msglen __unused) +print_rtmsg(struct rt_msghdr *rtm, size_t msglen) { struct if_msghdr *ifm; struct ifa_msghdr *ifam; @@ -1343,13 +1345,22 @@ print_rtmsg(struct rt_msghdr *rtm, int m rtm->rtm_version); return; } - if (msgtypes[rtm->rtm_type] != NULL) + if (rtm->rtm_type < sizeof(msgtypes) / sizeof(msgtypes[0])) (void)printf("%s: ", msgtypes[rtm->rtm_type]); else - (void)printf("#%d: ", rtm->rtm_type); + (void)printf("unknown type %d: ", rtm->rtm_type); (void)printf("len %d, ", rtm->rtm_msglen); + +#define REQUIRE(x) do { \ + if (msglen < sizeof(x)) \ + goto badlen; \ + else \ + msglen -= sizeof(x); \ + } while (0) + switch (rtm->rtm_type) { case RTM_IFINFO: + REQUIRE(struct if_msghdr); ifm = (struct if_msghdr *)rtm; (void) printf("if# %d, ", ifm->ifm_index); switch (ifm->ifm_data.ifi_link_state) { @@ -1365,23 +1376,26 @@ print_rtmsg(struct rt_msghdr *rtm, int m } (void) printf("link: %s, flags:", state); bprintf(stdout, ifm->ifm_flags, ifnetflags); - pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs); + pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs, msglen); break; case RTM_NEWADDR: case RTM_DELADDR: + REQUIRE(struct ifa_msghdr); ifam = (struct ifa_msghdr *)rtm; (void) printf("metric %d, flags:", ifam->ifam_metric); bprintf(stdout, ifam->ifam_flags, routeflags); - pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs); + pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs, msglen); break; #ifdef RTM_NEWMADDR case RTM_NEWMADDR: case RTM_DELMADDR: + REQUIRE(struct ifma_msghdr); ifmam = (struct ifma_msghdr *)rtm; - pmsg_addrs((char *)(ifmam + 1), ifmam->ifmam_addrs); + pmsg_addrs((char *)(ifmam + 1), ifmam->ifmam_addrs, msglen); break; #endif case RTM_IFANNOUNCE: + REQUIRE(struct if_announcemsghdr); ifan = (struct if_announcemsghdr *)rtm; (void) printf("if# %d, what: ", ifan->ifan_index); switch (ifan->ifan_what) { @@ -1402,8 +1416,14 @@ print_rtmsg(struct rt_msghdr *rtm, int m (void) printf("pid: %ld, seq %d, errno %d, flags:", (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); bprintf(stdout, rtm->rtm_flags, routeflags); - pmsg_common(rtm); + pmsg_common(rtm, msglen); } + + return; + +badlen: + (void)printf(errfmt, __func__, msglen); +#undef REQUIRE } static void @@ -1491,7 +1511,7 @@ print_getmsg(struct rt_msghdr *rtm, int #undef msec #define RTA_IGN (RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_IFP|RTA_IFA|RTA_BRD) if (verbose) - pmsg_common(rtm); + pmsg_common(rtm, msglen); else if (rtm->rtm_addrs &~ RTA_IGN) { (void) printf("sockaddrs: "); bprintf(stdout, rtm->rtm_addrs, addrnames); @@ -1501,17 +1521,21 @@ print_getmsg(struct rt_msghdr *rtm, int } static void -pmsg_common(struct rt_msghdr *rtm) +pmsg_common(struct rt_msghdr *rtm, size_t msglen) { (void) printf("\nlocks: "); bprintf(stdout, rtm->rtm_rmx.rmx_locks, metricnames); (void) printf(" inits: "); bprintf(stdout, rtm->rtm_inits, metricnames); - pmsg_addrs(((char *)(rtm + 1)), rtm->rtm_addrs); + if (msglen > sizeof(struct rt_msghdr)) + pmsg_addrs(((char *)(rtm + 1)), rtm->rtm_addrs, + msglen - sizeof(struct rt_msghdr)); + else + (void) fflush(stdout); } static void -pmsg_addrs(char *cp, int addrs) +pmsg_addrs(char *cp, int addrs, size_t len) { struct sockaddr *sa; int i; @@ -1526,7 +1550,12 @@ pmsg_addrs(char *cp, int addrs) for (i = 1; i != 0; i <<= 1) if (i & addrs) { sa = (struct sockaddr *)cp; + if (len == 0 || len < SA_SIZE(sa)) { + (void) printf(errfmt, __func__, len); + break; + } (void) printf(" %s", routename(sa)); + len -= SA_SIZE(sa); cp += SA_SIZE(sa); } (void) putchar('\n'); From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 15:32:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198B2106566B; Wed, 8 Dec 2010 15:32:55 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E25958FC15; Wed, 8 Dec 2010 15:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8FWsQw007449; Wed, 8 Dec 2010 15:32:54 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8FWsgB007446; Wed, 8 Dec 2010 15:32:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012081532.oB8FWsgB007446@svn.freebsd.org> From: Attilio Rao Date: Wed, 8 Dec 2010 15:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216298 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 15:32:55 -0000 Author: attilio Date: Wed Dec 8 15:32:54 2010 New Revision: 216298 URL: http://svn.freebsd.org/changeset/base/216298 Log: Use convenience macro for minimum and maximum value capping when re-arming the watchdog timeout. Sponsored by: Sandvine Incorporated Submitted by: Mark Johnston Reviewed by: des MFC after: 10 days Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Wed Dec 8 15:12:37 2010 (r216297) +++ head/sys/dev/ichwd/ichwd.c Wed Dec 8 15:32:54 2010 (r216298) @@ -288,30 +288,23 @@ static __inline void ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout) { - /* - * If the datasheets are to be believed, the minimum value - * actually varies from chipset to chipset - 4 for ICH5 and 2 for - * all other chipsets. I suspect this is a bug in the ICH5 - * datasheet and that the minimum is uniformly 2, but I'd rather - * err on the side of caution. - */ - if (timeout < 4) - timeout = 4; + if (timeout < TCO_RLD_TMR_MIN) + timeout = TCO_RLD_TMR_MIN; if (sc->ich_version <= 5) { uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1); - tmr_val8 &= 0xc0; - if (timeout > 0x3f) - timeout = 0x3f; + tmr_val8 &= (~TCO_RLD1_TMR_MAX & 0xff); + if (timeout > TCO_RLD1_TMR_MAX) + timeout = TCO_RLD1_TMR_MAX; tmr_val8 |= timeout; ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8); } else { uint16_t tmr_val16 = ichwd_read_tco_2(sc, TCO_TMR2); - tmr_val16 &= 0xfc00; - if (timeout > 0x03ff) - timeout = 0x03ff; + tmr_val16 &= (~TCO_RLD2_TMR_MAX & 0xffff); + if (timeout > TCO_RLD2_TMR_MAX) + timeout = TCO_RLD2_TMR_MAX; tmr_val16 |= timeout; ichwd_write_tco_2(sc, TCO_TMR2, tmr_val16); } Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Wed Dec 8 15:12:37 2010 (r216297) +++ head/sys/dev/ichwd/ichwd.h Wed Dec 8 15:32:54 2010 (r216298) @@ -199,6 +199,17 @@ struct ichwd_softc { #define TCO_TMR_HALT 0x0800 /* clear to enable WDT */ #define TCO_CNT_PRESERVE 0x0200 /* preserve these bits */ +/* + * Masks for the TCO timer value field in TCO_RLD. + * If the datasheets are to be believed, the minimum value actually varies + * from chipset to chipset - 4 for ICH5 and 2 for all other chipsets. + * I suspect this is a bug in the ICH5 datasheet and that the minimum is + * uniformly 2, but I'd rather err on the side of caution. + */ +#define TCO_RLD_TMR_MIN 0x0004 +#define TCO_RLD1_TMR_MAX 0x003f +#define TCO_RLD2_TMR_MAX 0x03ff + /* approximate length in nanoseconds of one WDT tick (about 0.6 sec) */ #define ICHWD_TICK 600000000 From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 15:52:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EE910656C4; Wed, 8 Dec 2010 15:52:06 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90AFD8FC17; Wed, 8 Dec 2010 15:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8Fq6YU007904; Wed, 8 Dec 2010 15:52:06 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8Fq6Cc007902; Wed, 8 Dec 2010 15:52:06 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012081552.oB8Fq6Cc007902@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 8 Dec 2010 15:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216299 - head/contrib/bsnmp/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 15:52:06 -0000 Author: syrinx Date: Wed Dec 8 15:52:06 2010 New Revision: 216299 URL: http://svn.freebsd.org/changeset/base/216299 Log: Add a forgotten file from r216294 and unbreak the build. Sponsored by: The FreeBSD Foundation Reviewed by: philip@ (mostly) Approved by: philip@ Added: head/contrib/bsnmp/lib/snmpcrypto.c (contents, props changed) Added: head/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bsnmp/lib/snmpcrypto.c Wed Dec 8 15:52:06 2010 (r216299) @@ -0,0 +1,404 @@ +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Shteryana Sotirova Shopova under + * sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include +#include +#include +#include +#include +#include +#ifdef HAVE_STDINT_H +#include +#elif defined(HAVE_INTTYPES_H) +#include +#endif +#include +#include +#include +#include + +#ifdef HAVE_LIBCRYPTO +#include +#endif + +#include "asn1.h" +#include "snmp.h" +#include "snmppriv.h" + +#define SNMP_PRIV_AES_IV_SIZ 16 +#define SNMP_EXTENDED_KEY_SIZ 64 +#define SNMP_AUTH_KEY_LOOPCNT 1048576 +#define SNMP_AUTH_BUF_SIZE 72 + +static const uint8_t ipad = 0x36; +static const uint8_t opad = 0x5c; + +#ifdef HAVE_LIBCRYPTO + +static int32_t +snmp_digest_init(const struct snmp_user *user, EVP_MD_CTX *ctx, + const EVP_MD **dtype, uint32_t *keylen) +{ + if (user->auth_proto == SNMP_AUTH_HMAC_MD5) { + *dtype = EVP_md5(); + *keylen = SNMP_AUTH_HMACMD5_KEY_SIZ; + } else if (user->auth_proto == SNMP_AUTH_HMAC_SHA) { + *dtype = EVP_sha1(); + *keylen = SNMP_AUTH_HMACSHA_KEY_SIZ; + } else if (user->auth_proto == SNMP_AUTH_NOAUTH) + return (0); + else { + snmp_error("unknown authentication option - %d", + user->auth_proto); + return (-1); + } + + if (EVP_DigestInit(ctx, *dtype) != 1) + return (-1); + + return (1); +} + +enum snmp_code +snmp_pdu_calc_digest(struct asn_buf *b, const struct snmp_pdu *pdu, + uint8_t *digest) +{ + uint8_t md[EVP_MAX_MD_SIZE], extkey[SNMP_EXTENDED_KEY_SIZ]; + uint8_t key1[SNMP_EXTENDED_KEY_SIZ], key2[SNMP_EXTENDED_KEY_SIZ]; + uint32_t i, keylen, olen; + int32_t err; + const EVP_MD *dtype; + EVP_MD_CTX ctx; + + err = snmp_digest_init(&pdu->user, &ctx, &dtype, &keylen); + if (err < 0) + return (SNMP_CODE_BADDIGEST); + else if (err == 0) + return (SNMP_CODE_OK); + + memset(pdu->digest_ptr, 0, sizeof(pdu->msg_digest)); + memcpy(extkey, pdu->user.auth_key, keylen); + memset(extkey + keylen, 0, sizeof(extkey) - keylen); + + for (i = 0; i < SNMP_EXTENDED_KEY_SIZ; i++) { + key1[i] = extkey[i] ^ ipad; + key2[i] = extkey[i] ^ opad; + } + + if (EVP_DigestUpdate(&ctx, key1, SNMP_EXTENDED_KEY_SIZ) != 1 || + EVP_DigestUpdate(&ctx, pdu->outer_ptr, pdu->outer_len) != 1 || + EVP_DigestFinal(&ctx, md, &olen) != 1) + goto failed; + + if (EVP_DigestInit(&ctx, dtype) != 1 || + EVP_DigestUpdate(&ctx, key2, SNMP_EXTENDED_KEY_SIZ) != 1 || + EVP_DigestUpdate(&ctx, md, olen) != 1 || + EVP_DigestFinal(&ctx, md, &olen) != 1) + goto failed; + + if (olen < SNMP_USM_AUTH_SIZE) { + snmp_error("bad digest size - %d", olen); + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_BADDIGEST); + } + + memcpy(digest, md, SNMP_USM_AUTH_SIZE); + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_OK); + +failed: + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_BADDIGEST); +} + +static int32_t +snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len, + EVP_CIPHER_CTX *ctx, const EVP_CIPHER **ctype, uint8_t *piv) +{ + int i; + uint32_t netint; + + if (pdu->user.priv_proto == SNMP_PRIV_DES) { + if (len % 8 != 0) + return (-1); + *ctype = EVP_des_cbc(); + memcpy(piv, pdu->msg_salt, sizeof(pdu->msg_salt)); + for (i = 0; i < 8; i++) + piv[i] = piv[i] ^ pdu->user.priv_key[8 + i]; + } else if (pdu->user.priv_proto == SNMP_PRIV_AES) { + *ctype = EVP_aes_128_cfb128(); + netint = htonl(pdu->engine.engine_boots); + memcpy(piv, &netint, sizeof(netint)); + piv += sizeof(netint); + netint = htonl(pdu->engine.engine_time); + memcpy(piv, &netint, sizeof(netint)); + piv += sizeof(netint); + memcpy(piv, pdu->msg_salt, sizeof(pdu->msg_salt)); + } else if (pdu->user.priv_proto == SNMP_PRIV_NOPRIV) + return (0); + else { + snmp_error("unknown privacy option - %d", pdu->user.priv_proto); + return (-1); + } + + return (1); +} + +enum snmp_code +snmp_pdu_encrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +{ + int32_t err, olen; + uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; + const EVP_CIPHER *ctype; + EVP_CIPHER_CTX ctx; + + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + if (err < 0) + return (SNMP_CODE_EDECRYPT); + else if (err == 0) + return (SNMP_CODE_OK); + + if (EVP_EncryptInit(&ctx, ctype, pdu->user.priv_key, iv) != 1) + return (SNMP_CODE_FAILED); + + if (EVP_EncryptUpdate(&ctx, pdu->scoped_ptr, &olen, pdu->scoped_ptr, + pdu->scoped_len) != 1 || + EVP_EncryptFinal(&ctx, pdu->scoped_ptr + olen, &olen) != 1) { + EVP_CIPHER_CTX_cleanup(&ctx); + return (SNMP_CODE_FAILED); + } + + EVP_CIPHER_CTX_cleanup(&ctx); + return (SNMP_CODE_OK); +} + +enum snmp_code +snmp_pdu_decrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +{ + int32_t err, olen; + uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; + const EVP_CIPHER *ctype; + EVP_CIPHER_CTX ctx; + + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + if (err < 0) + return (SNMP_CODE_EDECRYPT); + else if (err == 0) + return (SNMP_CODE_OK); + + if (EVP_DecryptInit(&ctx, ctype, pdu->user.priv_key, iv) != 1 || + EVP_CIPHER_CTX_set_padding(&ctx, 0) != 1) + return (SNMP_CODE_EDECRYPT); + + if (EVP_DecryptUpdate(&ctx, pdu->scoped_ptr, &olen, pdu->scoped_ptr, + pdu->scoped_len) != 1 || + EVP_DecryptFinal(&ctx, pdu->scoped_ptr + olen, &olen) != 1) { + EVP_CIPHER_CTX_cleanup(&ctx); + return (SNMP_CODE_EDECRYPT); + } + + EVP_CIPHER_CTX_cleanup(&ctx); + return (SNMP_CODE_OK); +} + +/* [RFC 3414] - A.2. Password to Key Algorithm */ +enum snmp_code +snmp_passwd_to_keys(struct snmp_user *user, char *passwd) +{ + int err, loop, i, pwdlen; + uint32_t keylen, olen; + const EVP_MD *dtype; + EVP_MD_CTX ctx; + uint8_t authbuf[SNMP_AUTH_BUF_SIZE]; + + if (passwd == NULL || user == NULL) + return (SNMP_CODE_FAILED); + + err = snmp_digest_init(user, &ctx, &dtype, &keylen); + if (err < 0) + return (SNMP_CODE_BADDIGEST); + else if (err == 0) + return (SNMP_CODE_OK); + + memset(user->auth_key, 0, sizeof(user->auth_key)); + pwdlen = strlen(passwd); + + for (loop = 0; loop < SNMP_AUTH_KEY_LOOPCNT; loop += i) { + for (i = 0; i < SNMP_EXTENDED_KEY_SIZ; i++) + authbuf[i] = passwd[(loop + i) % pwdlen]; + if (EVP_DigestUpdate(&ctx, authbuf, SNMP_EXTENDED_KEY_SIZ) != 1) + goto failed; + } + + if (EVP_DigestFinal(&ctx, user->auth_key, &olen) != 1) + goto failed; + + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_OK); + +failed: + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_BADDIGEST); +} + +/* [RFC 3414] - 2.6. Key Localization Algorithm */ +enum snmp_code +snmp_get_local_keys(struct snmp_user *user, uint8_t *eid, uint32_t elen) +{ + int err; + uint32_t keylen, olen; + const EVP_MD *dtype; + EVP_MD_CTX ctx; + uint8_t authbuf[SNMP_AUTH_BUF_SIZE]; + + if (user == NULL || eid == NULL || elen > SNMP_ENGINE_ID_SIZ) + return (SNMP_CODE_FAILED); + + memset(user->priv_key, 0, sizeof(user->priv_key)); + memset(authbuf, 0, sizeof(authbuf)); + + err = snmp_digest_init(user, &ctx, &dtype, &keylen); + if (err < 0) + return (SNMP_CODE_BADDIGEST); + else if (err == 0) + return (SNMP_CODE_OK); + + memcpy(authbuf, user->auth_key, keylen); + memcpy(authbuf + keylen, eid, elen); + memcpy(authbuf + keylen + elen, user->auth_key, keylen); + + if (EVP_DigestUpdate(&ctx, authbuf, 2 * keylen + elen) != 1 || + EVP_DigestFinal(&ctx, user->auth_key, &olen) != 1) { + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_BADDIGEST); + } + EVP_MD_CTX_cleanup(&ctx); + + if (user->priv_proto != SNMP_PRIV_NOPRIV) + memcpy(user->priv_key, user->auth_key, sizeof(user->priv_key)); + + return (SNMP_CODE_OK); +} + +enum snmp_code +snmp_calc_keychange(struct snmp_user *user, uint8_t *keychange) +{ + int32_t i, err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4]; + uint32_t keylen, olen; + const EVP_MD *dtype; + EVP_MD_CTX ctx; + + err = snmp_digest_init(user, &ctx, &dtype, &keylen); + if (err < 0) + return (SNMP_CODE_BADDIGEST); + else if (err == 0) + return (SNMP_CODE_OK); + + for (i = 0; i < keylen / 4; i++) + rvalue[i] = random(); + + memcpy(keychange, user->auth_key, keylen); + memcpy(keychange + keylen, rvalue, keylen); + + if (EVP_DigestUpdate(&ctx, keychange, 2 * keylen) != 1 || + EVP_DigestFinal(&ctx, keychange, &olen) != 1) { + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_BADDIGEST); + } + + EVP_MD_CTX_cleanup(&ctx); + return (SNMP_CODE_OK); +} + +#else /* !HAVE_LIBCRYPTO */ + +enum snmp_code +snmp_pdu_calc_digest(struct asn_buf *b __unused, const struct snmp_pdu *pdu, + uint8_t *digest __unused) +{ + if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH) + return (SNMP_CODE_BADSECLEVEL); + + + return (SNMP_CODE_OK); +} + +enum snmp_code +snmp_pdu_encrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +{ + if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) + return (SNMP_CODE_BADSECLEVEL); + + return (SNMP_CODE_OK); +} + +enum snmp_code +snmp_pdu_decrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +{ + if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) + return (SNMP_CODE_BADSECLEVEL); + + return (SNMP_CODE_OK); +} + +int +snmp_passwd_to_keys(struct snmp_user *user, char *passwd __unused) +{ + if (user->auth_proto == SNMP_AUTH_NOAUTH && + user->priv_proto == SNMP_PRIV_NOPRIV) + return (SNMP_CODE_OK); + + errno = EPROTONOSUPPORT; + + return (SNMP_CODE_FAILED); +} + +int +snmp_get_local_keys(struct snmp_user *user, uint8_t *eid __unused, + uint32_t elen __unused) +{ + if (user->auth_proto == SNMP_AUTH_NOAUTH && + user->priv_proto == SNMP_PRIV_NOPRIV) + return (SNMP_CODE_OK); + + errno = EPROTONOSUPPORT; + + return (SNMP_CODE_FAILED); +} + +enum snmp_code +snmp_calc_keychange(struct snmp_user *user __unused, + uint8_t *keychange __unused) +{ + errno = EPROTONOSUPPORT; + return (SNMP_CODE_FAILED); +} + +#endif /* HAVE_LIBCRYPTO */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 17:27:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45DA106566C; Wed, 8 Dec 2010 17:27:59 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3BA38FC19; Wed, 8 Dec 2010 17:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8HRxhL009891; Wed, 8 Dec 2010 17:27:59 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8HRxL0009889; Wed, 8 Dec 2010 17:27:59 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012081727.oB8HRxL0009889@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 8 Dec 2010 17:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216300 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 17:28:00 -0000 Author: syrinx Date: Wed Dec 8 17:27:59 2010 New Revision: 216300 URL: http://svn.freebsd.org/changeset/base/216300 Log: Add (disabled) sample configurations needed to enable the snmp_usm and snmp_vacm modules and minimal user/view configurations needed to for the modules to work properly. Sponsored by: The FreeBSD Foundation Reviewed by: philip@ (mostly) Approved by: philip@ Modified: head/etc/snmpd.config Modified: head/etc/snmpd.config ============================================================================== --- head/etc/snmpd.config Wed Dec 8 15:52:06 2010 (r216299) +++ head/etc/snmpd.config Wed Dec 8 17:27:59 2010 (r216300) @@ -12,6 +12,15 @@ system := 1 # FreeBSD traphost := localhost trapport := 162 +# +# Set the SNMP engine ID. +# +# The snmpEngineID object required from the SNMPv3 Framework. If not explicitly set via +# this configuration file, an ID is assigned based on the value of the +# kern.hostid variable +# engine := 0x80:0x10:0x08:0x10:0x80:0x25 +# snmpEngineID = $(engine) + # Change this! read := "public" # Uncomment begemotSnmpdCommunityString.0.2 below that sets the community @@ -19,6 +28,26 @@ read := "public" write := "geheim" trap := "mytrap" +# Declarations for SNMP-USER-BASED-SM-MIB authentication and privacy options +NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1 +HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2 +HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3 +NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1 +DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2 +AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4 + +# +# SNMPv3 USM User definition +# +# The localized hex password for a user may be obtained by setting SNMPUSER, SNMPPASSWD, +# SNMPAUTH and SNMPPRIV environment variables to the desired parameters and invoking +# 'bsnmpget -v 3 -D -K -o verbose' against the running bsnmpd(1). For other +# usages refer to the bsnmpget(1) manual page. The following lines define a user "bsnmp" +# which a private password "bsnmp", localized for the above engine ID. +# +# user1 := "bsnmp" +# user1passwd := 0x1b:0x6d:0x9e:0x94:0xbe:0x19:0x17:0xfb:0xde:0x60:0x46:0xfe:0x59:0x6f:0x61:0x95:0xf2:0xc9:0x57:0x1f + # # Configuration # @@ -72,6 +101,113 @@ begemotSnmpdModulePath."mibII" = "/usr/l #begemotIfForcePoll = 2000 # +# SNMPv3 User-based security module - must be loaded for SNMPv3 USM +# +#begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" + +# +# SNMPv3 USM User definition. +# + +#%usm + +# +# The following block creates a user with name "bsnmp" and sets privacy +# and encryption options to SHA256 message digests and AES encryption +# for this user. +# +# usmUserStatus.$(engine).$(user1) = 5 +# usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol) +# usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserPrivProtocol.$(engine).$(user1) = $(AesCfb128Protocol) +# usmUserPrivKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserStatus.$(engine).$(user1) = 1 +# + +# +# The following block creates a user with name "public" with no authentication +# or encyption options. +# +# usmUserStatus.$(engine).$(read) = 5 +# usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol) +# usmUserPrivProtocol.$(engine).$(read) = $(NoPrivProtocol) +# usmUserStatus.$(engine).$(read) = 1 +# + +# +# SNMPv3 View-based Access Control module +# +#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" + +# +# Definition of view-based access control entries. +# +#%vacm + +# Definition of a SNMPv1 group +# vacmSecurityToGroupStatus.1.$(read) = 4 +# vacmGroupName.1.$(read) = $(read) + +# Definition of SNMPv2 group +# vacmSecurityToGroupStatus.2.$(write) = 4 +# vacmGroupName.2.$(write) = $(write) + +# Definition of SNMPv3 group with users "bsnmp" and "public" +# vacmSecurityToGroupStatus.3.$(user1) = 4 +# vacmGroupName.3.$(user1) = $(write) +# vacmSecurityToGroupStatus.3.$(read) = 4 +# vacmGroupName.3.$(read) = $(write) + +# +# The OID of the .iso.org.dod.internet subtree +# +# internetoid := 1.3.6.1 +# internetoidlen := 4 + +# Enumerated values for the privacy options +# noAuthNoPriv := 1 +# authNoPriv := 2 +# authPriv := 3 + +# +# Definitions of two views +# +# vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4 +# vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4 + +# +# Access control +# + +# +# Read-only access for SNMPv1 users +# +# vacmAccessStatus.$(read)."".1.1 = 4 +# vacmAccessReadViewName.$(read)."".1.1 = "internet" + +# +# Read-write access for SNMPv2 users +# +# vacmAccessStatus.$(write)."".2.1 = 4 +# vacmAccessReadViewName.$(write)."".2.1 = "internet" +# vacmAccessWriteViewName.$(write)."".2.1 = "internet" + +# +# Read-write-notify access for SNMPv3 USM users with noAuthNoPriv +# +# vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(write)."".3.$(noAuthNoPriv) = "internet" +# vacmAccessWriteViewName.$(write)."".3.$(noAuthNoPriv) = "internet" +# vacmAccessNotifyViewName.$(write)."".3.$(noAuthNoPriv) = "internet" + +# +#Read-write-notify access to restricted for SNMPv3 USM users with authPriv +# +# vacmAccessStatus.$(write)."".3.$(authPriv) = 4 +# vacmAccessReadViewName.$(write)."".3.$(authPriv) = "restricted" +# vacmAccessWriteViewName.$(write)."".3.$(authPriv) = "restricted" +# vacmAccessNotifyViewName.$(write)."".3.$(authPriv) = "restricted" + # Netgraph module # #begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 17:34:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE0C61065670; Wed, 8 Dec 2010 17:34:07 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDE738FC17; Wed, 8 Dec 2010 17:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8HY7xd010045; Wed, 8 Dec 2010 17:34:07 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8HY7qu010043; Wed, 8 Dec 2010 17:34:07 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012081734.oB8HY7qu010043@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 8 Dec 2010 17:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216301 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 17:34:07 -0000 Author: syrinx Date: Wed Dec 8 17:34:07 2010 New Revision: 216301 URL: http://svn.freebsd.org/changeset/base/216301 Log: Fix typos. Modified: head/etc/snmpd.config Modified: head/etc/snmpd.config ============================================================================== --- head/etc/snmpd.config Wed Dec 8 17:27:59 2010 (r216300) +++ head/etc/snmpd.config Wed Dec 8 17:34:07 2010 (r216301) @@ -43,7 +43,7 @@ AesCfb128Protocol := 1.3.6.1.6.3.10.1.2. # SNMPAUTH and SNMPPRIV environment variables to the desired parameters and invoking # 'bsnmpget -v 3 -D -K -o verbose' against the running bsnmpd(1). For other # usages refer to the bsnmpget(1) manual page. The following lines define a user "bsnmp" -# which a private password "bsnmp", localized for the above engine ID. +# with a private password "bsnmp", localized for the above engine ID. # # user1 := "bsnmp" # user1passwd := 0x1b:0x6d:0x9e:0x94:0xbe:0x19:0x17:0xfb:0xde:0x60:0x46:0xfe:0x59:0x6f:0x61:0x95:0xf2:0xc9:0x57:0x1f @@ -126,7 +126,7 @@ begemotSnmpdModulePath."mibII" = "/usr/l # # The following block creates a user with name "public" with no authentication -# or encyption options. +# or encryption options. # # usmUserStatus.$(engine).$(read) = 5 # usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol) From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 17:51:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 278CA106566C; Wed, 8 Dec 2010 17:51:42 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C3C258FC18; Wed, 8 Dec 2010 17:51:40 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 62AD745C99; Wed, 8 Dec 2010 18:51:39 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 0D536456B1; Wed, 8 Dec 2010 18:51:30 +0100 (CET) Date: Wed, 8 Dec 2010 18:51:29 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20101208175129.GA1884@garage.freebsd.pl> References: <201012081351.oB8DpPnr005212@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: <201012081351.oB8DpPnr005212@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216293 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 17:51:42 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 08, 2010 at 01:51:25PM +0000, Martin Matuska wrote: > Author: mm > Date: Wed Dec 8 13:51:25 2010 > New Revision: 216293 > URL: http://svn.freebsd.org/changeset/base/216293 >=20 > Log: > Print message with information about updating the boot code if a new > vdev is attached to a root pool (e.g. when creating a mirrored boot poo= l). > =20 > Reviewed by: pav s/pav/pjd/ --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEUEARECAAYFAkz/xaEACgkQForvXbEpPzSIEwCgnzjh0zENVrc1oQyw6zmq7gqk kyUAl14nxAYR9OxBnSYhVuHTEtEKngE= =CC+D -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 18:30:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75DBF106566C; Wed, 8 Dec 2010 18:30:04 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-gw0-f49.google.com (mail-gw0-f49.google.com [74.125.83.49]) by mx1.freebsd.org (Postfix) with ESMTP id C79758FC1D; Wed, 8 Dec 2010 18:30:03 +0000 (UTC) Received: by gwj20 with SMTP id 20so997822gwj.36 for ; Wed, 08 Dec 2010 10:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=8AnOMfI2f+Ax/LYzb40jWdPDByAdlww/e3nWBA/tdJ0=; b=SjLl6pfj/g3FV14Paymn5gU5ZPT/tQ8vonb/CN4DvIvPIBw59lBMgCHbHzMs+v8CDr fUyMwEfzKp3whbN9qiVf5okCsKtGlwf44o7Ezt3r3OdaHAhcU+BRsA3+Md/hB3XPaTW8 YTGPvVbFQDgotobQVCozJlub3+pvzeXPp6GWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=cE9GeU5Y49HlujRSz8E8PqBrpWw1OAM/DzDzkwZDs06wqL7dJBr4mjKQpcptVUS5fl PzLPFoIkAoo1t/lEHsx1r29LGS2ZGJosRLyh7KJ5cAYN1i+eK1Qalz9/FuiM4fGPEMI8 z2syW4JFthBRj+YrjEhPT80wU+uALXCAGtelM= Received: by 10.151.6.15 with SMTP id j15mr4461335ybi.391.1291833002874; Wed, 08 Dec 2010 10:30:02 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id f4sm125635ybi.11.2010.12.08.10.29.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Dec 2010 10:30:01 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 8 Dec 2010 10:30:04 -0800 From: Pyun YongHyeon Date: Wed, 8 Dec 2010 10:30:04 -0800 To: Hans Petter Selasky Message-ID: <20101208183004.GA10892@michelle.cdnetworks.com> References: <201012080124.oB81O5Te086075@svn.freebsd.org> <201012080826.50794.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012080826.50794.hselasky@c2i.net> User-Agent: Mutt/1.4.2.3i Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Pyun YongHyeon Subject: Re: svn commit: r216284 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 18:30:04 -0000 On Wed, Dec 08, 2010 at 08:26:50AM +0100, Hans Petter Selasky wrote: > On Wednesday 08 December 2010 02:24:05 Pyun YongHyeon wrote: > > - if (m->m_pkthdr.len > MCLBYTES) { > > - m->m_pkthdr.len = MCLBYTES; > > - } > > You are sure that no packets passed to this code is bigger than MCLBYTES minus > overhead by AXE protocol ? Even if MTU is changed by ifconfig? > Yes and Yes. axe(4) uses uether_ioctl which in turn calls default ether_ioctl. Users have no way to use jumbo frame on axe(4) since ether_ioctl does not allow it. Actually axe(4) supports jumbo frame but I don't think it's worth to implement it due to many limitation of USB ethernet controller. > --HPS From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 19:42:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A562B1065672; Wed, 8 Dec 2010 19:42:21 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B538FC20; Wed, 8 Dec 2010 19:42:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8JgLTR012920; Wed, 8 Dec 2010 19:42:21 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8JgLVW012918; Wed, 8 Dec 2010 19:42:21 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012081942.oB8JgLVW012918@svn.freebsd.org> From: Colin Percival Date: Wed, 8 Dec 2010 19:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216304 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 19:42:21 -0000 Author: cperciva Date: Wed Dec 8 19:42:21 2010 New Revision: 216304 URL: http://svn.freebsd.org/changeset/base/216304 Log: MFi386 r1.81, r1.82, r1.84: Reorganize code to reduce cache pressure and branch mispredictions. No objections from: scottl Modified: head/sys/amd64/amd64/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 19:33:44 2010 (r216303) +++ head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 19:42:21 2010 (r216304) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #define MAX_BPAGES 8192 +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 struct bounce_zone; @@ -135,7 +137,9 @@ static int reserve_bounce_pages(bus_dma_ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags); /* * Return true if a match is made. @@ -145,7 +149,7 @@ static __inline int run_filter(bus_dma_t * If paddr is within the bounds of the dma tag then call the filter callback * to check for a match, if there is no filter callback then assume a match. */ -static __inline int +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) { int retval; @@ -200,8 +204,6 @@ dflt_lock(void *arg, bus_dma_lock_op_t o panic("driver error: busdma dflt_lock called"); } -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 /* * Allocate a device specific dma_tag. */ @@ -266,6 +268,9 @@ bus_dma_tag_create(bus_dma_tag_t parent, else if (parent->boundary != 0) newtag->boundary = MIN(parent->boundary, newtag->boundary); + if ((newtag->filter != NULL) || + ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) + newtag->flags |= BUS_DMA_COULD_BOUNCE; if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly @@ -561,36 +566,15 @@ bus_dmamem_free(bus_dma_tag_t dmat, void CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); } -/* - * Utility function to load a linear buffer. lastaddrp holds state - * between invocations (for multiple-buffer loads). segp contains - * the starting segment on entrace, and the ending segment on exit. - * first indicates if this is the first invocation of this function. - */ -static __inline int -_bus_dmamap_load_buffer(bus_dma_tag_t dmat, - bus_dmamap_t map, - void *buf, bus_size_t buflen, - pmap_t pmap, - int flags, - bus_addr_t *lastaddrp, - bus_dma_segment_t *segs, - int *segp, - int first) +int +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) { - bus_size_t sgsize; - bus_addr_t curaddr, lastaddr, baddr, bmask; vm_offset_t vaddr; + vm_offset_t vendaddr; bus_addr_t paddr; - int seg; - - if (map == NULL) - map = &nobounce_dmamap; - - if ((map != &nobounce_dmamap && map->pagesneeded == 0) - && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { - vm_offset_t vendaddr; + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), dmat->boundary, dmat->alignment); @@ -611,7 +595,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm paddr = pmap_extract(pmap, vaddr); else paddr = pmap_kextract(vaddr); - if (run_filter(dmat, paddr) != 0) { + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + run_filter(dmat, paddr) != 0) { sg_len = roundup2(sg_len, dmat->alignment); map->pagesneeded++; } @@ -643,6 +628,40 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm mtx_unlock(&bounce_lock); } + return (0); +} + +/* + * Utility function to load a linear buffer. lastaddrp holds state + * between invocations (for multiple-buffer loads). segp contains + * the starting segment on entrace, and the ending segment on exit. + * first indicates if this is the first invocation of this function. + */ +static __inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, + bus_dmamap_t map, + void *buf, bus_size_t buflen, + pmap_t pmap, + int flags, + bus_addr_t *lastaddrp, + bus_dma_segment_t *segs, + int *segp, + int first) +{ + bus_size_t sgsize; + bus_addr_t curaddr, lastaddr, baddr, bmask; + vm_offset_t vaddr; + int seg, error; + + if (map == NULL) + map = &nobounce_dmamap; + + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); + if (error) + return (error); + } + vaddr = (vm_offset_t)buf; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -663,7 +682,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm */ max_sgsize = MIN(buflen, dmat->maxsegsz); sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); - if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { sgsize = roundup2(sgsize, dmat->alignment); sgsize = MIN(sgsize, max_sgsize); curaddr = add_bounce_page(dmat, map, vaddr, sgsize); @@ -762,18 +782,17 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ /* * Like _bus_dmamap_load(), but for mbufs. */ -int -bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) +static __inline int +_bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, + int flags) { - int nsegs, error; + int error; M_ASSERTPKTHDR(m0); flags |= BUS_DMA_NOWAIT; - nsegs = 0; + *nsegs = 0; error = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; @@ -785,7 +804,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, error = _bus_dmamap_load_buffer(dmat, map, m->m_data, m->m_len, NULL, flags, &lastaddr, - dmat->segments, &nsegs, first); + segs, nsegs, first); first = 0; } } @@ -793,15 +812,33 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, error = EINVAL; } + /* XXX FIXME: Having to increment nsegs is really annoying */ + ++*nsegs; + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, *nsegs); + return (error); +} + +int +bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, + bus_dmamap_callback2_t *callback, void *callback_arg, + int flags) +{ + int nsegs, error; + + error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, dmat->segments, &nsegs, + flags); + if (error) { /* force "no valid mappings" in callback */ (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { (*callback)(callback_arg, dmat->segments, - nsegs+1, m0->m_pkthdr.len, error); + nsegs, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); + __func__, dmat, dmat->flags, error, nsegs); return (error); } @@ -810,36 +847,7 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, int flags) { - int error; - - M_ASSERTPKTHDR(m0); - - flags |= BUS_DMA_NOWAIT; - *nsegs = 0; - error = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { - int first = 1; - bus_addr_t lastaddr = 0; - struct mbuf *m; - - for (m = m0; m != NULL && error == 0; m = m->m_next) { - if (m->m_len > 0) { - error = _bus_dmamap_load_buffer(dmat, map, - m->m_data, m->m_len, - NULL, flags, &lastaddr, - segs, nsegs, first); - first = 0; - } - } - } else { - error = EINVAL; - } - - /* XXX FIXME: Having to increment nsegs is really annoying */ - ++*nsegs; - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, *nsegs); - return (error); + return (_bus_dmamap_load_mbuf_sg(dmat, map, m0, segs, nsegs, flags)); } /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 19:52:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28295106566B; Wed, 8 Dec 2010 19:52:05 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176D48FC13; Wed, 8 Dec 2010 19:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8Jq4E8013200; Wed, 8 Dec 2010 19:52:04 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8Jq4mV013198; Wed, 8 Dec 2010 19:52:04 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012081952.oB8Jq4mV013198@svn.freebsd.org> From: Colin Percival Date: Wed, 8 Dec 2010 19:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216306 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 19:52:05 -0000 Author: cperciva Date: Wed Dec 8 19:52:04 2010 New Revision: 216306 URL: http://svn.freebsd.org/changeset/base/216306 Log: MFi386 r1.94: If XEN, make pmap_kextract = pmap_kextract_ma. This is a no-op currently, since FreeBSD/amd64 doesn't have (paravirtualized) Xen support, but if/when that support is ever added we'll want this, and until then it's harmless. Modified: head/sys/amd64/amd64/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 19:48:29 2010 (r216305) +++ head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 19:52:04 2010 (r216306) @@ -141,6 +141,11 @@ int run_filter(bus_dma_tag_t dmat, bus_a int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); +#ifdef XEN +#undef pmap_kextract +#define pmap_kextract pmap_kextract_ma +#endif + /* * Return true if a match is made. * From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 20:20:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DCAB106564A; Wed, 8 Dec 2010 20:20:11 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CCA78FC12; Wed, 8 Dec 2010 20:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8KKBMU013853; Wed, 8 Dec 2010 20:20:11 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8KKA7V013850; Wed, 8 Dec 2010 20:20:10 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012082020.oB8KKA7V013850@svn.freebsd.org> From: Colin Percival Date: Wed, 8 Dec 2010 20:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216308 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 20:20:11 -0000 Author: cperciva Date: Wed Dec 8 20:20:10 2010 New Revision: 216308 URL: http://svn.freebsd.org/changeset/base/216308 Log: On amd64, we have (since r1.72, in December 2005) MAX_BPAGES=8192, while on i386 we have MAX_BPAGES=512. Implement this difference via '#ifdef __i386__'. With this commit, the i386 and amd64 busdma_machdep.c files become identical; they will soon be replaced by a single file under sys/x86. Modified: head/sys/amd64/amd64/busdma_machdep.c head/sys/i386/i386/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 19:59:53 2010 (r216307) +++ head/sys/amd64/amd64/busdma_machdep.c Wed Dec 8 20:20:10 2010 (r216308) @@ -50,7 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __i386__ +#define MAX_BPAGES 512 +#else #define MAX_BPAGES 8192 +#endif #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Wed Dec 8 19:59:53 2010 (r216307) +++ head/sys/i386/i386/busdma_machdep.c Wed Dec 8 20:20:10 2010 (r216308) @@ -50,7 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __i386__ #define MAX_BPAGES 512 +#else +#define MAX_BPAGES 8192 +#endif #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 20:35:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFB09106564A; Wed, 8 Dec 2010 20:35:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF5178FC15; Wed, 8 Dec 2010 20:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8KZK9w014205; Wed, 8 Dec 2010 20:35:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8KZK6t014203; Wed, 8 Dec 2010 20:35:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201012082035.oB8KZK6t014203@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Dec 2010 20:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216309 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 20:35:21 -0000 Author: mav Date: Wed Dec 8 20:35:20 2010 New Revision: 216309 URL: http://svn.freebsd.org/changeset/base/216309 Log: Add IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips). PR: kern/152926 Submitted by: Mike Tancsa MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Dec 8 20:20:10 2010 (r216308) +++ head/sys/dev/ahci/ahci.c Wed Dec 8 20:35:20 2010 (r216309) @@ -172,6 +172,10 @@ static struct { {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, + {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, + {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, + {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, + {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 22:13:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8DC106566C; Wed, 8 Dec 2010 22:13:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1238FC14; Wed, 8 Dec 2010 22:13:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8MDRx3016345; Wed, 8 Dec 2010 22:13:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8MDRMI016343; Wed, 8 Dec 2010 22:13:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012082213.oB8MDRMI016343@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 8 Dec 2010 22:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216310 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 22:13:27 -0000 Author: jilles Date: Wed Dec 8 22:13:27 2010 New Revision: 216310 URL: http://svn.freebsd.org/changeset/base/216310 Log: printf: Remove support for building as a csh builtin. The #define BUILTIN was for building as a csh (not tcsh) builtin. Given that csh was replaced by tcsh years ago there is no point in keeping this. The #define SHELL is for building as an sh builtin and is in active use. This commit does not change the /bin/sh and /usr/bin/printf binaries. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Dec 8 20:35:20 2010 (r216309) +++ head/usr.bin/printf/printf.c Wed Dec 8 22:13:27 2010 (r216310) @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -#if !defined(BUILTIN) && !defined(SHELL) +#ifndef SHELL #ifndef lint static char const copyright[] = "@(#) Copyright (c) 1989, 1993\n\ @@ -69,9 +69,7 @@ static const char rcsid[] = #define warnx3(a, b, c) warnx(a, b, c) #endif -#ifndef BUILTIN #include -#endif #define PF(f, func) do { \ char *b = NULL; \ @@ -105,17 +103,13 @@ static void usage(void); static char **gargv; int -#ifdef BUILTIN -progprintf(int argc, char *argv[]) -#else main(int argc, char *argv[]) -#endif { size_t len; int ch, chopped, end, rval; char *format, *fmt, *start; -#if !defined(BUILTIN) && !defined(SHELL) +#ifndef SHELL (void) setlocale(LC_NUMERIC, ""); #endif #ifdef SHELL From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 22:52:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81101065672; Wed, 8 Dec 2010 22:52:44 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 165138FC15; Wed, 8 Dec 2010 22:52:44 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 396F7E7178; Wed, 8 Dec 2010 22:52:43 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=mail; bh=YHrHyy/PDqQM14mJp+M6AsQGNj4=; b=PRoVjO 4JKQWJ0TpwBXEVPUKw+YUEdUvUWwKjeQv9LnETCurQraXvyQ4BN76H5vn0EQTwKO AuwyYdK5lLYe2yp++iiPussvZeqvVbWzTRF5Y86JuE26c+kuu7IOksFMv3iIdLD9 Xos8RiQXZlAr3Gt9uH8VzcjvSStuk9RWm6xI4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=mail; b=D+2ajQvL7MRL0KviIvzv/AcbnmI2oJ0Z d7h1qcG9kvIEeyaFjOab8SIx7DkeApzJuPBuLSnPby3d2reFkUbw0uo/QvjaqdUR Mb3y/RCA+dFN4HvohvBhQOYwSRpVS8CuIboZxq3WozP+RQT0q1XTRu54er/NyNkf +7O+mtvhcjo= Received: from core.draftnet (client-86-27-21-134.glfd.adsl.virginmedia.com [86.27.21.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id A06B3E7177; Wed, 8 Dec 2010 22:52:42 +0000 (GMT) Date: Wed, 8 Dec 2010 22:52:35 +0000 From: Bruce Cran To: Bruce Evans Message-ID: <20101208225235.501ced0e@core.draftnet> In-Reply-To: <20101208153857.H1428@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Av5jmbeWaQI14I+Ohwfkt6u" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 22:52:44 -0000 --MP_/Av5jmbeWaQI14I+Ohwfkt6u Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, 8 Dec 2010 16:46:17 +1100 (EST) Bruce Evans wrote: > - for ATA drives, it uses the "firmware" geometry supplied by the > drive firmware. The ATA standard specifies this to be H=16/S=63 for > all drives larger than a certain size (IIRC, about 8GB, which is the > size at which the better default fake of H=255/S=63 generated by > cam_calc_geometry() for drives larger than 1GB, stops working for > systems that can't handle more than 1024 fake cylinders. The magic > 1GB is the size at which the even better default fake of H=64/S=32 > stops working with more than 1024 fake cylinders. > cam_calc_geometry() has no comment about this either). Since all > modern ATA drives are larger than 8GB, H=16/S=63 is almost hard-coded > for ATA. I've put together a patch which will hopefully improve the reporting of geometry, though as you say nothing actually uses it nowadays - we don't even appear to support CHS addressing in the disk drivers. ata_da.c now calls cam_calc_geometry() which is updated to clip the number of cylinders to 65535. This introduces a problem because the calculated geometry will no longer match the disklabel: however, since CHS isn't used I don't know if we need to warn if the geometries don't match? Since it appears superfluous I've removed the warning in the patch. atacontrol and camcontrol are updated to only display CHS parameters from the drive if the disk conforms to ATA-5 or before. The patch is also available at http://www.cran.org.uk/~brucec/freebsd/chs_deprecate.diff.txt in case the attachment gets lost. -- Bruce Cran --MP_/Av5jmbeWaQI14I+Ohwfkt6u Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=chs_deprecate.diff.txt Index: sbin/atacontrol/atacontrol.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sbin/atacontrol/atacontrol.c (revision 216266) +++ sbin/atacontrol/atacontrol.c (working copy) @@ -161,6 +161,7 @@ static void cap_print(struct ata_params *parm) { + int ataver; u_int32_t lbasize =3D (u_int32_t)parm->lba_size_1 | ((u_int32_t)parm->lba_size_2 << 16); =20 @@ -169,6 +170,8 @@ ((u_int64_t)parm->lba_size48_3 << 32) | ((u_int64_t)parm->lba_size48_4 << 48); =20 + ataver =3D version(parm->version_major); + printf("\n"); printf("Protocol "); if (parm->satacapabilities && parm->satacapabilities !=3D 0xffff) { @@ -180,14 +183,16 @@ printf("Unknown SATA revision\n"); } else - printf("ATA/ATAPI revision %d\n", version(parm->version_major)); + printf("ATA/ATAPI revision %d\n", ataver); printf("device model %.40s\n", parm->model); printf("serial number %.20s\n", parm->serial); printf("firmware revision %.8s\n", parm->revision); =20 - printf("cylinders %d\n", parm->cylinders); - printf("heads %d\n", parm->heads); - printf("sectors/track %d\n", parm->sectors); + if (ataver <=3D 5) { + printf("cylinders %d\n", parm->cylinders); + printf("heads %d\n", parm->heads); + printf("sectors/track %d\n", parm->sectors); + } =20 if (parm->config =3D=3D ATA_PROTO_CFA || (parm->support.command2 & ATA_SUPPORT_CFA)) Index: sbin/camcontrol/camcontrol.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sbin/camcontrol/camcontrol.c (revision 216266) +++ sbin/camcontrol/camcontrol.c (working copy) @@ -1104,6 +1104,7 @@ static void atacapprint(struct ata_params *parm) { + int ataver; u_int32_t lbasize =3D (u_int32_t)parm->lba_size_1 | ((u_int32_t)parm->lba_size_2 << 16); =20 @@ -1112,9 +1113,11 @@ ((u_int64_t)parm->lba_size48_3 << 32) | ((u_int64_t)parm->lba_size48_4 << 48); =20 + ataver =3D ata_version(parm->version_major); + printf("\n"); printf("protocol "); - printf("ATA/ATAPI-%d", ata_version(parm->version_major)); + printf("ATA/ATAPI-%d", ataver); if (parm->satacapabilities && parm->satacapabilities !=3D 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x\n"); @@ -1139,9 +1142,11 @@ parm->media_serial); } =20 - printf("cylinders %d\n", parm->cylinders); - printf("heads %d\n", parm->heads); - printf("sectors/track %d\n", parm->sectors); + if (ataver <=3D 5) { + printf("cylinders %d\n", parm->cylinders); + printf("heads %d\n", parm->heads); + printf("sectors/track %d\n", parm->sectors); + } printf("sector size logical %u, physical %lu, offset %lu\n", ata_logical_sector_size(parm), (unsigned long)ata_physical_sector_size(parm), Index: sys/cam/cam.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/cam.c (revision 216266) +++ sys/cam/cam.c (working copy) @@ -468,5 +468,8 @@ return; } ccg->cylinders =3D ccg->volume_size / secs_per_cylinder; + if (ccg->cylinders > 65535) + ccg->cylinders =3D 65535; + ccg->ccb_h.status =3D CAM_REQ_CMP; } Index: sys/cam/ata/ata_da.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/ata/ata_da.c (revision 216266) +++ sys/cam/ata/ata_da.c (working copy) @@ -1129,27 +1129,14 @@ struct disk_params *dp =3D &softc->params; u_int64_t lbasize48; u_int32_t lbasize; + struct ccb_calc_geometry cg; =20 dp->secsize =3D ata_logical_sector_size(&cgd->ident_data); - if ((cgd->ident_data.atavalid & ATA_FLAG_54_58) && - cgd->ident_data.current_heads && cgd->ident_data.current_sectors) { - dp->heads =3D cgd->ident_data.current_heads; - dp->secs_per_track =3D cgd->ident_data.current_sectors; - dp->cylinders =3D cgd->ident_data.cylinders; - dp->sectors =3D (u_int32_t)cgd->ident_data.current_size_1 | - ((u_int32_t)cgd->ident_data.current_size_2 << 16); - } else { - dp->heads =3D cgd->ident_data.heads; - dp->secs_per_track =3D cgd->ident_data.sectors; - dp->cylinders =3D cgd->ident_data.cylinders; - dp->sectors =3D cgd->ident_data.cylinders * dp->heads * dp->secs_per_tra= ck; =20 - } + lbasize =3D (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16); =20 - /* use the 28bit LBA size if valid or bigger than the CHS mapping */ - if (cgd->ident_data.cylinders =3D=3D 16383 || dp->sectors < lbasize) - dp->sectors =3D lbasize; + dp->sectors =3D lbasize; =20 /* use the 48bit LBA size if valid */ lbasize48 =3D ((u_int64_t)cgd->ident_data.lba_size48_1) | @@ -1159,6 +1146,14 @@ if ((cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) && lbasize48 > ATA_MAX_28BIT_LBA) dp->sectors =3D lbasize48; + + cg.block_size =3D dp->secsize; + cg.volume_size =3D dp->sectors * dp->secsize; + cam_calc_geometry(&cg, 1); + + dp->heads =3D cg.heads; + dp->secs_per_track =3D cg.secs_per_track; + dp->cylinders =3D cg.cylinders; } =20 static void Index: sys/geom/part/g_part.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/geom/part/g_part.h (revision 216266) +++ sys/geom/part/g_part.h (working copy) @@ -114,12 +114,12 @@ uint32_t gpt_smhead; uint32_t gpt_smtail; /* - * gpt_sectors and gpt_heads are the fixed or synchesized number + * gpt_sectors and gpt_heads are the fixed or synthesized number * of sectors per track and heads (resp) that make up a disks * geometry. This is to support partitioning schemes as well as * file systems that work on a geometry. The MBR scheme and the * MS-DOS (FAT) file system come to mind. - * We keep track of whether the geometry is fixed or synchesized + * We keep track of whether the geometry is fixed or synthesized * so that a partitioning scheme can correct the synthesized * geometry, based on the on-disk metadata. */ Index: sys/geom/part/g_part_bsd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/geom/part/g_part_bsd.c (revision 216266) +++ sys/geom/part/g_part_bsd.c (working copy) @@ -387,10 +387,6 @@ goto invalid_label; if (heads !=3D basetable->gpt_heads && !basetable->gpt_fixgeom) basetable->gpt_heads =3D heads; - if (sectors !=3D basetable->gpt_sectors || heads !=3D basetable->gpt_head= s) - printf("GEOM: %s: geometry does not match label" - " (%uh,%us !=3D %uh,%us).\n", pp->name, heads, sectors, - basetable->gpt_heads, basetable->gpt_sectors); =20 chs =3D le32dec(buf + 60); if (chs < 1) Index: sys/geom/part/g_part.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/geom/part/g_part.c (revision 216266) +++ sys/geom/part/g_part.c (working copy) @@ -203,7 +203,7 @@ continue; /* * Prefer a geometry with sectors > 1, but only if - * it doesn't bump down the numbver of heads to 1. + * it doesn't bump down the number of heads to 1. */ if (chs > bestchs || (chs =3D=3D bestchs && heads > 1 && table->gpt_sectors =3D=3D 1)) { --MP_/Av5jmbeWaQI14I+Ohwfkt6u-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 22:54:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F017106564A; Wed, 8 Dec 2010 22:54:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F246A8FC18; Wed, 8 Dec 2010 22:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8MsIiE017168; Wed, 8 Dec 2010 22:54:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8MsINQ017166; Wed, 8 Dec 2010 22:54:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012082254.oB8MsINQ017166@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 8 Dec 2010 22:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216311 - head/tools/regression/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 22:54:19 -0000 Author: jilles Date: Wed Dec 8 22:54:18 2010 New Revision: 216311 URL: http://svn.freebsd.org/changeset/base/216311 Log: printf: Test that the "--" option terminator works. Added: head/tools/regression/usr.bin/printf/regress.m5.out (contents, props changed) Modified: head/tools/regression/usr.bin/printf/regress.sh Added: head/tools/regression/usr.bin/printf/regress.m5.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/printf/regress.m5.out Wed Dec 8 22:54:18 2010 (r216311) @@ -0,0 +1 @@ +-d Modified: head/tools/regression/usr.bin/printf/regress.sh ============================================================================== --- head/tools/regression/usr.bin/printf/regress.sh Wed Dec 8 22:13:27 2010 (r216310) +++ head/tools/regression/usr.bin/printf/regress.sh Wed Dec 8 22:54:18 2010 (r216311) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..8' +echo '1..9' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') @@ -11,6 +11,7 @@ REGRESSION_TEST(`m1', `printf "%c%%%d\0\ REGRESSION_TEST(`m2', `printf "abc\n\cdef"') REGRESSION_TEST(`m3', `printf "%%%s\n" abc def ghi jkl') REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"') +REGRESSION_TEST(`m5', `printf -- "-d\n"') REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc') REGRESSION_END() From owner-svn-src-head@FreeBSD.ORG Wed Dec 8 23:40:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B560106564A; Wed, 8 Dec 2010 23:40:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001E18FC14; Wed, 8 Dec 2010 23:40:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB8NefHV018117; Wed, 8 Dec 2010 23:40:41 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB8Nefff018113; Wed, 8 Dec 2010 23:40:41 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012082340.oB8Nefff018113@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Dec 2010 23:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216312 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 23:40:42 -0000 Author: jkim Date: Wed Dec 8 23:40:41 2010 New Revision: 216312 URL: http://svn.freebsd.org/changeset/base/216312 Log: Do not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC. Remove a confusing comment about converting to MHz as we never did. Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Dec 8 22:54:18 2010 (r216311) +++ head/sys/amd64/amd64/machdep.c Wed Dec 8 23:40:41 2010 (r216312) @@ -563,13 +563,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * thread_unlock(curthread); #endif - /* - * Calculate the difference in readings, convert to Mhz, and - * subtract 0.5% of the total. Empirical testing has shown that - * overhead in DELAY() works out to approximately this value. - */ - tsc2 -= tsc1; - *rate = tsc2 * 1000 - tsc2 * 5; + *rate = (tsc2 - tsc1) * 1000; return (0); } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Dec 8 22:54:18 2010 (r216311) +++ head/sys/i386/i386/machdep.c Wed Dec 8 23:40:41 2010 (r216312) @@ -1157,12 +1157,16 @@ cpu_est_clockrate(int cpu_id, uint64_t * thread_unlock(curthread); #endif + tsc2 -= tsc1; + if (tsc_freq != 0 && !tsc_is_broken) { + *rate = tsc2 * 1000; + return (0); + } + /* - * Calculate the difference in readings, convert to Mhz, and - * subtract 0.5% of the total. Empirical testing has shown that + * Subtract 0.5% of the total. Empirical testing has shown that * overhead in DELAY() works out to approximately this value. */ - tsc2 -= tsc1; *rate = tsc2 * 1000 - tsc2 * 5; return (0); } Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Wed Dec 8 22:54:18 2010 (r216311) +++ head/sys/pc98/pc98/machdep.c Wed Dec 8 23:40:41 2010 (r216312) @@ -1092,12 +1092,16 @@ cpu_est_clockrate(int cpu_id, uint64_t * thread_unlock(curthread); #endif + tsc2 -= tsc1; + if (tsc_freq != 0 && !tsc_is_broken) { + *rate = tsc2 * 1000; + return (0); + } + /* - * Calculate the difference in readings, convert to Mhz, and - * subtract 0.5% of the total. Empirical testing has shown that + * Subtract 0.5% of the total. Empirical testing has shown that * overhead in DELAY() works out to approximately this value. */ - tsc2 -= tsc1; *rate = tsc2 * 1000 - tsc2 * 5; return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 02:42:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8536F1065670; Thu, 9 Dec 2010 02:42:02 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73D378FC14; Thu, 9 Dec 2010 02:42:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB92g2Ba021714; Thu, 9 Dec 2010 02:42:02 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB92g2Ha021706; Thu, 9 Dec 2010 02:42:02 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201012090242.oB92g2Ha021706@svn.freebsd.org> From: David Xu Date: Thu, 9 Dec 2010 02:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216313 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 02:42:02 -0000 Author: davidxu Date: Thu Dec 9 02:42:02 2010 New Revision: 216313 URL: http://svn.freebsd.org/changeset/base/216313 Log: MFp4: It is possible a lower priority thread lending priority to higher priority thread, in old code, it is ignored, however the lending should always be recorded, add field td_lend_user_pri to fix the problem, if a thread does not have borrowed priority, its value is PRI_MAX. MFC after: 1 week Modified: head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/kern/kern_thread.c head/sys/kern/kern_umtx.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/proc.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/init_main.c Thu Dec 9 02:42:02 2010 (r216313) @@ -460,6 +460,7 @@ proc0_init(void *dummy __unused) td->td_pri_class = PRI_TIMESHARE; td->td_user_pri = PUSER; td->td_base_user_pri = PUSER; + td->td_lend_user_pri = PRI_MAX; td->td_priority = PVM; td->td_base_pri = PUSER; td->td_oncpu = 0; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/kern_fork.c Thu Dec 9 02:42:02 2010 (r216313) @@ -543,6 +543,7 @@ again: td2->td_sigstk = td->td_sigstk; td2->td_sigmask = td->td_sigmask; td2->td_flags = TDF_INMEM; + td2->td_lend_user_pri = PRI_MAX; #ifdef VIMAGE td2->td_vnet = NULL; Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/kern_thread.c Thu Dec 9 02:42:02 2010 (r216313) @@ -110,6 +110,7 @@ thread_ctor(void *mem, int size, void *a * end of a context switch. */ td->td_critnest = 1; + td->td_lend_user_pri = PRI_MAX; EVENTHANDLER_INVOKE(thread_ctor, td); #ifdef AUDIT audit_thread_alloc(td); Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/kern_umtx.c Thu Dec 9 02:42:02 2010 (r216313) @@ -1407,17 +1407,19 @@ umtx_propagate_priority(struct thread *t for (;;) { td = pi->pi_owner; - if (td == NULL) + if (td == NULL || td == curthread) return; MPASS(td->td_proc != NULL); MPASS(td->td_proc->p_magic == P_MAGIC); - if (UPRI(td) <= pri) - return; - thread_lock(td); - sched_lend_user_prio(td, pri); + if (td->td_lend_user_pri > pri) + sched_lend_user_prio(td, pri); + else { + thread_unlock(td); + break; + } thread_unlock(td); /* @@ -3587,8 +3589,8 @@ umtx_thread_cleanup(struct thread *td) pi->pi_owner = NULL; TAILQ_REMOVE(&uq->uq_pi_contested, pi, pi_link); } + mtx_unlock_spin(&umtx_lock); thread_lock(td); - td->td_flags &= ~TDF_UBORROWING; + sched_unlend_user_prio(td, PRI_MAX); thread_unlock(td); - mtx_unlock_spin(&umtx_lock); } Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/sched_4bsd.c Thu Dec 9 02:42:02 2010 (r216313) @@ -879,25 +879,23 @@ sched_prio(struct thread *td, u_char pri void sched_user_prio(struct thread *td, u_char prio) { - u_char oldprio; THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_base_user_pri = prio; - if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) + if (td->td_lend_user_pri <= prio) return; - oldprio = td->td_user_pri; td->td_user_pri = prio; } void sched_lend_user_prio(struct thread *td, u_char prio) { - u_char oldprio; THREAD_LOCK_ASSERT(td, MA_OWNED); - td->td_flags |= TDF_UBORROWING; - oldprio = td->td_user_pri; - td->td_user_pri = prio; + if (prio < td->td_lend_user_pri) + td->td_lend_user_pri = prio; + if (prio < td->td_user_pri) + td->td_user_pri = prio; } void @@ -907,12 +905,11 @@ sched_unlend_user_prio(struct thread *td THREAD_LOCK_ASSERT(td, MA_OWNED); base_pri = td->td_base_user_pri; - if (prio >= base_pri) { - td->td_flags &= ~TDF_UBORROWING; - sched_user_prio(td, base_pri); - } else { - sched_lend_user_prio(td, prio); - } + td->td_lend_user_pri = prio; + if (prio > base_pri) + td->td_user_pri = base_pri; + else + td->td_user_pri = prio; } void Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/kern/sched_ule.c Thu Dec 9 02:42:02 2010 (r216313) @@ -1677,8 +1677,8 @@ sched_user_prio(struct thread *td, u_cha { td->td_base_user_pri = prio; - if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) - return; + if (td->td_lend_user_pri <= prio) + return; td->td_user_pri = prio; } @@ -1687,8 +1687,10 @@ sched_lend_user_prio(struct thread *td, { THREAD_LOCK_ASSERT(td, MA_OWNED); - td->td_flags |= TDF_UBORROWING; - td->td_user_pri = prio; + if (prio < td->td_lend_user_pri) + td->td_lend_user_pri = prio; + if (prio < td->td_user_pri) + td->td_user_pri = prio; } void @@ -1698,12 +1700,11 @@ sched_unlend_user_prio(struct thread *td THREAD_LOCK_ASSERT(td, MA_OWNED); base_pri = td->td_base_user_pri; - if (prio >= base_pri) { - td->td_flags &= ~TDF_UBORROWING; - sched_user_prio(td, base_pri); - } else { - sched_lend_user_prio(td, prio); - } + td->td_lend_user_pri = prio; + if (prio > base_pri) + td->td_user_pri = base_pri; + else + td->td_user_pri = prio; } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Dec 8 23:40:41 2010 (r216312) +++ head/sys/sys/proc.h Thu Dec 9 02:42:02 2010 (r216313) @@ -214,6 +214,7 @@ struct thread { lwpid_t td_tid; /* (b) Thread ID. */ sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ #define td_siglist td_sigqueue.sq_signals + u_char td_lend_user_pri; /* (t) Lend user pri. */ /* Cleared during fork1() */ #define td_startzero td_flags @@ -343,7 +344,7 @@ do { \ #define TDF_CANSWAP 0x00000040 /* Thread can be swapped. */ #define TDF_SLEEPABORT 0x00000080 /* sleepq_abort was called. */ #define TDF_KTH_SUSP 0x00000100 /* kthread is suspended */ -#define TDF_UBORROWING 0x00000200 /* Thread is borrowing user pri. */ +#define TDF_UNUSED09 0x00000200 /* --available-- */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ #define TDF_ASTPENDING 0x00000800 /* Thread has some asynchronous events. */ #define TDF_TIMOFAIL 0x00001000 /* Timeout from sleep after we were awake. */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 05:16:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F561065670; Thu, 9 Dec 2010 05:16:20 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91428FC13; Thu, 9 Dec 2010 05:16:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB95GKui025037; Thu, 9 Dec 2010 05:16:20 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB95GKoY025035; Thu, 9 Dec 2010 05:16:20 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201012090516.oB95GKoY025035@svn.freebsd.org> From: David Xu Date: Thu, 9 Dec 2010 05:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216314 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 05:16:21 -0000 Author: davidxu Date: Thu Dec 9 05:16:20 2010 New Revision: 216314 URL: http://svn.freebsd.org/changeset/base/216314 Log: MFp4: The unit number allocator reuses ID too fast, this may hide bugs in other code, add a ring buffer to delay freeing a thread ID. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Dec 9 02:42:02 2010 (r216313) +++ head/sys/kern/kern_thread.c Thu Dec 9 05:16:20 2010 (r216314) @@ -81,15 +81,54 @@ MTX_SYSINIT(zombie_lock, &zombie_lock, " static void thread_zombie(struct thread *); +#define TID_BUFFER_SIZE 1024 + struct mtx tid_lock; static struct unrhdr *tid_unrhdr; - +static lwpid_t tid_buffer[TID_BUFFER_SIZE]; +static int tid_head, tid_tail; static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); struct tidhashhead *tidhashtbl; u_long tidhash; struct rwlock tidhash_lock; +static lwpid_t +tid_alloc(void) +{ + lwpid_t tid; + + tid = alloc_unr(tid_unrhdr); + if (tid != -1) + return (tid); + mtx_lock(&tid_lock); + if (tid_head == tid_tail) { + mtx_unlock(&tid_lock); + return (-1); + } + tid = tid_buffer[tid_head++]; + tid_head %= TID_BUFFER_SIZE; + mtx_unlock(&tid_lock); + return (tid); +} + +static void +tid_free(lwpid_t tid) +{ + lwpid_t tmp_tid = -1; + + mtx_lock(&tid_lock); + if ((tid_tail + 1) % TID_BUFFER_SIZE == tid_head) { + tmp_tid = tid_buffer[tid_head++]; + tid_head = (tid_head + 1) % TID_BUFFER_SIZE; + } + tid_buffer[tid_tail++] = tid; + tid_tail %= TID_BUFFER_SIZE; + mtx_unlock(&tid_lock); + if (tmp_tid != -1) + free_unr(tid_unrhdr, tmp_tid); +} + /* * Prepare a thread for use. */ @@ -102,7 +141,7 @@ thread_ctor(void *mem, int size, void *a td->td_state = TDS_INACTIVE; td->td_oncpu = NOCPU; - td->td_tid = alloc_unr(tid_unrhdr); + td->td_tid = tid_alloc(); /* * Note that td_critnest begins life as 1 because the thread is not @@ -156,7 +195,7 @@ thread_dtor(void *mem, int size, void *a osd_thread_exit(td); EVENTHANDLER_INVOKE(thread_dtor, td); - free_unr(tid_unrhdr, td->td_tid); + tid_free(td->td_tid); } /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 06:34:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C6261065672; Thu, 9 Dec 2010 06:34:29 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6C28FC08; Thu, 9 Dec 2010 06:34:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB96YS23026626; Thu, 9 Dec 2010 06:34:28 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB96YS4P026620; Thu, 9 Dec 2010 06:34:28 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012090634.oB96YS4P026620@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 9 Dec 2010 06:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216315 - in head/sys: conf mips/include mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 06:34:29 -0000 Author: jchandra Date: Thu Dec 9 06:34:28 2010 New Revision: 216315 URL: http://svn.freebsd.org/changeset/base/216315 Log: UMA_MD_SMALL_ALLOC for mips. Implement uma_small_alloc() and uma_small_free() for mips that allocates pages from direct mapped memory. Uses the same mechanism as the page table page allocator, so that we allocate from KSEG0 in 32 bit, and from XKPHYS on 64 bit. Reviewed by: alc, jmallett Added: head/sys/mips/mips/uma_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/include/pmap.h head/sys/mips/include/vmparam.h head/sys/mips/mips/pmap.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Dec 9 05:16:20 2010 (r216314) +++ head/sys/conf/files.mips Thu Dec 9 06:34:28 2010 (r216315) @@ -63,6 +63,7 @@ mips/mips/support.S standard mips/mips/sys_machdep.c standard mips/mips/swtch.S standard mips/mips/uio_machdep.c standard +mips/mips/uma_machdep.c standard crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb geom/geom_bsd.c optional geom_bsd Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Thu Dec 9 05:16:20 2010 (r216314) +++ head/sys/mips/include/pmap.h Thu Dec 9 06:34:28 2010 (r216315) @@ -163,6 +163,9 @@ void pmap_kenter_temporary_free(vm_paddr int pmap_compute_pages_to_dump(void); void pmap_flush_pvcache(vm_page_t m); int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); +void pmap_grow_direct_page_cache(void); +vm_page_t pmap_alloc_direct_page(unsigned int index, int req); + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Thu Dec 9 05:16:20 2010 (r216314) +++ head/sys/mips/include/vmparam.h Thu Dec 9 06:34:28 2010 (r216315) @@ -149,6 +149,8 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define UMA_MD_SMALL_ALLOC + /* * max number of non-contig chunks of physical RAM you can have */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Dec 9 05:16:20 2010 (r216314) +++ head/sys/mips/mips/pmap.c Thu Dec 9 06:34:28 2010 (r216315) @@ -185,8 +185,6 @@ static vm_page_t pmap_allocpte(pmap_t pm static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t); static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot); -static vm_page_t pmap_alloc_pte_page(unsigned int index, int req); -static void pmap_grow_pte_page_cache(void); #ifdef SMP static void pmap_invalidate_page_action(void *arg); @@ -1062,8 +1060,8 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof pmap->pm_stats); } -static void -pmap_grow_pte_page_cache() +void +pmap_grow_direct_page_cache() { #ifdef __mips_n64 @@ -1073,8 +1071,8 @@ pmap_grow_pte_page_cache() #endif } -static vm_page_t -pmap_alloc_pte_page(unsigned int index, int req) +vm_page_t +pmap_alloc_direct_page(unsigned int index, int req) { vm_page_t m; @@ -1107,8 +1105,8 @@ pmap_pinit(pmap_t pmap) /* * allocate the page directory page */ - while ((ptdpg = pmap_alloc_pte_page(NUSERPGTBLS, VM_ALLOC_NORMAL)) == NULL) - pmap_grow_pte_page_cache(); + while ((ptdpg = pmap_alloc_direct_page(NUSERPGTBLS, VM_ALLOC_NORMAL)) == NULL) + pmap_grow_direct_page_cache(); ptdva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(ptdpg)); pmap->pm_segtab = (pd_entry_t *)ptdva; @@ -1141,11 +1139,11 @@ _pmap_allocpte(pmap_t pmap, unsigned pte /* * Find or fabricate a new pagetable page */ - if ((m = pmap_alloc_pte_page(ptepindex, VM_ALLOC_NORMAL)) == NULL) { + if ((m = pmap_alloc_direct_page(ptepindex, VM_ALLOC_NORMAL)) == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); vm_page_unlock_queues(); - pmap_grow_pte_page_cache(); + pmap_grow_direct_page_cache(); vm_page_lock_queues(); PMAP_LOCK(pmap); } @@ -1313,7 +1311,7 @@ pmap_growkernel(vm_offset_t addr) #ifdef __mips_n64 if (*pdpe == 0) { /* new intermediate page table entry */ - nkpg = pmap_alloc_pte_page(nkpt, VM_ALLOC_INTERRUPT); + nkpg = pmap_alloc_direct_page(nkpt, VM_ALLOC_INTERRUPT); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); *pdpe = (pd_entry_t)MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(nkpg)); @@ -1333,7 +1331,7 @@ pmap_growkernel(vm_offset_t addr) /* * This index is bogus, but out of the way */ - nkpg = pmap_alloc_pte_page(nkpt, VM_ALLOC_INTERRUPT); + nkpg = pmap_alloc_direct_page(nkpt, VM_ALLOC_INTERRUPT); if (!nkpg) panic("pmap_growkernel: no memory to grow kernel"); nkpt++; Added: head/sys/mips/mips/uma_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/uma_machdep.c Thu Dec 9 06:34:28 2010 (r216315) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2003 Alan L. Cox + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void * +uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) +{ + static vm_pindex_t color; + vm_paddr_t pa; + vm_page_t m; + int pflags; + void *va; + + *flags = UMA_SLAB_PRIV; + + if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT; + else + pflags = VM_ALLOC_SYSTEM; + + for (;;) { + m = pmap_alloc_direct_page(color++, pflags); + if (m == NULL) { + if (wait & M_NOWAIT) + return (NULL); + else + pmap_grow_direct_page_cache(); + } else + break; + } + + pa = VM_PAGE_TO_PHYS(m); + va = (void *)MIPS_PHYS_TO_DIRECT(pa); + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) + bzero(va, PAGE_SIZE); + return (va); +} + +void +uma_small_free(void *mem, int size, u_int8_t flags) +{ + vm_page_t m; + vm_paddr_t pa; + + pa = MIPS_DIRECT_TO_PHYS((vm_offset_t)mem); + m = PHYS_TO_VM_PAGE(pa); + m->wire_count--; + vm_page_free(m); + atomic_subtract_int(&cnt.v_wire_count, 1); +} From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 06:41:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76AB1106564A; Thu, 9 Dec 2010 06:41:50 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63E938FC18; Thu, 9 Dec 2010 06:41:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB96foPA026793; Thu, 9 Dec 2010 06:41:50 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB96fouj026788; Thu, 9 Dec 2010 06:41:50 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012090641.oB96fouj026788@svn.freebsd.org> From: Colin Percival Date: Thu, 9 Dec 2010 06:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216316 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 06:41:50 -0000 Author: cperciva Date: Thu Dec 9 06:41:50 2010 New Revision: 216316 URL: http://svn.freebsd.org/changeset/base/216316 Log: Replace i386/i386/busdma_machdep.c and amd64/amd64/busdma_machdep.c (which are identical) with a single x86/x86/busdma_machdep.c. Added: head/sys/x86/x86/busdma_machdep.c - copied unchanged from r216308, head/sys/i386/i386/busdma_machdep.c Deleted: head/sys/amd64/amd64/busdma_machdep.c head/sys/i386/i386/busdma_machdep.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Dec 9 06:34:28 2010 (r216315) +++ head/sys/conf/files.amd64 Thu Dec 9 06:41:50 2010 (r216316) @@ -97,7 +97,6 @@ amd64/amd64/atomic.c standard amd64/amd64/autoconf.c standard amd64/amd64/bios.c standard amd64/amd64/bpf_jit_machdep.c optional bpf_jitter -amd64/amd64/busdma_machdep.c standard amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb @@ -317,6 +316,7 @@ x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c standard x86/x86/local_apic.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Dec 9 06:34:28 2010 (r216315) +++ head/sys/conf/files.i386 Thu Dec 9 06:41:50 2010 (r216316) @@ -272,7 +272,6 @@ i386/i386/autoconf.c standard i386/i386/bios.c optional native i386/i386/bioscall.s optional native i386/i386/bpf_jit_machdep.c optional bpf_jitter -i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb @@ -406,6 +405,7 @@ x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/qpi.c standard +x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Dec 9 06:34:28 2010 (r216315) +++ head/sys/conf/files.pc98 Thu Dec 9 06:41:50 2010 (r216316) @@ -134,7 +134,6 @@ i386/i386/autoconf.c standard i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/bpf_jit_machdep.c optional bpf_jitter -i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb @@ -250,6 +249,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic Copied: head/sys/x86/x86/busdma_machdep.c (from r216308, head/sys/i386/i386/busdma_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/busdma_machdep.c Thu Dec 9 06:41:50 2010 (r216316, copy of r216308, head/sys/i386/i386/busdma_machdep.c) @@ -0,0 +1,1222 @@ +/*- + * Copyright (c) 1997, 1998 Justin T. Gibbs. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef __i386__ +#define MAX_BPAGES 512 +#else +#define MAX_BPAGES 8192 +#endif +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +struct bounce_zone; + +struct bus_dma_tag { + bus_dma_tag_t parent; + bus_size_t alignment; + bus_size_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_dma_filter_t *filter; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + int ref_count; + int map_count; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + 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 int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + +struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + void *buf; /* unmapped buffer pointer */ + bus_size_t buflen; /* unmapped buffer length */ + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; +static struct bus_dmamap nobounce_dmamap; + +static void init_bounce_pages(void *dummy); +static int 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); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags); + +#ifdef XEN +#undef pmap_kextract +#define pmap_kextract pmap_kextract_ma +#endif + +/* + * Return true if a match is made. + * + * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. + * + * If paddr is within the bounds of the dma tag then call the filter callback + * to check for a match, if there is no filter callback then assume a match. + */ +int +run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) +{ + int retval; + + retval = 0; + + do { + if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) + || ((paddr & (dmat->alignment - 1)) != 0)) + && (dmat->filter == NULL + || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + retval = 1; + + dmat = dmat->parent; + } while (retval == 0 && dmat != NULL); + return (retval); +} + +/* + * Convenience function for manipulating driver locks from busdma (during + * busdma_swi, for example). Drivers that don't provide their own locks + * should specify &Giant to dmat->lockfuncarg. Drivers that use their own + * non-mutex locking scheme don't have to use this at all. + */ +void +busdma_lock_mutex(void *arg, bus_dma_lock_op_t op) +{ + struct mtx *dmtx; + + dmtx = (struct mtx *)arg; + switch (op) { + case BUS_DMA_LOCK: + mtx_lock(dmtx); + break; + case BUS_DMA_UNLOCK: + mtx_unlock(dmtx); + break; + default: + panic("Unknown operation 0x%x for busdma_lock_mutex!", op); + } +} + +/* + * dflt_lock should never get called. It gets put into the dma tag when + * lockfunc == NULL, which is only valid if the maps that are associated + * with the tag are meant to never be defered. + * XXX Should have a way to identify which driver is responsible here. + */ +static void +dflt_lock(void *arg, bus_dma_lock_op_t op) +{ + panic("driver error: busdma dflt_lock called"); +} + +/* + * Allocate a device specific dma_tag. + */ +int +bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_size_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t newtag; + int error = 0; + + /* Basic sanity checking */ + if (boundary != 0 && boundary < maxsegsz) + maxsegsz = boundary; + + if (maxsegsz == 0) { + return (EINVAL); + } + + /* Return a NULL tag on failure */ + *dmat = NULL; + + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, + M_ZERO | M_NOWAIT); + if (newtag == NULL) { + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, 0, error); + return (ENOMEM); + } + + newtag->parent = parent; + newtag->alignment = alignment; + newtag->boundary = boundary; + newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1); + newtag->filter = filter; + newtag->filterarg = filterarg; + newtag->maxsize = maxsize; + newtag->nsegments = nsegments; + newtag->maxsegsz = maxsegsz; + newtag->flags = flags; + newtag->ref_count = 1; /* Count ourself */ + newtag->map_count = 0; + if (lockfunc != NULL) { + newtag->lockfunc = lockfunc; + newtag->lockfuncarg = lockfuncarg; + } else { + newtag->lockfunc = dflt_lock; + newtag->lockfuncarg = NULL; + } + newtag->segments = NULL; + + /* Take into account any restrictions imposed by our parent tag */ + if (parent != NULL) { + newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); + if ((newtag->filter != NULL) || + ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + if (newtag->filter == NULL) { + /* + * Short circuit looking at our parent directly + * since we have encapsulated all of its information + */ + newtag->filter = parent->filter; + newtag->filterarg = parent->filterarg; + newtag->parent = parent->parent; + } + if (newtag->parent != NULL) + atomic_add_int(&parent->ref_count, 1); + } + + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) + || newtag->alignment > 1) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; + } + + if (error != 0) { + free(newtag, M_DEVBUF); + } else { + *dmat = newtag; + } + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, 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) { + error = EBUSY; + goto out; + } + + while (dmat != NULL) { + bus_dma_tag_t parent; + + parent = dmat->parent; + atomic_subtract_int(&dmat->ref_count, 1); + if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +int +bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + int error; + + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { + + /* Must bounce */ + struct bounce_zone *bz; + int maxpages; + + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + } + bz = dmat->bounce_zone; + + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { + int pages; + + pages = MAX(atop(dmat->maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { + if (error == 0) + dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else { + error = 0; + } + } + bz->map_count++; + } else { + *mapp = NULL; + } + if (error == 0) + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, error); + return (error); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +int +bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + if (map != NULL && map != &nobounce_dmamap) { + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; + free(map, M_DEVBUF); + } + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); +} + + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints lited in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +int +bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + + /* If we succeed, no mapping/bouncing will be required */ + *mapp = NULL; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + + /* + * XXX: + * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact + * alignment guarantees of malloc need to be nailed down, and the + * code below should be rewritten to take that into account. + * + * In the meantime, we'll warn the user if malloc gets it wrong. + */ + if ((dmat->maxsize <= PAGE_SIZE) && + (dmat->alignment < dmat->maxsize) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { + *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); + } else { + /* + * XXX Use Contigmalloc until it is merged into this facility + * and handles multi-seg allocations. Nobody is doing + * multi-seg allocations yet though. + * XXX Certain AGP hardware does. + */ + *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, + 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, + dmat->boundary); + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } else if (vtophys(*vaddr) & (dmat->alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } + if (flags & BUS_DMA_NOCACHE) + pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, + PAT_UNCACHEABLE); + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, 0); + return (0); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +void +bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + /* + * dmamem does not need to be bounced, so the map should be + * NULL + */ + if (map != NULL) + panic("bus_dmamem_free: Invalid map freed\n"); + pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK); + if ((dmat->maxsize <= PAGE_SIZE) && + (dmat->alignment < dmat->maxsize) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) + free(vaddr, M_DEVBUF); + else { + contigfree(vaddr, dmat->maxsize, M_DEVBUF); + } + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); +} + +int +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + 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 + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + bus_size_t sg_len; + + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + run_filter(dmat, paddr) != 0) { + sg_len = roundup2(sg_len, dmat->alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } + + /* Reserve Necessary Bounce Pages */ + if (map->pagesneeded != 0) { + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + map->dmat = dmat; + map->buf = buf; + map->buflen = buflen; + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, + map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + } + + return (0); +} + +/* + * Utility function to load a linear buffer. lastaddrp holds state + * between invocations (for multiple-buffer loads). segp contains + * the starting segment on entrace, and the ending segment on exit. + * first indicates if this is the first invocation of this function. + */ +static __inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, + bus_dmamap_t map, + void *buf, bus_size_t buflen, + pmap_t pmap, + int flags, + bus_addr_t *lastaddrp, + bus_dma_segment_t *segs, + int *segp, + int first) +{ + bus_size_t sgsize; + bus_addr_t curaddr, lastaddr, baddr, bmask; + vm_offset_t vaddr; + int seg, error; + + if (map == NULL) + map = &nobounce_dmamap; + + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); + if (error) + return (error); + } + + vaddr = (vm_offset_t)buf; + lastaddr = *lastaddrp; + bmask = ~(dmat->boundary - 1); + + for (seg = *segp; buflen > 0 ; ) { + bus_size_t max_sgsize; + + /* + * Get the physical address for this segment. + */ + if (pmap) + curaddr = pmap_extract(pmap, vaddr); + else + curaddr = pmap_kextract(vaddr); + + /* + * Compute the segment size, and adjust counts. + */ + max_sgsize = MIN(buflen, dmat->maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = roundup2(sgsize, dmat->alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } + + /* + * Make sure we don't cross any boundaries. + */ + if (dmat->boundary > 0) { + baddr = (curaddr + dmat->boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * previous segment if possible. + */ + if (first) { + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + first = 0; + } else { + if (curaddr == lastaddr && + (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && + (dmat->boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + segs[seg].ds_len += sgsize; + else { + if (++seg >= dmat->nsegments) + break; + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + } + + lastaddr = curaddr + sgsize; + vaddr += sgsize; + buflen -= sgsize; + } + + *segp = seg; + *lastaddrp = lastaddr; + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + +/* + * Map the buffer buf into bus space using the dmamap map. + */ +int +bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, bus_dmamap_callback_t *callback, + void *callback_arg, int flags) +{ + bus_addr_t lastaddr = 0; + int error, nsegs = 0; + + if (map != NULL) { + flags |= BUS_DMA_WAITOK; + map->callback = callback; + map->callback_arg = callback_arg; + } + + error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, + &lastaddr, dmat->segments, &nsegs, 1); + + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); + + if (error == EINPROGRESS) { + return (error); + } + + if (error) + (*callback)(callback_arg, dmat->segments, 0, error); + else + (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); + + /* + * Return ENOMEM to the caller so that it can pass it up the stack. + * This error only happens when NOWAIT is set, so deferal is disabled. + */ + if (error == ENOMEM) + return (error); + + return (0); +} + + +/* + * Like _bus_dmamap_load(), but for mbufs. + */ +static __inline int +_bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, + int flags) +{ + int error; + + M_ASSERTPKTHDR(m0); + + flags |= BUS_DMA_NOWAIT; + *nsegs = 0; + error = 0; + if (m0->m_pkthdr.len <= dmat->maxsize) { + int first = 1; + bus_addr_t lastaddr = 0; + struct mbuf *m; + + for (m = m0; m != NULL && error == 0; m = m->m_next) { + if (m->m_len > 0) { + error = _bus_dmamap_load_buffer(dmat, map, + m->m_data, m->m_len, + NULL, flags, &lastaddr, + segs, nsegs, first); + first = 0; + } + } + } else { + error = EINVAL; + } + + /* XXX FIXME: Having to increment nsegs is really annoying */ + ++*nsegs; + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, *nsegs); + return (error); +} + +int +bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, + bus_dmamap_callback2_t *callback, void *callback_arg, + int flags) +{ + int nsegs, error; + + error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, dmat->segments, &nsegs, + flags); + + if (error) { + /* force "no valid mappings" in callback */ + (*callback)(callback_arg, dmat->segments, 0, 0, error); + } else { + (*callback)(callback_arg, dmat->segments, + nsegs, m0->m_pkthdr.len, error); + } + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs); + return (error); +} + +int +bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, + int flags) +{ + return (_bus_dmamap_load_mbuf_sg(dmat, map, m0, segs, nsegs, flags)); +} + +/* + * Like _bus_dmamap_load(), but for uios. + */ +int +bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, + struct uio *uio, + bus_dmamap_callback2_t *callback, void *callback_arg, + int flags) +{ + bus_addr_t lastaddr = 0; + int nsegs, error, first, i; + bus_size_t resid; + struct iovec *iov; + pmap_t pmap; + + flags |= BUS_DMA_NOWAIT; + resid = uio->uio_resid; + iov = uio->uio_iov; + + if (uio->uio_segflg == UIO_USERSPACE) { + 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; + first = 1; + for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + bus_size_t minlen = + resid < iov[i].iov_len ? resid : iov[i].iov_len; + caddr_t addr = (caddr_t) iov[i].iov_base; + + if (minlen > 0) { + error = _bus_dmamap_load_buffer(dmat, map, + addr, minlen, pmap, flags, &lastaddr, + dmat->segments, &nsegs, first); + first = 0; + + resid -= minlen; + } + } + + if (error) { + /* force "no valid mappings" in callback */ + (*callback)(callback_arg, dmat->segments, 0, 0, error); + } else { + (*callback)(callback_arg, dmat->segments, + nsegs+1, uio->uio_resid, error); + } + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); + return (error); +} + +/* + * Release the mapping held by map. + */ +void +_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bounce_page *bpage; + + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + STAILQ_REMOVE_HEAD(&map->bpages, links); + free_bounce_page(dmat, bpage); + } +} + +void +_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + struct bounce_page *bpage; + + if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + /* + * Handle data bouncing. We might also *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 06:54:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8FA1065674; Thu, 9 Dec 2010 06:54:07 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF558FC16; Thu, 9 Dec 2010 06:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB96s7iF027068; Thu, 9 Dec 2010 06:54:07 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB96s6DW027065; Thu, 9 Dec 2010 06:54:06 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012090654.oB96s6DW027065@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 9 Dec 2010 06:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216317 - in head/sys: mips/mips vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 06:54:07 -0000 Author: jchandra Date: Thu Dec 9 06:54:06 2010 New Revision: 216317 URL: http://svn.freebsd.org/changeset/base/216317 Log: swi_vm() for mips. Modified: head/sys/mips/mips/vm_machdep.c head/sys/vm/vm_page.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Dec 9 06:41:50 2010 (r216316) +++ head/sys/mips/mips/vm_machdep.c Thu Dec 9 06:54:06 2010 (r216317) @@ -538,6 +538,9 @@ sf_buf_free(struct sf_buf *sf) void swi_vm(void *dummy) { + + if (busdma_swi_pending) + busdma_swi(); } int Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Dec 9 06:41:50 2010 (r216316) +++ head/sys/vm/vm_page.c Thu Dec 9 06:54:06 2010 (r216317) @@ -430,7 +430,7 @@ vm_page_startup(vm_offset_t vaddr) */ new_end = vm_reserv_startup(&vaddr, new_end, high_water); #endif -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) /* * pmap_map on amd64 and mips can come out of the direct-map, not kvm * like i386, so the pages must be tracked for a crashdump to include From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 07:01:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFD8F106566B; Thu, 9 Dec 2010 07:01:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE07F8FC15; Thu, 9 Dec 2010 07:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9713Jf027273; Thu, 9 Dec 2010 07:01:03 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB97137o027263; Thu, 9 Dec 2010 07:01:03 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201012090701.oB97137o027263@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Dec 2010 07:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216318 - in head/sys/mips: adm5120 alchemy atheros cavium idt malta rmi sentry5 sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 07:01:04 -0000 Author: gonzo Date: Thu Dec 9 07:01:03 2010 New Revision: 216318 URL: http://svn.freebsd.org/changeset/base/216318 Log: - Populate dump_avail with proper values from phys_avail Modified: head/sys/mips/adm5120/adm5120_machdep.c head/sys/mips/alchemy/alchemy_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/idt/idt_machdep.c head/sys/mips/malta/malta_machdep.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/adm5120/adm5120_machdep.c ============================================================================== --- head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -97,6 +97,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/alchemy/alchemy_machdep.c ============================================================================== --- head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -97,6 +97,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/atheros/ar71xx_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -184,6 +184,9 @@ platform_start(__register_t a0 __unused, phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; /* Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -265,7 +265,7 @@ octeon_memory_init(void) { vm_paddr_t phys_end; int64_t addr; - unsigned i; + unsigned i, j; phys_end = round_page(MIPS_KSEG0_TO_PHYS((vm_offset_t)&end)); @@ -274,6 +274,9 @@ octeon_memory_init(void) phys_avail[0] = phys_end; phys_avail[1] = 96 << 20; + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + realmem = physmem = btoc(phys_avail[1] - phys_avail[0]); return; } @@ -314,6 +317,11 @@ octeon_memory_init(void) i += 2; } + for (j = 0; j < i; j += 2) { + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; + } + realmem = physmem; } Modified: head/sys/mips/idt/idt_machdep.c ============================================================================== --- head/sys/mips/idt/idt_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -167,6 +167,9 @@ platform_start(__register_t a0, __regist phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; /* Modified: head/sys/mips/malta/malta_machdep.c ============================================================================== --- head/sys/mips/malta/malta_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -181,6 +181,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -363,6 +363,9 @@ xlr_mem_init(void) (void *)phys_avail[0], (void *)phys_avail[1]); + dump_avail[0] = boot_map->physmem_map[0].addr; + dump_avail[1] = boot_map->physmem_map[0].size; + } else { /* * Can't use this code yet, because most of the fixed allocations happen from @@ -390,6 +393,10 @@ xlr_mem_init(void) (void *)phys_avail[j], (void *)phys_avail[j+1]); } + + dump_avail[j] = boot_map->physmem_map[j].addr; + dump_avail[j+1] = boot_map->physmem_map[j].size; + physsz += boot_map->physmem_map[i].size; } } Modified: head/sys/mips/sentry5/s5_machdep.c ============================================================================== --- head/sys/mips/sentry5/s5_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/sentry5/s5_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -91,7 +91,7 @@ platform_cpu_init() static void mips_init(void) { - int i; + int i, j; printf("entry: mips_init()\n"); @@ -128,6 +128,11 @@ mips_init(void) realmem = btoc(physmem); #endif + for (j = 0; j < i; j += 2) { + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; + } + physmem = realmem; init_param1(); Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/sibyte/sb_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -138,7 +138,7 @@ sb_intr_init(int cpuid) static void mips_init(void) { - int i, cfe_mem_idx, tmp; + int i, j, cfe_mem_idx, tmp; uint64_t maxmem; #ifdef CFE_ENV @@ -225,6 +225,11 @@ mips_init(void) realmem = btoc(physmem); #endif + for (j = 0; j < i; j += 2) { + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; + } + physmem = realmem; init_param1(); From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 07:39:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B81106566C; Thu, 9 Dec 2010 07:39:06 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 875868FC0A; Thu, 9 Dec 2010 07:39:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB97d6MF028128; Thu, 9 Dec 2010 07:39:06 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB97d66K028126; Thu, 9 Dec 2010 07:39:06 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012090739.oB97d66K028126@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 9 Dec 2010 07:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216319 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 07:39:06 -0000 Author: jchandra Date: Thu Dec 9 07:39:06 2010 New Revision: 216319 URL: http://svn.freebsd.org/changeset/base/216319 Log: Revert the vm/vm_page.c change in r216317. This adds back changes in r216141, which was reverted by the above check in. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Dec 9 07:01:03 2010 (r216318) +++ head/sys/vm/vm_page.c Thu Dec 9 07:39:06 2010 (r216319) @@ -430,7 +430,7 @@ vm_page_startup(vm_offset_t vaddr) */ new_end = vm_reserv_startup(&vaddr, new_end, high_water); #endif -#if defined(__amd64__) +#if defined(__amd64__) || defined(__mips__) /* * pmap_map on amd64 and mips can come out of the direct-map, not kvm * like i386, so the pages must be tracked for a crashdump to include From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 07:47:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 491D71065679; Thu, 9 Dec 2010 07:47:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37D888FC13; Thu, 9 Dec 2010 07:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB97lfsJ028360; Thu, 9 Dec 2010 07:47:41 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB97lfuh028351; Thu, 9 Dec 2010 07:47:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201012090747.oB97lfuh028351@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Dec 2010 07:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216320 - in head/sys/mips: adm5120 alchemy cavium idt malta rmi sentry5 sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 07:47:41 -0000 Author: gonzo Date: Thu Dec 9 07:47:40 2010 New Revision: 216320 URL: http://svn.freebsd.org/changeset/base/216320 Log: - dump_avail layout should be sequence of [start, end) pairs, not . Spotted by: alc@ Modified: head/sys/mips/adm5120/adm5120_machdep.c head/sys/mips/alchemy/alchemy_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/idt/idt_machdep.c head/sys/mips/malta/malta_machdep.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/adm5120/adm5120_machdep.c ============================================================================== --- head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -98,7 +98,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/alchemy/alchemy_machdep.c ============================================================================== --- head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -98,7 +98,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -275,7 +275,7 @@ octeon_memory_init(void) phys_avail[1] = 96 << 20; dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; realmem = physmem = btoc(phys_avail[1] - phys_avail[0]); return; @@ -317,10 +317,8 @@ octeon_memory_init(void) i += 2; } - for (j = 0; j < i; j += 2) { + for (j = 0; j < i; j++) dump_avail[j] = phys_avail[j]; - dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; - } realmem = physmem; } Modified: head/sys/mips/idt/idt_machdep.c ============================================================================== --- head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -168,7 +168,7 @@ platform_start(__register_t a0, __regist phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/malta/malta_machdep.c ============================================================================== --- head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -182,7 +182,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -363,8 +363,8 @@ xlr_mem_init(void) (void *)phys_avail[0], (void *)phys_avail[1]); - dump_avail[0] = boot_map->physmem_map[0].addr; - dump_avail[1] = boot_map->physmem_map[0].size; + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1]; } else { /* @@ -394,8 +394,8 @@ xlr_mem_init(void) (void *)phys_avail[j+1]); } - dump_avail[j] = boot_map->physmem_map[j].addr; - dump_avail[j+1] = boot_map->physmem_map[j].size; + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1]; physsz += boot_map->physmem_map[i].size; } Modified: head/sys/mips/sentry5/s5_machdep.c ============================================================================== --- head/sys/mips/sentry5/s5_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/sentry5/s5_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -128,10 +128,8 @@ mips_init(void) realmem = btoc(physmem); #endif - for (j = 0; j < i; j += 2) { + for (j = 0; j < i; j++) dump_avail[j] = phys_avail[j]; - dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; - } physmem = realmem; Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/sibyte/sb_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -225,10 +225,8 @@ mips_init(void) realmem = btoc(physmem); #endif - for (j = 0; j < i; j += 2) { + for (j = 0; j < i; j++) dump_avail[j] = phys_avail[j]; - dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; - } physmem = realmem; From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 08:36:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 755501065695; Thu, 9 Dec 2010 08:36:23 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648608FC28; Thu, 9 Dec 2010 08:36:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB98aNnT029386; Thu, 9 Dec 2010 08:36:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB98aNLt029384; Thu, 9 Dec 2010 08:36:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012090836.oB98aNLt029384@svn.freebsd.org> From: Kevin Lo Date: Thu, 9 Dec 2010 08:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216321 - head/usr.sbin/fwcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 08:36:23 -0000 Author: kevlo Date: Thu Dec 9 08:36:23 2010 New Revision: 216321 URL: http://svn.freebsd.org/changeset/base/216321 Log: Closing fd when it's done Reviewed by: sbruno Modified: head/usr.sbin/fwcontrol/fwcontrol.c Modified: head/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- head/usr.sbin/fwcontrol/fwcontrol.c Thu Dec 9 07:47:40 2010 (r216320) +++ head/usr.sbin/fwcontrol/fwcontrol.c Thu Dec 9 08:36:23 2010 (r216321) @@ -508,6 +508,7 @@ load_crom(char *filename, u_int32_t *p) p, p+1, p+2, p+3, p+4, p+5, p+6, p+7); p += 8; } + fclose(file); } static void From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 08:42:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D12F106564A; Thu, 9 Dec 2010 08:42:41 +0000 (UTC) (envelope-from poyopoyo@puripuri.plala.or.jp) Received: from msa03a.plala.or.jp (msa03.plala.or.jp [58.93.240.3]) by mx1.freebsd.org (Postfix) with ESMTP id 619098FC19; Thu, 9 Dec 2010 08:42:39 +0000 (UTC) Received: from i125-202-2-13.s02.a026.ap.plala.or.jp ([125.202.2.13]) by msa03b.plala.or.jp with ESMTP id <20101209083147.MDLL29007.msa03b.plala.or.jp@i125-202-2-13.s02.a026.ap.plala.or.jp>; Thu, 9 Dec 2010 17:31:47 +0900 Date: Thu, 09 Dec 2010 17:31:46 +0900 Message-ID: <86ipz3s5xp.wl%poyopoyo@puripuri.plala.or.jp> From: poyopoyo@puripuri.plala.or.jp To: Shteryana Shopova In-Reply-To: <201012081430.oB8EUP8J006067@svn.freebsd.org> References: <201012081430.oB8EUP8J006067@svn.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (amd64-portbld-freebsd9.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-VirusScan: Outbound; msa03b; Thu, 9 Dec 2010 17:31:47 +0900 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 08:42:41 -0000 install with DESTDIR is broken. -- kuro Index: tools/bsnmptools/Makefile =================================================================== --- tools/bsnmptools/Makefile (revision 216320) +++ tools/bsnmptools/Makefile (working copy) @@ -17,8 +17,8 @@ LDADD+= -lcrypto .endif -LINKS= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpwalk -LINKS+= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpset +LINKS= ${BINDIR}/bsnmpget ${BINDIR}/bsnmpwalk +LINKS+= ${BINDIR}/bsnmpget ${BINDIR}/bsnmpset MAN= bsnmpget.1 From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 08:59:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AA9106564A; Thu, 9 Dec 2010 08:59:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8B50B8FC0A; Thu, 9 Dec 2010 08:59:16 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB98wusg012169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Dec 2010 19:58:58 +1100 Date: Thu, 9 Dec 2010 19:58:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <20101208225235.501ced0e@core.draftnet> Message-ID: <20101209191657.B1400@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 08:59:17 -0000 On Wed, 8 Dec 2010, Bruce Cran wrote: > On Wed, 8 Dec 2010 16:46:17 +1100 (EST) > Bruce Evans wrote: > >> - for ATA drives, it uses the "firmware" geometry supplied by the >> drive firmware. The ATA standard specifies this to be H=16/S=63 for >> all drives larger than a certain size (IIRC, about 8GB, which is the >> size at which the better default fake of H=255/S=63 generated by >> cam_calc_geometry() for drives larger than 1GB, stops working for >> systems that can't handle more than 1024 fake cylinders. The magic >> 1GB is the size at which the even better default fake of H=64/S=32 >> stops working with more than 1024 fake cylinders. >> cam_calc_geometry() has no comment about this either). Since all >> modern ATA drives are larger than 8GB, H=16/S=63 is almost hard-coded >> for ATA. > > I've put together a patch which will hopefully improve the reporting of > geometry, though as you say nothing actually uses it nowadays - we > don't even appear to support CHS addressing in the disk drivers. It still does for the non-cam case. From ata_lowlevel.c: % #ifndef ATA_CAM % if (atadev->flags & ATA_D_USE_CHS) { New drives might not support CHS. Then we can't get here. Old drives don't support LBA, so we must get here. Not so old drives support both, but we never use CHS if LBA is available. So we only get here for old drivers. % int heads, sectors; % % if (atadev->param.atavalid & ATA_FLAG_54_58) { % heads = atadev->param.current_heads; % sectors = atadev->param.current_sectors; I had understood the ATA_FLAG_54_58 backwards. It tells us if the drive is not so old that it doesn't support IDENTIFY records for words 54-58. I think we rarely get here. Drives old enough to use CHS may be so old that they don't support words 54-58. Only drives manufactured during a few years or months in the 1990's will support words 54-58 but not LBA. Maybe I'm misremembering the length of this time. When the drive supports these words and we use CHS, we use these words. % } % else { % heads = atadev->param.heads; % sectors = atadev->param.sectors; We get here for very old drives (ones that don't support LBA and don't support changing their CHS from their default CHS to a current CHS, or is just ones that don't support words 54-58 to report such changes?). % } % // rest of CHS accces method % } % else { % #endif % // LBA accces method % #ifndef ATA_CAM % } % #endif % } % } It's strange that ata uses the ATA_FLAG_54_58 feature for CHS. 6 years ago, long after you couldn't buy a drive for which this code is executed, sys/ata.h declared words 54-58 as obsolete54[5] instead of as current_heads, etc., used in the above, and of course it didn't use them. The corresponding code was quite different. It was essentially the same for CHS and LBA. The CHS case was faked in ad_start() to look like the LBA case here. The faking used only the non-ATA_FLAG_54_58 parameters, so it corresponded to not having the clause for that here. This depended on the current parameters being the same as the default parameters. Ata ignored all the early 1990's features for changing the parameters to more suitable ones, and used a reset to force the current ones to defaults, then just used the defaults. Why does it now do more? > ata_da.c now calls cam_calc_geometry() which is updated to clip the > number of cylinders to 65535. I'm not familiar with ata_da.c. Presumably it is only used in the ATA_CAM case, when CHS addressing is not even an option (it is killed by the above ifdef). > This introduces a problem because the > calculated geometry will no longer match the disklabel: however, since > CHS isn't used I don't know if we need to warn if the geometries don't > match? Since it appears superfluous I've removed the warning in the > patch. I think it is too late to change this. It should have been changed before any metadata using old values was created. This may be impossible, since the metadata may have been created with another driver (ad say) that reports different geoemtry. > atacontrol and camcontrol are updated to only display CHS > parameters from the drive if the disk conforms to ATA-5 or before. I don't like this. If the drive supports CHS, then its geometries for this should be reported, if CHS reporting is implemented at all. There are many to choose from :-), but only 1 or 2 (if any) to report -- the default one and the current one. Capabilities reporting should make it clear if the default one can be changed. I consider CHS features to be unimportant, so they should be reported if the capabilites reporting tries to be complete; otherwise they are optional. hdparm for Linux always seemed to report more features than atacontrol. % Index: sbin/atacontrol/atacontrol.c % =================================================================== % --- sbin/atacontrol/atacontrol.c (revision 216266) % +++ sbin/atacontrol/atacontrol.c (working copy) % @@ -180,14 +183,16 @@ % printf("Unknown SATA revision\n"); % } % else % - printf("ATA/ATAPI revision %d\n", version(parm->version_major)); % + printf("ATA/ATAPI revision %d\n", ataver); % printf("device model %.40s\n", parm->model); % printf("serial number %.20s\n", parm->serial); % printf("firmware revision %.8s\n", parm->revision); % % - printf("cylinders %d\n", parm->cylinders); % - printf("heads %d\n", parm->heads); % - printf("sectors/track %d\n", parm->sectors); % + if (ataver <= 5) { % + printf("cylinders %d\n", parm->cylinders); % + printf("heads %d\n", parm->heads); % + printf("sectors/track %d\n", parm->sectors); % + } I don't like removing them depending on the version. atacontrol is about the only place that you can see CHS without it possibly having gone through several layers of fakery. Now I see more clearly that these are only the "firmware" = default parameters. There are also the current parameters in words 54-58. These are not reported here. One use for reporting them here is to make it easy to debug whether the kernel code for using them is ever reached :-). I don't know if a full unfakedparameter struct is available here for easy printing. If it is, then the capabilities flag for words 54-58 is in it, and should be used instead of atarev for deciding whether to print these words (though setting of capability bits for old drives is as unreliable as setting the capability words. The driver seems to trust it). I don't know of any capability bits for the default CHS. The words for this are so old that all drives support it if they support CHS. ATA_USE_CHS is a non-firmware-feature flag that is set if the version or lbasize is 0. It is the driver's use flag, not a capability flag. % Index: sys/cam/ata/ata_da.c % =================================================================== % --- sys/cam/ata/ata_da.c (revision 216266) % +++ sys/cam/ata/ata_da.c (working copy) % @@ -1129,27 +1129,14 @@ % struct disk_params *dp = &softc->params; % u_int64_t lbasize48; % u_int32_t lbasize; % + struct ccb_calc_geometry cg; Insertion sort error. % % dp->secsize = ata_logical_sector_size(&cgd->ident_data); % - if ((cgd->ident_data.atavalid & ATA_FLAG_54_58) && % - cgd->ident_data.current_heads && cgd->ident_data.current_sectors) { % - dp->heads = cgd->ident_data.current_heads; % - dp->secs_per_track = cgd->ident_data.current_sectors; % - dp->cylinders = cgd->ident_data.cylinders; % - dp->sectors = (u_int32_t)cgd->ident_data.current_size_1 | % - ((u_int32_t)cgd->ident_data.current_size_2 << 16); % - } else { % - dp->heads = cgd->ident_data.heads; % - dp->secs_per_track = cgd->ident_data.sectors; % - dp->cylinders = cgd->ident_data.cylinders; % - dp->sectors = cgd->ident_data.cylinders * dp->heads * dp->secs_per_track; % - } Hmm, it has the complications for words 54-58 too % + % lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | % ((u_int32_t)cgd->ident_data.lba_size_2 << 16); % % - /* use the 28bit LBA size if valid or bigger than the CHS mapping */ % - if (cgd->ident_data.cylinders == 16383 || dp->sectors < lbasize) % - dp->sectors = lbasize; % + dp->sectors = lbasize; The old code allows for CHS to give more sectors than LBA. I don't know if that is possible. It is more common for CHS to give less sectors. CHS certainly gives more sectors if LBA is not supported, but I think CAM ad doesn't support that case elsewhere. Strange that it supports it here. % % /* use the 48bit LBA size if valid */ % lbasize48 = ((u_int64_t)cgd->ident_data.lba_size48_1) | % @@ -1159,6 +1146,14 @@ % if ((cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) && % lbasize48 > ATA_MAX_28BIT_LBA) % dp->sectors = lbasize48; % + % + cg.block_size = dp->secsize; % + cg.volume_size = dp->sectors * dp->secsize; % + cam_calc_geometry(&cg, 1); % + % + dp->heads = cg.heads; % + dp->secs_per_track = cg.secs_per_track; % + dp->cylinders = cg.cylinders; Risky to change this so late. Actually, I have too much experience with the system generating wrong geometries, and it goes the other way. I normally run older FreeBSDs which generate the BIOS geometry of H=255/C=63 which matches all metadata. When I boot -current it generates H=16/C=63. I get annoyed by disk^Wbsdlabel complaining about this and more, and can't risk using it to change labels. So I'd be happy if you changed this, so everyone sees any problems in this area :-). Its main inconsistency seems to be that only CAM ad does it. % } % % static void % Index: sys/geom/part/g_part_bsd.c % =================================================================== % --- sys/geom/part/g_part_bsd.c (revision 216266) % +++ sys/geom/part/g_part_bsd.c (working copy) % @@ -387,10 +387,6 @@ % goto invalid_label; % if (heads != basetable->gpt_heads && !basetable->gpt_fixgeom) % basetable->gpt_heads = heads; % - if (sectors != basetable->gpt_sectors || heads != basetable->gpt_heads) % - printf("GEOM: %s: geometry does not match label" % - " (%uh,%us != %uh,%us).\n", pp->name, heads, sectors, % - basetable->gpt_heads, basetable->gpt_sectors); I would just put it under bootverbose. Labels really should have the same geometry as the drive, whatever that is, in case someone reads them and is confused or something uses them. But the geometry may be O/S or even driver-dependent. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 11:37:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D7F91065670; Thu, 9 Dec 2010 11:37:41 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6D4A8FC13; Thu, 9 Dec 2010 11:37:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9Bbeqr037274; Thu, 9 Dec 2010 11:37:40 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9Bbe5E037272; Thu, 9 Dec 2010 11:37:40 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012091137.oB9Bbe5E037272@svn.freebsd.org> From: Bruce Cran Date: Thu, 9 Dec 2010 11:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216322 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 11:37:41 -0000 Author: brucec Date: Thu Dec 9 11:37:40 2010 New Revision: 216322 URL: http://svn.freebsd.org/changeset/base/216322 Log: Build sade on amd64 as well as i386 and sparc64. Modified: head/usr.sbin/Makefile.amd64 Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Thu Dec 9 08:36:23 2010 (r216321) +++ head/usr.sbin/Makefile.amd64 Thu Dec 9 11:37:40 2010 (r216322) @@ -27,4 +27,7 @@ SUBDIR+= ndiscvt .endif SUBDIR+= sicontrol SUBDIR+= spkrtest +.if ${MK_SYSINSTALL} != "no" +SUBDIR+= sade +.endif SUBDIR+= zzz From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 12:25:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4C26106566C; Thu, 9 Dec 2010 12:25:45 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3BAE8FC1B; Thu, 9 Dec 2010 12:25:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9CPjDx038441; Thu, 9 Dec 2010 12:25:45 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9CPjv3038439; Thu, 9 Dec 2010 12:25:45 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012091225.oB9CPjv3038439@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 9 Dec 2010 12:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216323 - head/usr.sbin/bsnmpd/tools/bsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 12:25:45 -0000 Author: syrinx Date: Thu Dec 9 12:25:45 2010 New Revision: 216323 URL: http://svn.freebsd.org/changeset/base/216323 Log: Unbreak "make installworld" w/ DESTDIR specified PR : kern/152939 Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Thu Dec 9 11:37:40 2010 (r216322) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Thu Dec 9 12:25:45 2010 (r216323) @@ -17,8 +17,8 @@ DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto .endif -LINKS= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpwalk -LINKS+= ${DESTDIR}/usr/bin/bsnmpget ${DESTDIR}/usr/bin/bsnmpset +LINKS= ${BINDIR}/bsnmpget ${BINDIR}/bsnmpwalk +LINKS+= ${BINDIR}/bsnmpget ${BINDIR}/bsnmpset MAN= bsnmpget.1 From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 12:30:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C447A1065674; Thu, 9 Dec 2010 12:30:13 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989898FC15; Thu, 9 Dec 2010 12:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9CUDN0038594; Thu, 9 Dec 2010 12:30:13 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9CUDV9038590; Thu, 9 Dec 2010 12:30:13 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012091230.oB9CUDV9038590@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 9 Dec 2010 12:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216324 - in head/sys/mips: mips rmi rmi/dev/nlge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 12:30:13 -0000 Author: jchandra Date: Thu Dec 9 12:30:13 2010 New Revision: 216324 URL: http://svn.freebsd.org/changeset/base/216324 Log: Fix compilation when DEBUG option is enabled. - remove unused code in mips/rmi/xlr_pci.c - remove unused variable in mips/rmi/dev/nlge/if_nlge.c - fix reference to old function in mips/mips/pmap.c Reported by: Prabhath Raman (prabhath at netlogicmicro com) Modified: head/sys/mips/mips/pmap.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Dec 9 12:25:45 2010 (r216323) +++ head/sys/mips/mips/pmap.c Thu Dec 9 12:30:13 2010 (r216324) @@ -3098,7 +3098,7 @@ pads(pmap_t pm) va >= VM_MAXUSER_ADDRESS) continue; ptep = pmap_pte(pm, va); - if (pmap_pte_v(ptep)) + if (pte_test(ptep, PTE_V)) printf("%x:%x ", va, *(int *)ptep); } Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Dec 9 12:25:45 2010 (r216323) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Dec 9 12:30:13 2010 (r216324) @@ -213,7 +213,6 @@ static int send_fmn_msg_tx(struct nlge_s //#define DEBUG #ifdef DEBUG static int mac_debug = 1; -static int reg_dump = 0; #undef PDEBUG #define PDEBUG(fmt, args...) \ do {\ Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Thu Dec 9 12:25:45 2010 (r216323) +++ head/sys/mips/rmi/xlr_pci.c Thu Dec 9 12:30:13 2010 (r216324) @@ -105,13 +105,6 @@ __FBSDID("$FreeBSD$"); (MSI_MIPS_DATA_TRGRLVL | MSI_MIPS_DATA_DELFIXED | \ MSI_MIPS_DATA_ASSERT | (irq)) -#define DEBUG -#ifdef DEBUG -#define dbg_devprintf device_printf -#else -#define dbg_devprintf(dev, fmt, ...) -#endif - struct xlr_pcib_softc { bus_dma_tag_t sc_pci_dmat; /* PCI DMA tag pointer */ }; From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 19:02:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B801C106566B; Thu, 9 Dec 2010 19:02:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC498FC0A; Thu, 9 Dec 2010 19:02:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9J2NMZ047914; Thu, 9 Dec 2010 19:02:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9J2NJg047912; Thu, 9 Dec 2010 19:02:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012091902.oB9J2NJg047912@svn.freebsd.org> From: Rick Macklem Date: Thu, 9 Dec 2010 19:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216330 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 19:02:23 -0000 Author: rmacklem Date: Thu Dec 9 19:02:23 2010 New Revision: 216330 URL: http://svn.freebsd.org/changeset/base/216330 Log: Disable attempts to establish a callback connection from the experimental NFSv4 server to a NFSv4 client when delegations are not being issued, even if the client advertises a callback path. This avoids a problem where a Linux client advertises a callback path that doesn't work, due to a firewall, and then times out an Open attempt before the FreeBSD server gives up its callback connection attempt. (Suggested by drb at karlov.mff.cuni.cz to fix the Linux client problem that he reported on the fs-stable mailing list.) The server should probably have a 1sec timeout on callback connection attempts when there are no delegations issued to the client, but that patch will require changes to the krpc and this serves as a work around until then. Tested by: drb at karlov.mff.cuni.cz MFC after: 5 days Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Dec 9 17:39:40 2010 (r216329) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Dec 9 19:02:23 2010 (r216330) @@ -147,12 +147,20 @@ nfsrv_setclient(struct nfsrv_descript *n if (nfsrv_openpluslock > NFSRV_V4STATELIMIT) return (NFSERR_RESOURCE); - if ((nd->nd_flag & ND_GSS) && nfsrv_nogsscallback) + if (nfsrv_issuedelegs == 0 || + ((nd->nd_flag & ND_GSS) != 0 && nfsrv_nogsscallback != 0)) /* - * Don't do callbacks for AUTH_GSS. - * (Since these aren't yet debugged, they might cause the - * server to crap out, if they get past the Init call to - * the client.) + * Don't do callbacks when delegations are disabled or + * for AUTH_GSS unless enabled via nfsrv_nogsscallback. + * If establishing a callback connection is attempted + * when a firewall is blocking the callback path, the + * server may wait too long for the connect attempt to + * succeed during the Open. Some clients, such as Linux, + * may timeout and give up on the Open before the server + * replies. Also, since AUTH_GSS callbacks are not + * yet interoperability tested, they might cause the + * server to crap out, if they get past the Init call to + * the client. */ new_clp->lc_program = 0; From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 20:16:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2D111065672; Thu, 9 Dec 2010 20:16:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1EA18FC0A; Thu, 9 Dec 2010 20:16:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9KG0VO049568; Thu, 9 Dec 2010 20:16:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9KG05P049565; Thu, 9 Dec 2010 20:16:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012092016.oB9KG05P049565@svn.freebsd.org> From: Alan Cox Date: Thu, 9 Dec 2010 20:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216333 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 20:16:01 -0000 Author: alc Date: Thu Dec 9 20:16:00 2010 New Revision: 216333 URL: http://svn.freebsd.org/changeset/base/216333 Log: When r207410 eliminated the acquisition and release of the page queues lock from pmap_extract_and_hold(), it didn't take into account that pmap_pte_quick() sometimes requires the page queues lock to be held. This change reimplements pmap_extract_and_hold() such that it no longer uses pmap_pte_quick(), and thus never requires the page queues lock. For consistency, adopt the same idiom as used by the new implementation of pmap_extract_and_hold() in pmap_extract() and pmap_mincore(). It also happens to make these functions shorter. Fix a style error in pmap_pte(). Reviewed by: kib@ Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Dec 9 20:05:29 2010 (r216332) +++ head/sys/i386/i386/pmap.c Thu Dec 9 20:16:00 2010 (r216333) @@ -1213,7 +1213,7 @@ pmap_pte(pmap_t pmap, vm_offset_t va) } return (PADDR2 + (i386_btop(va) & (NPTEPG - 1))); } - return (0); + return (NULL); } /* @@ -1291,21 +1291,19 @@ pmap_pte_quick(pmap_t pmap, vm_offset_t vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va) { + pt_entry_t pte, *ptep; vm_paddr_t rtval; - pt_entry_t *pte; - pd_entry_t pde; rtval = 0; PMAP_LOCK(pmap); - pde = pmap->pm_pdir[va >> PDRSHIFT]; - if (pde != 0) { - if ((pde & PG_PS) != 0) - rtval = (pde & PG_PS_FRAME) | (va & PDRMASK); - else { - pte = pmap_pte(pmap, va); - rtval = (*pte & PG_FRAME) | (va & PAGE_MASK); - pmap_pte_release(pte); - } + ptep = pmap_pte(pmap, va); + pte = (ptep != NULL) ? *ptep : 0; + pmap_pte_release(ptep); + if ((pte & PG_V) != 0) { + if ((pte & PG_PS) != 0) + rtval = (pte & PG_PS_FRAME) | (va & PDRMASK); + else + rtval = (pte & PG_FRAME) | (va & PAGE_MASK); } PMAP_UNLOCK(pmap); return (rtval); @@ -1321,40 +1319,30 @@ pmap_extract(pmap_t pmap, vm_offset_t va vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { - pd_entry_t pde; - pt_entry_t pte; + pt_entry_t pte, *ptep; + vm_paddr_t locked_pa, pa; vm_page_t m; - vm_paddr_t pa; - pa = 0; + locked_pa = 0; m = NULL; PMAP_LOCK(pmap); retry: - pde = *pmap_pde(pmap, va); - if (pde != 0) { - if (pde & PG_PS) { - if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { - if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | - (va & PDRMASK), &pa)) - goto retry; - m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | - (va & PDRMASK)); - vm_page_hold(m); - } - } else { - sched_pin(); - pte = *pmap_pte_quick(pmap, va); - if (pte != 0 && - ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) - goto retry; - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); - } - sched_unpin(); - } + ptep = pmap_pte(pmap, va); + pte = (ptep != NULL) ? *ptep : 0; + pmap_pte_release(ptep); + if ((pte & PG_V) != 0 && + ((pte & PG_RW) != 0 || (prot & VM_PROT_WRITE) == 0)) { + if ((pte & PG_PS) != 0) { + /* Compute the physical address of the 4KB page. */ + pa = (pte & PG_PS_FRAME) | (va & PG_FRAME & PDRMASK); + } else + pa = pte & PG_FRAME; + if (vm_page_pa_tryrelock(pmap, pa, &locked_pa)) + goto retry; + m = PHYS_TO_VM_PAGE(pa); + vm_page_hold(m); + PA_UNLOCK(locked_pa); } - PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } @@ -4991,39 +4979,30 @@ pmap_change_attr(vm_offset_t va, vm_size int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - pd_entry_t *pdep; pt_entry_t *ptep, pte; vm_paddr_t pa; int val; PMAP_LOCK(pmap); retry: - pdep = pmap_pde(pmap, addr); - if (*pdep != 0) { - if (*pdep & PG_PS) { - pte = *pdep; + ptep = pmap_pte(pmap, addr); + pte = (ptep != NULL) ? *ptep : 0; + pmap_pte_release(ptep); + if ((pte & PG_V) != 0) { + val = MINCORE_INCORE; + if ((pte & PG_PS) != 0) { + val |= MINCORE_SUPER; /* Compute the physical address of the 4KB page. */ - pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) & - PG_FRAME; - val = MINCORE_SUPER; - } else { - ptep = pmap_pte(pmap, addr); - pte = *ptep; - pmap_pte_release(ptep); + pa = (pte & PG_PS_FRAME) | (addr & PG_FRAME & PDRMASK); + } else pa = pte & PG_FRAME; - val = 0; - } - } else { - pte = 0; - pa = 0; - val = 0; - } - if ((pte & PG_V) != 0) { - val |= MINCORE_INCORE; if ((pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; if ((pte & PG_A) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } else { + val = 0; + pa = 0; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 20:28:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AEB01065672; Thu, 9 Dec 2010 20:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60F6D8FC12; Thu, 9 Dec 2010 20:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9KSUvw049875; Thu, 9 Dec 2010 20:28:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9KSUgu049873; Thu, 9 Dec 2010 20:28:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012092028.oB9KSUgu049873@svn.freebsd.org> From: John Baldwin Date: Thu, 9 Dec 2010 20:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216334 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 20:28:30 -0000 Author: jhb Date: Thu Dec 9 20:28:30 2010 New Revision: 216334 URL: http://svn.freebsd.org/changeset/base/216334 Log: When reopening a stream backed by an open file descriptor, do not close the existing file descriptor. Instead, let dup2() atomically close the old file descriptor when assigning the newly opened file to the same descriptor. This closes a race in a multithreaded application where a concurrent open() could allocate the existing file descriptor in between the calls to close() and dup2(). PR: threads/79887 Submitted by: Dmitrij Tejblum tejblum of yandex-team.ru Reviewed by: davidxu MFC after: 1 week Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Thu Dec 9 20:16:00 2010 (r216333) +++ head/lib/libc/stdio/freopen.c Thu Dec 9 20:28:30 2010 (r216334) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 21:02:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD5701065673; Thu, 9 Dec 2010 21:02:22 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3058FC08; Thu, 9 Dec 2010 21:02:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9L2MSq050680; Thu, 9 Dec 2010 21:02:22 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9L2MMG050677; Thu, 9 Dec 2010 21:02:22 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201012092102.oB9L2MMG050677@svn.freebsd.org> From: Max Laier Date: Thu, 9 Dec 2010 21:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216335 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 21:02:22 -0000 Author: mlaier Date: Thu Dec 9 21:02:22 2010 New Revision: 216335 URL: http://svn.freebsd.org/changeset/base/216335 Log: Fix a long standing (from the original 4.4BSD lite sources) race between vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page missing" panics. While faulting in pages for a map entry that is being wired down, mark the containing map as busy. In vmspace_fork wait until the map is unbusy, before we try to copy the entries. Reviewed by: kib MFC after: 5 days Sponsored by: Isilon Systems, Inc. Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Dec 9 20:28:30 2010 (r216334) +++ head/sys/vm/vm_map.c Thu Dec 9 21:02:22 2010 (r216335) @@ -671,6 +671,41 @@ vm_map_wakeup(vm_map_t map) wakeup(&map->root); } +void +vm_map_busy(vm_map_t map) +{ + + VM_MAP_ASSERT_LOCKED(map); + map->busy++; +} + +void +vm_map_unbusy(vm_map_t map) +{ + + VM_MAP_ASSERT_LOCKED(map); + KASSERT(map->busy, ("vm_map_unbusy: not busy")); + if (--map->busy == 0 && (map->flags & MAP_BUSY_WAKEUP)) { + vm_map_modflags(map, 0, MAP_BUSY_WAKEUP); + wakeup(&map->busy); + } +} + +void +vm_map_wait_busy(vm_map_t map) +{ + + VM_MAP_ASSERT_LOCKED(map); + while (map->busy) { + vm_map_modflags(map, MAP_BUSY_WAKEUP, 0); + if (map->system_map) + msleep(&map->busy, &map->system_mtx, 0, "mbusy", 0); + else + sx_sleep(&map->busy, &map->lock, 0, "mbusy", 0); + } + map->timestamp++; +} + long vmspace_resident_count(struct vmspace *vmspace) { @@ -718,6 +753,7 @@ _vm_map_init(vm_map_t map, pmap_t pmap, map->flags = 0; map->root = NULL; map->timestamp = 0; + map->busy = 0; } void @@ -2382,12 +2418,14 @@ vm_map_wire(vm_map_t map, vm_offset_t st entry->object.vm_object->type == OBJT_SG); /* * Release the map lock, relying on the in-transition - * mark. + * mark. Mark the map busy for fork. */ + vm_map_busy(map); vm_map_unlock(map); rv = vm_fault_wire(map, saved_start, saved_end, fictitious); vm_map_lock(map); + vm_map_unbusy(map); if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was @@ -2995,6 +3033,8 @@ vmspace_fork(struct vmspace *vm1, vm_oof int locked; vm_map_lock(old_map); + if (old_map->busy) + vm_map_wait_busy(old_map); vm2 = vmspace_alloc(old_map->min_offset, old_map->max_offset); if (vm2 == NULL) goto unlock_and_return; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Thu Dec 9 20:28:30 2010 (r216334) +++ head/sys/vm/vm_map.h Thu Dec 9 21:02:22 2010 (r216335) @@ -187,12 +187,14 @@ struct vm_map { pmap_t pmap; /* (c) Physical map */ #define min_offset header.start /* (c) */ #define max_offset header.end /* (c) */ + int busy; }; /* * vm_flags_t values */ #define MAP_WIREFUTURE 0x01 /* wire all future pages */ +#define MAP_BUSY_WAKEUP 0x02 #ifdef _KERNEL static __inline vm_offset_t @@ -275,6 +277,9 @@ int _vm_map_lock_upgrade(vm_map_t map, c void _vm_map_lock_downgrade(vm_map_t map, const char *file, int line); int vm_map_locked(vm_map_t map); void vm_map_wakeup(vm_map_t map); +void vm_map_busy(vm_map_t map); +void vm_map_unbusy(vm_map_t map); +void vm_map_wait_busy(vm_map_t map); #define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE) From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 21:29:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1D8A106566C; Thu, 9 Dec 2010 21:29:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B152B8FC18; Thu, 9 Dec 2010 21:29:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9LTarm051316; Thu, 9 Dec 2010 21:29:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9LTakd051314; Thu, 9 Dec 2010 21:29:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012092129.oB9LTakd051314@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 9 Dec 2010 21:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216337 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 21:29:36 -0000 Author: jkim Date: Thu Dec 9 21:29:36 2010 New Revision: 216337 URL: http://svn.freebsd.org/changeset/base/216337 Log: Remove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state invariant CPUs. I do not believe this model is P-state invariant any more. Maybe cpufreq(4) was broken at the time of commit. :-( Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Thu Dec 9 21:11:53 2010 (r216336) +++ head/sys/x86/x86/tsc.c Thu Dec 9 21:29:36 2010 (r216337) @@ -107,7 +107,7 @@ init_TSC(void) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) + CPUID_TO_FAMILY(cpu_id) >= 0x10) tsc_is_invariant = 1; break; case CPU_VENDOR_INTEL: From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 21:31:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C361106564A; Thu, 9 Dec 2010 21:31:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5798FC13; Thu, 9 Dec 2010 21:31:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9LVLDm051414; Thu, 9 Dec 2010 21:31:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9LVLte051392; Thu, 9 Dec 2010 21:31:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201012092131.oB9LVLte051392@svn.freebsd.org> From: Dimitry Andric Date: Thu, 9 Dec 2010 21:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216338 - in head/lib/csu: amd64 arm i386-elf ia64 powerpc powerpc64 sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 21:31:22 -0000 Author: dim Date: Thu Dec 9 21:31:21 2010 New Revision: 216338 URL: http://svn.freebsd.org/changeset/base/216338 Log: Let all .c and .S files under lib/csu consistently use the __FBSDID() macro for identification, instead of several different hand-rolled variants (plain .ident, .ascii, etc). Modified: head/lib/csu/amd64/crt1.c head/lib/csu/amd64/crti.S head/lib/csu/amd64/crtn.S head/lib/csu/arm/crt1.c head/lib/csu/arm/crtn.S head/lib/csu/i386-elf/crt1_c.c head/lib/csu/i386-elf/crt1_s.S head/lib/csu/i386-elf/crti.S head/lib/csu/i386-elf/crtn.S head/lib/csu/ia64/crt1.S head/lib/csu/ia64/crti.S head/lib/csu/ia64/crtn.S head/lib/csu/powerpc/crt1.c head/lib/csu/powerpc/crti.S head/lib/csu/powerpc/crtn.S head/lib/csu/powerpc64/crt1.c head/lib/csu/powerpc64/crti.S head/lib/csu/powerpc64/crtn.S head/lib/csu/sparc64/crt1.c head/lib/csu/sparc64/crti.S head/lib/csu/sparc64/crtn.S Modified: head/lib/csu/amd64/crt1.c ============================================================================== --- head/lib/csu/amd64/crt1.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/amd64/crt1.c Thu Dec 9 21:31:21 2010 (r216338) @@ -24,6 +24,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -92,5 +95,3 @@ __asm__("eprol:"); _init(); exit( main(argc, argv, env) ); } - -__asm__(".ident\t\"$FreeBSD$\""); Modified: head/lib/csu/amd64/crti.S ============================================================================== --- head/lib/csu/amd64/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/amd64/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 4 .globl _init @@ -36,6 +39,3 @@ _init: .type _fini,@function _fini: subq $8,%rsp - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/amd64/crtn.S ============================================================================== --- head/lib/csu/amd64/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/amd64/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits addq $8,%rsp ret @@ -30,6 +33,3 @@ .section .fini,"ax",@progbits addq $8,%rsp ret - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/arm/crt1.c ============================================================================== --- head/lib/csu/arm/crt1.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/arm/crt1.c Thu Dec 9 21:31:21 2010 (r216338) @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -49,7 +52,6 @@ #include "libc_private.h" #include "crtbrand.c" -#include struct Struct_Obj_Entry; struct ps_strings; @@ -136,5 +138,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); Modified: head/lib/csu/arm/crtn.S ============================================================================== --- head/lib/csu/arm/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/arm/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -1,5 +1,6 @@ #include __FBSDID("$FreeBSD$"); + .section .init,"ax",%progbits ldmea fp, {fp, sp, pc} mov pc, lr Modified: head/lib/csu/i386-elf/crt1_c.c ============================================================================== --- head/lib/csu/i386-elf/crt1_c.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/i386-elf/crt1_c.c Thu Dec 9 21:31:21 2010 (r216338) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" Modified: head/lib/csu/i386-elf/crt1_s.S ============================================================================== --- head/lib/csu/i386-elf/crt1_s.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/i386-elf/crt1_s.S Thu Dec 9 21:31:21 2010 (r216338) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); .text .align 4 @@ -47,5 +49,3 @@ _start: int3 .cfi_endproc .size _start, . - _start - - .ident "$FreeBSD$" Modified: head/lib/csu/i386-elf/crti.S ============================================================================== --- head/lib/csu/i386-elf/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/i386-elf/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 4 .globl _init @@ -36,6 +39,3 @@ _init: .type _fini,@function _fini: sub $12,%esp /* re-align stack pointer */ - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/i386-elf/crtn.S ============================================================================== --- head/lib/csu/i386-elf/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/i386-elf/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits add $12,%esp ret @@ -30,6 +33,3 @@ .section .fini,"ax",@progbits add $12,%esp ret - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/ia64/crt1.S ============================================================================== --- head/lib/csu/ia64/crt1.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/ia64/crt1.S Thu Dec 9 21:31:21 2010 (r216338) @@ -24,7 +24,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - .ident "$FreeBSD$" +#include +__FBSDID("$FreeBSD$"); .text Modified: head/lib/csu/ia64/crti.S ============================================================================== --- head/lib/csu/ia64/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/ia64/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + /* * This file (and its companion crtn.S) form the terminators of the * .init and .fini sections. Modified: head/lib/csu/ia64/crtn.S ============================================================================== --- head/lib/csu/ia64/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/ia64/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + .file "crtn.S" .section .init,"ax",@progbits Modified: head/lib/csu/powerpc/crt1.c ============================================================================== --- head/lib/csu/powerpc/crt1.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc/crt1.c Thu Dec 9 21:31:21 2010 (r216338) @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -120,5 +123,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); Modified: head/lib/csu/powerpc/crti.S ============================================================================== --- head/lib/csu/powerpc/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -22,7 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 2 .globl _init @@ -44,7 +47,3 @@ _fini: stw 31,12(1) stw 0,20(1) mr 31,1 - - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/powerpc/crtn.S ============================================================================== --- head/lib/csu/powerpc/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits lwz 11,0(1) lwz 0,4(11) @@ -39,7 +42,3 @@ lwz 31,-4(11) mr 1,11 blr - - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/powerpc64/crt1.c ============================================================================== --- head/lib/csu/powerpc64/crt1.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc64/crt1.c Thu Dec 9 21:31:21 2010 (r216338) @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -119,5 +122,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); Modified: head/lib/csu/powerpc64/crti.S ============================================================================== --- head/lib/csu/powerpc64/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc64/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -22,7 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 2 .globl _init @@ -56,6 +59,3 @@ _fini: stdu 1,-48(1) mflr 0 std 0,64(1) - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/powerpc64/crtn.S ============================================================================== --- head/lib/csu/powerpc64/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/powerpc64/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits ld %r1,0(%r1) ld 0,16(%r1) @@ -35,7 +38,3 @@ ld 0,16(%r1) mtlr 0 blr - - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/sparc64/crt1.c ============================================================================== --- head/lib/csu/sparc64/crt1.c Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/sparc64/crt1.c Thu Dec 9 21:31:21 2010 (r216338) @@ -30,6 +30,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -121,5 +124,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); Modified: head/lib/csu/sparc64/crti.S ============================================================================== --- head/lib/csu/sparc64/crti.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/sparc64/crti.S Thu Dec 9 21:31:21 2010 (r216338) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .file "crti.S" /* The minimum stack frame size (bytes) is: @@ -52,7 +55,3 @@ _init: .align 4 _fini: save %sp,-192,%sp - - - .section .rodata -.ascii "$FreeBSD$\0" Modified: head/lib/csu/sparc64/crtn.S ============================================================================== --- head/lib/csu/sparc64/crtn.S Thu Dec 9 21:29:36 2010 (r216337) +++ head/lib/csu/sparc64/crtn.S Thu Dec 9 21:31:21 2010 (r216338) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .file "crtn.S" .section .init,"ax",@progbits @@ -37,6 +40,3 @@ .align 4 ret restore - - .section .rodata -.ascii "$FreeBSD$\0" From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 22:02:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 822D61065672; Thu, 9 Dec 2010 22:02:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 716818FC17; Thu, 9 Dec 2010 22:02:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9M2mBK052136; Thu, 9 Dec 2010 22:02:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9M2mWQ052134; Thu, 9 Dec 2010 22:02:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012092202.oB9M2mWQ052134@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Dec 2010 22:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216340 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 22:02:48 -0000 Author: bz Date: Thu Dec 9 22:02:48 2010 New Revision: 216340 URL: http://svn.freebsd.org/changeset/base/216340 Log: Don't tie ct_debug to bootverbose. Provide a sysctl to turn it on or off. Switch the default to always off. Reviewed by: kib Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Thu Dec 9 22:01:15 2010 (r216339) +++ head/sys/kern/subr_clock.c Thu Dec 9 22:02:48 2010 (r216340) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define ct_debug bootverbose +static int ct_debug; static int adjkerntz; /* local offset from UTC in seconds */ static int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */ @@ -60,6 +60,8 @@ int tz_dsttime; * This have traditionally been in machdep, but should probably be moved to * kern. */ +SYSCTL_INT(_machdep, OID_AUTO, ct_debug, + CTLFLAG_RW, &ct_debug, 0, "Print ct debug if enabled."); SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock, CTLFLAG_RW, &wall_cmos_clock, 0, "CMOS clock keeps wall time"); From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 22:15:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01186106564A; Thu, 9 Dec 2010 22:15:13 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 38C008FC17; Thu, 9 Dec 2010 22:15:12 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 59D4DE717A; Thu, 9 Dec 2010 22:15:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=C/Wy9dyIWUV5 FnQKsf/u8gbMHjs=; b=Rj8i0pp1CxzksN8JxUzr915aHcPQEzqnqgs8zpF87ff6 LhrCKEFzXaNAYlwv4T1cHS35rLPLnDBeQr37UwrnnLe7iSAHLK2tePKxOlU5p8kY rG2WMZhE3JRQ3OlJceb7V9pp/IyrsaUfSgcZqmc0WCyV01KQw4pOsmUs9m3giaw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=izlKV3 Gcxh/6NKfuZlfyrjbEqSxvqJ5oQN/GzUrmfPBXNg/IsQ6tp1uo6bPM05cZ48a2Tm KHLVAExWiWBphTU0u3VPKtyoNCaWptU8pro4S8BQ5PtnUkdvcdAn5UYY6sXgt/Lh kG9rlva+PvQyeuYxrL8duE17Cz6oD/3pdRd6g= Received: from core.draftnet (client-86-27-21-134.glfd.adsl.virginmedia.com [86.27.21.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 0D87EE7178; Thu, 9 Dec 2010 22:15:09 +0000 (GMT) Date: Thu, 9 Dec 2010 22:14:58 +0000 From: Bruce Cran To: Bruce Evans Message-ID: <20101209221458.42448075@core.draftnet> In-Reply-To: <20101209191657.B1400@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 22:15:13 -0000 On Thu, 9 Dec 2010 19:58:56 +1100 (EST) Bruce Evans wrote: > I had understood the ATA_FLAG_54_58 backwards. It tells us if the > drive is not so old that it doesn't support IDENTIFY records for > words 54-58. I think we rarely get here. Drives old enough to use > CHS may be so old that they don't support words 54-58. Only drives > manufactured during a few years or months in the 1990's will support > words 54-58 but not LBA. Maybe I'm misremembering the length of this > time. All modern drives (including ATA-8) seem to support reporting the current CHS geometry, so FreeBSD will use this for the geometry; however since when the BIOS chooses to use LBA mode the "current geometry" words aren't updated I think we use the wrong geometry on modern drives. > I don't like this. If the drive supports CHS, then its geometries for > this should be reported, if CHS reporting is implemented at all. > There are many to choose from :-), but only 1 or 2 (if any) to report > -- the default one and the current one. Capabilities reporting > should make it clear if the default one can be changed. I consider > CHS features to be unimportant, so they should be reported if the > capabilites reporting tries to be complete; otherwise they are > optional. hdparm for Linux always seemed to report more features > than atacontrol. =46rom more testing I've done today it seems that drive manufacturers have ignored the specifications that say certain fields are obsolete: on an ATA-7 drive setting the BIOS mode to CHS and the number of heads to 8 results in word 55 being updated; all the modern (ATA-7 and ATA-8) drives I've tested report words 54-58 as being valid. So should we be using an older version of the spec and printing obsolete fields too? As it is, we don't have a fallback position if a manufacturer does decide to stop supporting CHS. Should we perhaps be using the LBA mode settings (65535/255/63) if the disk is over 8GB? > I don't like removing them depending on the version. atacontrol is > about the only place that you can see CHS without it possibly having > gone through several layers of fakery. Since it appears that disks are still using the CHS fields despite having been obsolete since ATA-7 I guess it makes sense to continue printing them. > Now I see more clearly that these are only the "firmware" =3D default > parameters. There are also the current parameters in words 54-58. > These are not reported here. One use for reporting them here is > to make it easy to debug whether the kernel code for using them is > ever reached :-). I don't know if a full unfakedparameter struct is > available here for easy printing. If it is, then the capabilities > flag for words 54-58 is in it, and should be used instead of atarev > for deciding whether to print these words (though setting of > capability bits for old drives is as unreliable as setting the > capability words. The driver seems to trust it). We should definitely be printing the current geometry, since that's what the BIOS has configured. > Risky to change this so late. Actually, I have too much experience > with the system generating wrong geometries, and it goes the other > way. I normally run older FreeBSDs which generate the BIOS geometry > of H=3D255/C=3D63 which matches all metadata. When I boot -current it > generates H=3D16/C=3D63. I get annoyed by disk^Wbsdlabel complaining > about this and more, and can't risk using it to change labels. I had presumed that since bsdlabel(8) says the geometry values are historical that they weren't actually used anywhere. However I now see that it appears that fsck_ffs does interpret the geometry at least for UFS1. > So I'd be happy if you changed this, so everyone sees any problems in > this area :-). Its main inconsistency seems to be that only CAM ad > does it. If I was updating it I'd also update the old ad(4) driver to match. --=20 Bruce Cran From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 22:30:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 760A310656C0; Thu, 9 Dec 2010 22:30:20 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2586F8FC0A; Thu, 9 Dec 2010 22:30:18 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA24306; Fri, 10 Dec 2010 00:30:17 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQp0D-000Puc-5A; Fri, 10 Dec 2010 00:30:17 +0200 Message-ID: <4D015877.5020503@freebsd.org> Date: Fri, 10 Dec 2010 00:30:15 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Jung-uk Kim References: <201012092129.oB9LTakd051314@svn.freebsd.org> In-Reply-To: <201012092129.oB9LTakd051314@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216337 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 22:30:20 -0000 on 09/12/2010 23:29 Jung-uk Kim said the following: > Author: jkim > Date: Thu Dec 9 21:29:36 2010 > New Revision: 216337 > URL: http://svn.freebsd.org/changeset/base/216337 > > Log: > Remove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state > invariant CPUs. I do not believe this model is P-state invariant any more. I wonder why we had and have all those additional checks at all. Don't we trust AMDPM_TSC_INVARIANT bit to be set correctly? Especially for the AMD CPUs, not sure about Intel ones. > Maybe cpufreq(4) was broken at the time of commit. :-( > > Modified: > head/sys/x86/x86/tsc.c > > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Thu Dec 9 21:11:53 2010 (r216336) > +++ head/sys/x86/x86/tsc.c Thu Dec 9 21:29:36 2010 (r216337) > @@ -107,7 +107,7 @@ init_TSC(void) > switch (cpu_vendor_id) { > case CPU_VENDOR_AMD: > if ((amd_pminfo & AMDPM_TSC_INVARIANT) || > - CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) > + CPUID_TO_FAMILY(cpu_id) >= 0x10) > tsc_is_invariant = 1; > break; > case CPU_VENDOR_INTEL: -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 22:37:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A30E51065670; Thu, 9 Dec 2010 22:37:14 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFD28FC15; Thu, 9 Dec 2010 22:37:12 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA24363; Fri, 10 Dec 2010 00:36:58 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQp6g-000Pv7-4u; Fri, 10 Dec 2010 00:36:58 +0200 Message-ID: <4D015A09.7070608@freebsd.org> Date: Fri, 10 Dec 2010 00:36:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Cran References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> In-Reply-To: <20101209221458.42448075@core.draftnet> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 22:37:14 -0000 on 10/12/2010 00:14 Bruce Cran said the following: > Since it appears that disks are still using the CHS fields despite > having been obsolete since ATA-7 I guess it makes sense to continue > printing them. I apologize for repeating myself, that probably starts to be annoying... We read some reserved/unused/obsolete bytes and get some garbage in them. The fact that the garbage looks like "valid" (for some definition of "valid") CHS parameters doesn't mean that those are really valid, or CHS parameters, or we should use them, or we should even report them, even for debug. That's my personal position and I am sticking to it :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 22:56:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13725106564A; Thu, 9 Dec 2010 22:56:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7137E8FC12; Thu, 9 Dec 2010 22:56:11 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB9MtuPt051506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Dec 2010 00:55:56 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB9Mttuc079372; Fri, 10 Dec 2010 00:55:55 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB9Mtt1O079371; Fri, 10 Dec 2010 00:55:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Dec 2010 00:55:55 +0200 From: Kostik Belousov To: Andriy Gapon Message-ID: <20101209225555.GS33073@deviant.kiev.zoral.com.ua> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <4D015A09.7070608@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f0Ums9VvOMUG7syy" Content-Disposition: inline In-Reply-To: <4D015A09.7070608@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 22:56:13 -0000 --f0Ums9VvOMUG7syy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 10, 2010 at 12:36:57AM +0200, Andriy Gapon wrote: > on 10/12/2010 00:14 Bruce Cran said the following: > > Since it appears that disks are still using the CHS fields despite > > having been obsolete since ATA-7 I guess it makes sense to continue > > printing them. >=20 > I apologize for repeating myself, that probably starts to be annoying... > We read some reserved/unused/obsolete bytes and get some garbage in them. > The fact that the garbage looks like "valid" (for some definition of "val= id") > CHS parameters doesn't mean that those are really valid, or CHS parameter= s, or > we should use them, or we should even report them, even for debug. > That's my personal position and I am sticking to it :-) I think that the drive manufacturers are trying to be compatible not only with the latest ATA specifications, but also with the reasonable set of previous revisions of the specs. At least they do this to allow older BIOSes or DOS or whatever old software user has to continue to work. So, althought the fields are marked as reserved by newest spec, they still filled with something semi-reasonable to satisfy (very) old software. I think it is safe to read and interpret the values still. --f0Ums9VvOMUG7syy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0BXnoACgkQC3+MBN1Mb4hwSwCg9sDB4zPRUWVCQ4uS3lc47c4F 3TAAoIY5lvDg4LDgiAOAIzzeI/ybCHIN =FtLj -----END PGP SIGNATURE----- --f0Ums9VvOMUG7syy-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 23:04:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9BF106566C; Thu, 9 Dec 2010 23:04:27 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C823D8FC1A; Thu, 9 Dec 2010 23:04:25 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA24633; Fri, 10 Dec 2010 01:04:10 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQpX0-000PxE-Dg; Fri, 10 Dec 2010 01:04:10 +0200 Message-ID: <4D016069.7050505@freebsd.org> Date: Fri, 10 Dec 2010 01:04:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Kostik Belousov References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <4D015A09.7070608@freebsd.org> <20101209225555.GS33073@deviant.kiev.zoral.com.ua> In-Reply-To: <20101209225555.GS33073@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 23:04:27 -0000 on 10/12/2010 00:55 Kostik Belousov said the following: > On Fri, Dec 10, 2010 at 12:36:57AM +0200, Andriy Gapon wrote: >> on 10/12/2010 00:14 Bruce Cran said the following: >>> Since it appears that disks are still using the CHS fields despite >>> having been obsolete since ATA-7 I guess it makes sense to continue >>> printing them. >> >> I apologize for repeating myself, that probably starts to be annoying... >> We read some reserved/unused/obsolete bytes and get some garbage in them. >> The fact that the garbage looks like "valid" (for some definition of "valid") >> CHS parameters doesn't mean that those are really valid, or CHS parameters, or >> we should use them, or we should even report them, even for debug. >> That's my personal position and I am sticking to it :-) > > I think that the drive manufacturers are trying to be compatible not only > with the latest ATA specifications, but also with the reasonable set of > previous revisions of the specs. At least they do this to allow older > BIOSes or DOS or whatever old software user has to continue to work. > > So, althought the fields are marked as reserved by newest spec, they > still filled with something semi-reasonable to satisfy (very) old > software. I think it is safe to read and interpret the values still. That could be true, but that's not a reason to keep using them. That's good for software that was written and compiled 10 years ago and now being run unchanged. But there is no reason to perpetuate that old stuff in modern and alive software that is being developed now. IMO, of course. In a way it's similar to how we kept trying to interpret value in RTC NVRAM/CMOS register E as BIOS diagnostics when BIOSes had already stopped using it. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 23:12:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A76A106564A; Thu, 9 Dec 2010 23:12:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id F40BD8FC12; Thu, 9 Dec 2010 23:12:48 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB9NCY0T008212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Dec 2010 10:12:35 +1100 Date: Fri, 10 Dec 2010 10:12:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <20101209221458.42448075@core.draftnet> Message-ID: <20101210092805.M8539@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 23:12:49 -0000 On Thu, 9 Dec 2010, Bruce Cran wrote: > On Thu, 9 Dec 2010 19:58:56 +1100 (EST) > Bruce Evans wrote: > >> I had understood the ATA_FLAG_54_58 backwards. It tells us if the >> drive is not so old that it doesn't support IDENTIFY records for >> words 54-58. I think we rarely get here. Drives old enough to use >> CHS may be so old that they don't support words 54-58. Only drives >> manufactured during a few years or months in the 1990's will support >> words 54-58 but not LBA. Maybe I'm misremembering the length of this >> time. > > All modern drives (including ATA-8) seem to support reporting the > current CHS geometry, so FreeBSD will use this for the geometry; > however since when the BIOS chooses to use LBA mode the "current > geometry" words aren't updated I think we use the wrong geometry on > modern drives. The BIOS has little control over the mode. It can't enforce LBA if the drive supports CHS. It can't force any particular CHS mode since the driver may set any CHS mode. ata used to reset the drive in the probe and in reinit. I think this is a hard reset which restores the default CHS. I can't see where ata resets now. It is nicely obfuscated using function pointers. I think it does less resetting. It also has a soft reset for at least sata, but sata won't be using CHS. Removing of resets would explain why it now has to use the current CHS (since it doesn't change the CHS back to the default). >> I don't like this. If the drive supports CHS, then its geometries for >> this should be reported, if CHS reporting is implemented at all. >> ... > >> From more testing I've done today it seems that drive manufacturers > have ignored the specifications that say certain fields are obsolete: Obsolete doesn't mean that it is require to be broken. > on an ATA-7 drive setting the BIOS mode to CHS and the number of > heads to 8 results in word 55 being updated; all the modern (ATA-7 and > ATA-8) drives I've tested report words 54-58 as being valid. So should If they support using CHS, and also support changing CHS, then they have to have these words to report what the change was. > we be using an older version of the spec and printing obsolete fields > too? As it is, we don't have a fallback position if a manufacturer does > decide to stop supporting CHS. Should we perhaps be using the LBA mode > settings (65535/255/63) if the disk is over 8GB? The driver always ignores CHS (except to report it) and uses LBA if possible. If a manufacturer stops supporting CHS, then the driver shouldn't notice, but the manufacturer's non-support should include setting the obsolete fields to 0 (or possibly other specified magic numbers). It is then up to utilities whether to report these fields as simply there value or to decrypt their magic values into a CHS- unsupported flag (I don't know of any actual flag for this). Then there is the "firmware geometry" reported to GEOM. You could try changing this to 0/0/0 and see what breaks. CAM for SCSI drives still invents a geometry to avoid seeing evil here, since SCSI drives have only had no geometry for about 30 years now. >> I don't like removing them depending on the version. atacontrol is >> about the only place that you can see CHS without it possibly having >> gone through several layers of fakery. > > Since it appears that disks are still using the CHS fields despite > having been obsolete since ATA-7 I guess it makes sense to continue > printing them. Not really. Disks aren't users, but may support their use. Drivers aren't using them, but should be reporting when they are useable and also their values if use is supported and configured. >> Risky to change this so late. Actually, I have too much experience >> with the system generating wrong geometries, and it goes the other >> way. I normally run older FreeBSDs which generate the BIOS geometry >> of H=255/C=63 which matches all metadata. When I boot -current it >> generates H=16/C=63. I get annoyed by disk^Wbsdlabel complaining >> about this and more, and can't risk using it to change labels. > > I had presumed that since bsdlabel(8) says the geometry values are > historical that they weren't actually used anywhere. However I now see > that it appears that fsck_ffs does interpret the geometry at least for > UFS1. Urk. For ffs1, it seems to be rounding important parameters to track and cylinder boundaries. It divides by d_secpercyl. So you would soon find that a geometry of 0/0/0 doesn't work :-). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Dec 9 23:57:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C17DB1065679; Thu, 9 Dec 2010 23:57:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0D488FC16; Thu, 9 Dec 2010 23:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB9NvNBp054791; Thu, 9 Dec 2010 23:57:23 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB9NvNUT054789; Thu, 9 Dec 2010 23:57:23 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012092357.oB9NvNUT054789@svn.freebsd.org> From: Doug Barton Date: Thu, 9 Dec 2010 23:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216343 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 23:57:23 -0000 Author: dougb Date: Thu Dec 9 23:57:23 2010 New Revision: 216343 URL: http://svn.freebsd.org/changeset/base/216343 Log: Bring in the change from OpenBSD's 1.14: "synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually exclusive; while here, slightly improve spacing in the source code so it fits on a 80-column display again. diff greatly improved by martynas@" Obtained from: sobrado@OpenBSD.org Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Thu Dec 9 22:05:16 2010 (r216342) +++ head/usr.bin/stat/stat.c Thu Dec 9 23:57:23 2010 (r216343) @@ -30,7 +30,8 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.30 2010/11/25 04:33:30 dholland Exp $"); +__RCSID("$NetBSD: stat.c,v 1.30 2010/11/25 04:33:30 dholland Exp $" +"$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $"); #endif #endif @@ -226,7 +227,8 @@ main(int argc, char *argv[]) quiet = 1; } else { options = "f:FlLnqrst:x"; - synopsis = "[-FlLnqrsx] [-f format] [-t timefmt] [file ...]"; + synopsis = "[-FLnq] [-f format | -l | -r | -s | -x] " + "[-t timefmt] [file ...]"; } while ((ch = getopt(argc, argv, options)) != -1) From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 01:00:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5656106564A for ; Fri, 10 Dec 2010 01:00:47 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 30A898FC1C for ; Fri, 10 Dec 2010 01:00:47 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:14812 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1PQrLV-0003Vg-8S for svn-src-head@freebsd.org; Fri, 10 Dec 2010 02:00:28 +0100 Received: (qmail 77495 invoked from network); 10 Dec 2010 02:00:23 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 10 Dec 2010 02:00:23 +0100 Received: (qmail 68782 invoked by uid 1001); 10 Dec 2010 02:00:23 +0100 Date: Fri, 10 Dec 2010 02:00:23 +0100 From: Erik Trulsson To: Bruce Cran Message-ID: <20101210010023.GA68703@owl.midgard.homeip.net> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101209221458.42448075@core.draftnet> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1PQrLV-0003Vg-8S. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1PQrLV-0003Vg-8S 1260fd11ca964fec7b7c7f89b125c9bc Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 01:00:47 -0000 On Thu, Dec 09, 2010 at 10:14:58PM +0000, Bruce Cran wrote: > On Thu, 9 Dec 2010 19:58:56 +1100 (EST) > Bruce Evans wrote: > > > I had understood the ATA_FLAG_54_58 backwards. It tells us if the > > drive is not so old that it doesn't support IDENTIFY records for > > words 54-58. I think we rarely get here. Drives old enough to use > > CHS may be so old that they don't support words 54-58. Only drives > > manufactured during a few years or months in the 1990's will support > > words 54-58 but not LBA. Maybe I'm misremembering the length of this > > time. > > All modern drives (including ATA-8) seem to support reporting the > current CHS geometry, so FreeBSD will use this for the geometry; > however since when the BIOS chooses to use LBA mode the "current > geometry" words aren't updated I think we use the wrong geometry on > modern drives. Modern drives do not really report 'the current CHS geometry'. They report a fake geometry that normally do not have anything do with the actual geometry. (As an example just about all modern ATA/SATA drives report having 16 heads, while in reality none of them have more than 10 heads and most of them have fewer heads than that.) Finding out the real geometry of a disk is generally not possible and typically cannot even be expressed with a simple C/H/S scheme, since the 'S' component is usually not a constant. (Modern drives put more sectors per track on the outer tracks than on the inner tracks.) The only reason for actually using the geometry reported by the disk for anything is if you need to have the partitioning of the disk compatible with some other OS which does use the reported CHS values. (E.g. if you have a dual-boot machine where FreeBSD shares the disk with some other OS that insists on having partitions start exactly on a track boundary, then FreeBSD would need to handle that somehow.) But even then you are not really interested in using the 'correct' geometry, but rather in using whatever geometry that other OS is using. -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 01:17:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64550106564A for ; Fri, 10 Dec 2010 01:17:18 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id E31098FC0C for ; Fri, 10 Dec 2010 01:17:17 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:63517 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1PQrbb-0006Zl-8C for svn-src-head@freebsd.org; Fri, 10 Dec 2010 02:17:05 +0100 Received: (qmail 77522 invoked from network); 10 Dec 2010 02:10:22 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 10 Dec 2010 02:10:22 +0100 Received: (qmail 68800 invoked by uid 1001); 10 Dec 2010 02:10:22 +0100 Date: Fri, 10 Dec 2010 02:10:22 +0100 From: Erik Trulsson To: Andriy Gapon Message-ID: <20101210011022.GB68703@owl.midgard.homeip.net> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <4D015A09.7070608@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D015A09.7070608@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1PQrbb-0006Zl-8C. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1PQrbb-0006Zl-8C c50d633d14bf6de573e1f6f3095073c0 Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 01:17:18 -0000 On Fri, Dec 10, 2010 at 12:36:57AM +0200, Andriy Gapon wrote: > on 10/12/2010 00:14 Bruce Cran said the following: > > Since it appears that disks are still using the CHS fields despite > > having been obsolete since ATA-7 I guess it makes sense to continue > > printing them. > > I apologize for repeating myself, that probably starts to be annoying... > We read some reserved/unused/obsolete bytes and get some garbage in them. > The fact that the garbage looks like "valid" (for some definition of "valid") > CHS parameters doesn't mean that those are really valid, or CHS parameters, or > we should use them, or we should even report them, even for debug. > That's my personal position and I am sticking to it :-) No. Those bytes may be obsolete, and might be reserved by the latest version(s) of the ATA standard, but they are not unused and they do not contain garbage. They do contain CHS parameters as set by the drive manufacturers, and should continue to be reported as such by the tools we have that provide disk information. If they should be used for anything other than just listing what the drive reports is another question, to which the answer is probably no, since the values reported do not match the actual geometry of the drives (and haven't done so for many years now.) -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 07:55:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E07D3106566B; Fri, 10 Dec 2010 07:55:38 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D026F8FC1A; Fri, 10 Dec 2010 07:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBA7tc9U065429; Fri, 10 Dec 2010 07:55:38 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBA7tcpf065427; Fri, 10 Dec 2010 07:55:38 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201012100755.oBA7tcpf065427@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 10 Dec 2010 07:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216349 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 07:55:39 -0000 Author: ru Date: Fri Dec 10 07:55:38 2010 New Revision: 216349 URL: http://svn.freebsd.org/changeset/base/216349 Log: Document this driver supports the converter I just bought. Modified: head/share/man/man4/uplcom.4 Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Fri Dec 10 05:18:37 2010 (r216348) +++ head/share/man/man4/uplcom.4 Fri Dec 10 07:55:38 2010 (r216349) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd December 10, 2010 .Dt UPLCOM 4 .Os .Sh NAME @@ -105,6 +105,8 @@ SOURCENEXT KeikaiDenwa 8 (with and witho .It Sony Ericsson USB Cable (Susteen USB Data Cable) .It +TRENDnet USB to Serial Converter (TU-S9) +.It Willcom W-SIM DD PHS terminal.(WS002IN) .El .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 08:33:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E38106566B; Fri, 10 Dec 2010 08:33:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8848FC0A; Fri, 10 Dec 2010 08:33:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBA8Xu5R066302; Fri, 10 Dec 2010 08:33:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBA8Xu0I066300; Fri, 10 Dec 2010 08:33:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012100833.oBA8Xu0I066300@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 10 Dec 2010 08:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216350 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 08:33:56 -0000 Author: trasz Date: Fri Dec 10 08:33:56 2010 New Revision: 216350 URL: http://svn.freebsd.org/changeset/base/216350 Log: Refactor fork1() to make it easier to follow. No functional changes. Reviewed by: kib (earlier version) Tested by: pho Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Dec 10 07:55:38 2010 (r216349) +++ head/sys/kern/kern_fork.c Fri Dec 10 08:33:56 2010 (r216350) @@ -194,6 +194,93 @@ SYSCTL_PROC(_kern, OID_AUTO, randompid, 0, 0, sysctl_kern_randompid, "I", "Random PID modulus"); static int +fork_findpid(int flags) +{ + struct proc *p; + int trypid; + static int pidchecked = 0; + + sx_assert(&allproc_lock, SX_XLOCKED); + + /* + * Find an unused process ID. We remember a range of unused IDs + * ready to use (from lastpid+1 through pidchecked-1). + * + * If RFHIGHPID is set (used during system boot), do not allocate + * low-numbered pids. + */ + trypid = lastpid + 1; + if (flags & RFHIGHPID) { + if (trypid < 10) + trypid = 10; + } else { + if (randompid) + trypid += arc4random() % randompid; + } +retry: + /* + * If the process ID prototype has wrapped around, + * restart somewhat above 0, as the low-numbered procs + * tend to include daemons that don't exit. + */ + if (trypid >= PID_MAX) { + trypid = trypid % PID_MAX; + if (trypid < 100) + trypid += 100; + pidchecked = 0; + } + if (trypid >= pidchecked) { + int doingzomb = 0; + + pidchecked = PID_MAX; + /* + * Scan the active and zombie procs to check whether this pid + * is in use. Remember the lowest pid that's greater + * than trypid, so we can avoid checking for a while. + */ + p = LIST_FIRST(&allproc); +again: + for (; p != NULL; p = LIST_NEXT(p, p_list)) { + while (p->p_pid == trypid || + (p->p_pgrp != NULL && + (p->p_pgrp->pg_id == trypid || + (p->p_session != NULL && + p->p_session->s_sid == trypid)))) { + trypid++; + if (trypid >= pidchecked) + goto retry; + } + if (p->p_pid > trypid && pidchecked > p->p_pid) + pidchecked = p->p_pid; + if (p->p_pgrp != NULL) { + if (p->p_pgrp->pg_id > trypid && + pidchecked > p->p_pgrp->pg_id) + pidchecked = p->p_pgrp->pg_id; + if (p->p_session != NULL && + p->p_session->s_sid > trypid && + pidchecked > p->p_session->s_sid) + pidchecked = p->p_session->s_sid; + } + } + if (!doingzomb) { + doingzomb = 1; + p = LIST_FIRST(&zombproc); + goto again; + } + } + + /* + * RFHIGHPID does not mess with the lastpid counter during boot. + */ + if (flags & RFHIGHPID) + pidchecked = 0; + else + lastpid = trypid; + + return (trypid); +} + +static int fork_norfproc(struct thread *td, int flags, struct proc **procp) { int error; @@ -244,211 +331,31 @@ fail: return (error); } -int -fork1(struct thread *td, int flags, int pages, struct proc **procp) +static void +do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2, + struct vmspace *vm2) { - struct proc *p1, *p2, *pptr; - struct proc *newproc; - int ok, trypid; - static int curfail, pidchecked = 0; - static struct timeval lastfail; + struct proc *p1, *pptr; + int trypid; struct filedesc *fd; struct filedesc_to_leader *fdtol; - struct thread *td2; struct sigacts *newsigacts; - struct vmspace *vm2; - vm_ooffset_t mem_charged; - int error; - /* Can't copy and clear. */ - if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG)) - return (EINVAL); + sx_assert(&proctree_lock, SX_SLOCKED); + sx_assert(&allproc_lock, SX_XLOCKED); p1 = td->td_proc; /* - * Here we don't create a new process, but we divorce - * certain parts of a process from itself. - */ - if ((flags & RFPROC) == 0) - return (fork_norfproc(td, flags, procp)); - - /* - * XXX - * We did have single-threading code here - * however it proved un-needed and caused problems - */ - - mem_charged = 0; - vm2 = NULL; - if (pages == 0) - pages = KSTACK_PAGES; - /* Allocate new proc. */ - newproc = uma_zalloc(proc_zone, M_WAITOK); - td2 = FIRST_THREAD_IN_PROC(newproc); - if (td2 == NULL) { - td2 = thread_alloc(pages); - if (td2 == NULL) { - error = ENOMEM; - goto fail1; - } - proc_linkup(newproc, td2); - } else { - if (td2->td_kstack == 0 || td2->td_kstack_pages != pages) { - if (td2->td_kstack != 0) - vm_thread_dispose(td2); - if (!thread_alloc_stack(td2, pages)) { - error = ENOMEM; - goto fail1; - } - } - } - - if ((flags & RFMEM) == 0) { - vm2 = vmspace_fork(p1->p_vmspace, &mem_charged); - if (vm2 == NULL) { - error = ENOMEM; - goto fail1; - } - if (!swap_reserve(mem_charged)) { - /* - * The swap reservation failed. The accounting - * from the entries of the copied vm2 will be - * substracted in vmspace_free(), so force the - * reservation there. - */ - swap_reserve_force(mem_charged); - error = ENOMEM; - goto fail1; - } - } else - vm2 = NULL; -#ifdef MAC - mac_proc_init(newproc); -#endif - knlist_init_mtx(&newproc->p_klist, &newproc->p_mtx); - STAILQ_INIT(&newproc->p_ktr); - - /* We have to lock the process tree while we look for a pid. */ - sx_slock(&proctree_lock); - - /* - * Although process entries are dynamically created, we still keep - * a global limit on the maximum number we will create. Don't allow - * a nonprivileged user to use the last ten processes; don't let root - * exceed the limit. The variable nprocs is the current number of - * processes, maxproc is the limit. - */ - sx_xlock(&allproc_lock); - if ((nprocs >= maxproc - 10 && priv_check_cred(td->td_ucred, - PRIV_MAXPROC, 0) != 0) || nprocs >= maxproc) { - error = EAGAIN; - goto fail; - } - - /* - * Increment the count of procs running with this uid. Don't allow - * a nonprivileged user to exceed their current limit. - * - * XXXRW: Can we avoid privilege here if it's not needed? - */ - error = priv_check_cred(td->td_ucred, PRIV_PROC_LIMIT, 0); - if (error == 0) - ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1, 0); - else { - PROC_LOCK(p1); - ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1, - lim_cur(p1, RLIMIT_NPROC)); - PROC_UNLOCK(p1); - } - if (!ok) { - error = EAGAIN; - goto fail; - } - - /* * Increment the nprocs resource before blocking can occur. There * are hard-limits as to the number of processes that can run. */ nprocs++; - /* - * Find an unused process ID. We remember a range of unused IDs - * ready to use (from lastpid+1 through pidchecked-1). - * - * If RFHIGHPID is set (used during system boot), do not allocate - * low-numbered pids. - */ - trypid = lastpid + 1; - if (flags & RFHIGHPID) { - if (trypid < 10) - trypid = 10; - } else { - if (randompid) - trypid += arc4random() % randompid; - } -retry: - /* - * If the process ID prototype has wrapped around, - * restart somewhat above 0, as the low-numbered procs - * tend to include daemons that don't exit. - */ - if (trypid >= PID_MAX) { - trypid = trypid % PID_MAX; - if (trypid < 100) - trypid += 100; - pidchecked = 0; - } - if (trypid >= pidchecked) { - int doingzomb = 0; + trypid = fork_findpid(flags); - pidchecked = PID_MAX; - /* - * Scan the active and zombie procs to check whether this pid - * is in use. Remember the lowest pid that's greater - * than trypid, so we can avoid checking for a while. - */ - p2 = LIST_FIRST(&allproc); -again: - for (; p2 != NULL; p2 = LIST_NEXT(p2, p_list)) { - while (p2->p_pid == trypid || - (p2->p_pgrp != NULL && - (p2->p_pgrp->pg_id == trypid || - (p2->p_session != NULL && - p2->p_session->s_sid == trypid)))) { - trypid++; - if (trypid >= pidchecked) - goto retry; - } - if (p2->p_pid > trypid && pidchecked > p2->p_pid) - pidchecked = p2->p_pid; - if (p2->p_pgrp != NULL) { - if (p2->p_pgrp->pg_id > trypid && - pidchecked > p2->p_pgrp->pg_id) - pidchecked = p2->p_pgrp->pg_id; - if (p2->p_session != NULL && - p2->p_session->s_sid > trypid && - pidchecked > p2->p_session->s_sid) - pidchecked = p2->p_session->s_sid; - } - } - if (!doingzomb) { - doingzomb = 1; - p2 = LIST_FIRST(&zombproc); - goto again; - } - } sx_sunlock(&proctree_lock); - /* - * RFHIGHPID does not mess with the lastpid counter during boot. - */ - if (flags & RFHIGHPID) - pidchecked = 0; - else - lastpid = trypid; - - p2 = newproc; p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; /* @@ -776,11 +683,133 @@ again: cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); +} + +int +fork1(struct thread *td, int flags, int pages, struct proc **procp) +{ + struct proc *p1; + struct proc *newproc; + int ok; + struct thread *td2; + struct vmspace *vm2; + vm_ooffset_t mem_charged; + int error; + static int curfail; + static struct timeval lastfail; + + /* Can't copy and clear. */ + if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG)) + return (EINVAL); + + p1 = td->td_proc; + /* - * Return child proc pointer to parent. + * Here we don't create a new process, but we divorce + * certain parts of a process from itself. */ - *procp = p2; - return (0); + if ((flags & RFPROC) == 0) + return (fork_norfproc(td, flags, procp)); + + /* + * XXX + * We did have single-threading code here + * however it proved un-needed and caused problems + */ + + mem_charged = 0; + vm2 = NULL; + if (pages == 0) + pages = KSTACK_PAGES; + /* Allocate new proc. */ + newproc = uma_zalloc(proc_zone, M_WAITOK); + td2 = FIRST_THREAD_IN_PROC(newproc); + if (td2 == NULL) { + td2 = thread_alloc(pages); + if (td2 == NULL) { + error = ENOMEM; + goto fail1; + } + proc_linkup(newproc, td2); + } else { + if (td2->td_kstack == 0 || td2->td_kstack_pages != pages) { + if (td2->td_kstack != 0) + vm_thread_dispose(td2); + if (!thread_alloc_stack(td2, pages)) { + error = ENOMEM; + goto fail1; + } + } + } + + if ((flags & RFMEM) == 0) { + vm2 = vmspace_fork(p1->p_vmspace, &mem_charged); + if (vm2 == NULL) { + error = ENOMEM; + goto fail1; + } + if (!swap_reserve(mem_charged)) { + /* + * The swap reservation failed. The accounting + * from the entries of the copied vm2 will be + * substracted in vmspace_free(), so force the + * reservation there. + */ + swap_reserve_force(mem_charged); + error = ENOMEM; + goto fail1; + } + } else + vm2 = NULL; +#ifdef MAC + mac_proc_init(newproc); +#endif + knlist_init_mtx(&newproc->p_klist, &newproc->p_mtx); + STAILQ_INIT(&newproc->p_ktr); + + /* We have to lock the process tree while we look for a pid. */ + sx_slock(&proctree_lock); + + /* + * Although process entries are dynamically created, we still keep + * a global limit on the maximum number we will create. Don't allow + * a nonprivileged user to use the last ten processes; don't let root + * exceed the limit. The variable nprocs is the current number of + * processes, maxproc is the limit. + */ + sx_xlock(&allproc_lock); + if ((nprocs >= maxproc - 10 && priv_check_cred(td->td_ucred, + PRIV_MAXPROC, 0) != 0) || nprocs >= maxproc) { + error = EAGAIN; + goto fail; + } + + /* + * Increment the count of procs running with this uid. Don't allow + * a nonprivileged user to exceed their current limit. + * + * XXXRW: Can we avoid privilege here if it's not needed? + */ + error = priv_check_cred(td->td_ucred, PRIV_PROC_LIMIT, 0); + if (error == 0) + ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1, 0); + else { + PROC_LOCK(p1); + ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1, + lim_cur(p1, RLIMIT_NPROC)); + PROC_UNLOCK(p1); + } + if (ok) { + do_fork(td, flags, newproc, td2, vm2); + + /* + * Return child proc pointer to parent. + */ + *procp = newproc; + return (0); + } + + error = EAGAIN; fail: sx_sunlock(&proctree_lock); if (ppsratecheck(&lastfail, &curfail, 1)) From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 08:42:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D95D1065670; Fri, 10 Dec 2010 08:42:15 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 28B748FC0C; Fri, 10 Dec 2010 08:42:13 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA01177; Fri, 10 Dec 2010 10:42:06 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQyYI-0002rK-KB; Fri, 10 Dec 2010 10:42:06 +0200 Message-ID: <4D01E7DD.8050904@freebsd.org> Date: Fri, 10 Dec 2010 10:42:05 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Erik Trulsson References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <4D015A09.7070608@freebsd.org> <20101210011022.GB68703@owl.midgard.homeip.net> In-Reply-To: <20101210011022.GB68703@owl.midgard.homeip.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 08:42:15 -0000 on 10/12/2010 03:10 Erik Trulsson said the following: > On Fri, Dec 10, 2010 at 12:36:57AM +0200, Andriy Gapon wrote: >> on 10/12/2010 00:14 Bruce Cran said the following: >>> Since it appears that disks are still using the CHS fields despite >>> having been obsolete since ATA-7 I guess it makes sense to continue >>> printing them. Label1: >> I apologize for repeating myself, that probably starts to be annoying... >> We read some reserved/unused/obsolete bytes and get some garbage in them. >> The fact that the garbage looks like "valid" (for some definition of "valid") >> CHS parameters doesn't mean that those are really valid, or CHS parameters, or >> we should use them, or we should even report them, even for debug. >> That's my personal position and I am sticking to it :-) > > > No. Those bytes may be obsolete, and might be reserved by the latest > version(s) of the ATA standard, but they are not unused and they do not > contain garbage. They do contain CHS parameters as set by the drive > manufacturers, and should continue to be reported as such by the tools > we have that provide disk information. So, your personal belief/interpretation against mine, fair enough. Can't add anything except go to $Label1. :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 08:52:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC720106566B; Fri, 10 Dec 2010 08:52:37 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 74C878FC13; Fri, 10 Dec 2010 08:52:37 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9B038E7178; Fri, 10 Dec 2010 08:52:36 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=ldfMEJIY1iUi PNww7/Kz8zlRdnU=; b=vySA0PpCn1iB1c/sWA+gZYrKnE3jT7K+nCYk2GepgvEk mCTXUE28gd52+jb5+6HW9YRNKzMIAr9KblD2JlFwjCgBoFSPugTvrrnKACuiuxUF wC5gS4f9ZPBDbaX+eCjR7hcVvdK+HXvg9XmA4zHgE2E5Vd0QeF/8j5yIhg3atcY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=riqghJ MWTskZUNhUeOFU7IDXRIx5s4myvLMnl7HT73q95T8sfNbwaeGNk8o8Yp2R0WZ/rz 37qiskBD0c/8MChHYSDK3Hlu/CrnrWsqshCAFzv3UhrJ9/VHVfDY/SUtNNk/UEwj c9NCyPRkMWdhjGOYk32DK7VZOWKsaeG/xAdiY= Received: from core.draftnet (client-86-27-21-134.glfd.adsl.virginmedia.com [86.27.21.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 37E28E7174; Fri, 10 Dec 2010 08:52:36 +0000 (GMT) Date: Fri, 10 Dec 2010 08:52:26 +0000 From: Bruce Cran To: Erik Trulsson Message-ID: <20101210085226.5cf2b42b@core.draftnet> In-Reply-To: <20101210010023.GA68703@owl.midgard.homeip.net> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <20101210010023.GA68703@owl.midgard.homeip.net> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 08:52:38 -0000 On Fri, 10 Dec 2010 02:00:23 +0100 Erik Trulsson wrote: > Modern drives do not really report 'the current CHS geometry'. They > report a fake geometry that normally do not have anything do with the > actual geometry. (As an example just about all modern ATA/SATA drives > report having 16 heads, while in reality none of them have more than > 10 heads and most of them have fewer heads than that.) Note that I said 'current', not 'correct' :) They do continue to report the current CHS geometry that the BIOS has configured: for example overriding the settings to use a setting of 8H instead of 16H in the BIOS does get detected by FreeBSD when it reads the 'current CHS geometry' fields. And yes, the only thing that's useful for nowadays is configuring the MBR or BSD disklabel. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 08:53:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EAAD106566B; Fri, 10 Dec 2010 08:53:07 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FCD8FC20; Fri, 10 Dec 2010 08:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBA8r7PL066694; Fri, 10 Dec 2010 08:53:07 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBA8r7tX066692; Fri, 10 Dec 2010 08:53:07 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201012100853.oBA8r7tX066692@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 10 Dec 2010 08:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216351 - head/lib/csu/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 08:53:07 -0000 Author: tijl Date: Fri Dec 10 08:53:06 2010 New Revision: 216351 URL: http://svn.freebsd.org/changeset/base/216351 Log: Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.c in crt1.o. On other architectures crtbrand.c is included from crt1.c, but that's not a C source code file on ia64. Instead it is compiled separately and included in crt1.o using incremental linking. Tested by: dim (previous version) Approved by: kib (mentor) Modified: head/lib/csu/ia64/Makefile Modified: head/lib/csu/ia64/Makefile ============================================================================== --- head/lib/csu/ia64/Makefile Fri Dec 10 08:33:56 2010 (r216350) +++ head/lib/csu/ia64/Makefile Fri Dec 10 08:53:06 2010 (r216351) @@ -2,21 +2,42 @@ .PATH: ${.CURDIR}/../common -SRCS= crt1.S crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +OBJS+= crt1.o gcrt1.o Scrt1.o all: ${OBJS} CLEANFILES= ${OBJS} +CLEANFILES+= crt1_.o gcrt1_.o Scrt1_.o +CLEANFILES+= crtbrand.o gcrtbrand.o Scrtbrand.o -gcrt1.o: crt1.S - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +crt1_.o: crt1.S + ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC} -Scrt1.o: crt1.S - ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} +crtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC} + +crt1.o: crt1_.o crtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o + +gcrt1_.o: crt1.S + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC} + +gcrtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC} + +gcrt1.o: gcrt1_.o gcrtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} + +Scrt1_.o: crt1.S + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC} + +Scrtbrand.o: crtbrand.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC} + +Scrt1.o: Scrt1_.o Scrtbrand.o + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 08:58:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E83106566C; Fri, 10 Dec 2010 08:58:39 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 7444C8FC0C; Fri, 10 Dec 2010 08:58:39 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9C39FE717B; Fri, 10 Dec 2010 08:58:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=6pnyK7RsuYXa COrwISLK8A7zG80=; b=fQLXi2IQ8k0lFom0t1DcIaXcS5njkXFbUMfrqxVahOGm 6jrNBaBEiOo5zXp+UeKDdOKnafXxLL82aIVsqnUNJBMMC9qquibToy3ZD8B37f+4 IFtMAX04sXZUBLo9FAdFQ9aKLC9tdVa/of75WVT1POW/9M8Q3AkWe0t2Qdkp9lY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=lM+wIe l2o/VCHyv+1f4Tf3DJVQAd9pOyCaa8Rm4gHlPS85b6nfcWS2XKJAQk4la9L47fPj 7xn4A+dTM2b2KA2rf6VFUAiVRThvQWyGnjC9xC+P0enTskZluUIFCq73l0h4UXzv AEWao2dpGw9FPhx1NFEMxGJI5PrwnIgw+Sch8= Received: from core.draftnet (client-86-27-21-134.glfd.adsl.virginmedia.com [86.27.21.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 27848E7174; Fri, 10 Dec 2010 08:58:38 +0000 (GMT) Date: Fri, 10 Dec 2010 08:58:28 +0000 From: Bruce Cran To: Bruce Evans Message-ID: <20101210085828.780e2d45@core.draftnet> In-Reply-To: <20101210092805.M8539@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <20101210092805.M8539@besplex.bde.org> X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 08:58:40 -0000 On Fri, 10 Dec 2010 10:12:34 +1100 (EST) Bruce Evans wrote: > The BIOS has little control over the mode. It can't enforce LBA if > the drive supports CHS. It can't force any particular CHS mode since > the driver may set any CHS mode. ata used to reset the drive in the > probe and in reinit. I think this is a hard reset which restores the > default CHS. I can't see where ata resets now. It is nicely > obfuscated using function pointers. I think it does less resetting. > It also has a soft reset for at least sata, but sata won't be using > CHS. Removing of resets would explain why it now has to use the > current CHS (since it doesn't change the CHS back to the default). The BIOS does seem to have complete control over the geometry that FreeBSD detects. Yes we'll use LBA mode if it's available, but what I'm talking about is the geometry that gets used for creating disklabels and the MBR. Since I saw the change in the BIOS reflected in what FreeBSD detected, it appears the BIOS has control over those values except when it decides to initially use LBA mode. > The driver always ignores CHS (except to report it) and uses LBA if > possible. If a manufacturer stops supporting CHS, then the driver > shouldn't notice, but the manufacturer's non-support should include > setting the obsolete fields to 0 (or possibly other specified magic > numbers). It is then up to utilities whether to report these fields > as simply there value or to decrypt their magic values into a CHS- > unsupported flag (I don't know of any actual flag for this). Then > there is the "firmware geometry" reported to GEOM. You could try > changing this to 0/0/0 and see what breaks. CAM for SCSI drives still > invents a geometry to avoid seeing evil here, since SCSI drives have > only had no geometry for about 30 years now. But the problem is that we _do_ use CHS: we use it to create the MBR and disklabel. Linux invents a geometry if it can't create one from the on-disk data; we don't. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 11:47:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AAB4106564A; Fri, 10 Dec 2010 11:47:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 92DAD8FC12; Fri, 10 Dec 2010 11:47:31 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBABl8BQ020974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Dec 2010 22:47:09 +1100 Date: Fri, 10 Dec 2010 22:47:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Erik Trulsson In-Reply-To: <20101210010023.GA68703@owl.midgard.homeip.net> Message-ID: <20101210213131.Y1980@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <20101210010023.GA68703@owl.midgard.homeip.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 11:47:32 -0000 On Fri, 10 Dec 2010, Erik Trulsson wrote: > On Thu, Dec 09, 2010 at 10:14:58PM +0000, Bruce Cran wrote: >> On Thu, 9 Dec 2010 19:58:56 +1100 (EST) >> Bruce Evans wrote: >> >>> I had understood the ATA_FLAG_54_58 backwards. It tells us if the >>> drive is not so old that it doesn't support IDENTIFY records for >>> words 54-58. I think we rarely get here. Drives old enough to use >>> CHS may be so old that they don't support words 54-58. Only drives >>> manufactured during a few years or months in the 1990's will support >>> words 54-58 but not LBA. Maybe I'm misremembering the length of this >>> time. >> >> All modern drives (including ATA-8) seem to support reporting the >> current CHS geometry, so FreeBSD will use this for the geometry; >> however since when the BIOS chooses to use LBA mode the "current >> geometry" words aren't updated I think we use the wrong geometry on >> modern drives. > > Modern drives do not really report 'the current CHS geometry'. They > report a fake geometry that normally do not have anything do with the > actual geometry. No. The report the current CHS translation mode (if they support CHS and also support programming the CHS translation). This is the 'current CHS geometry'. It is reported in words 54-58 (if programming the CHS translation is supported, and the drive is not so old as to not support words 54-58 to indicate that non-null programming has been done). It has nothing to do with any physical geometry, unless the drive is so old as to have a representable physical geometry, and the current CHS geometry equals the physical geometry (either by defaulting to it or by beinbg changed to it). But it is very real. You have to use it if you talk to the drive in CHS mode. The current CHS geometry should not be confused with the default CHS geometry. This is in words 1, 3 and 6. All drives that support CHS mode have this. On very very old drives, this is the physical geometry and there is no way to change it. On very old drives, this is a fake geometry and there is no way to change it. On old drives, this is a fake geometry and anyone can change it to another fake geometry. When the geometry is fake, it is really the current CHS translation mode, but that takes too long to write so everyone still calls it the geometry except when technical precision is required. > (As an example just about all modern ATA/SATA drives > report having 16 heads, while in reality none of them have more than 10 > heads and most of them have fewer heads than that.) That is their default CHS translation mode. Old drives reported having even more heads, so that all disk addresses could be represtented in CHS, but that started to break about 12 years ago when average drive sizes started exceeding 8GB, and broke about 10 years ago when average drive sizes started exceeding 32GB (8GB is where BIOSes start breaking and 32GB is where CHS translation breaks), so about 10 years ago ATA started specifying that the default CHS translation mode be H=16/S=63 for drives larger than a certain size since no CHS translation can cover the whole drive and H=16/S=63 is safer for the BIOSes that broke at 8GB. Except I think it changes the breakage point from 8GB to 512MB for some. However, if the drive supports programming the CHS translation, then anyone can change the translation. This is even useful. H=16/S=63 can only reach the first 512MB of a disk for very old BIOSes that don't change it and also have a limit of C=1024. Old BIOSes that change it but which still have a limit of C=1024 and which don't add an extra level of fakery (translation) can reach 8GB by changing it to H=255/S=63 (CHS supports H=256, but that is unsafe with most BIOSes since allthough the maximum number of fake heads with H=256 is 255, some BIOS interface store the number of heads in a byte, and 256 doesn't fit). Not so old BIOSes still have a limit of C=1024, but this is not a limit on CHS except on pre-IDE drives (I think this limit started at 256, then was increased to 1024, and finally to 65536 before the interface ran out of bits at 128GB and LBAA48 became required). > Finding out the real geometry of a disk is generally not possible and > typically cannot even be expressed with a simple C/H/S scheme, since the > 'S' component is usually not a constant. (Modern drives put more > sectors per track on the outer tracks than on the inner tracks.) No one cares about that. The BIOS gemetry needed for putting in MBR entries for old OS's and boot loaders is the fake geometry that is expected or supported by the old software. This is sometimes the default CHS translation mode. On OS's that need this, it is more often the current CHS translation mode. Since FreeBSD doesn't need this, it is rarely either of the CHS translation modes. Since FreeBSD doesn't support this, but still needs a fake geometry, the best it can do is report both CHS translations for external use and distinguish them from its internal fake geometry. > The only reason for actually using the geometry reported by the disk > for anything is if you need to have the partitioning of the disk > compatible with some other OS which does use the reported CHS values. > (E.g. if you have a dual-boot machine where FreeBSD shares the disk > with some other OS that insists on having partitions start exactly on a > track boundary, then FreeBSD would need to handle that somehow.) > But even then you are not really interested in using the 'correct' > geometry, but rather in using whatever geometry that other OS is using. Correct. FreeBSD used to support this, but GEOM dropped the support. In 386BSD, the geometry that seemed to be used in the partition table was even used by the driver (wd) to determine which geometry the CHS translation mode should be programmed to, or the default fixed CHS translation mode if the translation was invariant. The driver itself confused the geometry needed to talk to the drive with the one needed for the MBR. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 12:24:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39FCC106564A; Fri, 10 Dec 2010 12:24:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id C2ACE8FC18; Fri, 10 Dec 2010 12:24:42 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBACORwx002151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Dec 2010 23:24:28 +1100 Date: Fri, 10 Dec 2010 23:24:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <20101210085828.780e2d45@core.draftnet> Message-ID: <20101210225049.N1980@besplex.bde.org> References: <201012072046.oB7KkB4L079555@svn.freebsd.org> <4CFEAD09.30904@freebsd.org> <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <20101208153857.H1428@besplex.bde.org> <20101208225235.501ced0e@core.draftnet> <20101209191657.B1400@besplex.bde.org> <20101209221458.42448075@core.draftnet> <20101210092805.M8539@besplex.bde.org> <20101210085828.780e2d45@core.draftnet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org, Matthew Jacob Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 12:24:43 -0000 On Fri, 10 Dec 2010, Bruce Cran wrote: > On Fri, 10 Dec 2010 10:12:34 +1100 (EST) > Bruce Evans wrote: > >> The BIOS has little control over the mode. It can't enforce LBA if >> the drive supports CHS. It can't force any particular CHS mode since >> the driver may set any CHS mode. ata used to reset the drive in the >> probe and in reinit. I think this is a hard reset which restores the >> default CHS. I can't see where ata resets now. It is nicely >> obfuscated using function pointers. I think it does less resetting. >> It also has a soft reset for at least sata, but sata won't be using >> CHS. Removing of resets would explain why it now has to use the >> current CHS (since it doesn't change the CHS back to the default). > > The BIOS does seem to have complete control over the geometry that > FreeBSD detects. Not exactly. Anything that runs before FreeBSD can change the CHS translation if CHS translation is changable. Then FreeBSD will only detect the geometry set by the BIOS (if the BIOS changed the default) if its initialization doesn't clobber the setting before it is read. Since FreeBSD doesn't care about the geometry, it is only accidental if this happens. It didn't happen between at least 1992 and 2009 in 386BSD or FreeBSD, since the driver always reset the drive first. Now we care less about the geometry than in 1992. > Yes we'll use LBA mode if it's available, but what I'm > talking about is the geometry that gets used for creating disklabels > and the MBR. Since I saw the change in the BIOS reflected in what > FreeBSD detected, it appears the BIOS has control over those values > except when it decides to initially use LBA mode. The current geometry possibly changed by the BIOS is equally useless to the default geometry set by the drive. You cannot know if the BIOS changed it. My BIOSes don't seem to change it -- FreeBSD with GEOM has always reported the default CHS as the "firmware" geometry, but I mostly use versions of ata with the reset, and might not have noticed if this changed (I always configure BIOS to "LBA" CHS mode with H=255 and C=63 if possible, but have never seen the CHS make it to the driver). Newer BIOSes with not-so-old not-so-new drives actually have a better chance of setting the default translation mode to the fake one used in partition tables for old OSes and boot loaders than old ones. First, they won't be using CHS translation to talk to the drive, so they can change the current translation to anything without affection their operation, provided the drive is not so old as to not support changing the translation and not so new as to not support CHS and/or changing it. This also depends on the drive being fairly old, else it cannot be covered by any portable CHS. Second, they might have dropped support for old OSes and boot loaders and not really support CHS except for the limit range that it can cover. Then all OSes and boot loaders on the drive must be either not using CHS or be using the limited range that it can cover. >> The driver always ignores CHS (except to report it) and uses LBA if >> possible. If a manufacturer stops supporting CHS, then the driver >> shouldn't notice, but the manufacturer's non-support should include >> setting the obsolete fields to 0 (or possibly other specified magic >> numbers). It is then up to utilities whether to report these fields >> as simply there value or to decrypt their magic values into a CHS- >> unsupported flag (I don't know of any actual flag for this). Then >> there is the "firmware geometry" reported to GEOM. You could try >> changing this to 0/0/0 and see what breaks. CAM for SCSI drives still >> invents a geometry to avoid seeing evil here, since SCSI drives have >> only had no geometry for about 30 years now. > > But the problem is that we _do_ use CHS: we use it to create the MBR > and disklabel. Linux invents a geometry if it can't create one from the > on-disk data; we don't. Even if it can't create on from the on-disk data? FreeBSD doesn't do that now, but used to. bsdBSD still does it. One thing I missed was creating a better default when there is no on-disk data. cam_calc_geometry() is good for that. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 14:04:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C28A106564A; Fri, 10 Dec 2010 14:04:42 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BBAD8FC1A; Fri, 10 Dec 2010 14:04:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBAE4gBo076109; Fri, 10 Dec 2010 14:04:42 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBAE4f1d076107; Fri, 10 Dec 2010 14:04:41 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201012101404.oBAE4f1d076107@svn.freebsd.org> From: Joerg Wunsch Date: Fri, 10 Dec 2010 14:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216355 - head/sys/dev/ieee488 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 14:04:42 -0000 Author: joerg Date: Fri Dec 10 14:04:41 2010 New Revision: 216355 URL: http://svn.freebsd.org/changeset/base/216355 Log: Fix __retval vs. retval confusion: retval is meant to store the (userland) pointer where data is to be returned by ibask() (currently unimplemented), while __retval holds the value returned by the libgpib ibfoo() functions. The confusion resulted in the ibfoo() functions returning an uninitialized value except in situations where the GPIB activity has been terminated abnormally. MFC after: 3 days Modified: head/sys/dev/ieee488/ibfoo.c Modified: head/sys/dev/ieee488/ibfoo.c ============================================================================== --- head/sys/dev/ieee488/ibfoo.c Fri Dec 10 11:02:59 2010 (r216354) +++ head/sys/dev/ieee488/ibfoo.c Fri Dec 10 14:04:41 2010 (r216355) @@ -1019,7 +1019,7 @@ gpib_ib_ioctl(struct cdev *dev, u_long c ap->__iberr = 0; ap->__ibsta = 0; ap->__ibcnt = 0; - ap->retval = 0; + ap->__retval = 0; if (ap->__field & __F_TMO) { if (ap->tmo < 0 || ap->tmo >= max_timeouts) From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 15:05:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4CFE106564A; Fri, 10 Dec 2010 15:05:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48328FC0A; Fri, 10 Dec 2010 15:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBAF5nYQ077456; Fri, 10 Dec 2010 15:05:49 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBAF5n9X077454; Fri, 10 Dec 2010 15:05:49 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201012101505.oBAF5n9X077454@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 10 Dec 2010 15:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216358 - head/sys/dev/le X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 15:05:49 -0000 Author: tijl Date: Fri Dec 10 15:05:49 2010 New Revision: 216358 URL: http://svn.freebsd.org/changeset/base/216358 Log: Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io. Approved by: kib (mentor) Modified: head/sys/dev/le/if_le_pci.c Modified: head/sys/dev/le/if_le_pci.c ============================================================================== --- head/sys/dev/le/if_le_pci.c Fri Dec 10 14:07:08 2010 (r216357) +++ head/sys/dev/le/if_le_pci.c Fri Dec 10 15:05:49 2010 (r216358) @@ -312,7 +312,7 @@ le_pci_attach(device_t dev) LE_LOCK_INIT(sc, device_get_nameunit(dev)); pci_enable_busmaster(dev); - pci_enable_io(dev, PCIM_CMD_PORTEN); + pci_enable_io(dev, SYS_RES_IOPORT); i = PCIR_BAR(0); lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 15:52:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF921065670; Fri, 10 Dec 2010 15:52:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E83B48FC1A; Fri, 10 Dec 2010 15:52:07 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7E4DC46B35; Fri, 10 Dec 2010 10:52:07 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 59D698A01D; Fri, 10 Dec 2010 10:52:06 -0500 (EST) From: John Baldwin To: Tijl Coosemans Date: Fri, 10 Dec 2010 10:31:36 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012101505.oBAF5n9X077454@svn.freebsd.org> In-Reply-To: <201012101505.oBAF5n9X077454@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012101031.36641.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 10 Dec 2010 10:52:06 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216358 - head/sys/dev/le X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 15:52:08 -0000 On Friday, December 10, 2010 10:05:49 am Tijl Coosemans wrote: > Author: tijl > Date: Fri Dec 10 15:05:49 2010 > New Revision: 216358 > URL: http://svn.freebsd.org/changeset/base/216358 > > Log: > Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io. > > Approved by: kib (mentor) To be honest, bus_alloc_resource() with RF_ACTIVE will set PORTEN or MEMEN for you. Drivers should no longer be calling pci_enable_io() by hand. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 16:52:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48D35106566C; Fri, 10 Dec 2010 16:52:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 198228FC13; Fri, 10 Dec 2010 16:52:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A741446B03; Fri, 10 Dec 2010 11:52:39 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 817C98A01D; Fri, 10 Dec 2010 11:52:38 -0500 (EST) From: John Baldwin To: Tijl Coosemans Date: Fri, 10 Dec 2010 11:52:24 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012101505.oBAF5n9X077454@svn.freebsd.org> <201012101031.36641.jhb@freebsd.org> <201012101736.25488.tijl@freebsd.org> In-Reply-To: <201012101736.25488.tijl@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201012101152.24843.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 10 Dec 2010 11:52:38 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216358 - head/sys/dev/le X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 16:52:40 -0000 On Friday, December 10, 2010 11:36:17 am Tijl Coosemans wrote: > On Friday 10 December 2010 16:31:36 John Baldwin wrote: > > On Friday, December 10, 2010 10:05:49 am Tijl Coosemans wrote: > >> Author: tijl > >> Date: Fri Dec 10 15:05:49 2010 > >> New Revision: 216358 > >> URL: http://svn.freebsd.org/changeset/base/216358 > >> > >> Log: > >> Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io. > >> > >> Approved by: kib (mentor) > > > > To be honest, bus_alloc_resource() with RF_ACTIVE will set PORTEN or MEMEN for > > you. Drivers should no longer be calling pci_enable_io() by hand. > > Looking into this, in dev/sound/pci/atiixp.c and dev/sound/pci/ich.c it > is used during resume. Can those calls be removed as well? Yes, we save and restore the command register (along with other standard header registers like BARs, etc.) across suspend and resume in the PCI bus layer. > And in dev/mpt/mpt.c pci_enable_io and pci_disable_io are called in a > number of places. Those should probably all stay? Yes, that appears to be a workaround for a quirk in the hardware. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 17:06:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20DF106566C; Fri, 10 Dec 2010 17:06:03 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id D86BA8FC0A; Fri, 10 Dec 2010 17:06:02 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAEjlAU1bseB9/2dsb2JhbACkAnm/Q4VKBA Received: from 125.224-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.224.125]) by relay.skynet.be with ESMTP; 10 Dec 2010 17:36:27 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id oBAGaRkA004404; Fri, 10 Dec 2010 17:36:27 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: John Baldwin Date: Fri, 10 Dec 2010 17:36:17 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.5.2; i386; ; ) References: <201012101505.oBAF5n9X077454@svn.freebsd.org> <201012101031.36641.jhb@freebsd.org> In-Reply-To: <201012101031.36641.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1602656.uXkA9cfRbB"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201012101736.25488.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216358 - head/sys/dev/le X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 17:06:03 -0000 --nextPart1602656.uXkA9cfRbB Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Friday 10 December 2010 16:31:36 John Baldwin wrote: > On Friday, December 10, 2010 10:05:49 am Tijl Coosemans wrote: >> Author: tijl >> Date: Fri Dec 10 15:05:49 2010 >> New Revision: 216358 >> URL: http://svn.freebsd.org/changeset/base/216358 >>=20 >> Log: >> Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_= io. >> =20 >> Approved by: kib (mentor) >=20 > To be honest, bus_alloc_resource() with RF_ACTIVE will set PORTEN or MEME= N for=20 > you. Drivers should no longer be calling pci_enable_io() by hand. Looking into this, in dev/sound/pci/atiixp.c and dev/sound/pci/ich.c it is used during resume. Can those calls be removed as well? And in dev/mpt/mpt.c pci_enable_io and pci_disable_io are called in a number of places. Those should probably all stay? All other cases are during device attach with bus_alloc_resource+RF_ACTIVE before or after. --nextPart1602656.uXkA9cfRbB Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAk0CVwkACgkQfoCS2CCgtit9rAD/bYOGsE+x2Zg1Vfz9c/AOriT1 ELRbquSk702wVQBC0xUA/jZmQWj4Zg9YrtJAqENQEAB0iQrD+P1kP6DT7NxCZwUy =Kk3z -----END PGP SIGNATURE----- --nextPart1602656.uXkA9cfRbB-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 18:04:35 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A631065673; Fri, 10 Dec 2010 18:04:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A6CFD8FC17; Fri, 10 Dec 2010 18:04:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBAHr5hu002079; Fri, 10 Dec 2010 10:53:06 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 10 Dec 2010 10:53:05 -0700 (MST) Message-Id: <20101210.105305.74748688.imp@bsdimp.com> To: mj@feral.com From: Warner Losh In-Reply-To: <4CFEBF27.8010203@feral.com> References: <4CFEAFA6.4020103@feral.com> <4CFEB1AD.70906@freebsd.org> <4CFEBF27.8010203@feral.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, avg@FreeBSD.org, brucec@FreeBSD.org Subject: Re: svn commit: r216269 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 18:04:35 -0000 From: Matthew Jacob > Geometry is still important. Trying booting a USB flash drive on all > BIOS' with a 63/255 geometry instead of a 64/32 geometry. At least most modern BIOSes I've had to deal with can be configured to use packet mode which makes the problem go away... Don't know if I'm lucky or if that's really wide spread... Warner From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 20:27:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF9B10656AC; Fri, 10 Dec 2010 20:27:50 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6198FC24; Fri, 10 Dec 2010 20:27:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBAKRowZ084683; Fri, 10 Dec 2010 20:27:50 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBAKRodg084681; Fri, 10 Dec 2010 20:27:50 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201012102027.oBAKRodg084681@svn.freebsd.org> From: Andreas Tobler Date: Fri, 10 Dec 2010 20:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216360 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 20:27:50 -0000 Author: andreast Date: Fri Dec 10 20:27:50 2010 New Revision: 216360 URL: http://svn.freebsd.org/changeset/base/216360 Log: On the Xserve G5 we find the LM75 instead of the DS1775. The core functionality is the same, a difference is that the DS1775 has a better precision than the LM75. But we do not use it in our setup. Make the LM75 work the same as the DS1775. Fix a typo in device_set_desc. Tested by: Paul Mather Approved by: nwhitehorn (mentor) Modified: head/sys/dev/iicbus/ds1775.c Modified: head/sys/dev/iicbus/ds1775.c ============================================================================== --- head/sys/dev/iicbus/ds1775.c Fri Dec 10 15:37:54 2010 (r216359) +++ head/sys/dev/iicbus/ds1775.c Fri Dec 10 20:27:50 2010 (r216360) @@ -127,14 +127,15 @@ ds1775_probe(device_t dev) return (ENXIO); if (strcmp(name, "temp-monitor") != 0 || - strcmp(compatible, "ds1775") != 0) + (strcmp(compatible, "ds1775") != 0 && + strcmp(compatible, "lm75") != 0)) return (ENXIO); sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_addr = iicbus_get_addr(dev); - device_set_desc(dev, "Temp-Monitor DS1755"); + device_set_desc(dev, "Temp-Monitor DS1775"); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 21:38:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22915106566B; Fri, 10 Dec 2010 21:38:52 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 106B58FC08; Fri, 10 Dec 2010 21:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBALcp5o086338; Fri, 10 Dec 2010 21:38:51 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBALcpJs086334; Fri, 10 Dec 2010 21:38:51 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201012102138.oBALcpJs086334@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Dec 2010 21:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216361 - in head: sbin/camcontrol sys/cam sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 21:38:52 -0000 Author: ken Date: Fri Dec 10 21:38:51 2010 New Revision: 216361 URL: http://svn.freebsd.org/changeset/base/216361 Log: Fix a few issues related to the XPT_GDEV_ADVINFO CCB. camcontrol.c: In buildbusdevlist(), don't attempt to get call getdevid() for an unconfigured device, even when the verbose flag is set. The cam_open_btl() call will almost certainly fail. Probe for the buffer size when issuing the XPT_GDEV_ADVINFO CCB. Probing for the buffer size first helps us avoid allocating the maximum buffer size when it really may not be necessary. This also helps avoid errors from cam_periph_mapmem() if we attempt to map more than MAXPHYS. cam_periph.c: In cam_periph_mapmem(), if the XPT_GDEV_ADVINFO CCB shows a bufsiz of 0, we don't have anything to map, so just return. Also, set the maximum mapping size to MAXPHYS instead of DFLTPHYS for XPT_GDEV_ADVINFO CCBs, since they don't actually go down to the hardware. scsi_pass.c: Don't bother mapping the buffer in XPT_GDEV_ADVINFO CCBs if bufsiz is 0. Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_pass.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Dec 10 20:27:50 2010 (r216360) +++ head/sbin/camcontrol/camcontrol.c Fri Dec 10 21:38:51 2010 (r216361) @@ -5026,14 +5026,7 @@ getdevid(struct cam_devitem *item) goto bailout; } - item->device_id_len = CAM_SCSI_DEVID_MAXLEN; - item->device_id = malloc(item->device_id_len); - if (item->device_id == NULL) { - warn("%s: unable to allocate %d bytes", __func__, - item->device_id_len); - retval = 1; - goto bailout; - } + item->device_id_len = 0; ccb = cam_getccb(dev); if (ccb == NULL) { @@ -5044,12 +5037,19 @@ getdevid(struct cam_devitem *item) bzero(&(&ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); + + /* + * On the first try, we just probe for the size of the data, and + * then allocate that much memory and try again. + */ +retry: ccb->ccb_h.func_code = XPT_GDEV_ADVINFO; ccb->ccb_h.flags = CAM_DIR_IN; ccb->cgdai.flags = CGDAI_FLAG_PROTO; ccb->cgdai.buftype = CGDAI_TYPE_SCSI_DEVID; ccb->cgdai.bufsiz = item->device_id_len; - ccb->cgdai.buf = (uint8_t *)item->device_id; + if (item->device_id_len != 0) + ccb->cgdai.buf = (uint8_t *)item->device_id; if (cam_send_ccb(dev, ccb) < 0) { warn("%s: error sending XPT_GDEV_ADVINFO CCB", __func__); @@ -5063,6 +5063,29 @@ getdevid(struct cam_devitem *item) goto bailout; } + if (item->device_id_len == 0) { + /* + * This is our first time through. Allocate the buffer, + * and then go back to get the data. + */ + if (ccb->cgdai.provsiz == 0) { + warnx("%s: invalid .provsiz field returned with " + "XPT_GDEV_ADVINFO CCB", __func__); + retval = 1; + goto bailout; + } + item->device_id_len = ccb->cgdai.provsiz; + item->device_id = malloc(item->device_id_len); + if (item->device_id == NULL) { + warn("%s: unable to allocate %d bytes", __func__, + item->device_id_len); + retval = 1; + goto bailout; + } + ccb->ccb_h.status = CAM_REQ_INPROG; + goto retry; + } + bailout: if (dev != NULL) cam_close_device(dev); @@ -5158,9 +5181,8 @@ buildbusdevlist(struct cam_devlist *devl dev_result = &ccb.cdm.matches[i].result.device_result; - if ((dev_result->flags - & DEV_RESULT_UNCONFIGURED) - && ((arglist & CAM_ARG_VERBOSE) == 0)) { + if (dev_result->flags & + DEV_RESULT_UNCONFIGURED) { skip_device = 1; break; } else Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Dec 10 20:27:50 2010 (r216360) +++ head/sys/cam/cam_periph.c Fri Dec 10 21:38:51 2010 (r216361) @@ -658,10 +658,19 @@ cam_periph_mapmem(union ccb *ccb, struct numbufs = 2; break; case XPT_GDEV_ADVINFO: + if (ccb->cgdai.bufsiz == 0) + return (0); + data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf; lengths[0] = ccb->cgdai.bufsiz; dirs[0] = CAM_DIR_IN; numbufs = 1; + + /* + * This request will not go to the hardware, no reason + * to be so strict. vmapbuf() is able to map up to MAXPHYS. + */ + maxmap = MAXPHYS; break; default: return(EINVAL); Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Fri Dec 10 20:27:50 2010 (r216360) +++ head/sys/cam/scsi/scsi_pass.c Fri Dec 10 21:38:51 2010 (r216361) @@ -525,9 +525,9 @@ passsendccb(struct cam_periph *periph, u * if they haven't passed in a physical memory pointer, * and if there is actually an I/O operation to perform. * cam_periph_mapmem() supports SCSI, ATA, SMP, ADVINFO and device - * match CCBs. For the SCSI and ATA CCBs, we only pass the CCB in if - * there's actually data to map. cam_periph_mapmem() will do the - * right thing, even if there isn't data to map, but since CCBs + * match CCBs. For the SCSI, ATA and ADVINFO CCBs, we only pass the + * CCB in if there's actually data to map. cam_periph_mapmem() will + * do the right thing, even if there isn't data to map, but since CCBs * without data are a reasonably common occurance (e.g. test unit * ready), it will save a few cycles if we check for it here. */ @@ -537,7 +537,8 @@ passsendccb(struct cam_periph *periph, u && ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)) || (ccb->ccb_h.func_code == XPT_DEV_MATCH) || (ccb->ccb_h.func_code == XPT_SMP_IO) - || (ccb->ccb_h.func_code == XPT_GDEV_ADVINFO))) { + || ((ccb->ccb_h.func_code == XPT_GDEV_ADVINFO) + && (ccb->cgdai.bufsiz > 0)))) { bzero(&mapinfo, sizeof(mapinfo)); From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 21:43:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFEF81065670; Fri, 10 Dec 2010 21:43:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4C978FC13; Fri, 10 Dec 2010 21:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBALhKO8086487; Fri, 10 Dec 2010 21:43:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBALhK0i086484; Fri, 10 Dec 2010 21:43:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012102143.oBALhK0i086484@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 10 Dec 2010 21:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216362 - in head/sys/dev: alc jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 21:43:20 -0000 Author: yongari Date: Fri Dec 10 21:43:20 2010 New Revision: 216362 URL: http://svn.freebsd.org/changeset/base/216362 Log: Remove unecessary and clearly wrong usage of atomic(9). Reported by: avg, jhb, attilio Modified: head/sys/dev/alc/if_alc.c head/sys/dev/jme/if_jme.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Dec 10 21:38:51 2010 (r216361) +++ head/sys/dev/alc/if_alc.c Fri Dec 10 21:43:20 2010 (r216362) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2668,9 +2667,10 @@ alc_int_task(void *arg, int pending) ifp = sc->alc_ifp; status = CSR_READ_4(sc, ALC_INTR_STATUS); - more = atomic_readandclear_int(&sc->alc_morework); - if (more != 0) + if (sc->alc_morework != 0) { + sc->alc_morework = 0; status |= INTR_RX_PKT; + } if ((status & ALC_INTRS) == 0) goto done; @@ -2682,7 +2682,7 @@ alc_int_task(void *arg, int pending) if ((status & INTR_RX_PKT) != 0) { more = alc_rxintr(sc, sc->alc_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->alc_morework, 1); + sc->alc_morework = 1; else if (more == EIO) { ALC_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Dec 10 21:38:51 2010 (r216361) +++ head/sys/dev/jme/if_jme.c Fri Dec 10 21:43:20 2010 (r216362) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2181,7 +2180,7 @@ jme_link_task(void *arg, int pending) * procuder/consumer index. */ sc->jme_cdata.jme_rx_cons = 0; - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; jme_init_tx_ring(sc); /* Initialize shadow status block. */ jme_init_ssb(sc); @@ -2251,10 +2250,9 @@ jme_int_task(void *arg, int pending) ifp = sc->jme_ifp; status = CSR_READ_4(sc, JME_INTR_STATUS); - more = atomic_readandclear_int(&sc->jme_morework); - if (more != 0) { + if (sc->jme_morework != 0) { + sc->jme_morework = 0; status |= INTR_RXQ_COAL | INTR_RXQ_COAL_TO; - more = 0; } if ((status & JME_INTRS) == 0 || status == 0xFFFFFFFF) goto done; @@ -2270,7 +2268,7 @@ jme_int_task(void *arg, int pending) if ((status & (INTR_RXQ_COAL | INTR_RXQ_COAL_TO)) != 0) { more = jme_rxintr(sc, sc->jme_process_limit); if (more != 0) - atomic_set_int(&sc->jme_morework, 1); + sc->jme_morework = 1; } if ((status & INTR_RXQ_DESC_EMPTY) != 0) { /* @@ -2980,7 +2978,7 @@ jme_init_rx_ring(struct jme_softc *sc) sc->jme_cdata.jme_rx_cons = 0; JME_RXCHAIN_RESET(sc); - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; rd = &sc->jme_rdata; bzero(rd->jme_rx_ring, JME_RX_RING_SIZE); From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 21:45:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB963106567A; Fri, 10 Dec 2010 21:45:10 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A11F8FC21; Fri, 10 Dec 2010 21:45:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBALjADJ086577; Fri, 10 Dec 2010 21:45:10 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBALjAv7086574; Fri, 10 Dec 2010 21:45:10 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201012102145.oBALjAv7086574@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Dec 2010 21:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216363 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 21:45:10 -0000 Author: ken Date: Fri Dec 10 21:45:10 2010 New Revision: 216363 URL: http://svn.freebsd.org/changeset/base/216363 Log: Fix an event handling bug with the mps(4) driver. This bug manifested itself after repeated device arrivals and departures. The root of the problem was that the last entry in the reply array wasn't initialized/allocated. So every time we got around to that event, we had a bogus address. There were a couple more problems with the code that are also fixed: - The reply mechanism was being treated as sequential (indexed by sc->replycurindex) even though the spec says that the driver should use the ReplyFrameAddress field of the post queue descriptor to figure out where the reply is. There is no guarantee that the reply descriptors will be used in sequential order. - The second word of the reply post queue descriptor wasn't being checked in mps_intr_locked() to make sure that it wasn't 0xffffffff. So the driver could potentially come across a partially DMAed descriptor. - The number of replies allocated was one less than the actual size of the queue. Instead, it was the size of the number of replies that can be used at one time. (Which is one less than the size of the queue.) mps.c: When initializing the entries in the reply free queue, make sure we initialize the full number that we tell the chip we have (sc->fqdepth), not the number that can be used at any one time (sc->num_replies). When allocating replies, make sure we allocate the number of replies that we've told the chip exist, not just the number that can be used simultaneously. Use the ReplyFrameAddress field of the post queue descriptor to figure out which reply is being referenced. This is what the spec says to do, and the spec doesn't guarantee that the replies will be used in order. Put a check in to verify that the reply address passed back from the card is valid. (Panic if it isn't, we'll panic when we try to deference the reply pointer in any case.) In mps_intr_locked(), verify that the second word of the post queue descriptor is not 0xffffffff in addition to verifying that the unused flag is not set, so we can make sure we didn't get a partially DMAed descriptor. Remove references to sc->replycurindex, it isn't needed now. mpsvar.h: Remove replycurindex from the softc, it isn't needed now. Reviewed by: scottl Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Dec 10 21:43:20 2010 (r216362) +++ head/sys/dev/mps/mps.c Fri Dec 10 21:45:10 2010 (r216363) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -607,9 +608,16 @@ mps_alloc_queues(struct mps_softc *sc) static int mps_alloc_replies(struct mps_softc *sc) { - int rsize; + int rsize, num_replies; - rsize = sc->facts->ReplyFrameSize * sc->num_replies * 4; + /* + * sc->num_replies should be one less than sc->fqdepth. We need to + * allocate space for sc->fqdepth replies, but only sc->num_replies + * replies can be used at once. + */ + num_replies = max(sc->fqdepth, sc->num_replies); + + rsize = sc->facts->ReplyFrameSize * num_replies * 4; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -782,11 +790,19 @@ mps_init_queues(struct mps_softc *sc) memset((uint8_t *)sc->post_queue, 0xff, sc->pqdepth * 8); + /* + * According to the spec, we need to use one less reply than we + * have space for on the queue. So sc->num_replies (the number we + * use) should be less than sc->fqdepth (allocated size). + */ if (sc->num_replies >= sc->fqdepth) return (EINVAL); - for (i = 0; i < sc->num_replies; i++) - sc->free_queue[i] = sc->reply_busaddr + i * sc->facts->ReplyFrameSize * 4; + /* + * Initialize all of the free queue entries. + */ + for (i = 0; i < sc->fqdepth; i++) + sc->free_queue[i] = sc->reply_busaddr + (i * sc->facts->ReplyFrameSize * 4); sc->replyfreeindex = sc->num_replies; return (0); @@ -907,7 +923,6 @@ mps_attach(struct mps_softc *sc) * replies. */ sc->replypostindex = 0; - sc->replycurindex = 0; mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); @@ -1211,7 +1226,8 @@ mps_intr_locked(void *data) desc = &sc->post_queue[pq]; flags = desc->Default.ReplyFlags & MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK; - if (flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED) + if ((flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED) + || (desc->Words.High == 0xffffffff)) break; switch (flags) { @@ -1224,9 +1240,36 @@ mps_intr_locked(void *data) uint32_t baddr; uint8_t *reply; + /* + * Re-compose the reply address from the address + * sent back from the chip. The ReplyFrameAddress + * is the lower 32 bits of the physical address of + * particular reply frame. Convert that address to + * host format, and then use that to provide the + * offset against the virtual address base + * (sc->reply_frames). + */ + baddr = le32toh(desc->AddressReply.ReplyFrameAddress); reply = sc->reply_frames + - sc->replycurindex * sc->facts->ReplyFrameSize * 4; - baddr = desc->AddressReply.ReplyFrameAddress; + (baddr - ((uint32_t)sc->reply_busaddr)); + /* + * Make sure the reply we got back is in a valid + * range. If not, go ahead and panic here, since + * we'll probably panic as soon as we deference the + * reply pointer anyway. + */ + if ((reply < sc->reply_frames) + || (reply > (sc->reply_frames + + (sc->fqdepth * sc->facts->ReplyFrameSize * 4)))) { + printf("%s: WARNING: reply %p out of range!\n", + __func__, reply); + printf("%s: reply_frames %p, fqdepth %d, " + "frame size %d\n", __func__, + sc->reply_frames, sc->fqdepth, + sc->facts->ReplyFrameSize * 4); + printf("%s: baddr %#x,\n", __func__, baddr); + panic("Reply address out of range"); + } if (desc->AddressReply.SMID == 0) { mps_dispatch_event(sc, baddr, (MPI2_EVENT_NOTIFICATION_REPLY *) reply); @@ -1236,8 +1279,6 @@ mps_intr_locked(void *data) cm->cm_reply_data = desc->AddressReply.ReplyFrameAddress; } - if (++sc->replycurindex >= sc->fqdepth) - sc->replycurindex = 0; break; } case MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS: Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Fri Dec 10 21:43:20 2010 (r216362) +++ head/sys/dev/mps/mpsvar.h Fri Dec 10 21:45:10 2010 (r216363) @@ -135,7 +135,6 @@ struct mps_softc { TAILQ_HEAD(, mps_command) tm_list; int replypostindex; int replyfreeindex; - int replycurindex; struct resource *mps_regs_resource; bus_space_handle_t mps_bhandle; From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 22:20:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD3510656C3; Fri, 10 Dec 2010 22:20:12 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25C358FC08; Fri, 10 Dec 2010 22:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBAMKCja087317; Fri, 10 Dec 2010 22:20:12 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBAMKCXb087315; Fri, 10 Dec 2010 22:20:12 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201012102220.oBAMKCXb087315@svn.freebsd.org> From: Joerg Wunsch Date: Fri, 10 Dec 2010 22:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216364 - head/sys/dev/ieee488 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 22:20:12 -0000 Author: joerg Date: Fri Dec 10 22:20:11 2010 New Revision: 216364 URL: http://svn.freebsd.org/changeset/base/216364 Log: Implement more of __ibsta: END and SRQI status bits (taken out of the uPD7210 IRQ status). MFC after: 1 week Modified: head/sys/dev/ieee488/ibfoo.c Modified: head/sys/dev/ieee488/ibfoo.c ============================================================================== --- head/sys/dev/ieee488/ibfoo.c Fri Dec 10 21:45:10 2010 (r216363) +++ head/sys/dev/ieee488/ibfoo.c Fri Dec 10 22:20:11 2010 (r216364) @@ -333,6 +333,14 @@ gpib_ib_wait_xfer(struct upd7210 *u, str break; } } + if ((u->rreg[ISR1] & IXR1_ENDRX) != 0) { + ib->ap->__retval |= END; + ib->ap->__ibsta |= END; + } + if ((u->rreg[ISR2] & IXR2_SRQI) != 0) { + ib->ap->__retval |= SRQI; + ib->ap->__ibsta |= SRQI; + } ib->mode = BUSY; ib->buf = NULL; upd7210_wr(u, IMR1, 0); From owner-svn-src-head@FreeBSD.ORG Fri Dec 10 22:22:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55C8106566C; Fri, 10 Dec 2010 22:22:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3EDA8FC0A; Fri, 10 Dec 2010 22:22:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBAMM1Hv087402; Fri, 10 Dec 2010 22:22:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBAMM1JP087400; Fri, 10 Dec 2010 22:22:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012102222.oBAMM1JP087400@svn.freebsd.org> From: Robert Watson Date: Fri, 10 Dec 2010 22:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216365 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 22:22:02 -0000 Author: rwatson Date: Fri Dec 10 22:22:01 2010 New Revision: 216365 URL: http://svn.freebsd.org/changeset/base/216365 Log: Derive the XENHVM kernel from GENERIC, adding only the options required to support PV drivers (such as xenpci), and non-adptive locking (along with a comment about why). This change eliminates the synchronisation problem between GENERIC and XENHVM, which had become severely rotted in HEAD, and in 8-STABLE included non-production kernel debugging features such as WITNESS. However, it comes at the cost of enabling devices and options that may not be present under Xen (such as random ethernet cards). For now, opt for a simpler kernel configuration file rather than using nooptions/ nodevice to enumerate and eliminate them. This leads to a somewhat larger XENHVM kernel. This is an MFC candidate for 8-STABLE before 8.2, in order to provide a production-worthy XENHVM kernel configuration for amd64. Discussed with: gibbs, cperciva Reported by: Piete Brooks Sponsored by: DARPA, AFRL MFC after: 3 days Modified: head/sys/amd64/conf/XENHVM Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Fri Dec 10 22:20:11 2010 (r216364) +++ head/sys/amd64/conf/XENHVM Fri Dec 10 22:22:01 2010 (r216365) @@ -1,152 +1,23 @@ # # XENHVM -- Xen HVM kernel configuration file for FreeBSD/amd64 # -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# # $FreeBSD$ - -cpu HAMMER +# +include GENERIC ident XENHVM -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" -options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options MD_ROOT # MD is a potential root device -options NFSCLIENT # Network Filesystem Client -options NFSSERVER # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options GEOM_PART_GPT # GUID Partition Tables. -options GEOM_LABEL # Provides labelization -options COMPAT_FREEBSD32 # Compatible with i386 binaries -options COMPAT_FREEBSD4 # Compatible with FreeBSD4 -options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options STACK # stack(9) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) -options AUDIT # Security event auditing -#options KDTRACE_FRAME # Ensure frames are compiled in -#options KDTRACE_HOOKS # Kernel DTrace hooks +# +# Adaptive locks rely on a lock-free pointer read to determine the run state +# of the thread holding a lock when under contention; under a virtualisation +# system, the thread run state may not accurately reflect whether the thread +# (or rather its host VCPU) is actually executing. As such, disable this +# optimisation. +# options NO_ADAPTIVE_MUTEXES options NO_ADAPTIVE_RWLOCKS -# Debugging for use in -current -options KDB # Enable kernel debugger support. -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - -# Make an SMP-capable kernel by default -options SMP # Symmetric MultiProcessor Kernel - -# CPU frequency control -device cpufreq - -# Bus support. -device acpi -device pci - -# Floppy drives -device fdc - # Xen HVM support options XENHVM device xenpci - -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering - -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) - - -# atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse - -device kbdmux # keyboard multiplexer - -device vga # VGA video card driver - -device splash # Splash screen and screen saver support - -# syscons is the default console driver, resembling an SCO console -device sc - -device agp # support several AGP chipsets - -# Serial (COM) ports -device uart # Generic UART driver - -# PCI Ethernet NICs that use the common MII bus controller code. -# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device re # RealTek 8139C+/8169/8169S/8110S - -# Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device tun # Packet tunnel. -device pty # BSD-style compatibility pseudo ttys -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module - -# The `bpf' device enables the Berkeley Packet Filter. -# Be aware of the administrative consequences of enabling this! -# Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 00:36:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B7F106566B; Sat, 11 Dec 2010 00:36:35 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0B88FC0A; Sat, 11 Dec 2010 00:36:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBB0aZTH090254; Sat, 11 Dec 2010 00:36:35 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBB0aZCi090252; Sat, 11 Dec 2010 00:36:35 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201012110036.oBB0aZCi090252@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 11 Dec 2010 00:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216368 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 00:36:35 -0000 Author: ken Date: Sat Dec 11 00:36:35 2010 New Revision: 216368 URL: http://svn.freebsd.org/changeset/base/216368 Log: Fix setting LUN numbers in the mps(4) driver. Prior to this change, the addressing method wasn't getting set, and so the LUN field could be set incorrectly in some instances. This fix should allow for LUN numbers up to 16777215 (and return an error for anything larger, which wouldn't fit into the flat addressing model). Submitted by: scottl (in part) Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Dec 10 23:57:55 2010 (r216367) +++ head/sys/dev/mps/mps_sas.c Sat Dec 11 00:36:35 2010 (r216368) @@ -121,6 +121,7 @@ struct mpssas_devprobe { MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); +static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, struct mpssas_target *); static struct mpssas_target * mpssas_find_target(struct mpssas_softc *, int, @@ -163,6 +164,43 @@ static void mpssas_resetdev_complete(str static void mpssas_freeze_device(struct mpssas_softc *, struct mpssas_target *); static void mpssas_unfreeze_device(struct mpssas_softc *, struct mpssas_target *) __unused; +/* + * Abstracted so that the driver can be backwards and forwards compatible + * with future versions of CAM that will provide this functionality. + */ +#define MPS_SET_LUN(lun, ccblun) \ + mpssas_set_lun(lun, ccblun) + +static __inline int +mpssas_set_lun(uint8_t *lun, u_int ccblun) +{ + uint64_t *newlun; + + newlun = (uint64_t *)lun; + *newlun = 0; + if (ccblun <= 0xff) { + /* Peripheral device address method, LUN is 0 to 255 */ + lun[1] = ccblun; + } else if (ccblun <= 0x3fff) { + /* Flat space address method, LUN is <= 16383 */ + scsi_ulto2b(ccblun, lun); + lun[0] |= 0x40; + } else if (ccblun <= 0xffffff) { + /* Extended flat space address method, LUN is <= 16777215 */ + scsi_ulto3b(ccblun, &lun[1]); + /* Extended Flat space address method */ + lun[0] = 0xc0; + /* Length = 1, i.e. LUN is 3 bytes long */ + lun[0] |= 0x10; + /* Extended Address Method */ + lun[0] |= 0x02; + } else { + return (EINVAL); + } + + return (0); +} + static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *sassc, struct mpssas_target *probe) { @@ -1366,14 +1404,12 @@ mpssas_action_scsiio(struct mpssas_softc break; } - /* XXX Need to handle multi-level LUNs */ - if (csio->ccb_h.target_lun > 255) { + if (MPS_SET_LUN(req->LUN, csio->ccb_h.target_lun) != 0) { mps_free_command(sc, cm); ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); return; } - req->LUN[1] = csio->ccb_h.target_lun; if (csio->ccb_h.flags & CAM_CDB_POINTER) bcopy(csio->cdb_io.cdb_ptr, &req->CDB.CDB32[0], csio->cdb_len); From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 08:07:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76A91065674; Sat, 11 Dec 2010 08:07:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9740E8FC43; Sat, 11 Dec 2010 08:07:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBB87L0X099231; Sat, 11 Dec 2010 08:07:21 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBB87LHd099229; Sat, 11 Dec 2010 08:07:21 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012110807.oBB87LHd099229@svn.freebsd.org> From: Kevin Lo Date: Sat, 11 Dec 2010 08:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216369 - head/lib/libipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 08:07:21 -0000 Author: kevlo Date: Sat Dec 11 08:07:21 2010 New Revision: 216369 URL: http://svn.freebsd.org/changeset/base/216369 Log: The use of snprintf() to append to a buffer is not valid according to C99 Modified: head/lib/libipsec/ipsec_dump_policy.c Modified: head/lib/libipsec/ipsec_dump_policy.c ============================================================================== --- head/lib/libipsec/ipsec_dump_policy.c Sat Dec 11 00:36:35 2010 (r216368) +++ head/lib/libipsec/ipsec_dump_policy.c Sat Dec 11 08:07:21 2010 (r216369) @@ -162,7 +162,8 @@ ipsec_dump_policy(policy, delimiter) return NULL; } buf = newbuf; - snprintf(buf, buflen, "%s%s%s", buf, delimiter, isrbuf); + snprintf(buf + strlen(buf), buflen - strlen(buf), + "%s%s", delimiter, isrbuf); off += xisr->sadb_x_ipsecrequest_len; } From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 08:32:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E43C1065670; Sat, 11 Dec 2010 08:32:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E958FC16; Sat, 11 Dec 2010 08:32:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBB8WIaT099905; Sat, 11 Dec 2010 08:32:18 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBB8WHoW099826; Sat, 11 Dec 2010 08:32:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201012110832.oBB8WHoW099826@svn.freebsd.org> From: Joel Dahl Date: Sat, 11 Dec 2010 08:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216370 - in head/usr.bin: apply banner basename biff cap_mkdb checknr chpass cksum cmp col colcrt colrm column comm compress csup ctags cut dirname du env expand false find finger fmt ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 08:32:18 -0000 Author: joel (doc committer) Date: Sat Dec 11 08:32:16 2010 New Revision: 216370 URL: http://svn.freebsd.org/changeset/base/216370 Log: Remove the advertising clause from UCB copyrighted files in usr.bin. This is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Modified: head/usr.bin/apply/apply.1 head/usr.bin/apply/apply.c head/usr.bin/banner/banner.6 head/usr.bin/banner/banner.c head/usr.bin/basename/basename.1 head/usr.bin/basename/basename.c head/usr.bin/biff/biff.1 head/usr.bin/biff/biff.c head/usr.bin/cap_mkdb/cap_mkdb.1 head/usr.bin/cap_mkdb/cap_mkdb.c head/usr.bin/checknr/checknr.1 head/usr.bin/checknr/checknr.c head/usr.bin/chpass/chpass.1 head/usr.bin/chpass/table.c head/usr.bin/cksum/cksum.1 head/usr.bin/cksum/cksum.c head/usr.bin/cksum/crc.c head/usr.bin/cksum/extern.h head/usr.bin/cksum/print.c head/usr.bin/cksum/sum1.c head/usr.bin/cksum/sum2.c head/usr.bin/cmp/cmp.1 head/usr.bin/cmp/cmp.c head/usr.bin/cmp/extern.h head/usr.bin/cmp/misc.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/col/col.1 head/usr.bin/col/col.c head/usr.bin/colcrt/colcrt.1 head/usr.bin/colcrt/colcrt.c head/usr.bin/colrm/colrm.1 head/usr.bin/colrm/colrm.c head/usr.bin/column/column.1 head/usr.bin/column/column.c head/usr.bin/comm/comm.1 head/usr.bin/comm/comm.c head/usr.bin/compress/compress.1 head/usr.bin/compress/compress.c head/usr.bin/compress/zopen.3 head/usr.bin/compress/zopen.c head/usr.bin/csup/fnmatch.c head/usr.bin/csup/fnmatch.h head/usr.bin/ctags/C.c head/usr.bin/ctags/ctags.1 head/usr.bin/ctags/ctags.c head/usr.bin/ctags/ctags.h head/usr.bin/ctags/fortran.c head/usr.bin/ctags/lisp.c head/usr.bin/ctags/print.c head/usr.bin/ctags/tree.c head/usr.bin/ctags/yacc.c head/usr.bin/cut/cut.1 head/usr.bin/cut/cut.c head/usr.bin/dirname/dirname.c head/usr.bin/du/du.1 head/usr.bin/du/du.c head/usr.bin/env/env.1 head/usr.bin/env/env.c head/usr.bin/expand/expand.1 head/usr.bin/expand/expand.c head/usr.bin/false/false.1 head/usr.bin/false/false.c head/usr.bin/find/extern.h head/usr.bin/find/find.1 head/usr.bin/find/find.c head/usr.bin/find/find.h head/usr.bin/find/function.c head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/operator.c head/usr.bin/find/option.c head/usr.bin/finger/extern.h head/usr.bin/finger/finger.1 head/usr.bin/finger/finger.c head/usr.bin/finger/finger.h head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/sprint.c head/usr.bin/finger/util.c head/usr.bin/fmt/fmt.1 head/usr.bin/fold/fold.1 head/usr.bin/fold/fold.c head/usr.bin/from/from.1 head/usr.bin/from/from.c head/usr.bin/fstat/fstat.1 head/usr.bin/fstat/fstat.c head/usr.bin/fstat/fstat.h head/usr.bin/gcore/extern.h head/usr.bin/gcore/gcore.1 head/usr.bin/gcore/gcore.c head/usr.bin/gprof/amd64.h head/usr.bin/gprof/aout.c head/usr.bin/gprof/arcs.c head/usr.bin/gprof/arm.h head/usr.bin/gprof/dfn.c head/usr.bin/gprof/elf.c head/usr.bin/gprof/gprof.1 head/usr.bin/gprof/gprof.c head/usr.bin/gprof/gprof.h head/usr.bin/gprof/hertz.c head/usr.bin/gprof/i386.h head/usr.bin/gprof/ia64.h head/usr.bin/gprof/lookup.c head/usr.bin/gprof/pathnames.h head/usr.bin/gprof/powerpc.h head/usr.bin/gprof/printgprof.c head/usr.bin/gprof/printlist.c head/usr.bin/gprof/sparc64.h head/usr.bin/head/head.1 head/usr.bin/head/head.c head/usr.bin/hexdump/conv.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.1 head/usr.bin/hexdump/hexdump.c head/usr.bin/hexdump/hexdump.h head/usr.bin/hexdump/hexsyntax.c head/usr.bin/hexdump/od.1 head/usr.bin/hexdump/odsyntax.c head/usr.bin/hexdump/parse.c head/usr.bin/id/groups.1 head/usr.bin/id/id.1 head/usr.bin/id/id.c head/usr.bin/id/whoami.1 head/usr.bin/join/join.1 head/usr.bin/join/join.c head/usr.bin/jot/jot.1 head/usr.bin/jot/jot.c head/usr.bin/kdump/kdump.1 head/usr.bin/kdump/kdump.c head/usr.bin/ktrace/ktrace.1 head/usr.bin/ktrace/ktrace.c head/usr.bin/ktrace/ktrace.h head/usr.bin/ktrace/subr.c head/usr.bin/lam/lam.1 head/usr.bin/lam/lam.c head/usr.bin/last/last.1 head/usr.bin/last/last.c head/usr.bin/lastcomm/lastcomm.1 head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/pathnames.h head/usr.bin/leave/leave.1 head/usr.bin/leave/leave.c head/usr.bin/lock/lock.1 head/usr.bin/lock/lock.c head/usr.bin/logger/logger.1 head/usr.bin/logger/logger.c head/usr.bin/login/login.1 head/usr.bin/login/pathnames.h head/usr.bin/logname/logname.1 head/usr.bin/logname/logname.c head/usr.bin/look/look.1 head/usr.bin/look/look.c head/usr.bin/look/pathnames.h head/usr.bin/lorder/lorder.1 head/usr.bin/lorder/lorder.sh head/usr.bin/m4/TEST/ack.m4 head/usr.bin/m4/TEST/hanoi.m4 head/usr.bin/m4/TEST/hash.m4 head/usr.bin/m4/TEST/sqroot.m4 head/usr.bin/m4/TEST/string.m4 head/usr.bin/m4/TEST/test.m4 head/usr.bin/m4/eval.c head/usr.bin/m4/expr.c head/usr.bin/m4/extern.h head/usr.bin/m4/look.c head/usr.bin/m4/main.c head/usr.bin/m4/mdef.h head/usr.bin/m4/misc.c head/usr.bin/m4/pathnames.h head/usr.bin/m4/stdd.h head/usr.bin/mail/cmd1.c head/usr.bin/mail/cmd2.c head/usr.bin/mail/cmd3.c head/usr.bin/mail/cmdtab.c head/usr.bin/mail/collect.c head/usr.bin/mail/def.h head/usr.bin/mail/edit.c head/usr.bin/mail/extern.h head/usr.bin/mail/fio.c head/usr.bin/mail/getname.c head/usr.bin/mail/glob.h head/usr.bin/mail/head.c head/usr.bin/mail/lex.c head/usr.bin/mail/list.c head/usr.bin/mail/mail.1 head/usr.bin/mail/main.c head/usr.bin/mail/names.c head/usr.bin/mail/pathnames.h head/usr.bin/mail/popen.c head/usr.bin/mail/quit.c head/usr.bin/mail/rcv.h head/usr.bin/mail/send.c head/usr.bin/mail/strings.c head/usr.bin/mail/temp.c head/usr.bin/mail/tty.c head/usr.bin/mail/util.c head/usr.bin/mail/v7.local.c head/usr.bin/mail/vars.c head/usr.bin/mail/version.c head/usr.bin/mesg/mesg.1 head/usr.bin/mkdep/mkdep.1 head/usr.bin/mkdep/mkdep.gcc.sh head/usr.bin/mkdep/mkdep.sh head/usr.bin/mkfifo/mkfifo.1 head/usr.bin/mkfifo/mkfifo.c head/usr.bin/mklocale/extern.h head/usr.bin/mklocale/ldef.h head/usr.bin/mklocale/lex.l head/usr.bin/mklocale/mklocale.1 head/usr.bin/mklocale/yacc.y head/usr.bin/mkstr/mkstr.1 head/usr.bin/mkstr/mkstr.c head/usr.bin/mktemp/mktemp.1 head/usr.bin/msgs/msgs.1 head/usr.bin/msgs/msgs.c head/usr.bin/msgs/pathnames.h head/usr.bin/mt/mt.1 head/usr.bin/mt/mt.c head/usr.bin/netstat/atalk.c head/usr.bin/netstat/if.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/unix.c head/usr.bin/nfsstat/nfsstat.1 head/usr.bin/nfsstat/nfsstat.c head/usr.bin/nice/nice.1 head/usr.bin/nice/nice.c head/usr.bin/nohup/nohup.1 head/usr.bin/nohup/nohup.c head/usr.bin/pagesize/pagesize.1 head/usr.bin/pagesize/pagesize.sh head/usr.bin/passwd/passwd.1 head/usr.bin/paste/paste.1 head/usr.bin/paste/paste.c head/usr.bin/printenv/printenv.1 head/usr.bin/printenv/printenv.c head/usr.bin/printf/printf.1 head/usr.bin/printf/printf.c head/usr.bin/quota/quota.1 head/usr.bin/quota/quota.c head/usr.bin/renice/renice.8 head/usr.bin/renice/renice.c head/usr.bin/rev/rev.1 head/usr.bin/rev/rev.c head/usr.bin/rlogin/rlogin.1 head/usr.bin/rs/rs.1 head/usr.bin/rs/rs.c head/usr.bin/rsh/rsh.1 head/usr.bin/rup/rup.1 head/usr.bin/ruptime/ruptime.1 head/usr.bin/ruptime/ruptime.c head/usr.bin/rusers/rusers.1 head/usr.bin/rwall/rwall.1 head/usr.bin/rwho/rwho.1 head/usr.bin/rwho/rwho.c head/usr.bin/script/script.1 head/usr.bin/script/script.c head/usr.bin/shar/shar.1 head/usr.bin/shar/shar.sh head/usr.bin/showmount/showmount.8 head/usr.bin/showmount/showmount.c head/usr.bin/split/split.1 head/usr.bin/split/split.c head/usr.bin/su/su.1 head/usr.bin/su/su.c head/usr.bin/systat/cmds.c head/usr.bin/systat/cmdtab.c head/usr.bin/systat/devs.c head/usr.bin/systat/extern.h head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp.c head/usr.bin/systat/icmp6.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/ip6.c head/usr.bin/systat/keyboard.c head/usr.bin/systat/main.c head/usr.bin/systat/mbufs.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/systat/pigs.c head/usr.bin/systat/swap.c head/usr.bin/systat/systat.1 head/usr.bin/systat/systat.h head/usr.bin/systat/tcp.c head/usr.bin/systat/vmstat.c head/usr.bin/tail/extern.h head/usr.bin/tail/forward.c head/usr.bin/tail/misc.c head/usr.bin/tail/read.c head/usr.bin/tail/reverse.c head/usr.bin/tail/tail.1 head/usr.bin/tail/tail.c head/usr.bin/talk/ctl.c head/usr.bin/talk/ctl_transact.c head/usr.bin/talk/display.c head/usr.bin/talk/get_addrs.c head/usr.bin/talk/get_names.c head/usr.bin/talk/init_disp.c head/usr.bin/talk/invite.c head/usr.bin/talk/io.c head/usr.bin/talk/look_up.c head/usr.bin/talk/msgs.c head/usr.bin/talk/talk.1 head/usr.bin/talk/talk.c head/usr.bin/talk/talk.h head/usr.bin/talk/talk_ctl.h head/usr.bin/tcopy/tcopy.1 head/usr.bin/tcopy/tcopy.c head/usr.bin/tee/tee.1 head/usr.bin/tee/tee.c head/usr.bin/tftp/main.c head/usr.bin/tftp/tftp.1 head/usr.bin/tftp/tftp.c head/usr.bin/tftp/tftp.h head/usr.bin/time/time.1 head/usr.bin/time/time.c head/usr.bin/touch/touch.1 head/usr.bin/touch/touch.c head/usr.bin/tput/clear.sh head/usr.bin/tput/tput.1 head/usr.bin/tput/tput.c head/usr.bin/tr/extern.h head/usr.bin/tr/str.c head/usr.bin/tr/tr.1 head/usr.bin/tr/tr.c head/usr.bin/true/true.1 head/usr.bin/true/true.c head/usr.bin/tset/extern.h head/usr.bin/tset/map.c head/usr.bin/tset/misc.c head/usr.bin/tset/set.c head/usr.bin/tset/term.c head/usr.bin/tset/tset.1 head/usr.bin/tset/tset.c head/usr.bin/tset/wrterm.c head/usr.bin/tsort/tsort.1 head/usr.bin/tsort/tsort.c head/usr.bin/tty/tty.1 head/usr.bin/tty/tty.c head/usr.bin/ul/ul.1 head/usr.bin/ul/ul.c head/usr.bin/uname/uname.1 head/usr.bin/unexpand/unexpand.c head/usr.bin/uniq/uniq.1 head/usr.bin/uniq/uniq.c head/usr.bin/unvis/unvis.1 head/usr.bin/unvis/unvis.c head/usr.bin/users/users.1 head/usr.bin/users/users.c head/usr.bin/uudecode/uudecode.c head/usr.bin/uuencode/uuencode.1 head/usr.bin/uuencode/uuencode.c head/usr.bin/uuencode/uuencode.format.5 head/usr.bin/vgrind/RETEST/retest.c head/usr.bin/vgrind/extern.h head/usr.bin/vgrind/pathnames.h head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c head/usr.bin/vgrind/vgrind.1 head/usr.bin/vgrind/vgrind.sh head/usr.bin/vgrind/vgrindefs.5 head/usr.bin/vgrind/vgrindefs.c head/usr.bin/vgrind/vgrindefs.src head/usr.bin/vis/extern.h head/usr.bin/vis/foldit.c head/usr.bin/vis/vis.1 head/usr.bin/vis/vis.c head/usr.bin/vmstat/vmstat.8 head/usr.bin/vmstat/vmstat.c head/usr.bin/w/extern.h head/usr.bin/w/pr_time.c head/usr.bin/w/proc_compare.c head/usr.bin/w/uptime.1 head/usr.bin/w/w.1 head/usr.bin/w/w.c head/usr.bin/wall/ttymsg.c head/usr.bin/wall/wall.1 head/usr.bin/wall/wall.c head/usr.bin/wc/wc.1 head/usr.bin/wc/wc.c head/usr.bin/what/what.1 head/usr.bin/what/what.c head/usr.bin/who/who.1 head/usr.bin/whois/whois.1 head/usr.bin/whois/whois.c head/usr.bin/write/write.1 head/usr.bin/write/write.c head/usr.bin/xargs/pathnames.h head/usr.bin/xargs/xargs.1 head/usr.bin/xargs/xargs.c head/usr.bin/xinstall/install.1 head/usr.bin/xinstall/xinstall.c head/usr.bin/xstr/pathnames.h head/usr.bin/xstr/xstr.1 head/usr.bin/xstr/xstr.c head/usr.bin/yacc/closure.c head/usr.bin/yacc/defs.h head/usr.bin/yacc/error.c head/usr.bin/yacc/lalr.c head/usr.bin/yacc/lr0.c head/usr.bin/yacc/main.c head/usr.bin/yacc/mkpar.c head/usr.bin/yacc/output.c head/usr.bin/yacc/reader.c head/usr.bin/yacc/skeleton.c head/usr.bin/yacc/symtab.c head/usr.bin/yacc/verbose.c head/usr.bin/yacc/warshall.c head/usr.bin/yacc/yacc.1 head/usr.bin/yacc/yyfix.1 head/usr.bin/yacc/yyfix.sh head/usr.bin/yes/yes.1 head/usr.bin/yes/yes.c Modified: head/usr.bin/apply/apply.1 ============================================================================== --- head/usr.bin/apply/apply.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/apply/apply.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/apply/apply.c ============================================================================== --- head/usr.bin/apply/apply.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/apply/apply.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/banner/banner.6 ============================================================================== --- head/usr.bin/banner/banner.6 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/banner/banner.6 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/banner/banner.c ============================================================================== --- head/usr.bin/banner/banner.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/banner/banner.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/basename/basename.1 ============================================================================== --- head/usr.bin/basename/basename.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/basename/basename.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/basename/basename.c ============================================================================== --- head/usr.bin/basename/basename.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/basename/basename.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/biff/biff.1 ============================================================================== --- head/usr.bin/biff/biff.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/biff/biff.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/biff/biff.c ============================================================================== --- head/usr.bin/biff/biff.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/biff/biff.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cap_mkdb/cap_mkdb.1 ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cap_mkdb/cap_mkdb.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/cap_mkdb/cap_mkdb.c ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cap_mkdb/cap_mkdb.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/checknr/checknr.1 ============================================================================== --- head/usr.bin/checknr/checknr.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/checknr/checknr.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/checknr/checknr.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/chpass/chpass.1 ============================================================================== --- head/usr.bin/chpass/chpass.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/chpass/chpass.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/chpass/table.c ============================================================================== --- head/usr.bin/chpass/table.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/chpass/table.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/cksum.1 ============================================================================== --- head/usr.bin/cksum/cksum.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/cksum.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/cksum/cksum.c ============================================================================== --- head/usr.bin/cksum/cksum.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/cksum.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/crc.c ============================================================================== --- head/usr.bin/cksum/crc.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/crc.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/extern.h ============================================================================== --- head/usr.bin/cksum/extern.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/extern.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/print.c ============================================================================== --- head/usr.bin/cksum/print.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/print.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/sum1.c ============================================================================== --- head/usr.bin/cksum/sum1.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/sum1.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cksum/sum2.c ============================================================================== --- head/usr.bin/cksum/sum2.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cksum/sum2.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cmp/cmp.1 ============================================================================== --- head/usr.bin/cmp/cmp.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/cmp.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/cmp.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cmp/extern.h ============================================================================== --- head/usr.bin/cmp/extern.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/extern.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cmp/misc.c ============================================================================== --- head/usr.bin/cmp/misc.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/misc.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/regular.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cmp/special.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/col/col.1 ============================================================================== --- head/usr.bin/col/col.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/col/col.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/col/col.c ============================================================================== --- head/usr.bin/col/col.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/col/col.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/colcrt/colcrt.1 ============================================================================== --- head/usr.bin/colcrt/colcrt.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/colcrt/colcrt.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/colcrt/colcrt.c ============================================================================== --- head/usr.bin/colcrt/colcrt.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/colcrt/colcrt.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/colrm/colrm.1 ============================================================================== --- head/usr.bin/colrm/colrm.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/colrm/colrm.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/colrm/colrm.c ============================================================================== --- head/usr.bin/colrm/colrm.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/colrm/colrm.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/column/column.1 ============================================================================== --- head/usr.bin/column/column.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/column/column.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/column/column.c ============================================================================== --- head/usr.bin/column/column.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/column/column.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/comm/comm.1 ============================================================================== --- head/usr.bin/comm/comm.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/comm/comm.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/comm/comm.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/compress/compress.1 ============================================================================== --- head/usr.bin/compress/compress.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/compress/compress.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/compress/compress.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/compress/zopen.3 ============================================================================== --- head/usr.bin/compress/zopen.3 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/compress/zopen.3 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/compress/zopen.c Sat Dec 11 08:32:16 2010 (r216370) @@ -14,10 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/csup/fnmatch.c ============================================================================== --- head/usr.bin/csup/fnmatch.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/csup/fnmatch.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -33,6 +29,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ + * * From FreeBSD fnmatch.c 1.11 * $Id: fnmatch.c,v 1.3 1997/08/19 02:34:30 jdp Exp $ */ Modified: head/usr.bin/csup/fnmatch.h ============================================================================== --- head/usr.bin/csup/fnmatch.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/csup/fnmatch.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -30,6 +26,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ + * * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 * * From FreeBSD fnmatch.h 1.7 Modified: head/usr.bin/ctags/C.c ============================================================================== --- head/usr.bin/ctags/C.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/C.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/ctags.1 ============================================================================== --- head/usr.bin/ctags/ctags.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/ctags.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/ctags/ctags.c ============================================================================== --- head/usr.bin/ctags/ctags.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/ctags.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/ctags.h ============================================================================== --- head/usr.bin/ctags/ctags.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/ctags.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/fortran.c ============================================================================== --- head/usr.bin/ctags/fortran.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/fortran.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/lisp.c ============================================================================== --- head/usr.bin/ctags/lisp.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/lisp.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/print.c ============================================================================== --- head/usr.bin/ctags/print.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/print.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/tree.c ============================================================================== --- head/usr.bin/ctags/tree.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/tree.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/ctags/yacc.c ============================================================================== --- head/usr.bin/ctags/yacc.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/ctags/yacc.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/cut/cut.1 ============================================================================== --- head/usr.bin/cut/cut.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cut/cut.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/cut/cut.c ============================================================================== --- head/usr.bin/cut/cut.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/cut/cut.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/dirname/dirname.c ============================================================================== --- head/usr.bin/dirname/dirname.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/dirname/dirname.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/du/du.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/du/du.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/env/env.1 ============================================================================== --- head/usr.bin/env/env.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/env/env.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -11,10 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/env/env.c ============================================================================== --- head/usr.bin/env/env.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/env/env.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/expand/expand.1 ============================================================================== --- head/usr.bin/expand/expand.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/expand/expand.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/expand/expand.c ============================================================================== --- head/usr.bin/expand/expand.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/expand/expand.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/false/false.1 ============================================================================== --- head/usr.bin/false/false.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/false/false.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/false/false.c ============================================================================== --- head/usr.bin/false/false.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/false/false.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/extern.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/find.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -12,10 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/find.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/find.h ============================================================================== --- head/usr.bin/find/find.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/find.h Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/function.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/ls.c Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/main.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/misc.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/operator.c ============================================================================== --- head/usr.bin/find/operator.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/operator.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/find/option.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/finger/extern.h ============================================================================== --- head/usr.bin/finger/extern.h Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/finger/extern.h Sat Dec 11 08:32:16 2010 (r216370) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.bin/finger/finger.1 ============================================================================== --- head/usr.bin/finger/finger.1 Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/finger/finger.1 Sat Dec 11 08:32:16 2010 (r216370) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Sat Dec 11 08:07:21 2010 (r216369) +++ head/usr.bin/finger/finger.c Sat Dec 11 08:32:16 2010 (r216370) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 08:44:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5793F106564A; Sat, 11 Dec 2010 08:44:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46E1C8FC13; Sat, 11 Dec 2010 08:44:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBB8iAZj000267; Sat, 11 Dec 2010 08:44:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBB8iASt000265; Sat, 11 Dec 2010 08:44:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201012110844.oBB8iASt000265@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 11 Dec 2010 08:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216371 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 08:44:10 -0000 Author: hselasky Date: Sat Dec 11 08:44:10 2010 New Revision: 216371 URL: http://svn.freebsd.org/changeset/base/216371 Log: Fix race in devfs by using LIST_FIRST() instead of LIST_FOREACH_SAFE() when freeing the devfs private data entries. Reviewed by: kib MFC after: 3 days Approved by: thompsa (mentor) Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Dec 11 08:32:16 2010 (r216370) +++ head/sys/kern/kern_conf.c Sat Dec 11 08:44:10 2010 (r216371) @@ -926,7 +926,7 @@ static void destroy_devl(struct cdev *dev) { struct cdevsw *csw; - struct cdev_privdata *p, *p1; + struct cdev_privdata *p; mtx_assert(&devmtx, MA_OWNED); KASSERT(dev->si_flags & SI_NAMED, @@ -974,7 +974,7 @@ destroy_devl(struct cdev *dev) dev_unlock(); notify_destroy(dev); mtx_lock(&cdevpriv_mtx); - LIST_FOREACH_SAFE(p, &cdev2priv(dev)->cdp_fdpriv, cdpd_list, p1) { + while ((p = LIST_FIRST(&cdev2priv(dev)->cdp_fdpriv)) != NULL) { devfs_destroy_cdevpriv(p); mtx_lock(&cdevpriv_mtx); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 09:38:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A1A106566C; Sat, 11 Dec 2010 09:38:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3D68FC08; Sat, 11 Dec 2010 09:38:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBB9cCcf001384; Sat, 11 Dec 2010 09:38:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBB9cC9g001327; Sat, 11 Dec 2010 09:38:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201012110938.oBB9cC9g001327@svn.freebsd.org> From: Joel Dahl Date: Sat, 11 Dec 2010 09:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216372 - in head/usr.sbin: config gpioctl iostat lpr/common_source lpr/filters lpr/lpc lpr/lpd lpr/lpq lpr/lpr lpr/lprm lpr/lptest lpr/pac timed/timed timed/timedc traceroute6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 09:38:13 -0000 Author: joel (doc committer) Date: Sat Dec 11 09:38:12 2010 New Revision: 216372 URL: http://svn.freebsd.org/changeset/base/216372 Log: Remove the advertising clause from UCB copyrighted files in usr.sbin. This is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Modified: head/usr.sbin/config/config.y head/usr.sbin/gpioctl/gpioctl.8 head/usr.sbin/iostat/iostat.8 head/usr.sbin/iostat/iostat.c head/usr.sbin/lpr/common_source/displayq.c head/usr.sbin/lpr/common_source/lp.h head/usr.sbin/lpr/common_source/lp.local.h head/usr.sbin/lpr/common_source/pathnames.h head/usr.sbin/lpr/common_source/rmjob.c head/usr.sbin/lpr/common_source/startdaemon.c head/usr.sbin/lpr/filters/lpf.c head/usr.sbin/lpr/lpc/cmds.c head/usr.sbin/lpr/lpc/cmdtab.c head/usr.sbin/lpr/lpc/extern.h head/usr.sbin/lpr/lpc/lpc.8 head/usr.sbin/lpr/lpc/lpc.c head/usr.sbin/lpr/lpc/lpc.h head/usr.sbin/lpr/lpd/extern.h head/usr.sbin/lpr/lpd/lpd.8 head/usr.sbin/lpr/lpd/lpd.c head/usr.sbin/lpr/lpd/lpdchar.c head/usr.sbin/lpr/lpd/modes.c head/usr.sbin/lpr/lpd/printjob.c head/usr.sbin/lpr/lpd/recvjob.c head/usr.sbin/lpr/lpq/lpq.1 head/usr.sbin/lpr/lpq/lpq.c head/usr.sbin/lpr/lpr/lpr.1 head/usr.sbin/lpr/lpr/printcap.5 head/usr.sbin/lpr/lprm/lprm.1 head/usr.sbin/lpr/lprm/lprm.c head/usr.sbin/lpr/lptest/lptest.1 head/usr.sbin/lpr/lptest/lptest.c head/usr.sbin/lpr/pac/pac.8 head/usr.sbin/lpr/pac/pac.c head/usr.sbin/timed/timed/acksend.c head/usr.sbin/timed/timed/byteorder.c head/usr.sbin/timed/timed/candidate.c head/usr.sbin/timed/timed/cksum.c head/usr.sbin/timed/timed/correct.c head/usr.sbin/timed/timed/extern.h head/usr.sbin/timed/timed/globals.h head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/measure.c head/usr.sbin/timed/timed/networkdelta.c head/usr.sbin/timed/timed/pathnames.h head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.8 head/usr.sbin/timed/timed/timed.c head/usr.sbin/timed/timedc/cmds.c head/usr.sbin/timed/timedc/cmdtab.c head/usr.sbin/timed/timedc/extern.h head/usr.sbin/timed/timedc/timedc.8 head/usr.sbin/timed/timedc/timedc.c head/usr.sbin/timed/timedc/timedc.h head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/config/config.y Sat Dec 11 09:38:12 2010 (r216372) @@ -48,10 +48,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/gpioctl/gpioctl.8 ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/gpioctl/gpioctl.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/iostat/iostat.8 ============================================================================== --- head/usr.sbin/iostat/iostat.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/iostat/iostat.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -38,10 +38,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/iostat/iostat.c Sat Dec 11 09:38:12 2010 (r216372) @@ -43,10 +43,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/common_source/displayq.c ============================================================================== --- head/usr.sbin/lpr/common_source/displayq.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/displayq.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/common_source/lp.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/lp.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/common_source/lp.local.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.local.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/lp.local.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/common_source/pathnames.h ============================================================================== --- head/usr.sbin/lpr/common_source/pathnames.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/pathnames.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -30,6 +26,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ + * * @(#)pathnames.h 8.1 (Berkeley) 6/6/93 */ Modified: head/usr.sbin/lpr/common_source/rmjob.c ============================================================================== --- head/usr.sbin/lpr/common_source/rmjob.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/rmjob.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/common_source/startdaemon.c ============================================================================== --- head/usr.sbin/lpr/common_source/startdaemon.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/common_source/startdaemon.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/filters/lpf.c ============================================================================== --- head/usr.sbin/lpr/filters/lpf.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/filters/lpf.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/cmds.c ============================================================================== --- head/usr.sbin/lpr/lpc/cmds.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/cmds.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/cmdtab.c ============================================================================== --- head/usr.sbin/lpr/lpc/cmdtab.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/cmdtab.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/extern.h ============================================================================== --- head/usr.sbin/lpr/lpc/extern.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/extern.h Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/lpc.8 ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/lpc.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/lpc.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpc/lpc.h ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpc/lpc.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/extern.h ============================================================================== --- head/usr.sbin/lpr/lpd/extern.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/extern.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- head/usr.sbin/lpr/lpd/lpd.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/lpd.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/lpd.c ============================================================================== --- head/usr.sbin/lpr/lpd/lpd.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/lpd.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/lpdchar.c ============================================================================== --- head/usr.sbin/lpr/lpd/lpdchar.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/lpdchar.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/modes.c ============================================================================== --- head/usr.sbin/lpr/lpd/modes.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/modes.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/printjob.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/printjob.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpd/recvjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/recvjob.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpd/recvjob.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpq/lpq.1 ============================================================================== --- head/usr.sbin/lpr/lpq/lpq.1 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpq/lpq.1 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lpq/lpq.c ============================================================================== --- head/usr.sbin/lpr/lpq/lpq.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpq/lpq.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lpr/lpr.1 ============================================================================== --- head/usr.sbin/lpr/lpr/lpr.1 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpr/lpr.1 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lpr/printcap.5 ============================================================================== --- head/usr.sbin/lpr/lpr/printcap.5 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lpr/printcap.5 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lprm/lprm.1 ============================================================================== --- head/usr.sbin/lpr/lprm/lprm.1 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lprm/lprm.1 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lprm/lprm.c ============================================================================== --- head/usr.sbin/lpr/lprm/lprm.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lprm/lprm.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/lptest/lptest.1 ============================================================================== --- head/usr.sbin/lpr/lptest/lptest.1 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lptest/lptest.1 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/lptest/lptest.c ============================================================================== --- head/usr.sbin/lpr/lptest/lptest.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/lptest/lptest.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/lpr/pac/pac.8 ============================================================================== --- head/usr.sbin/lpr/pac/pac.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/pac/pac.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/lpr/pac/pac.c ============================================================================== --- head/usr.sbin/lpr/pac/pac.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/lpr/pac/pac.c Sat Dec 11 09:38:12 2010 (r216372) @@ -11,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/acksend.c ============================================================================== --- head/usr.sbin/timed/timed/acksend.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/acksend.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/byteorder.c ============================================================================== --- head/usr.sbin/timed/timed/byteorder.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/byteorder.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/candidate.c ============================================================================== --- head/usr.sbin/timed/timed/candidate.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/candidate.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/cksum.c ============================================================================== --- head/usr.sbin/timed/timed/cksum.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/cksum.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/correct.c ============================================================================== --- head/usr.sbin/timed/timed/correct.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/correct.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/extern.h ============================================================================== --- head/usr.sbin/timed/timed/extern.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/extern.h Sat Dec 11 09:38:12 2010 (r216372) @@ -12,10 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/globals.h ============================================================================== --- head/usr.sbin/timed/timed/globals.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/globals.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/master.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/measure.c ============================================================================== --- head/usr.sbin/timed/timed/measure.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/measure.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/networkdelta.c ============================================================================== --- head/usr.sbin/timed/timed/networkdelta.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/networkdelta.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/pathnames.h ============================================================================== --- head/usr.sbin/timed/timed/pathnames.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/pathnames.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/readmsg.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/slave.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timed/timed.8 ============================================================================== --- head/usr.sbin/timed/timed/timed.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/timed.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timed/timed.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timedc/cmds.c ============================================================================== --- head/usr.sbin/timed/timedc/cmds.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/cmds.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timedc/cmdtab.c ============================================================================== --- head/usr.sbin/timed/timedc/cmdtab.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/cmdtab.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timedc/extern.h ============================================================================== --- head/usr.sbin/timed/timedc/extern.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/extern.h Sat Dec 11 09:38:12 2010 (r216372) @@ -12,10 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timedc/timedc.8 ============================================================================== --- head/usr.sbin/timed/timedc/timedc.8 Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/timedc.8 Sat Dec 11 09:38:12 2010 (r216372) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. Modified: head/usr.sbin/timed/timedc/timedc.c ============================================================================== --- head/usr.sbin/timed/timedc/timedc.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/timedc.c Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/timed/timedc/timedc.h ============================================================================== --- head/usr.sbin/timed/timedc/timedc.h Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/timed/timedc/timedc.h Sat Dec 11 09:38:12 2010 (r216372) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sat Dec 11 08:44:10 2010 (r216371) +++ head/usr.sbin/traceroute6/traceroute6.c Sat Dec 11 09:38:12 2010 (r216372) @@ -44,10 +44,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 10:14:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C007106564A; Sat, 11 Dec 2010 10:14:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B4838FC13; Sat, 11 Dec 2010 10:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBAE86j004241; Sat, 11 Dec 2010 10:14:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBAE8ts004239; Sat, 11 Dec 2010 10:14:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012111014.oBBAE8ts004239@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Dec 2010 10:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216373 - head/sys/dev/cxgb/ulp/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 10:14:08 -0000 Author: avg Date: Sat Dec 11 10:14:08 2010 New Revision: 216373 URL: http://svn.freebsd.org/changeset/base/216373 Log: fix incorrect use of atomic_set_xxx in cxgb There is no need to use an atomic operation at structure initialization time. Note that the file changed is not connected to the build at this time. Reviewed by: jhb (general issue) Approved by: np MFC after: 2 weeks Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Sat Dec 11 09:38:12 2010 (r216372) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Sat Dec 11 10:14:08 2010 (r216373) @@ -269,7 +269,7 @@ init_tid_tabs(struct tid_info *t, unsign t->atid_base = atid_base; t->afree = NULL; t->stids_in_use = t->atids_in_use = 0; - atomic_set_int(&t->tids_in_use, 0); + t->tids_in_use = 0; mtx_init(&t->stid_lock, "stid", NULL, MTX_DUPOK|MTX_DEF); mtx_init(&t->atid_lock, "atid", NULL, MTX_DUPOK|MTX_DEF); From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 10:18:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 769D7106566B; Sat, 11 Dec 2010 10:18:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65FA68FC12; Sat, 11 Dec 2010 10:18:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBAI5B8004346; Sat, 11 Dec 2010 10:18:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBAI5aL004344; Sat, 11 Dec 2010 10:18:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012111018.oBBAI5aL004344@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Dec 2010 10:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216374 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 10:18:05 -0000 Author: avg Date: Sat Dec 11 10:18:05 2010 New Revision: 216374 URL: http://svn.freebsd.org/changeset/base/216374 Log: fix atomic_set_xxx misuse in drm It seems that atomic_set_xxx and atomic_store_xxx were confused. Reviewed by: jhb MFC after: 3 weeks Modified: head/sys/dev/drm/drm_irq.c Modified: head/sys/dev/drm/drm_irq.c ============================================================================== --- head/sys/dev/drm/drm_irq.c Sat Dec 11 10:14:08 2010 (r216373) +++ head/sys/dev/drm/drm_irq.c Sat Dec 11 10:18:05 2010 (r216374) @@ -140,7 +140,7 @@ int drm_vblank_init(struct drm_device *d for (i = 0; i < num_crtcs; i++) { DRM_INIT_WAITQUEUE(&dev->vblank[i].queue); dev->vblank[i].refcount = 0; - atomic_set_rel_32(&dev->vblank[i].count, 0); + atomic_store_rel_32(&dev->vblank[i].count, 0); } dev->vblank_disable_allowed = 0; DRM_SPINUNLOCK(&dev->vbl_lock); From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 10:21:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B758106564A; Sat, 11 Dec 2010 10:21:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC498FC1B; Sat, 11 Dec 2010 10:21:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBALc60004452; Sat, 11 Dec 2010 10:21:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBALcrV004450; Sat, 11 Dec 2010 10:21:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012111021.oBBALcrV004450@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Dec 2010 10:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216375 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 10:21:38 -0000 Author: avg Date: Sat Dec 11 10:21:38 2010 New Revision: 216375 URL: http://svn.freebsd.org/changeset/base/216375 Log: fix atomic_set_xxx misuse in rge It seems that atomic_set_xxx and atomic_store_xxx were confused. Reviewed by: jhb (general issue) MFC after: 3 weeks Modified: head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:18:05 2010 (r216374) +++ head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:21:38 2010 (r216375) @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32]; static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE); #define port_inc_counter(port, counter) atomic_add_int(&port_counters[port][(counter)], 1) -#define port_set_counter(port, counter, value) atomic_set_int(&port_counters[port][(counter)], (value)) +#define port_set_counter(port, counter, value) atomic_store_int(&port_counters[port][(counter)], (value)) #else #define port_inc_counter(port, counter) /* Nothing */ #define port_set_counter(port, counter, value) /* Nothing */ @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc) mtx_unlock_spin(&priv->lock); for (i = 0; i < 8; i++) { - atomic_set_int(&(priv->frin_to_be_sent[i]), 0); + atomic_store_int(&(priv->frin_to_be_sent[i]), 0); } return 0; From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 10:25:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49293106566B; Sat, 11 Dec 2010 10:25:30 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EF2248FC1D; Sat, 11 Dec 2010 10:25:28 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA20147; Sat, 11 Dec 2010 12:25:26 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PRMdq-0007qK-Hi; Sat, 11 Dec 2010 12:25:26 +0200 Message-ID: <4D035195.9090905@freebsd.org> Date: Sat, 11 Dec 2010 12:25:25 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Andriy Gapon References: <201012111021.oBBALcrV004450@svn.freebsd.org> In-Reply-To: <201012111021.oBBALcrV004450@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 10:25:30 -0000 on 11/12/2010 12:21 Andriy Gapon said the following: > Author: avg > Date: Sat Dec 11 10:21:38 2010 > New Revision: 216375 > URL: http://svn.freebsd.org/changeset/base/216375 > > Log: > fix atomic_set_xxx misuse in rge > > It seems that atomic_set_xxx and atomic_store_xxx were confused. Please note that I've just made a mechanical change. Most probably atomic store is not needed here at all. > Reviewed by: jhb (general issue) > MFC after: 3 weeks > > Modified: > head/sys/mips/rmi/dev/xlr/rge.c > > Modified: head/sys/mips/rmi/dev/xlr/rge.c > ============================================================================== > --- head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:18:05 2010 (r216374) > +++ head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:21:38 2010 (r216375) > @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32]; > static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE); > > #define port_inc_counter(port, counter) atomic_add_int(&port_counters[port][(counter)], 1) > -#define port_set_counter(port, counter, value) atomic_set_int(&port_counters[port][(counter)], (value)) > +#define port_set_counter(port, counter, value) atomic_store_int(&port_counters[port][(counter)], (value)) > #else > #define port_inc_counter(port, counter) /* Nothing */ > #define port_set_counter(port, counter, value) /* Nothing */ > @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc) > mtx_unlock_spin(&priv->lock); > > for (i = 0; i < 8; i++) { > - atomic_set_int(&(priv->frin_to_be_sent[i]), 0); > + atomic_store_int(&(priv->frin_to_be_sent[i]), 0); > } > > return 0; -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 10:55:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBE9F106564A; Sat, 11 Dec 2010 10:55:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CACA38FC08; Sat, 11 Dec 2010 10:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBAtICC005120; Sat, 11 Dec 2010 10:55:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBAtIMe005118; Sat, 11 Dec 2010 10:55:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012111055.oBBAtIMe005118@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Dec 2010 10:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216376 - head/sys/dev/acpi_support X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 10:55:19 -0000 Author: avg Date: Sat Dec 11 10:55:18 2010 New Revision: 216376 URL: http://svn.freebsd.org/changeset/base/216376 Log: acpi_fujitsu: update for P8010 PR: kern/121102 Submitted by: Anish Mistry MFC after: 3 weeks Modified: head/sys/dev/acpi_support/acpi_fujitsu.c Modified: head/sys/dev/acpi_support/acpi_fujitsu.c ============================================================================== --- head/sys/dev/acpi_support/acpi_fujitsu.c Sat Dec 11 10:21:38 2010 (r216375) +++ head/sys/dev/acpi_support/acpi_fujitsu.c Sat Dec 11 10:55:18 2010 (r216376) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2002 Sean Bullington - * 2003-2006 Anish Mistry + * 2003-2008 Anish Mistry * 2004 Mark Santcroos * All Rights Reserved. * @@ -86,6 +86,7 @@ ACPI_MODULE_NAME("Fujitsu") #define METHOD_RVOL 6 #define METHOD_GSIF 7 #define METHOD_GHKS 8 +#define METHOD_GBLS 9 /* Notify event */ #define ACPI_NOTIFY_STATUS_CHANGED 0x80 @@ -110,6 +111,7 @@ struct acpi_fujitsu_softc { /* Control methods */ struct int_nameval _sta, /* unused */ gbll, /* brightness */ + gbls, /* get brightness state */ ghks, /* hotkey selector */ gbuf, /* unused (buffer?) */ gmou, /* mouse */ @@ -191,6 +193,11 @@ static struct { .description = "Brightness level of the LCD panel" }, { + .name = "lcd_brightness", + .method = METHOD_GBLS, + .description = "Brightness level of the LCD panel" + }, + { .name = "volume", .method = METHOD_GVOL, .description = "Speakers/headphones volume level" @@ -360,6 +367,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so /* Setup all of the names for each control method */ sc->_sta.name = "_STA"; sc->gbll.name = "GBLL"; + sc->gbls.name = "GBLS"; sc->ghks.name = "GHKS"; sc->gmou.name = "GMOU"; sc->gsif.name = "GSIF"; @@ -387,6 +395,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so case METHOD_GBLL: exists = sc->gbll.exists; break; + case METHOD_GBLS: + exists = sc->gbls.exists; + break; case METHOD_GVOL: case METHOD_MUTE: exists = sc->gvol.exists; @@ -463,6 +474,9 @@ acpi_fujitsu_method_get(struct acpi_fuji case METHOD_GBLL: nv = sc->gbll; break; + case METHOD_GBLS: + nv = sc->gbls; + break; case METHOD_GMOU: nv = sc->gmou; break; @@ -520,6 +534,11 @@ acpi_fujitsu_method_set(struct acpi_fuji control = "SBLL"; nv = sc->gbll; break; + case METHOD_GBLS: + changed = BRIGHT_CHANGED; + control = "SBL2"; + nv = sc->gbls; + break; case METHOD_GMOU: changed = MOUSE_CHANGED; control = "SMOU"; @@ -585,6 +604,14 @@ acpi_fujitsu_check_hardware(struct acpi_ } if (ACPI_FAILURE(acpi_GetInteger(sc->handle, + sc->gbls.name, &val))) { + sc->gbls.exists = 0; + } else { + sc->gbls.exists = 1; + } + + // don't add if we can use the new method + if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle, sc->gbll.name, &val))) { sc->gbll.exists = 0; } else { @@ -681,6 +708,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_ /* Clear the modification bit */ sc->gmou.value &= MOUSE_SETTING_BITS; + /* Set the value in case it is not hardware controlled */ + acpi_fujitsu_method_set(sc, METHOD_GMOU, sc->gmou.value); + acpi_UserNotify("FUJITSU", sc->handle, FN_POINTER_ENABLE); ACPI_VPRINT(sc->dev, acpi_sc, "Internal pointer is now %s\n", @@ -688,6 +718,29 @@ acpi_fujitsu_update(struct acpi_fujitsu_ } } + /* Screen Brightness Level P8XXX */ + if(sc->gbls.exists) { + if (ACPI_FAILURE(acpi_GetInteger(sc->handle, + sc->gbls.name, &(sc->gbls.value)))) { + device_printf(sc->dev, "Couldn't query P8XXX brightness level\n"); + return (FALSE); + } + if (changed & BRIGHT_CHANGED) { + /* No state to record here. */ + + /* Clear the modification bit */ + sc->gbls.value &= BRIGHTNESS_SETTING_BITS; + + /* Set the value in case it is not hardware controlled */ + acpi_fujitsu_method_set(sc, METHOD_GBLS, sc->gbls.value); + + acpi_UserNotify("FUJITSU", sc->handle, FN_LCD_BRIGHTNESS); + + ACPI_VPRINT(sc->dev, acpi_sc, "P8XXX Brightness level is now %d\n", + sc->gbls.value); + } + } + /* Screen Brightness Level */ if(sc->gbll.exists) { if (ACPI_FAILURE(acpi_GetInteger(sc->handle, From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 13:24:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2D1106564A; Sat, 11 Dec 2010 13:24:01 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AB128FC18; Sat, 11 Dec 2010 13:24:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBDO1aT008048; Sat, 11 Dec 2010 13:24:01 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBDO1SJ008046; Sat, 11 Dec 2010 13:24:01 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012111324.oBBDO1SJ008046@svn.freebsd.org> From: Shteryana Shopova Date: Sat, 11 Dec 2010 13:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216377 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 13:24:01 -0000 Author: syrinx Date: Sat Dec 11 13:24:01 2010 New Revision: 216377 URL: http://svn.freebsd.org/changeset/base/216377 Log: Remove unnecessary debug/error CFLAGS. Reported by : pawel.worach (at) gmail (dot) com Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile Sat Dec 11 10:55:18 2010 (r216376) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile Sat Dec 11 13:24:01 2010 (r216377) @@ -7,7 +7,6 @@ LIB= bsnmptools #INTERNALLIB= SRCS= bsnmpimport.c bsnmpmap.c bsnmptools.c bsnmptc.c -CFLAGS+= -g -Wall -Werror SHLIB_MAJOR= 0 From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 13:35:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09229106566C; Sat, 11 Dec 2010 13:35:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBF5A8FC14; Sat, 11 Dec 2010 13:35:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBDZPFL008296; Sat, 11 Dec 2010 13:35:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBDZPKo008294; Sat, 11 Dec 2010 13:35:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012111335.oBBDZPKo008294@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 11 Dec 2010 13:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216378 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 13:35:26 -0000 Author: pjd Date: Sat Dec 11 13:35:25 2010 New Revision: 216378 URL: http://svn.freebsd.org/changeset/base/216378 Log: Remove redundant semicolon and empty like. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 11 13:24:01 2010 (r216377) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 11 13:35:25 2010 (r216378) @@ -407,12 +407,11 @@ update_pages(vnode_t *vp, int64_t start, va+off, tx); } else { (void) dmu_read(os, oid, start+off, nbytes, - va+off, DMU_READ_PREFETCH);; + va+off, DMU_READ_PREFETCH); } zfs_unmap_page(sf); VM_OBJECT_LOCK(obj); page_unlock(pp); - } len -= nbytes; off = 0; From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 16:06:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54DC0106566B; Sat, 11 Dec 2010 16:06:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439FE8FC0A; Sat, 11 Dec 2010 16:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBG6qCO011511; Sat, 11 Dec 2010 16:06:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBG6qUS011509; Sat, 11 Dec 2010 16:06:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012111606.oBBG6qUS011509@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 11 Dec 2010 16:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216379 - head/tools/regression/sockets/sendfile X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 16:06:52 -0000 Author: pjd Date: Sat Dec 11 16:06:52 2010 New Revision: 216379 URL: http://svn.freebsd.org/changeset/base/216379 Log: Allow to specify path to a file we want to test with sendfile(2). This allows to specify selected file system and not only /tmp/. Modified: head/tools/regression/sockets/sendfile/sendfile.c Modified: head/tools/regression/sockets/sendfile/sendfile.c ============================================================================== --- head/tools/regression/sockets/sendfile/sendfile.c Sat Dec 11 13:35:25 2010 (r216378) +++ head/tools/regression/sockets/sendfile/sendfile.c Sat Dec 11 16:06:52 2010 (r216379) @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -408,7 +409,7 @@ cleanup(void) } int -main(void) +main(int argc, char *argv[]) { char *page_buffer; int pagesize; @@ -422,8 +423,20 @@ main(void) FAIL_ERR("malloc") bzero(page_buffer, TEST_PAGES * pagesize); - snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX"); - file_fd = mkstemp(path); + if (argc == 1) { + snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX"); + file_fd = mkstemp(path); + if (file_fd == -1) + FAIL_ERR("mkstemp"); + } else if (argc == 2) { + (void)strlcpy(path, argv[1], sizeof(path)); + file_fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600); + if (file_fd == -1) + FAIL_ERR("open"); + } else { + FAIL("usage: sendfile [path]"); + } + atexit(cleanup); len = write(file_fd, page_buffer, TEST_PAGES * pagesize); From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 16:06:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8755C106566C; Sat, 11 Dec 2010 16:06:53 +0000 (UTC) (envelope-from shteryana@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1A5498FC14; Sat, 11 Dec 2010 16:06:52 +0000 (UTC) Received: by qwj9 with SMTP id 9so4819845qwj.13 for ; Sat, 11 Dec 2010 08:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=YlOLJ/p6jxzs8bozWPrnM/8d9JDz+RO6veZqAisv+28=; b=F4IQBCL7tMmpJho8fraLTvBlM/mC9JDFlZ3CYpQ3WzKZJbQGVRK4mR3OW76vIidOdg +3qsAt/s1kTv16elj6+kBUHp6vjmOg+f2gSMwAZ2jQc9aPljQThx+bsyKaBn0jrGmnRk +FFPM0/GfxpHtVWb6I8WIlZl3VoizkP2udchM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=s4CxfeMgw1OkstzhWfguJlp4ZvKfeUle6vFLZqLRL8jlfU5T7gI+NQCdE8ORMAGKRr FS7wFMy2xNa9strg12t7SU39ebMg4X1VmWLJdzlBQfQF4YzNkZmKf67r1gAIaNTdIjzF lIILY25hyYXjELcQnObLZj+D7nKA5NCKI6pCw= MIME-Version: 1.0 Received: by 10.229.185.7 with SMTP id cm7mr1911124qcb.89.1292082143728; Sat, 11 Dec 2010 07:42:23 -0800 (PST) Sender: shteryana@gmail.com Received: by 10.229.105.68 with HTTP; Sat, 11 Dec 2010 07:42:23 -0800 (PST) In-Reply-To: References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> Date: Sat, 11 Dec 2010 17:42:23 +0200 X-Google-Sender-Auth: BCYSD0UX1oN5pXtpEzn-ZLPA2BU Message-ID: From: Shteryana Shopova To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, Pawel Worach , ed@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, rdivacky@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 16:06:54 -0000 Hi, This is now fixed. However I wouldn't expect bsnmpd(1) compiled with clang to work - it didn't run last time I checked several months ago, and I still get the same error - udo /usr/sbin/bsnmpd -d -c /root/snmpd.config snmpd[80050]: lm_load: open /usr/lib/snmp_mibII.so: Undefined symbol "oid_zeroDotZero" snmpd[80050]: init dep failed: 13 1.3.6.1.4.1.12325.1.1.1.6 5.109.105.98.73.73 snmpd[80050]: error in config file bsnmpd(1) uses export-dynamic flag and dlopen() to load its modules runtime, but for some reason that does not work if bsnmpd(1) is compiled with clang. Obviosly the oid_zeroDotZero OID defined in the bsnmpd main binary is not available in the snmp_mibII(3) or any other module that uses it. I am not sure where exactly the problems is. cheers, Shteryana On 12/10/10, Garrett Cooper wrote: > On Fri, Dec 10, 2010 at 11:07 AM, Pawel Worach > wrote: >> On Dec 8, 2010, at 15:30, Shteryana Shopova wrote: >>> Author: syrinx >>> Date: Wed Dec 8 14:30:25 2010 >>> New Revision: 216295 >>> URL: http://svn.freebsd.org/changeset/base/216295 >>> >>> Log: >>> Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base >>> system. >>> >>> Sponsored by: The FreeBSD Foundation (the SNMPv3 bits), Google Summer >>> of Code 2005 >>> Reviewed by: philip@ (mostly), bz@ (earlier version based on p4 >>> ch124545) >>> Approved by: philip@ >>> >>> Added: >>> head/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile (contents, props >>> changed) >> >> >> Hi, >> >> In bsnmpd/tools/libbsnmptools/Makefile you set CFLAGS+= -g -Wall -Werror > > And it's just plain wrong in the first place; if you want to specify > -g, etc please use DEBUG_FLAGS. > >> this breaks the build with clang even with NO_WERROR=1 set, you probably >> want so this instead: >> >> WARNS?= >> >> ps. >> The warnings with clang are: >> /data/buildslave/freebsd-clang-amd64/src-freebsd/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c:620:50: >> error: comparison of unsigned expression < 0 is always false >> [-Wtautological-compare] >> snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) >> { >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ >> /data/buildslave/freebsd-clang-amd64/src-freebsd/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c:658:38: >> error: comparison of unsigned expression < 0 is always false >> [-Wtautological-compare] >> if (snmp_client.engine.engine_len < 0) { >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ > > Thanks, > -Garrett > From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 17:47:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32250106564A; Sat, 11 Dec 2010 17:47:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 212278FC12; Sat, 11 Dec 2010 17:47:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBHlSfa013724; Sat, 11 Dec 2010 17:47:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBHlSJw013722; Sat, 11 Dec 2010 17:47:28 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012111747.oBBHlSJw013722@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Dec 2010 17:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216380 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 17:47:28 -0000 Author: jilles Date: Sat Dec 11 17:47:27 2010 New Revision: 216380 URL: http://svn.freebsd.org/changeset/base/216380 Log: sh: Use vsnprintf() rather than crafting our own in fmtstr(). Add INTOFF/INTON as longjmp out of vsnprintf may cause memory leaks or undefined behaviour. Modified: head/bin/sh/output.c Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Sat Dec 11 16:06:52 2010 (r216379) +++ head/bin/sh/output.c Sat Dec 11 17:47:27 2010 (r216380) @@ -64,8 +64,7 @@ __FBSDID("$FreeBSD$"); #define OUTBUFSIZ BUFSIZ -#define BLOCK_OUT -2 /* output to a fixed block of memory */ -#define MEM_OUT -3 /* output to dynamically allocated memory */ +#define MEM_OUT -2 /* output to dynamically allocated memory */ #define OUTPUT_ERR 01 /* error occurred on output */ static int doformat_wr(void *, const char *, int); @@ -180,18 +179,12 @@ outbin(const void *data, size_t len, str outc(*p++, file); } -static char out_junk[16]; - void emptyoutbuf(struct output *dest) { int offset; - if (dest->fd == BLOCK_OUT) { - dest->nextc = out_junk; - dest->nleft = sizeof out_junk; - dest->flags |= OUTPUT_ERR; - } else if (dest->buf == NULL) { + if (dest->buf == NULL) { INTOFF; dest->buf = ckmalloc(dest->bufsize); dest->nextc = dest->buf; @@ -282,18 +275,12 @@ void fmtstr(char *outbuf, int length, const char *fmt, ...) { va_list ap; - struct output strout; - strout.nextc = outbuf; - strout.nleft = length; - strout.fd = BLOCK_OUT; - strout.flags = 0; + INTOFF; va_start(ap, fmt); - doformat(&strout, fmt, ap); + vsnprintf(outbuf, length, fmt, ap); va_end(ap); - outc('\0', &strout); - if (strout.flags & OUTPUT_ERR) - outbuf[length - 1] = '\0'; + INTON; } static int From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 17:57:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1081065675; Sat, 11 Dec 2010 17:57:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B82F8FC1E; Sat, 11 Dec 2010 17:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBHvh5e013947; Sat, 11 Dec 2010 17:57:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBHvhHe013944; Sat, 11 Dec 2010 17:57:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012111757.oBBHvhHe013944@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 11 Dec 2010 17:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216381 - head/lib/libc/powerpc64/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 17:57:43 -0000 Author: nwhitehorn Date: Sat Dec 11 17:57:42 2010 New Revision: 216381 URL: http://svn.freebsd.org/changeset/base/216381 Log: Fix stack alignment (required to be to 16 bytes) instead of ptrace and cerror on powerpc64. Modified: head/lib/libc/powerpc64/sys/cerror.S head/lib/libc/powerpc64/sys/ptrace.S Modified: head/lib/libc/powerpc64/sys/cerror.S ============================================================================== --- head/lib/libc/powerpc64/sys/cerror.S Sat Dec 11 17:47:27 2010 (r216380) +++ head/lib/libc/powerpc64/sys/cerror.S Sat Dec 11 17:57:42 2010 (r216381) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); ENTRY(HIDENAME(cerror)) mflr %r0 std %r0,16(%r1) /* save lr */ - stdu %r1,-56(%r1) /* allocate new stack frame */ + stdu %r1,-64(%r1) /* allocate new stack frame */ std %r31,48(%r1) mr %r31,%r3 /* stash errval in callee-saved register */ Modified: head/lib/libc/powerpc64/sys/ptrace.S ============================================================================== --- head/lib/libc/powerpc64/sys/ptrace.S Sat Dec 11 17:47:27 2010 (r216380) +++ head/lib/libc/powerpc64/sys/ptrace.S Sat Dec 11 17:57:42 2010 (r216381) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); ENTRY(ptrace) mflr %r0 - stdu %r1,-68(%r1) - std %r0,84(%r1) + std %r0,16(%r1) + stdu %r1,-80(%r1) stw %r3,48(%r1) stw %r4,52(%r1) std %r5,56(%r1) @@ -47,10 +47,10 @@ ENTRY(ptrace) lwz %r3,48(%r1) lwz %r4,52(%r1) ld %r5,56(%r1) - ld %r0,84(%r1) lwz %r6,64(%r1) - mtlr %r0 ld %r1,0(%r1) + ld %r0,16(%r1) + mtlr %r0 li %r0,SYS_ptrace sc bso 1f From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 20:12:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE51106566B; Sat, 11 Dec 2010 20:12:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7238FC14; Sat, 11 Dec 2010 20:12:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBKChOE016759; Sat, 11 Dec 2010 20:12:43 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBKChW5016757; Sat, 11 Dec 2010 20:12:43 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012112012.oBBKChW5016757@svn.freebsd.org> From: Colin Percival Date: Sat, 11 Dec 2010 20:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216382 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 20:12:43 -0000 Author: cperciva Date: Sat Dec 11 20:12:42 2010 New Revision: 216382 URL: http://svn.freebsd.org/changeset/base/216382 Log: Make the machdep.independent_wallclock sysctl do what it says on the box. Modified: head/sys/i386/xen/clock.c Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Sat Dec 11 17:57:42 2010 (r216381) +++ head/sys/i386/xen/clock.c Sat Dec 11 20:12:42 2010 (r216382) @@ -340,7 +340,8 @@ clkintr(void *arg) * time base. */ - if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) { + if (shadow_tv_version != HYPERVISOR_shared_info->wc_version && + !independent_wallclock) { printf("[XEN] hypervisor wallclock nudged; nudging TOD.\n"); update_wallclock(); add_uptime_to_wallclock(); From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 20:29:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32019106566B; Sat, 11 Dec 2010 20:29:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 205238FC16; Sat, 11 Dec 2010 20:29:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBKTr9n017097; Sat, 11 Dec 2010 20:29:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBKTrxu017094; Sat, 11 Dec 2010 20:29:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012112029.oBBKTrxu017094@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 11 Dec 2010 20:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216383 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 20:29:53 -0000 Author: nwhitehorn Date: Sat Dec 11 20:29:52 2010 New Revision: 216383 URL: http://svn.freebsd.org/changeset/base/216383 Log: Add some isync()s related to the 64-bit MMU scratch page to avoid race conditions on its invalidation. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Dec 11 20:12:42 2010 (r216382) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Dec 11 20:29:52 2010 (r216383) @@ -1114,6 +1114,7 @@ void moea64_set_scratchpage_pa(mmu_t mmu MOEA64_PTE_CHANGE(mmup, moea64_scratchpage_pte[which], &moea64_scratchpage_pvo[which]->pvo_pte.lpte, moea64_scratchpage_pvo[which]->pvo_vpn); + isync(); } void Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Dec 11 20:12:42 2010 (r216382) +++ head/sys/powerpc/aim/moea64_native.c Sat Dec 11 20:29:52 2010 (r216383) @@ -292,6 +292,9 @@ moea64_pte_unset_native(mmu_t mmu, uintp pvo_pt->pte_hi &= ~LPTE_VALID; + /* Finish all pending operations */ + isync(); + /* * Force the reg & chg bits back into the PTEs. */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 22:13:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A12E106566C; Sat, 11 Dec 2010 22:13:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4B38FC1C; Sat, 11 Dec 2010 22:13:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBMDT8K019670; Sat, 11 Dec 2010 22:13:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBMDTX0019668; Sat, 11 Dec 2010 22:13:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012112213.oBBMDTX0019668@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Dec 2010 22:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216384 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 22:13:29 -0000 Author: jilles Date: Sat Dec 11 22:13:29 2010 New Revision: 216384 URL: http://svn.freebsd.org/changeset/base/216384 Log: sh: Replace some macros and repeated code in expand.c with functions. No functional change is intended, but the binary is about 1K smaller on i386. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Dec 11 20:29:52 2010 (r216383) +++ head/bin/sh/expand.c Sat Dec 11 22:13:29 2010 (r216384) @@ -137,6 +137,18 @@ expandhere(union node *arg, int fd) xwrite(fd, stackblock(), expdest - stackblock()); } +static char * +stputs_quotes(const char *data, const char *syntax, char *p) +{ + while (*data) { + CHECKSTRSPACE(2, p); + if (syntax[(int)*data] == CCTL) + USTPUTC(CTLESC, p); + USTPUTC(*data++, p); + } + return (p); +} +#define STPUTS_QUOTES(data, syntax, p) p = stputs_quotes((data), syntax, p) /* * Perform expansions on an argument, placing the resulting list of arguments @@ -334,11 +346,10 @@ done: if (*home == '\0') goto lose; *p = c; - while ((c = *home++) != '\0') { - if (quotes && SQSYNTAX[(int)c] == CCTL) - STPUTC(CTLESC, expdest); - STPUTC(c, expdest); - } + if (quotes) + STPUTS_QUOTES(home, SQSYNTAX, expdest); + else + STPUTS(home, expdest); return (p); lose: *p = c; @@ -723,12 +734,10 @@ again: /* jump here after setting a vari varlen++; } else { - while (*val) { - if (quotes && - syntax[(int)*val] == CCTL) - STPUTC(CTLESC, expdest); - STPUTC(*val++, expdest); - } + if (quotes) + STPUTS_QUOTES(val, syntax, expdest); + else + STPUTS(val, expdest); } } @@ -877,7 +886,14 @@ varisset(char *name, int nulok) return 1; } - +static void +strtodest(const char *p, int flag, int subtype, int quoted) +{ + if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) + STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); + else + STPUTS(p, expdest); +} /* * Add the value of a specialized variable to the stack string. @@ -891,21 +907,6 @@ varvalue(char *name, int quoted, int sub int i; char sep; char **ap; - char const *syntax; - -#define STRTODEST(p) \ - do {\ - if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) { \ - syntax = quoted? DQSYNTAX : BASESYNTAX; \ - while (*p) { \ - if (syntax[(int)*p] == CCTL) \ - STPUTC(CTLESC, expdest); \ - STPUTC(*p++, expdest); \ - } \ - } else \ - STPUTS(p, expdest); \ - } while (0) - switch (*name) { case '$': @@ -931,7 +932,7 @@ numvar: case '@': if (flag & EXP_FULL && quoted) { for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { - STRTODEST(p); + strtodest(p, flag, subtype, quoted); if (*ap) STPUTC('\0', expdest); } @@ -944,21 +945,21 @@ numvar: else sep = ' '; for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { - STRTODEST(p); + strtodest(p, flag, subtype, quoted); if (*ap && sep) STPUTC(sep, expdest); } break; case '0': p = arg0; - STRTODEST(p); + strtodest(p, flag, subtype, quoted); break; default: if (is_digit(*name)) { num = atoi(name); if (num > 0 && num <= shellparam.nparam) { p = shellparam.p[num - 1]; - STRTODEST(p); + strtodest(p, flag, subtype, quoted); } } break; From owner-svn-src-head@FreeBSD.ORG Sat Dec 11 22:33:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1CF0106566C; Sat, 11 Dec 2010 22:33:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D078E8FC16; Sat, 11 Dec 2010 22:33:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBBMXXiW020069; Sat, 11 Dec 2010 22:33:33 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBBMXX3W020067; Sat, 11 Dec 2010 22:33:33 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012112233.oBBMXX3W020067@svn.freebsd.org> From: Colin Percival Date: Sat, 11 Dec 2010 22:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216385 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2010 22:33:34 -0000 Author: cperciva Date: Sat Dec 11 22:33:33 2010 New Revision: 216385 URL: http://svn.freebsd.org/changeset/base/216385 Log: Reduce the Xen timecounter from 1GHz to 2^-9 GHz, thereby increasing the timecounter period from 2^32 ns (~4.3s) to 2^41 ns (~36m39s). Some time sharing systems can skip clock interrupts for a few seconds when under load (e.g., if we've recently used more than our fair share of CPU and someone else wants a burst of CPU) and we were losing time in quanta of 2^32 ns due to timecounter wrapping. Increasing the timecounter period up to 2^41 ns is definitely overkill, but we still have microsecond timecounter precision, and anyone using paravirtualized hardware when they need submicrosecond timing is crazy. Modified: head/sys/i386/xen/clock.c Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Sat Dec 11 22:13:29 2010 (r216384) +++ head/sys/i386/xen/clock.c Sat Dec 11 22:33:33 2010 (r216385) @@ -523,7 +523,8 @@ startrtclock() set_cyc2ns_scale(cpu_khz/1000); tsc_freq = cpu_khz * 1000; - timer_freq = xen_timecounter.tc_frequency = 1000000000LL; + timer_freq = 1000000000LL; + xen_timecounter.tc_frequency = timer_freq >> 9; tc_init(&xen_timecounter); rdtscll(alarm); @@ -830,7 +831,7 @@ xen_get_timecount(struct timecounter *tc clk = shadow->system_timestamp + get_nsec_offset(shadow); - return (uint32_t)(clk); + return (uint32_t)(clk >> 9); }