From owner-svn-src-head@freebsd.org Sun Feb 14 02:29:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3111FAA0022; Sun, 14 Feb 2016 02:29:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15FAE1D; Sun, 14 Feb 2016 02:29:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1E2Sx7w056780; Sun, 14 Feb 2016 02:28:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1E2SxBM056779; Sun, 14 Feb 2016 02:28:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602140228.u1E2SxBM056779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Sun, 14 Feb 2016 02:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295606 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 02:29:01 -0000 Author: sephe Date: Sun Feb 14 02:28:59 2016 New Revision: 295606 URL: https://svnweb.freebsd.org/changeset/base/295606 Log: hyperv/hn: Fix typo in comment Noticed by: avos Reviewed by: adrian, avos, Hongjiang Zhang Approved by: adrian MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5199 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Feb 13 22:51:25 2016 (r295605) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sun Feb 14 02:28:59 2016 (r295606) @@ -787,7 +787,7 @@ netvsc_channel_rollup(struct hv_device * /* * NOTE: - * This this function fails, then both txd and m_head0 will be freed + * If this function fails, then both txd and m_head0 will be freed. */ static int hn_encap(struct hn_softc *sc, struct hn_txdesc *txd, struct mbuf **m_head0) From owner-svn-src-head@freebsd.org Sun Feb 14 07:16:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9923AA7553; Sun, 14 Feb 2016 07:16:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 713EF1C25; Sun, 14 Feb 2016 07:16:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1E7Ga9j040506; Sun, 14 Feb 2016 07:16:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1E7Gaot040504; Sun, 14 Feb 2016 07:16:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602140716.u1E7Gaot040504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Feb 2016 07:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295607 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 07:16:37 -0000 Author: hselasky Date: Sun Feb 14 07:16:36 2016 New Revision: 295607 URL: https://svnweb.freebsd.org/changeset/base/295607 Log: Reduce the number of supported WLAN keys in the rum driver, else we risk bit shifting overflows. Found by D5245 / PVS. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumreg.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun Feb 14 02:28:59 2016 (r295606) +++ head/sys/dev/usb/wlan/if_rum.c Sun Feb 14 07:16:36 2016 (r295607) @@ -2732,7 +2732,7 @@ rum_pair_key_del_cb(struct rum_softc *sc DPRINTF("%s: removing key %d\n", __func__, k->wk_keyix); rum_clrbits(sc, (k->wk_keyix < 32) ? RT2573_SEC_CSR2 : RT2573_SEC_CSR3, 1 << (k->wk_keyix % 32)); - sc->keys_bmap &= ~(1 << k->wk_keyix); + sc->keys_bmap &= ~(1ULL << k->wk_keyix); if (--sc->vap_key_count[rvp_id] == 0) rum_clrbits(sc, RT2573_SEC_CSR4, 1 << rvp_id); } @@ -2749,8 +2749,8 @@ rum_key_alloc(struct ieee80211vap *vap, if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { RUM_LOCK(sc); for (i = 0; i < RT2573_ADDR_MAX; i++) { - if ((sc->keys_bmap & (1 << i)) == 0) { - sc->keys_bmap |= 1 << i; + if ((sc->keys_bmap & (1ULL << i)) == 0) { + sc->keys_bmap |= (1ULL << i); *keyix = i; break; } Modified: head/sys/dev/usb/wlan/if_rumreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 (r295606) +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 (r295607) @@ -47,7 +47,7 @@ * H/w encryption/decryption support */ #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) -#define RT2573_ADDR_MAX 64 +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) #define RT2573_SKEY_MAX 4 #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ From owner-svn-src-head@freebsd.org Sun Feb 14 07:20:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21F2AA770A; Sun, 14 Feb 2016 07:20:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84EC01DCB; Sun, 14 Feb 2016 07:20:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1E7K7hK040672; Sun, 14 Feb 2016 07:20:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1E7K7bW040671; Sun, 14 Feb 2016 07:20:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602140720.u1E7K7bW040671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Feb 2016 07:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295608 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 07:20:08 -0000 Author: hselasky Date: Sun Feb 14 07:20:07 2016 New Revision: 295608 URL: https://svnweb.freebsd.org/changeset/base/295608 Log: Fix variable assignment inside if-clause in the smsc driver. Found by D5245 / PVS. MFC after: 1 week Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sun Feb 14 07:16:36 2016 (r295607) +++ head/sys/dev/usb/net/if_smsc.c Sun Feb 14 07:20:07 2016 (r295608) @@ -1362,7 +1362,7 @@ smsc_chip_init(struct smsc_softc *sc) /* Reset the PHY */ smsc_write_reg(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST); - if ((err = smsc_wait_for_bits(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST) != 0)) { + if ((err = smsc_wait_for_bits(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST)) != 0) { smsc_warn_printf(sc, "timed-out waiting for phy reset to complete\n"); goto init_failed; } From owner-svn-src-head@freebsd.org Sun Feb 14 13:42:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26728AA7525; Sun, 14 Feb 2016 13:42:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED08E1CE9; Sun, 14 Feb 2016 13:42:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EDgG7b052753; Sun, 14 Feb 2016 13:42:16 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EDgGqG052752; Sun, 14 Feb 2016 13:42:16 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201602141342.u1EDgGqG052752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 14 Feb 2016 13:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295609 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 13:42:18 -0000 Author: cperciva Date: Sun Feb 14 13:42:16 2016 New Revision: 295609 URL: https://svnweb.freebsd.org/changeset/base/295609 Log: Don't dereference a pointer immediately after determining that it is equal to NULL. [1] While I'm here, s/xb/xbd/ (the name changed a long time ago but this instance wasn't corrected). Reported by: PVS-Studio [1] Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sun Feb 14 07:20:07 2016 (r295608) +++ head/sys/dev/xen/blkfront/blkfront.c Sun Feb 14 13:42:16 2016 (r295609) @@ -674,7 +674,7 @@ xbd_open(struct disk *dp) struct xbd_softc *sc = dp->d_drv1; if (sc == NULL) { - printf("xb%d: not found", sc->xbd_unit); + printf("xbd%d: not found", dp->d_unit); return (ENXIO); } From owner-svn-src-head@freebsd.org Sun Feb 14 14:23:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 627C4AA84E3; Sun, 14 Feb 2016 14:23:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30FAB1E29; Sun, 14 Feb 2016 14:23:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EENvGj064759; Sun, 14 Feb 2016 14:23:57 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EENv1J064758; Sun, 14 Feb 2016 14:23:57 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201602141423.u1EENv1J064758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sun, 14 Feb 2016 14:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295610 - head/usr.bin/hexdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 14:23:58 -0000 Author: kevlo Date: Sun Feb 14 14:23:56 2016 New Revision: 295610 URL: https://svnweb.freebsd.org/changeset/base/295610 Log: Fix a bug that caused nothing to be skipped when skipping exactly the number of bytes present in a regular file was requested. Obtained from: OpenBSD Modified: head/usr.bin/hexdump/display.c Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Sun Feb 14 13:42:16 2016 (r295609) +++ head/usr.bin/hexdump/display.c Sun Feb 14 14:23:56 2016 (r295610) @@ -374,7 +374,7 @@ doskip(const char *fname, int statok) if (statok) { if (fstat(fileno(stdin), &sb)) err(1, "%s", fname); - if (S_ISREG(sb.st_mode) && skip >= sb.st_size) { + if (S_ISREG(sb.st_mode) && skip > sb.st_size) { address += sb.st_size; skip -= sb.st_size; return; From owner-svn-src-head@freebsd.org Sun Feb 14 15:23:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C8A1AA858B; Sun, 14 Feb 2016 15:23:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 293311431; Sun, 14 Feb 2016 15:23:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id xg9so37677776igb.1; Sun, 14 Feb 2016 07:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sM/7Ir7DZk9mNY2QfQEJ8Req1BEMqZkVyRpBGLH3pfM=; b=GWlycpE3gW3WuBuuEudud0NyQ3xneZ7GF9hLdsHIw4ONm+/xjM4o9Jtbh6A3JjGAlH YQmQWPriqH1ebaC6EtwKwbAaCPU3rLu0zV4SlFR/xZy3Vp0s2BsOX2XVhBKWKEcL9LIr s7cBy8wO7d2ILpBha1mBxDBRiatd4HxpZ61BtL2Ozmv5++3NseQ8C57rOOMg73Mpur30 LjmaWxghzKpBRJnfDS9eQ3xHjMOsR8u9kuBUpz7FdUEzxZeoFyYBnU2zcqQDIfgxxNyt eMFgn/6SSPrle/27kwg0TViu8MsZaiFtdM8TwPZbHlMVDdsCkwRutRxmJ5jRTVSjKZSy xEuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sM/7Ir7DZk9mNY2QfQEJ8Req1BEMqZkVyRpBGLH3pfM=; b=OjLA11RF8nNTKnNG3UCQwYIXV+kXo5sjx0slGwcH6v55wnrVvJUBqgovvq4HF1FVJC dhFnzw4cjcX6pCOoTLHKgFMl801YDGnibkQtlwb4U3E+LezPqQYDEl8M1x3UYfTCi33x xM71GRq34mWC1FfuA4Zf1IhcxxyJh0FgVQcoKX9GQKKhIJCXV+aDqJzng0uJRoMM7hB/ 3TroaCpuvxIVQMQzrPz0/RZu9il0xvo/fxzCkknMqG5WU1r/12Zwz2PELhKsjfFVfH43 ZdGNBFt5zhu8Pl5O9an/jxl9eI+6sptBXDCIKtlb4EaLQB88XDGnFfBSdQtcmTR70Nx9 p8cQ== X-Gm-Message-State: AG10YOSQ8qJMVoDBldu++YWZvaNTXAfqsC1pUx9GUEjc9M/4XleRCQsG3zuYFTPLkO6v51FtV6nCNB8+Lpakig== MIME-Version: 1.0 X-Received: by 10.50.79.230 with SMTP id m6mr5461225igx.22.1455463420053; Sun, 14 Feb 2016 07:23:40 -0800 (PST) Received: by 10.36.14.19 with HTTP; Sun, 14 Feb 2016 07:23:40 -0800 (PST) In-Reply-To: <201602140716.u1E7Gaot040504@repo.freebsd.org> References: <201602140716.u1E7Gaot040504@repo.freebsd.org> Date: Sun, 14 Feb 2016 07:23:40 -0800 Message-ID: Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan From: Adrian Chadd To: Hans Petter Selasky , Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 15:23:41 -0000 uhm, why'd you not just file a separate pr for this? 8 keys limits how many stations it can support in hostap mode :( I'd rather the bitmap management code gets fixed. -a On 13 February 2016 at 23:16, Hans Petter Selasky wrote: > Author: hselasky > Date: Sun Feb 14 07:16:36 2016 > New Revision: 295607 > URL: https://svnweb.freebsd.org/changeset/base/295607 > > Log: > Reduce the number of supported WLAN keys in the rum driver, else we > risk bit shifting overflows. Found by D5245 / PVS. > > MFC after: 1 week > > Modified: > head/sys/dev/usb/wlan/if_rum.c > head/sys/dev/usb/wlan/if_rumreg.h > > Modified: head/sys/dev/usb/wlan/if_rum.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_rum.c Sun Feb 14 02:28:59 2016 (r295606) > +++ head/sys/dev/usb/wlan/if_rum.c Sun Feb 14 07:16:36 2016 (r295607) > @@ -2732,7 +2732,7 @@ rum_pair_key_del_cb(struct rum_softc *sc > DPRINTF("%s: removing key %d\n", __func__, k->wk_keyix); > rum_clrbits(sc, (k->wk_keyix < 32) ? RT2573_SEC_CSR2 : RT2573_SEC_CSR3, > 1 << (k->wk_keyix % 32)); > - sc->keys_bmap &= ~(1 << k->wk_keyix); > + sc->keys_bmap &= ~(1ULL << k->wk_keyix); > if (--sc->vap_key_count[rvp_id] == 0) > rum_clrbits(sc, RT2573_SEC_CSR4, 1 << rvp_id); > } > @@ -2749,8 +2749,8 @@ rum_key_alloc(struct ieee80211vap *vap, > if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { > RUM_LOCK(sc); > for (i = 0; i < RT2573_ADDR_MAX; i++) { > - if ((sc->keys_bmap & (1 << i)) == 0) { > - sc->keys_bmap |= 1 << i; > + if ((sc->keys_bmap & (1ULL << i)) == 0) { > + sc->keys_bmap |= (1ULL << i); > *keyix = i; > break; > } > > Modified: head/sys/dev/usb/wlan/if_rumreg.h > ============================================================================== > --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 (r295606) > +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 (r295607) > @@ -47,7 +47,7 @@ > * H/w encryption/decryption support > */ > #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) > -#define RT2573_ADDR_MAX 64 > +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) > #define RT2573_SKEY_MAX 4 > > #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ > From owner-svn-src-head@freebsd.org Sun Feb 14 15:37:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE0C8AA8CDF; Sun, 14 Feb 2016 15:37:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2A51F7F; Sun, 14 Feb 2016 15:37:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7E5451FE023; Sun, 14 Feb 2016 16:37:09 +0100 (CET) Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan To: Adrian Chadd , Andriy Voskoboinyk References: <201602140716.u1E7Gaot040504@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56C09FB4.4000201@selasky.org> Date: Sun, 14 Feb 2016 16:39:32 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 15:37:14 -0000 On 02/14/16 16:23, Adrian Chadd wrote: > uhm, why'd you not just file a separate pr for this? > > 8 keys limits how many stations it can support in hostap mode :( I'd > rather the bitmap management code gets fixed. > Hi, From what I can see 8 keys is the maximum due to the following shift: /* Set cipher mode. */ if (rum_modbits(sc, rvp_id < 2 ? RT2573_SEC_CSR1 : RT2573_SEC_CSR5, mode << (rvp_id % 2 + k->wk_keyix) * RT2573_SKEY_MAX, RT2573_MODE_MASK << (rvp_id % 2 + k->wk_keyix) * RT2573_SKEY_MAX) != 0) goto print_err; It is only about bitmanagement, but about where to actually write those bits. Feel free to fix it. --HPS From owner-svn-src-head@freebsd.org Sun Feb 14 15:40:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF766AA8ED4; Sun, 14 Feb 2016 15:40:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78E501221; Sun, 14 Feb 2016 15:40:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 602721FE023; Sun, 14 Feb 2016 16:40:53 +0100 (CET) Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan To: Adrian Chadd , Andriy Voskoboinyk References: <201602140716.u1E7Gaot040504@repo.freebsd.org> <56C09FB4.4000201@selasky.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56C0A094.6020800@selasky.org> Date: Sun, 14 Feb 2016 16:43:16 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56C09FB4.4000201@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 15:40:57 -0000 On 02/14/16 16:39, Hans Petter Selasky wrote: > It is only about bitmanagement, ^ not --HPS From owner-svn-src-head@freebsd.org Sun Feb 14 15:42:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0339BAA8F94; Sun, 14 Feb 2016 15:42:25 +0000 (UTC) (envelope-from s3erios@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FFBE15E9; Sun, 14 Feb 2016 15:42:24 +0000 (UTC) (envelope-from s3erios@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id l143so76217521lfe.2; Sun, 14 Feb 2016 07:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=kj52p7DxshrBfxz+ZAwyg43sTNNi6/c6j1fmPTStx+M=; b=aS2fB/2pEi/uIhbHyrNDy5DpJakCLZV+bgNhcrjyU1rY3jAK21YGQfowGhfFlwA1EY 7ZXjKE2KV4lHXtmuJ5xPGN+NuisE6AIwu06HidUnpN6eRcRHJ/ERbGRnyvdmv8Cy3Uim Vcch+khCSh9EBJVFTrGzeLkvxYmfjaiw1/SSf0SDY006k3qRmSvickT2DVhzyqrLz1Xy EnjRnWYrTcMlyTM8QuHK2+Kd+wbjIoIkT+tMVglW+L+yxT+/SqnM4tL3zU4un06YjZzt hDdLClp7uT/n2jtRdnTGW0+Ed8aM3cnJJw41GUCytQWfsGayXSJEb+GutFlEeHrvV5op 9tQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:to:subject:references:date:cc :mime-version:content-transfer-encoding:from:message-id:in-reply-to :user-agent; bh=kj52p7DxshrBfxz+ZAwyg43sTNNi6/c6j1fmPTStx+M=; b=QYbL6GDVYWMwkbdMpL77BJAdxgxqphz0tAtaHRdU8AM6byZPVmw/nexyHkzh1/TmtC GlpZoAso+xpycq/knIS6AG/XmvT2UBlKyLz/isHWMfOjuRMagnyhvgVjvlgJfPQt/Y4Y 0APHiEvn5FTM12FJ3n8a8sqKyLuPv5yhaF9YvWalljFd0hpp7WFnBCCYMZg5D41d5CAp l5UhMc4h06kQc1akPZ53ODR+Ay8APBu/dPJt3jbVxkx7dQEzDrH72v7ivRmaLMT/hcUx tFM9Fxjjwg6ipfvOxYE1AuktvJuYZ6vu0P4E3vmuUGqi+hNkMGCRECemxEU+XOavbopi hHLg== X-Gm-Message-State: AG10YOTmCovcfFmVytkuN80kfF3pKvG2z5HSB29p7xEB4yv47MzW26hBAh4GbE5VGxOTkw== X-Received: by 10.25.15.23 with SMTP id e23mr4650430lfi.111.1455464541583; Sun, 14 Feb 2016 07:42:21 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id i1sm3054355lbs.38.2016.02.14.07.42.20 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 14 Feb 2016 07:42:20 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hans Petter Selasky" , "Adrian Chadd" Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan References: <201602140716.u1E7Gaot040504@repo.freebsd.org> <56C09FB4.4000201@selasky.org> Date: Sun, 14 Feb 2016 17:42:21 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <56C09FB4.4000201@selasky.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 15:42:25 -0000 Sun, 14 Feb 2016 17:39:32 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hans Petter Selasky = : This does not related to pairwise keys management: static void rum_group_key_set_cb(struct rum_softc *sc, union sec_param *data, uint8_t rvp_id) { ... /* Set cipher mode. */ if (rum_modbits(sc, rvp_id < 2 ? RT2573_SEC_CSR1 : = RT2573_SEC_CSR5, mode << (rvp_id % 2 + k->wk_keyix) * RT2573_SKEY_MAX, RT2573_MODE_MASK << (rvp_id % 2 + k->wk_keyix) * = RT2573_SKEY_MAX) !=3D 0) goto print_err; ... } For group keys, k->wk_keyix is assigned in another way: static int rum_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) { ... *keyix =3D k - vap->iv_nw_keys; } ... } > On 02/14/16 16:23, Adrian Chadd wrote: >> uhm, why'd you not just file a separate pr for this? >> >> 8 keys limits how many stations it can support in hostap mode :( I'd >> rather the bitmap management code gets fixed. >> > > Hi, > > From what I can see 8 keys is the maximum due to the following shift:= > > /* Set cipher mode. */ > if (rum_modbits(sc, rvp_id < 2 ? RT2573_SEC_CSR1 : = > RT2573_SEC_CSR5, > mode << (rvp_id % 2 + k->wk_keyix) * RT2573_SKEY_MAX, > RT2573_MODE_MASK << (rvp_id % 2 + k->wk_keyix) * = > RT2573_SKEY_MAX) > !=3D 0) > goto print_err; > > > It is only about bitmanagement, but about where to actually write thos= e = > bits. Feel free to fix it. > > --HPS From owner-svn-src-head@freebsd.org Sun Feb 14 15:46:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B200CAA80F3; Sun, 14 Feb 2016 15:46:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A76C19B1; Sun, 14 Feb 2016 15:46:16 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 524BA1FE023; Sun, 14 Feb 2016 16:46:14 +0100 (CET) Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk , Adrian Chadd References: <201602140716.u1E7Gaot040504@repo.freebsd.org> <56C09FB4.4000201@selasky.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56C0A1D5.9010902@selasky.org> Date: Sun, 14 Feb 2016 16:48:37 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 15:46:17 -0000 On 02/14/16 16:42, Andriy Voskoboinyk wrote: > Sun, 14 Feb 2016 17:39:32 +0200 було написано Hans Petter Selasky > : > > This does not related to pairwise keys management: > > static void > rum_group_key_set_cb(struct rum_softc *sc, union sec_param *data, > uint8_t rvp_id) > { > ... Then the if_rumreg.h part of the patch was not needed. Do you want me to fix it? --HPS From owner-svn-src-head@freebsd.org Sun Feb 14 16:11:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3EBAA8870; Sun, 14 Feb 2016 16:11:13 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C47F1204; Sun, 14 Feb 2016 16:11:12 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f179.google.com with SMTP id bc4so66984881lbc.2; Sun, 14 Feb 2016 08:11:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:to:subject:references:date:cc :mime-version:content-transfer-encoding:from:message-id:in-reply-to :user-agent; bh=UsdTHe/1srRJ49Uhml3HHjAezLsmsmWXCttGzhmlzGg=; b=HB8Q0bNq0rEKDUkaIM6EcnlbSxDlfmM2qwCoa/PepYzrRW/FfXTq6cqKQBOJw3zxtn DPxotx+hPxS2nZ/VyUZ7XTqOKu3yXyN5J3OQyDi3C26N0Zzqoc8EQetbZVvZmZCrvvuD U+VRxXsS9mTcM2zdyT4Q4VM1YnHbFjwr9er/zEdUxOWE8lPo4NXPlQgkKOMcEjv5Cw3w Z3bmJw19/UnsyudioHLIJzuTLncIUg+jkk+5zqOOl1jRoHIj2UF+DgoBJSXFgijdIqgQ KItLDmr7cBdM61eoHok2pV6FlMHNvPgo38AYogYr6MFAkF294X6Kg1RU1G9bpEfrCnx5 f2yQ== X-Gm-Message-State: AG10YOT2k5Zw5zLr9WJI9JP9Dh3zmKONu11M88M21cNGpigKa4uWAi3TyXWuldw8/M+6+Q== X-Received: by 10.112.151.134 with SMTP id uq6mr3872398lbb.18.1455462805555; Sun, 14 Feb 2016 07:13:25 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id h8sm3002037lbd.48.2016.02.14.07.13.24 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 14 Feb 2016 07:13:25 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hans Petter Selasky" Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan References: <201602140716.u1E7Gaot040504@repo.freebsd.org> Date: Sun, 14 Feb 2016 17:13:25 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201602140716.u1E7Gaot040504@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 16:11:13 -0000 Sun, 14 Feb 2016 09:16:36 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hans Petter Selasky = : > Author: hselasky > Date: Sun Feb 14 07:16:36 2016 > New Revision: 295607 > URL: https://svnweb.freebsd.org/changeset/base/295607 > > Log: > Reduce the number of supported WLAN keys in the rum driver, else we > risk bit shifting overflows. Found by D5245 / PVS. > MFC after: 1 week Hardware crypto support was never merged (so, there is nothing to MFC). > > Modified: > head/sys/dev/usb/wlan/if_rum.c > head/sys/dev/usb/wlan/if_rumreg.h > > Modified: head/sys/dev/usb/wlan/if_rum.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/dev/usb/wlan/if_rum.c Sun Feb 14 02:28:59 2016 (r295606) > +++ head/sys/dev/usb/wlan/if_rum.c Sun Feb 14 07:16:36 2016 (r295607) > ... > --- skipped --- > ... > Modified: head/sys/dev/usb/wlan/if_rumreg.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=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 (r29560= 6) > +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 (r29560= 7) > @@ -47,7 +47,7 @@ > * H/w encryption/decryption support > */ > #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) > -#define RT2573_ADDR_MAX 64 > +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) > #define RT2573_SKEY_MAX 4 > #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ > Reason of this change? (device table has 64 entries, not 8). I have not seen any overflows, caused by it: 1) vap->iv_key_set =3D rum_key_set; vap->iv_key_delete =3D rum_key_delete; vap->iv_update_beacon =3D rum_update_beacon; vap->iv_max_aid =3D RT2573_ADDR_MAX; // not the case usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); 2) k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { RUM_LOCK(sc); for (i =3D 0; i < RT2573_ADDR_MAX; i++) { // can hold [0;63] wit= hout = any overflows; // keys_bmap is 64-bit, so there is no overflow too if ((sc->keys_bmap & (1ULL << i)) =3D=3D 0) { sc->keys_bmap |=3D 1ULL << i; *keyix =3D i; 3) } } RUM_UNLOCK(sc); if (i =3D=3D RT2573_ADDR_MAX) { // like the first case device_printf(sc->sc_dev, "%s: no free space in the key table\n", __func__); From owner-svn-src-head@freebsd.org Sun Feb 14 16:16:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E932AAA8B21; Sun, 14 Feb 2016 16:16:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F08176A; Sun, 14 Feb 2016 16:16:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C1EB41FE023; Sun, 14 Feb 2016 17:16:39 +0100 (CET) Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk References: <201602140716.u1E7Gaot040504@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56C0A8F6.1090105@selasky.org> Date: Sun, 14 Feb 2016 17:19:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 16:16:43 -0000 On 02/14/16 16:13, Andriy Voskoboinyk wrote: > Sun, 14 Feb 2016 09:16:36 +0200 було написано Hans Petter Selasky > : > >> Author: hselasky >> Date: Sun Feb 14 07:16:36 2016 >> New Revision: 295607 >> URL: https://svnweb.freebsd.org/changeset/base/295607 >> >> Log: >> Reduce the number of supported WLAN keys in the rum driver, else we >> risk bit shifting overflows. Found by D5245 / PVS. >> MFC after: 1 week > > Hardware crypto support was never merged (so, there is nothing to MFC). OK. >> Modified: head/sys/dev/usb/wlan/if_rumreg.h >> ============================================================================== >> >> --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 >> (r295606) >> +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 >> (r295607) >> @@ -47,7 +47,7 @@ >> * H/w encryption/decryption support >> */ >> #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) >> -#define RT2573_ADDR_MAX 64 >> +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) >> #define RT2573_SKEY_MAX 4 >> #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ >> > > Reason of this change? (device table has 64 entries, not 8). > I have not seen any overflows, caused by it: You're right. > > 1) > vap->iv_key_set = rum_key_set; > vap->iv_key_delete = rum_key_delete; > vap->iv_update_beacon = rum_update_beacon; > vap->iv_max_aid = RT2573_ADDR_MAX; // not > the case > > usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); > TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); > > 2) > k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { > if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { > RUM_LOCK(sc); > for (i = 0; i < RT2573_ADDR_MAX; i++) { // can hold > [0;63] without any overflows; > // keys_bmap is 64-bit, so there > is no overflow too > if ((sc->keys_bmap & (1ULL << i)) == 0) { > sc->keys_bmap |= 1ULL << i; > *keyix = i; > > 3) > } I'll revert the header file change shortly. Then we're up to date. --HPS From owner-svn-src-head@freebsd.org Sun Feb 14 16:18:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BBA3AA8D81; Sun, 14 Feb 2016 16:18:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ED96197E; Sun, 14 Feb 2016 16:18:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EGIdqD097906; Sun, 14 Feb 2016 16:18:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EGIdvP097905; Sun, 14 Feb 2016 16:18:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602141618.u1EGIdvP097905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Feb 2016 16:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295611 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 16:18:40 -0000 Author: hselasky Date: Sun Feb 14 16:18:39 2016 New Revision: 295611 URL: https://svnweb.freebsd.org/changeset/base/295611 Log: Restore maximum number of host keys to 64. Discussed with: adrian @ and avos @ Modified: head/sys/dev/usb/wlan/if_rumreg.h Modified: head/sys/dev/usb/wlan/if_rumreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 14:23:56 2016 (r295610) +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 16:18:39 2016 (r295611) @@ -47,7 +47,7 @@ * H/w encryption/decryption support */ #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + IEEE80211_MICBUF_SIZE) -#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) +#define RT2573_ADDR_MAX 64 #define RT2573_SKEY_MAX 4 #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX + \ From owner-svn-src-head@freebsd.org Sun Feb 14 16:38:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84EC3AA897A; Sun, 14 Feb 2016 16:38:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5818613BC; Sun, 14 Feb 2016 16:38:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EGcWbS003952; Sun, 14 Feb 2016 16:38:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EGcWk6003951; Sun, 14 Feb 2016 16:38:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602141638.u1EGcWk6003951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Feb 2016 16:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295612 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 16:38:33 -0000 Author: andrew Date: Sun Feb 14 16:38:32 2016 New Revision: 295612 URL: https://svnweb.freebsd.org/changeset/base/295612 Log: Remove an unused include. Modified: head/sys/arm/mv/twsi.c Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Sun Feb 14 16:18:39 2016 (r295611) +++ head/sys/arm/mv/twsi.c Sun Feb 14 16:38:32 2016 (r295612) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "iicbus_if.h" From owner-svn-src-head@freebsd.org Sun Feb 14 18:20:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432DCAA89BD; Sun, 14 Feb 2016 18:20:47 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA5FD1BD2; Sun, 14 Feb 2016 18:20:46 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f178.google.com with SMTP id bc4so67804625lbc.2; Sun, 14 Feb 2016 10:20:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:to:subject:references:date:cc :mime-version:content-transfer-encoding:from:message-id:in-reply-to :user-agent; bh=vsg6GlAAxRUe9nNSsXlVxxgoAbb5bdzJ3a8NNzwW3uA=; b=h0fyGkwvR0RSTDv9c4+IFY5gH0xWZHK9jvr2wRCI6Q83ad5loqazRsxiTYuT/uXA2s uosrBEoJJZQnvfb+U5/XuIGUDb99t+wXRXv428PvYLrqs9fX6/BIIy8y7PLzo/4+TDwu /4tD5Xc0ywcpCOn7GbKhlEbQ8m+tVpULwGPdRxqCtwg1bvwZuG2J/im0/CmGF2P6Dhq+ Pgou9Sv1fF1V5dmV2RE1U/LDQD616Mpw9O5gm6bJcyEoK48bKcW7A8J3lgFsCrMV/R82 7pvudu2dTbXrmCPGnqIYnFpZk7w2JZzpXAdpIdPxtmkdsWx5Bc3uoScNblK/LJoTjEKM jFjg== X-Gm-Message-State: AG10YOQ6t9tjuraXRDYQt//UrrHMpX9gZ2eFe3Wg2mRwCgS6oP5nINWE4fps+K93wrxJpw== X-Received: by 10.112.134.70 with SMTP id pi6mr4164869lbb.59.1455474044865; Sun, 14 Feb 2016 10:20:44 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id jb5sm428953lbc.8.2016.02.14.10.20.43 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 14 Feb 2016 10:20:44 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hans Petter Selasky" Subject: Re: svn commit: r295607 - head/sys/dev/usb/wlan References: <201602140716.u1E7Gaot040504@repo.freebsd.org> <56C0A8F6.1090105@selasky.org> Date: Sun, 14 Feb 2016 20:20:44 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <56C0A8F6.1090105@selasky.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 18:20:47 -0000 Sun, 14 Feb 2016 18:19:02 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hans Petter Selasky = : > On 02/14/16 16:13, Andriy Voskoboinyk wrote: >> Sun, 14 Feb 2016 09:16:36 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hans Petter Selasky >> : >> >>> Author: hselasky >>> Date: Sun Feb 14 07:16:36 2016 >>> New Revision: 295607 >>> URL: https://svnweb.freebsd.org/changeset/base/295607 >>> >>> Log: >>> Reduce the number of supported WLAN keys in the rum driver, else w= e >>> risk bit shifting overflows. Found by D5245 / PVS. >>> MFC after: 1 week >> >> Hardware crypto support was never merged (so, there is nothing to MFC= ). > > OK. > >>> Modified: head/sys/dev/usb/wlan/if_rumreg.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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >>> >>> --- head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 02:28:59 2016 >>> (r295606) >>> +++ head/sys/dev/usb/wlan/if_rumreg.h Sun Feb 14 07:16:36 2016 >>> (r295607) >>> @@ -47,7 +47,7 @@ >>> * H/w encryption/decryption support >>> */ >>> #define KEY_SIZE (IEEE80211_KEYBUF_SIZE + = >>> IEEE80211_MICBUF_SIZE) >>> -#define RT2573_ADDR_MAX 64 >>> +#define RT2573_ADDR_MAX (32 / RT2573_SKEY_MAX) >>> #define RT2573_SKEY_MAX 4 >>> #define RT2573_SKEY(vap, kidx) (0x1000 + ((vap) * RT2573_SKEY_MAX= + = >>> \ >>> >> >> Reason of this change? (device table has 64 entries, not 8). >> I have not seen any overflows, caused by it: > > You're right. > >> >> 1) >> vap->iv_key_set =3D rum_key_set; >> vap->iv_key_delete =3D rum_key_delete; >> vap->iv_update_beacon =3D rum_update_beacon; >> vap->iv_max_aid =3D RT2573_ADDR_MAX; // n= ot >> the case >> >> usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); >> TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); >> >> 2) >> k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { >> if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { >> RUM_LOCK(sc); >> for (i =3D 0; i < RT2573_ADDR_MAX; i++) { // can ho= ld >> [0;63] without any overflows; >> // keys_bmap is 64-bit, so ther= e >> is no overflow too >> if ((sc->keys_bmap & (1ULL << i)) =3D=3D 0) { >> sc->keys_bmap |=3D 1ULL << i; >> *keyix =3D i; >> >> 3) >> } > > I'll revert the header file change shortly. Then we're up to date. > > --HPS Thanks! From owner-svn-src-head@freebsd.org Sun Feb 14 19:52:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02850AA8E61; Sun, 14 Feb 2016 19:52:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C862DDE7; Sun, 14 Feb 2016 19:52:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EJqoYQ072955; Sun, 14 Feb 2016 19:52:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EJqoN1072954; Sun, 14 Feb 2016 19:52:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602141952.u1EJqoN1072954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 14 Feb 2016 19:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295616 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 19:52:52 -0000 Author: pfg Date: Sun Feb 14 19:52:50 2016 New Revision: 295616 URL: https://svnweb.freebsd.org/changeset/base/295616 Log: ext2fs: Remove panics for rename() race conditions. Sync with r84642 from UFS: The panics are inappropriate because the IN_RENAME flag only fixes a few of the huge number of race conditions that can result in the source path becoming invalid even prior to the VOP_RENAME() call. Found accidentally while checking an issue from PVS Static Analysis. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun Feb 14 18:57:40 2016 (r295615) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun Feb 14 19:52:50 2016 (r295616) @@ -985,10 +985,10 @@ abortit: dp = VTOI(fdvp); } else { /* - * From name has disappeared. + * From name has disappeared. IN_RENAME is not sufficient + * to protect against directory races due to timing windows, + * so we can't panic here. */ - if (doingdirectory) - panic("ext2_rename: lost dir entry"); vrele(ap->a_fvp); return (0); } @@ -1003,8 +1003,11 @@ abortit: * rename. */ if (xp != ip) { - if (doingdirectory) - panic("ext2_rename: lost dir entry"); + /* + * From name resolves to a different inode. IN_RENAME is + * not sufficient protection against timing window races + * so we can't panic here. + */ } else { /* * If the source is a directory with a From owner-svn-src-head@freebsd.org Sun Feb 14 22:37:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E66AA84A5; Sun, 14 Feb 2016 22:37:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5B5BA33; Sun, 14 Feb 2016 22:37:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1EMbSuY021703; Sun, 14 Feb 2016 22:37:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1EMbS1L021700; Sun, 14 Feb 2016 22:37:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201602142237.u1EMbS1L021700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 14 Feb 2016 22:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295618 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 22:37:30 -0000 Author: cem Date: Sun Feb 14 22:37:28 2016 New Revision: 295618 URL: https://svnweb.freebsd.org/changeset/base/295618 Log: NTB: workaround for high traffic hardware hang This patch comes from Dave Jiang's Linux tree, davejiang/ntb. It hasn't been accepted into Linus' tree, so I do not have an authoritative SHA1 to point at. Original commit log: ===================================================================== A hardware errata causes the NTB to hang when heavy bi-directional traffic in addition to the usage of BAR0/1 (where the registers reside, including the doorbell registers to trigger interrupts). This workaround is only available on Haswell and Broadwell platform. The workaround is to enable split BAR in the BIOS to allow the 64bit BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed to LAPIC region of the remote host. We will bypass the db mechanism and directly trigger the MSIX interrupts. The offsets and vectors are exchanged during transport scratch pad negotiation. The scratch pads are now overloaded in order to allow the exchange of the information. This gets around using the doorbell and prevents the lockup with additional pcode changes in BIOS. Signed-off-by: Dave Jiang ===================================================================== Notable changes in the FreeBSD version of this patch: * The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx). The Linux version of the patch only uses BAR4. * MSIX negotiation aborts if the link goes down. Obtained from: Linux (Dual BSD/GPL driver) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_hw.h head/sys/dev/ntb/ntb_hw/ntb_regs.h Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Sun Feb 14 22:31:38 2016 (r295617) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sun Feb 14 22:37:28 2016 (r295618) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -42,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +73,19 @@ __FBSDID("$FreeBSD$"); #define DEVICE2SOFTC(dev) ((struct ntb_softc *) device_get_softc(dev)) +#define NTB_MSIX_VER_GUARD 0xaabbccdd +#define NTB_MSIX_RECEIVED 0xe0f0e0f0 +#define ONE_MB (1024u * 1024) + +/* + * PCI constants could be somewhere more generic, but aren't defined/used in + * pci.c. + */ +#define PCI_MSIX_ENTRY_SIZE 16 +#define PCI_MSIX_ENTRY_LOWER_ADDR 0 +#define PCI_MSIX_ENTRY_UPPER_ADDR 4 +#define PCI_MSIX_ENTRY_DATA 8 + enum ntb_device_type { NTB_XEON, NTB_ATOM @@ -95,6 +111,18 @@ enum ntb_bar { NTB_MAX_BARS }; +enum { + NTB_MSIX_GUARD = 0, + NTB_MSIX_DATA0, + NTB_MSIX_DATA1, + NTB_MSIX_DATA2, + NTB_MSIX_OFS0, + NTB_MSIX_OFS1, + NTB_MSIX_OFS2, + NTB_MSIX_DONE, + NTB_MAX_MSIX_SPAD +}; + /* Device features and workarounds */ #define HAS_FEATURE(feature) \ ((ntb->features & (feature)) != 0) @@ -131,6 +159,7 @@ struct ntb_int_info { struct ntb_vec { struct ntb_softc *ntb; uint32_t num; + unsigned masked; }; struct ntb_reg { @@ -169,6 +198,11 @@ struct ntb_b2b_addr { uint64_t bar5_addr32; }; +struct ntb_msix_data { + uint32_t nmd_ofs; + uint32_t nmd_data; +}; + struct ntb_softc { device_t device; enum ntb_device_type type; @@ -178,6 +212,13 @@ struct ntb_softc { struct ntb_int_info int_info[MAX_MSIX_INTERRUPTS]; uint32_t allocated_interrupts; + struct ntb_msix_data peer_msix_data[XEON_NONLINK_DB_MSIX_BITS]; + struct ntb_msix_data msix_data[XEON_NONLINK_DB_MSIX_BITS]; + bool peer_msix_good; + bool peer_msix_done; + struct ntb_pci_bar_info *peer_lapic_bar; + struct callout peer_msix_work; + struct callout heartbeat_timer; struct callout lr_timer; @@ -198,6 +239,7 @@ struct ntb_softc { /* Memory window used to access peer bar0 */ #define B2B_MW_DISABLED UINT8_MAX uint8_t b2b_mw_idx; + uint8_t msix_mw_idx; uint8_t mw_count; uint8_t spad_count; @@ -292,6 +334,8 @@ static inline void db_iowrite(struct ntb static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); static void ntb_free_msix_vec(struct ntb_softc *ntb); +static void ntb_get_msix_info(struct ntb_softc *ntb, uint32_t num_vectors); +static void ntb_exchange_msix(void *); static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); static void ntb_detect_max_mw(struct ntb_softc *ntb); static int ntb_detect_xeon(struct ntb_softc *ntb); @@ -308,7 +352,9 @@ static void xeon_set_pbar_xlat(struct nt enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); +static int xeon_setup_msix_bar(struct ntb_softc *); static inline bool link_is_up(struct ntb_softc *ntb); +static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); static inline enum ntb_speed ntb_link_sta_speed(struct ntb_softc *); static inline enum ntb_width ntb_link_sta_width(struct ntb_softc *); @@ -395,6 +441,13 @@ ntb_vm_memattr_to_str(vm_memattr_t pat) } } +static int g_ntb_msix_idx = 0; +SYSCTL_INT(_hw_ntb, OID_AUTO, msix_mw_idx, CTLFLAG_RDTUN, &g_ntb_msix_idx, + 0, "Use this memory window to access the peer MSIX message complex on " + "certain Xeon-based NTB systems, as a workaround for a hardware errata. " + "Like b2b_mw_idx, negative values index from the last available memory " + "window. (Applies on Xeon platforms with SB01BASE_LOCKUP errata.)"); + static int g_ntb_mw_idx = -1; SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx, 0, "Use this memory window to access the peer NTB registers. A " @@ -593,10 +646,12 @@ ntb_attach(device_t device) ntb->type = p->type; ntb->features = p->features; ntb->b2b_mw_idx = B2B_MW_DISABLED; + ntb->msix_mw_idx = B2B_MW_DISABLED; /* Heartbeat timer for NTB_ATOM since there is no link interrupt */ callout_init(&ntb->heartbeat_timer, 1); callout_init(&ntb->lr_timer, 1); + callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); @@ -621,6 +676,8 @@ ntb_attach(device_t device) if (error != 0) goto out; + ntb_spad_clear(ntb); + ntb_poll_link(ntb); ntb_sysctl_init(ntb); @@ -638,10 +695,14 @@ ntb_detach(device_t device) ntb = DEVICE2SOFTC(device); - if (ntb->self_reg != NULL) - ntb_db_set_mask(ntb, ntb->db_valid_mask); + if (ntb->self_reg != NULL) { + DB_MASK_LOCK(ntb); + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_valid_mask); + DB_MASK_UNLOCK(ntb); + } callout_drain(&ntb->heartbeat_timer); callout_drain(&ntb->lr_timer); + callout_drain(&ntb->peer_msix_work); pci_disable_busmaster(ntb->device); if (ntb->type == NTB_XEON) ntb_teardown_xeon(ntb); @@ -965,9 +1026,12 @@ ntb_init_isr(struct ntb_softc *ntb) ntb->last_ts = ticks; /* - * Mask all doorbell interrupts. + * Mask all doorbell interrupts. (Except link events!) */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); num_vectors = desired_vectors = MIN(pci_msix_count(ntb->device), ntb->db_count); @@ -992,12 +1056,20 @@ ntb_init_isr(struct ntb_softc *ntb) num_vectors = 1; if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround does not support MSI or INTX\n"); + return (EINVAL); + } + ntb->db_vec_count = 1; ntb->db_vec_shift = XEON_DB_TOTAL_SHIFT; rc = ntb_setup_legacy_interrupt(ntb); } else { ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); + if (rc == 0 && HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + ntb_get_msix_info(ntb, num_vectors); } if (rc != 0) { device_printf(ntb->device, @@ -1103,6 +1175,9 @@ void ntb_db_set_mask(struct ntb_softc *ntb, uint64_t bits) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask |= bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1118,6 +1193,9 @@ ntb_db_clear_mask(struct ntb_softc *ntb, (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask &= ~bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1128,6 +1206,18 @@ uint64_t ntb_db_read(struct ntb_softc *ntb) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + uint64_t res; + unsigned i; + + res = 0; + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if (ntb->msix_vec[i].masked != 0) + res |= ntb_db_vector_mask(ntb, i); + } + return (res); + } + return (db_ioread(ntb, ntb->self_reg->db_bell)); } @@ -1140,6 +1230,25 @@ ntb_db_clear(struct ntb_softc *ntb, uint (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + unsigned i; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bits & ntb_db_vector_mask(ntb, i)) != 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[i].masked != 0) { + /* XXX These need a public API. */ +#if 0 + pci_unmask_msix(ntb->device, i); +#endif + ntb->msix_vec[i].masked = 0; + } + DB_MASK_UNLOCK(ntb); + } + } + return; + } + db_iowrite(ntb, ntb->self_reg->db_bell, bits); } @@ -1166,6 +1275,19 @@ ntb_interrupt(struct ntb_softc *ntb, uin ntb_link_event(ntb); } + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + (vec_mask & ntb->db_link_mask) == 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[vec].masked == 0) { + /* XXX These need a public API. */ +#if 0 + pci_mask_msix(ntb->device, vec); +#endif + ntb->msix_vec[vec].masked = 1; + } + DB_MASK_UNLOCK(ntb); + } + if ((vec_mask & ntb->db_valid_mask) != 0) ntb_db_event(ntb, vec); } @@ -1211,6 +1333,38 @@ ntb_free_msix_vec(struct ntb_softc *ntb) ntb->msix_vec = NULL; } +static void +ntb_get_msix_info(struct ntb_softc *ntb, uint32_t num_vectors) +{ + struct pci_devinfo *dinfo; + struct pcicfg_msix *msix; + uint32_t laddr, data, i, offset; + + dinfo = device_get_ivars(ntb->device); + msix = &dinfo->cfg.msix; + + laddr = data = 0; + + for (i = 0; i < num_vectors; i++) { + offset = msix->msix_table_offset + i * PCI_MSIX_ENTRY_SIZE; + + laddr = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_LOWER_ADDR); + ntb_printf(2, "local lower MSIX addr(%u): 0x%x\n", i, laddr); + + KASSERT((laddr & MSI_INTEL_ADDR_BASE) == MSI_INTEL_ADDR_BASE, + ("local MSIX addr 0x%x not in MSI base 0x%x", laddr, + MSI_INTEL_ADDR_BASE)); + ntb->msix_data[i].nmd_ofs = laddr & ~MSI_INTEL_ADDR_BASE; + + data = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_DATA); + ntb_printf(2, "local MSIX data(%u): 0x%x\n", i, data); + + ntb->msix_data[i].nmd_data = data; + } +} + static struct ntb_hw_info * ntb_get_device_info(uint32_t device_id) { @@ -1263,9 +1417,12 @@ ntb_detect_xeon(struct ntb_softc *ntb) if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; - /* SB01BASE_LOCKUP errata is a superset of SDOORBELL errata */ + /* + * SDOORBELL errata workaround gets in the way of SB01BASE_LOCKUP + * errata workaround; only do one at a time. + */ if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) - ntb->features |= NTB_SDOORBELL_LOCKUP; + ntb->features &= ~NTB_SDOORBELL_LOCKUP; conn_type = ppd & XEON_PPD_CONN_TYPE; switch (conn_type) { @@ -1329,19 +1486,28 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) ntb->peer_reg = &xeon_b2b_reg; ntb->xlat_reg = &xeon_sec_xlat; - /* - * There is a Xeon hardware errata related to writes to SDOORBELL or - * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, - * which may hang the system. To workaround this, use a memory - * window to access the interrupt and scratch pad registers on the - * remote system. - */ - if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + ntb->msix_mw_idx = (ntb->mw_count + g_ntb_msix_idx) % + ntb->mw_count; + ntb_printf(2, "Setting up MSIX mw idx %d means %u\n", + g_ntb_msix_idx, ntb->msix_mw_idx); + rc = ntb_mw_set_wc_internal(ntb, ntb->msix_mw_idx, + VM_MEMATTR_UNCACHEABLE); + KASSERT(rc == 0, ("shouldn't fail")); + } else if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + /* + * There is a Xeon hardware errata related to writes to SDOORBELL or + * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, + * which may hang the system. To workaround this, use a memory + * window to access the interrupt and scratch pad registers on the + * remote system. + */ ntb->b2b_mw_idx = (ntb->mw_count + g_ntb_mw_idx) % ntb->mw_count; ntb_printf(2, "Setting up b2b mw idx %d means %u\n", g_ntb_mw_idx, ntb->b2b_mw_idx); - rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, VM_MEMATTR_UNCACHEABLE); + rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, + VM_MEMATTR_UNCACHEABLE); KASSERT(rc == 0, ("shouldn't fail")); } else if (HAS_FEATURE(NTB_B2BDOORBELL_BIT14)) /* @@ -1372,7 +1538,14 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) /* * Mask all doorbell interrupts. */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); + + rc = xeon_setup_msix_bar(ntb); + if (rc != 0) + return (rc); rc = ntb_init_isr(ntb); return (rc); @@ -1475,6 +1648,15 @@ xeon_reset_sbar_size(struct ntb_softc *n bar_sz--; else bar_sz = 0; + } else if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) { + /* Restrict LAPIC BAR to 1MB */ + pci_write_config(ntb->device, bar->psz_off, 20, 1); + pci_write_config(ntb->device, bar->ssz_off, 20, 1); + bar_sz = pci_read_config(ntb->device, bar->psz_off, 1); + bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); + (void)bar_sz; + return; } pci_write_config(ntb->device, bar->ssz_off, bar_sz, 1); bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); @@ -1485,28 +1667,37 @@ static void xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, enum ntb_bar idx, enum ntb_bar regbar) { - uint64_t reg_val; + uint64_t reg_val, lmt_addr; uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); if (idx == regbar) bar_addr += ntb->b2b_off; + lmt_addr = bar_addr; + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) + lmt_addr += ONE_MB; + + /* + * Set limit registers first to avoid an errata where setting the base + * registers locks the limit registers. + */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, base_reg, bar_addr); - reg_val = ntb_reg_read(4, base_reg); + ntb_reg_write(4, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(4, lmt_reg); (void)reg_val; - ntb_reg_write(4, lmt_reg, bar_addr); - reg_val = ntb_reg_read(4, lmt_reg); + ntb_reg_write(4, base_reg, bar_addr); + reg_val = ntb_reg_read(4, base_reg); (void)reg_val; } else { - ntb_reg_write(8, base_reg, bar_addr); - reg_val = ntb_reg_read(8, base_reg); + ntb_reg_write(8, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(8, lmt_reg); (void)reg_val; - ntb_reg_write(8, lmt_reg, bar_addr); - reg_val = ntb_reg_read(8, lmt_reg); + ntb_reg_write(8, base_reg, bar_addr); + reg_val = ntb_reg_read(8, base_reg); (void)reg_val; } } @@ -1528,6 +1719,37 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb } static int +xeon_setup_msix_bar(struct ntb_softc *ntb) +{ + struct ntb_pci_bar_info *lapic_bar; + enum ntb_bar bar_num; + int rc; + + if (!HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return (0); + + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + lapic_bar = &ntb->bar_info[bar_num]; + + /* Restrict LAPIC BAR to 1MB */ + if (lapic_bar->size > ONE_MB) { + rc = bus_adjust_resource(ntb->device, SYS_RES_MEMORY, + lapic_bar->pci_resource, lapic_bar->pbase, + lapic_bar->pbase + ONE_MB - 1); + if (rc == 0) + lapic_bar->size = ONE_MB; + else { + ntb_printf(0, "Failed to shrink LAPIC BAR resource to " + "1 MB: %d\n", rc); + /* Ignore error */ + } + } + + ntb->peer_lapic_bar = lapic_bar; + return (0); +} + +static int xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr) { @@ -1605,6 +1827,43 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, XEON_SBAR2XLAT_OFFSET, 0); ntb_reg_write(8, XEON_SBAR4XLAT_OFFSET, 0); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + size_t size, xlatoffset; + + switch (ntb_mw_to_bar(ntb, ntb->msix_mw_idx)) { + case NTB_B2B_BAR_1: + size = 8; + xlatoffset = XEON_SBAR2XLAT_OFFSET; + break; + case NTB_B2B_BAR_2: + xlatoffset = XEON_SBAR4XLAT_OFFSET; + if (HAS_FEATURE(NTB_SPLIT_BAR)) + size = 4; + else + size = 8; + break; + case NTB_B2B_BAR_3: + xlatoffset = XEON_SBAR5XLAT_OFFSET; + size = 4; + break; + default: + KASSERT(false, ("Bogus msix mw idx: %u", + ntb->msix_mw_idx)); + return (EINVAL); + } + + /* + * We point the chosen MSIX MW BAR xlat to remote LAPIC for + * workaround + */ + if (size == 4) + ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); + else + ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); + } + (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); + (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); + /* Zero outgoing translation limits (whole bar size windows) */ ntb_reg_write(8, XEON_PBAR2LMT_OFFSET, 0); ntb_reg_write(8, XEON_PBAR4LMT_OFFSET, 0); @@ -1642,14 +1901,21 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, } static inline bool +_xeon_link_is_up(struct ntb_softc *ntb) +{ + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); +} + +static inline bool link_is_up(struct ntb_softc *ntb) { - if (ntb->type == NTB_XEON) { - if (ntb->conn_type == NTB_CONN_TRANSPARENT) - return (true); - return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); - } + if (ntb->type == NTB_XEON) + return (_xeon_link_is_up(ntb) && (ntb->peer_msix_good || + !HAS_FEATURE(NTB_SB01BASE_LOCKUP))); KASSERT(ntb->type == NTB_ATOM, ("ntb type")); return ((ntb->ntb_ctl & ATOM_CNTL_LINK_DOWN) == 0); @@ -1988,6 +2254,19 @@ ntb_poll_link(struct ntb_softc *ntb) return (false); ntb->lnk_sta = reg_val; + + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + if (_xeon_link_is_up(ntb)) { + if (!ntb->peer_msix_good) { + callout_reset(&ntb->peer_msix_work, 0, + ntb_exchange_msix, ntb); + return (false); + } + } else { + ntb->peer_msix_good = false; + ntb->peer_msix_done = false; + } + } } return (true); } @@ -2416,12 +2695,70 @@ static unsigned ntb_user_mw_to_idx(struct ntb_softc *ntb, unsigned uidx) { - if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && - uidx >= ntb->b2b_mw_idx) - return (uidx + 1); + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) || + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) && + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; return (uidx); } +static void +ntb_exchange_msix(void *ctx) +{ + struct ntb_softc *ntb; + uint32_t val; + unsigned i; + + ntb = ctx; + + if (ntb->peer_msix_done) + goto msix_done; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_peer_spad_write(ntb, NTB_MSIX_DATA0 + i, + ntb->msix_data[i].nmd_data); + ntb_peer_spad_write(ntb, NTB_MSIX_OFS0 + i, + ntb->msix_data[i].nmd_ofs); + } + ntb_peer_spad_write(ntb, NTB_MSIX_GUARD, NTB_MSIX_VER_GUARD); + + ntb_spad_read(ntb, NTB_MSIX_GUARD, &val); + if (val != NTB_MSIX_VER_GUARD) + goto reschedule; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_spad_read(ntb, NTB_MSIX_DATA0 + i, &val); + ntb->peer_msix_data[i].nmd_data = val; + ntb_spad_read(ntb, NTB_MSIX_OFS0 + i, &val); + ntb->peer_msix_data[i].nmd_ofs = val; + } + + ntb->peer_msix_done = true; + +msix_done: + ntb_peer_spad_write(ntb, NTB_MSIX_DONE, NTB_MSIX_RECEIVED); + ntb_spad_read(ntb, NTB_MSIX_DONE, &val); + if (val != NTB_MSIX_RECEIVED) + goto reschedule; + + ntb->peer_msix_good = true; + + ntb_poll_link(ntb); + ntb_link_event(ntb); + return; + +reschedule: + ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); + if (_xeon_link_is_up(ntb)) + callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); + else + ntb_spad_clear(ntb); +} + /* * Public API to the rest of the OS */ @@ -2451,10 +2788,14 @@ ntb_get_max_spads(struct ntb_softc *ntb) uint8_t ntb_mw_count(struct ntb_softc *ntb) { + uint8_t res; + res = ntb->mw_count; if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0) - return (ntb->mw_count - 1); - return (ntb->mw_count); + res--; + if (ntb->msix_mw_idx != B2B_MW_DISABLED) + res--; + return (res); } /** @@ -2480,6 +2821,18 @@ ntb_spad_write(struct ntb_softc *ntb, un return (0); } +/* + * Zeros the local scratchpad. + */ +void +ntb_spad_clear(struct ntb_softc *ntb) +{ + unsigned i; + + for (i = 0; i < ntb->spad_count; i++) + ntb_spad_write(ntb, i, 0); +} + /** * ntb_spad_read() - read from the primary scratchpad register * @ntb: pointer to ntb_softc instance @@ -2808,6 +3161,22 @@ void ntb_peer_db_set(struct ntb_softc *ntb, uint64_t bit) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + struct ntb_pci_bar_info *lapic; + unsigned i; + + lapic = ntb->peer_lapic_bar; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bit & ntb_db_vector_mask(ntb, i)) != 0) + bus_space_write_4(lapic->pci_bus_tag, + lapic->pci_bus_handle, + ntb->peer_msix_data[i].nmd_ofs, + ntb->peer_msix_data[i].nmd_data); + } + return; + } + if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); return; Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.h Sun Feb 14 22:31:38 2016 (r295617) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.h Sun Feb 14 22:37:28 2016 (r295618) @@ -86,6 +86,7 @@ int ntb_mw_get_wc(struct ntb_softc *, un int ntb_mw_set_wc(struct ntb_softc *, unsigned mw_idx, vm_memattr_t mode); uint8_t ntb_get_max_spads(struct ntb_softc *ntb); +void ntb_spad_clear(struct ntb_softc *ntb); int ntb_spad_write(struct ntb_softc *ntb, unsigned int idx, uint32_t val); int ntb_spad_read(struct ntb_softc *ntb, unsigned int idx, uint32_t *val); int ntb_peer_spad_write(struct ntb_softc *ntb, unsigned int idx, Modified: head/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_regs.h Sun Feb 14 22:31:38 2016 (r295617) +++ head/sys/dev/ntb/ntb_hw/ntb_regs.h Sun Feb 14 22:37:28 2016 (r295618) @@ -44,6 +44,7 @@ #define XEON_DB_MSIX_VECTOR_COUNT 4 #define XEON_DB_MSIX_VECTOR_SHIFT 5 #define XEON_DB_LINK_BIT (1 << XEON_DB_LINK) +#define XEON_NONLINK_DB_MSIX_BITS 3 #define XEON_SPCICMD_OFFSET 0x0504 #define XEON_DEVCTRL_OFFSET 0x0598 From owner-svn-src-head@freebsd.org Sun Feb 14 23:05:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AA6AAA80F7; Sun, 14 Feb 2016 23:05:22 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3988A1C43; Sun, 14 Feb 2016 23:05:22 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: by mail-pf0-x233.google.com with SMTP id q63so76879505pfb.0; Sun, 14 Feb 2016 15:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=x+Ojlp3owUsxqcyEx9vIROoo4VjRD4bYWb7pP88fXmo=; b=ujpF2TYvrPI/rGV+iOufKORtXGsKNKiwR3ZXjF6PAz5CNGYJmUFCWqJaJoPHNlGVdd DH7ktb2DPxYXelbKXXjO1/maE1LPFc99RG9awIxJfhlZY3Q4QoJgAzk9RPoYZPb2YMaS CnCUZMtt83yd1pqyCvoQe8fhDkyaln3qLFWh4Fx04InroyL2gsfkjn3M4NEPkM6FHBNw RzLZul7T5jguUv37bxjoLf8KJJmD96cICBVhcbj7B58H9ejADks/xFpa4JkxXd+3tm/r SkWLntlvzL5Qw5LEc6vPChiaUNYVjeNFvnTDVVC9rYUPe6BAuZTcOzNbCid4kgsK2vtq amCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=x+Ojlp3owUsxqcyEx9vIROoo4VjRD4bYWb7pP88fXmo=; b=L+z3gE0AfnZ3RNC0vvSOitbyyw5WJjdsNvCAr41Ce2vpWO9HyNyU6q3V4ci8T1bx8O wZ8jKF1DcIp91s5OBU0xGhkzv8conTNilxqDCNPJPC+4xKk1TlPZIiCsNPpAp9MDnXh5 WDeKmrMOLbZCfbh22XtwSfQAQ+plby2WwZ2Nf/nN54ZRjoBjvcpBV/s7w41E9iYY+2kT W9mbRzdUOIHYwXheh+MR9w42GGoWpPku2XFERCwlGom1RftntcCyjwI1CEslthqGrrwD D/A8GLrcitTcMBCkx1cSFM+MFlevJQh72OxCK4J6SaJ2bKkwowSqrAfRKYyfgmsxrw2n WIrg== X-Gm-Message-State: AG10YOSFSPgWMjO169UvvBI1Xz5ItY/5zRB4NKQ23nu4uzcrVzXbWyFX2SGl7qv519jmww== X-Received: by 10.98.17.92 with SMTP id z89mr19506018pfi.16.1455491121804; Sun, 14 Feb 2016 15:05:21 -0800 (PST) Received: from localhost ([98.234.173.179]) by smtp.gmail.com with ESMTPSA id lq10sm33710413pab.36.2016.02.14.15.05.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 15:05:20 -0800 (PST) Sender: Gleb Kurtsou Date: Sun, 14 Feb 2016 15:04:35 -0800 From: Gleb Kurtsou To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20160214230435.GA4547@reks> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512162130.tBGLUjPj083575@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <201512162130.tBGLUjPj083575@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 23:05:22 -0000 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On (16/12/2015 21:30), Gleb Smirnoff wrote: > Author: glebius > Date: Wed Dec 16 21:30:45 2015 > New Revision: 292373 > URL: https://svnweb.freebsd.org/changeset/base/292373 > > Log: > A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES(). > > o With new KPI consumers can request contiguous ranges of pages, and > unlike before, all pages will be kept busied on return, like it was > done before with the 'reqpage' only. Now the reqpage goes away. With > new interface it is easier to implement code protected from race > conditions. > > Such arrayed requests for now should be preceeded by a call to > vm_pager_haspage() to make sure that request is possible. This > could be improved later, making vm_pager_haspage() obsolete. vm_pager_haspage is essentially wrapper around VOP_BMAP. VOP_BMAP is a stub for all non UFS-like file systems. E.g. it's return (0) in zfs and return (EOPNOTSUPP) in tmpfs. Could you elaborate on how strong the requirement of "should be preceded by a call to vm_pager_haspage" is. It's also not clear how to approach it if file system doesn't have bmap and getpages/putpages, but uses standard fallback pager through read/write. You've added vm_pager_has_page to exec_map_first_page. Should we now assume that vm_pager_get_pages(VM_INITIAL_PAGEIN) may fail if 'after' returned by vm_pager_has_page is less than VM_INITIAL_PAGEIN? Could you please take a look at 2 patches attached. I'd like to commit the one fixing vnode_pager_haspage, but I'm not sure about vm_pager_has_page usage in exec_map_first_page. 0001-Emulate-vop_stdbmap-in-vnode_pager_haspage-if-bmap-i.patch 'after' will be uninitialized if VOP_BMAP returns error. KASSERT in exec_map_first_page may fail because of it. I'm not sure if after = 0 is currently expected in exec_map_first_page. Extend the logic to treat EOPNOTSUPP as vop_stdbmap (set before and after to 0). Then extend both to fs block size. 0002-Handle-vm_pager_has_page-failure-during-exec.patch Patch may be dropped if vm_pager_has_page is required to succeed as described above. Thanks, Gleb. --7AUc2qLy4jB3hD7Z Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Emulate-vop_stdbmap-in-vnode_pager_haspage-if-bmap-i.patch" >From 40978eba392bcb20bf59704eac3d744d15f1e080 Mon Sep 17 00:00:00 2001 From: Gleb Kurtsou Date: Sat, 13 Feb 2016 23:00:00 -0800 Subject: [PATCH 1/2] Emulate vop_stdbmap in vnode_pager_haspage if bmap is not supported fs. Reset 'before' and 'after' to zero if VOP_BMAP fails. Assume no error if bmap is not supported by file system and adjust 'before', 'after' accordingly. --- sys/vm/vnode_pager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 66dd29d7686..063d8d55495 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -321,32 +321,39 @@ vnode_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, if (IDX_TO_OFF(pindex) >= object->un_pager.vnp.vnp_size) return FALSE; bsize = vp->v_mount->mnt_stat.f_iosize; pagesperblock = bsize / PAGE_SIZE; blocksperpage = 0; if (pagesperblock > 0) { reqblock = pindex / pagesperblock; } else { blocksperpage = (PAGE_SIZE / bsize); reqblock = pindex * blocksperpage; } VM_OBJECT_WUNLOCK(object); err = VOP_BMAP(vp, reqblock, NULL, &bn, after, before); VM_OBJECT_WLOCK(object); - if (err) - return TRUE; + if (err) { + if (before) + *before = 0; + if (after) + *after = 0; + if (err != EOPNOTSUPP) + return TRUE; + bn = reqblock; + } if (bn == -1) return FALSE; if (pagesperblock > 0) { poff = pindex - (reqblock * pagesperblock); if (before) { *before *= pagesperblock; *before += poff; } if (after) { /* * The BMAP vop can report a partial block in the * 'after', but must not report blocks after EOF. * Assert the latter, and truncate 'after' in case * of the former. */ -- 2.4.2 --7AUc2qLy4jB3hD7Z Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0002-Handle-vm_pager_has_page-failure-during-exec.patch" >From 0d4ed2d975a796b612914ee70b82064ba5fa19e3 Mon Sep 17 00:00:00 2001 From: Gleb Kurtsou Date: Sat, 13 Feb 2016 23:07:50 -0800 Subject: [PATCH 2/2] Handle vm_pager_has_page failure during exec. Relax exec_map_first_page dependency on vm_pager_has_page to calculate initial number of pages. r292373 changed behavior to completely rely on vm_pager_has_page(). Fallback to VM_INITIAL_PAGEIN if vm_pager_has_page fails or number of pages reported as available ('after' argument) is zero. --- sys/kern/kern_exec.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 741bc3e48c6..e71a32fca09 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -954,39 +954,34 @@ exec_map_first_page(imgp) vm_page_t ma[VM_INITIAL_PAGEIN]; vm_object_t object; if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); object = imgp->vp->v_object; if (object == NULL) return (EACCES); VM_OBJECT_WLOCK(object); #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL); if (ma[0]->valid != VM_PAGE_BITS_ALL) { - if (!vm_pager_has_page(object, 0, NULL, &after)) { - vm_page_lock(ma[0]); - vm_page_free(ma[0]); - vm_page_unlock(ma[0]); - vm_page_xunbusy(ma[0]); - VM_OBJECT_WUNLOCK(object); - return (EIO); - } - initial_pagein = min(after, VM_INITIAL_PAGEIN); + if (vm_pager_has_page(object, 0, NULL, &after) && after > 0) + initial_pagein = min(after, VM_INITIAL_PAGEIN); + else + initial_pagein = min(object->size, VM_INITIAL_PAGEIN); KASSERT(initial_pagein <= object->size, ("%s: initial_pagein %d object->size %ju", __func__, initial_pagein, (uintmax_t )object->size)); for (i = 1; i < initial_pagein; i++) { if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; if (vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, VM_ALLOC_NORMAL | VM_ALLOC_IFNOTCACHED); if (ma[i] == NULL) break; } -- 2.4.2 --7AUc2qLy4jB3hD7Z-- From owner-svn-src-head@freebsd.org Sun Feb 14 23:42:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1734AA90BA; Sun, 14 Feb 2016 23:42:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACBF1E93; Sun, 14 Feb 2016 23:42:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ENg8kx041910; Sun, 14 Feb 2016 23:42:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ENg7d5041901; Sun, 14 Feb 2016 23:42:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602142342.u1ENg7d5041901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Feb 2016 23:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295621 - in head/sys/arm: conf mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 23:42:10 -0000 Author: andrew Date: Sun Feb 14 23:42:07 2016 New Revision: 295621 URL: https://svnweb.freebsd.org/changeset/base/295621 Log: Create the twsi device option in preparation to move the driver to a common location. The device is also found in Allwinner SoCs. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/conf/ARMADAXP head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/NOTES head/sys/arm/mv/files.mv Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/ARMADA38X Sun Feb 14 23:42:07 2016 (r295621) @@ -78,6 +78,7 @@ device da # I2C device iic device iicbus +device twsi #FDT options FDT Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/ARMADAXP Sun Feb 14 23:42:07 2016 (r295621) @@ -90,6 +90,7 @@ device uart # I2C (TWSI) device iic device iicbus +device twsi #Network device ether Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/DB-78XXX Sun Feb 14 23:42:07 2016 (r295621) @@ -82,6 +82,7 @@ device da # I2C (TWSI) device iic device iicbus +device twsi device ds133x # SATA Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/DB-88F5XXX Sun Feb 14 23:42:07 2016 (r295621) @@ -74,6 +74,7 @@ options HZ=1000 # I2C (TWSI) device iic device iicbus +device twsi device ds133x # USB Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/DB-88F6XXX Sun Feb 14 23:42:07 2016 (r295621) @@ -87,6 +87,7 @@ device da # I2C (TWSI) device iic device iicbus +device twsi # SATA device mvs Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/DOCKSTAR Sun Feb 14 23:42:07 2016 (r295621) @@ -117,6 +117,7 @@ device u3g # USB-based 3G modems (O # I2C (TWSI) device iic device iicbus +device twsi # Sound device sound Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/DREAMPLUG-1001 Sun Feb 14 23:42:07 2016 (r295621) @@ -121,6 +121,7 @@ device u3g # USB-based 3G modems (O # I2C (TWSI) device iic device iicbus +device twsi # GPIO device gpio Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/conf/NOTES Sun Feb 14 23:42:07 2016 (r295621) @@ -51,6 +51,9 @@ device at91_board_tsc4370 device at91rm9200 device nand +# IIC +device twsi + nooptions SMP nooptions MAXCPU Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Sun Feb 14 23:05:45 2016 (r295620) +++ head/sys/arm/mv/files.mv Sun Feb 14 23:42:07 2016 (r295621) @@ -19,7 +19,7 @@ arm/mv/mv_machdep.c standard arm/mv/mv_pci.c optional pci arm/mv/mv_ts.c standard arm/mv/timer.c standard -arm/mv/twsi.c optional iicbus +arm/mv/twsi.c optional twsi dev/cesa/cesa.c optional cesa dev/mge/if_mge.c optional mge From owner-svn-src-head@freebsd.org Sun Feb 14 23:51:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE959AA9493; Sun, 14 Feb 2016 23:51:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4A613C8; Sun, 14 Feb 2016 23:51:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ENpDop044815; Sun, 14 Feb 2016 23:51:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ENpDap044812; Sun, 14 Feb 2016 23:51:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602142351.u1ENpDap044812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Feb 2016 23:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295622 - in head/sys: arm/mv conf dev/iicbus/twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Feb 2016 23:51:14 -0000 Author: andrew Date: Sun Feb 14 23:51:13 2016 New Revision: 295622 URL: https://svnweb.freebsd.org/changeset/base/295622 Log: Move the twsi driver source to be under iicbus. It is in a separate directory as it is expected multiple attachments will be added for the SoC families that use this hardware. Sponsored by: ABT Systems Ltd Added: head/sys/dev/iicbus/twsi/ head/sys/dev/iicbus/twsi/twsi.c - copied unchanged from r295621, head/sys/arm/mv/twsi.c Deleted: head/sys/arm/mv/twsi.c Modified: head/sys/arm/mv/files.mv head/sys/conf/files.arm Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Sun Feb 14 23:42:07 2016 (r295621) +++ head/sys/arm/mv/files.mv Sun Feb 14 23:51:13 2016 (r295622) @@ -19,7 +19,6 @@ arm/mv/mv_machdep.c standard arm/mv/mv_pci.c optional pci arm/mv/mv_ts.c standard arm/mv/timer.c standard -arm/mv/twsi.c optional twsi dev/cesa/cesa.c optional cesa dev/mge/if_mge.c optional mge Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Feb 14 23:42:07 2016 (r295621) +++ head/sys/conf/files.arm Sun Feb 14 23:51:13 2016 (r295622) @@ -101,6 +101,7 @@ dev/fb/fb.c optional sc dev/fdt/fdt_arm_platform.c optional platform fdt dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 +dev/iicbus/twsi/twsi.c optional twsi dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc Copied: head/sys/dev/iicbus/twsi/twsi.c (from r295621, head/sys/arm/mv/twsi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/twsi/twsi.c Sun Feb 14 23:51:13 2016 (r295622, copy of r295621, head/sys/arm/mv/twsi.c) @@ -0,0 +1,644 @@ +/*- + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * 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. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + */ + +/* + * Driver for the TWSI (aka I2C, aka IIC) bus controller found on Marvell + * SoCs. Supports master operation only, and works in polling mode. + * + * Calls to DELAY() are needed per Application Note AN-179 "TWSI Software + * Guidelines for Discovery(TM), Horizon (TM) and Feroceon(TM) Devices". + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "iicbus_if.h" + +#define MV_TWSI_NAME "twsi" +#define IICBUS_DEVNAME "iicbus" + +#define TWSI_SLAVE_ADDR 0x00 +#define TWSI_EXT_SLAVE_ADDR 0x10 +#define TWSI_DATA 0x04 + +#define TWSI_CONTROL 0x08 +#define TWSI_CONTROL_ACK (1 << 2) +#define TWSI_CONTROL_IFLG (1 << 3) +#define TWSI_CONTROL_STOP (1 << 4) +#define TWSI_CONTROL_START (1 << 5) +#define TWSI_CONTROL_TWSIEN (1 << 6) +#define TWSI_CONTROL_INTEN (1 << 7) + +#define TWSI_STATUS 0x0c +#define TWSI_STATUS_START 0x08 +#define TWSI_STATUS_RPTD_START 0x10 +#define TWSI_STATUS_ADDR_W_ACK 0x18 +#define TWSI_STATUS_DATA_WR_ACK 0x28 +#define TWSI_STATUS_ADDR_R_ACK 0x40 +#define TWSI_STATUS_DATA_RD_ACK 0x50 +#define TWSI_STATUS_DATA_RD_NOACK 0x58 + +#define TWSI_BAUD_RATE 0x0c +#define TWSI_BAUD_RATE_PARAM(M,N) ((((M) << 3) | ((N) & 0x7)) & 0x7f) +#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N+1))) +#define TWSI_BAUD_RATE_SLOW 50000 /* 50kHz */ +#define TWSI_BAUD_RATE_FAST 100000 /* 100kHz */ + +#define TWSI_SOFT_RESET 0x1c + +#define TWSI_DEBUG +#undef TWSI_DEBUG + +#ifdef TWSI_DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +struct mv_twsi_softc { + device_t dev; + struct resource *res[1]; /* SYS_RES_MEMORY */ + struct mtx mutex; + device_t iicbus; +}; + +static struct mv_twsi_baud_rate { + uint32_t raw; + int param; + int m; + int n; +} baud_rate[IIC_FASTEST + 1]; + +static int mv_twsi_probe(device_t); +static int mv_twsi_attach(device_t); +static int mv_twsi_detach(device_t); + +static int mv_twsi_reset(device_t dev, u_char speed, u_char addr, + u_char *oldaddr); +static int mv_twsi_repeated_start(device_t dev, u_char slave, int timeout); +static int mv_twsi_start(device_t dev, u_char slave, int timeout); +static int mv_twsi_stop(device_t dev); +static int mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, + int delay); +static int mv_twsi_write(device_t dev, const char *buf, int len, int *sent, + int timeout); + +static struct resource_spec res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static struct ofw_compat_data compat_data[] = { + { "mrvl,twsi", true }, + { "marvell,mv64xxx-i2c", true }, + { NULL, false } +}; + +static device_method_t mv_twsi_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, mv_twsi_probe), + DEVMETHOD(device_attach, mv_twsi_attach), + DEVMETHOD(device_detach, mv_twsi_detach), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, mv_twsi_repeated_start), + DEVMETHOD(iicbus_start, mv_twsi_start), + DEVMETHOD(iicbus_stop, mv_twsi_stop), + DEVMETHOD(iicbus_write, mv_twsi_write), + DEVMETHOD(iicbus_read, mv_twsi_read), + DEVMETHOD(iicbus_reset, mv_twsi_reset), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + { 0, 0 } +}; + +static devclass_t mv_twsi_devclass; + +static driver_t mv_twsi_driver = { + MV_TWSI_NAME, + mv_twsi_methods, + sizeof(struct mv_twsi_softc), +}; + +DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); +DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); +MODULE_DEPEND(twsi, iicbus, 1, 1, 1); + +static __inline uint32_t +TWSI_READ(struct mv_twsi_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->res[0], off)); +} + +static __inline void +TWSI_WRITE(struct mv_twsi_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->res[0], off, val); +} + +static __inline void +twsi_control_clear(struct mv_twsi_softc *sc, uint32_t mask) +{ + uint32_t val; + + val = TWSI_READ(sc, TWSI_CONTROL); + val &= ~mask; + TWSI_WRITE(sc, TWSI_CONTROL, val); +} + +static __inline void +twsi_control_set(struct mv_twsi_softc *sc, uint32_t mask) +{ + uint32_t val; + + val = TWSI_READ(sc, TWSI_CONTROL); + val |= mask; + TWSI_WRITE(sc, TWSI_CONTROL, val); +} + +static __inline void +twsi_clear_iflg(struct mv_twsi_softc *sc) +{ + + DELAY(1000); + twsi_control_clear(sc, TWSI_CONTROL_IFLG); + DELAY(1000); +} + + +/* + * timeout given in us + * returns + * 0 on sucessfull mask change + * non-zero on timeout + */ +static int +twsi_poll_ctrl(struct mv_twsi_softc *sc, int timeout, uint32_t mask) +{ + + timeout /= 10; + while (!(TWSI_READ(sc, TWSI_CONTROL) & mask)) { + DELAY(10); + if (--timeout < 0) + return (timeout); + } + return (0); +} + + +/* + * 'timeout' is given in us. Note also that timeout handling is not exact -- + * twsi_locked_start() total wait can be more than 2 x timeout + * (twsi_poll_ctrl() is called twice). 'mask' can be either TWSI_STATUS_START + * or TWSI_STATUS_RPTD_START + */ +static int +twsi_locked_start(device_t dev, struct mv_twsi_softc *sc, int32_t mask, + u_char slave, int timeout) +{ + int read_access, iflg_set = 0; + uint32_t status; + + mtx_assert(&sc->mutex, MA_OWNED); + + if (mask == TWSI_STATUS_RPTD_START) + /* read IFLG to know if it should be cleared later; from NBSD */ + iflg_set = TWSI_READ(sc, TWSI_CONTROL) & TWSI_CONTROL_IFLG; + + twsi_control_set(sc, TWSI_CONTROL_START); + + if (mask == TWSI_STATUS_RPTD_START && iflg_set) { + debugf("IFLG set, clearing\n"); + twsi_clear_iflg(sc); + } + + /* + * Without this delay we timeout checking IFLG if the timeout is 0. + * NBSD driver always waits here too. + */ + DELAY(1000); + + if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { + debugf("timeout sending %sSTART condition\n", + mask == TWSI_STATUS_START ? "" : "repeated "); + return (IIC_ETIMEOUT); + } + + status = TWSI_READ(sc, TWSI_STATUS); + if (status != mask) { + debugf("wrong status (%02x) after sending %sSTART condition\n", + status, mask == TWSI_STATUS_START ? "" : "repeated "); + return (IIC_ESTATUS); + } + + TWSI_WRITE(sc, TWSI_DATA, slave); + DELAY(1000); + twsi_clear_iflg(sc); + + if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { + debugf("timeout sending slave address\n"); + return (IIC_ETIMEOUT); + } + + read_access = (slave & 0x1) ? 1 : 0; + status = TWSI_READ(sc, TWSI_STATUS); + if (status != (read_access ? + TWSI_STATUS_ADDR_R_ACK : TWSI_STATUS_ADDR_W_ACK)) { + debugf("no ACK (status: %02x) after sending slave address\n", + status); + return (IIC_ENOACK); + } + + return (IIC_NOERR); +} + +static int +mv_twsi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Marvell Integrated I2C Bus Controller"); + return (BUS_PROBE_DEFAULT); +} + +#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) +static void +mv_twsi_cal_baud_rate(const uint32_t target, struct mv_twsi_baud_rate *rate) +{ + uint32_t clk, cur, diff, diff0; + int m, n, m0, n0; + + /* Calculate baud rate. */ + m0 = n0 = 4; /* Default values on reset */ + diff0 = 0xffffffff; + clk = get_tclk(); + + for (n = 0; n < 8; n++) { + for (m = 0; m < 16; m++) { + cur = TWSI_BAUD_RATE_RAW(clk,m,n); + diff = ABSSUB(target, cur); + if (diff < diff0) { + m0 = m; + n0 = n; + diff0 = diff; + } + } + } + rate->raw = TWSI_BAUD_RATE_RAW(clk, m0, n0); + rate->param = TWSI_BAUD_RATE_PARAM(m0, n0); + rate->m = m0; + rate->n = n0; +} + +static int +mv_twsi_attach(device_t dev) +{ + struct mv_twsi_softc *sc; + phandle_t child, iicbusnode; + device_t childdev; + struct iicbus_ivar *devi; + char dname[32]; /* 32 is taken from struct u_device */ + uint32_t paddr; + int len, error; + + sc = device_get_softc(dev); + sc->dev = dev; + bzero(baud_rate, sizeof(baud_rate)); + + mtx_init(&sc->mutex, device_get_nameunit(dev), MV_TWSI_NAME, MTX_DEF); + + /* Allocate IO resources */ + if (bus_alloc_resources(dev, res_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + mv_twsi_detach(dev); + return (ENXIO); + } + + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_SLOW, &baud_rate[IIC_SLOW]); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_FAST, &baud_rate[IIC_FAST]); + if (bootverbose) + device_printf(dev, "calculated baud rates are:\n" + " %" PRIu32 " kHz (M=%d, N=%d) for slow,\n" + " %" PRIu32 " kHz (M=%d, N=%d) for fast.\n", + baud_rate[IIC_SLOW].raw / 1000, + baud_rate[IIC_SLOW].m, + baud_rate[IIC_SLOW].n, + baud_rate[IIC_FAST].raw / 1000, + baud_rate[IIC_FAST].m, + baud_rate[IIC_FAST].n); + + sc->iicbus = device_add_child(dev, IICBUS_DEVNAME, -1); + if (sc->iicbus == NULL) { + device_printf(dev, "could not add iicbus child\n"); + mv_twsi_detach(dev); + return (ENXIO); + } + /* Attach iicbus. */ + bus_generic_attach(dev); + + iicbusnode = 0; + /* Find iicbus as the child devices in the device tree. */ + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname)) + continue; + error = OF_getprop(child, "model", &dname, len); + if (error == -1) + continue; + len = strlen(dname); + if (len == strlen(IICBUS_DEVNAME) && + strncasecmp(dname, IICBUS_DEVNAME, len) == 0) { + iicbusnode = child; + break; + } + } + if (iicbusnode == 0) + goto attach_end; + + /* Attach child devices onto iicbus. */ + for (child = OF_child(iicbusnode); child != 0; child = OF_peer(child)) { + /* Get slave address. */ + error = OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)); + if (error == -1) + error = OF_getprop(child, "reg", &paddr, sizeof(paddr)); + if (error == -1) + continue; + + /* Get device driver name. */ + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname)) + continue; + OF_getprop(child, "model", &dname, len); + + if (bootverbose) + device_printf(dev, "adding a device %s at %d.\n", + dname, fdt32_to_cpu(paddr)); + childdev = BUS_ADD_CHILD(sc->iicbus, 0, dname, -1); + devi = IICBUS_IVAR(childdev); + devi->addr = fdt32_to_cpu(paddr); + } + +attach_end: + bus_generic_attach(sc->iicbus); + + return (0); +} + +static int +mv_twsi_detach(device_t dev) +{ + struct mv_twsi_softc *sc; + int rv; + + sc = device_get_softc(dev); + + if ((rv = bus_generic_detach(dev)) != 0) + return (rv); + + if (sc->iicbus != NULL) + if ((rv = device_delete_child(dev, sc->iicbus)) != 0) + return (rv); + + bus_release_resources(dev, res_spec, sc->res); + + mtx_destroy(&sc->mutex); + return (0); +} + +/* + * Only slave mode supported, disregard [old]addr + */ +static int +mv_twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) +{ + struct mv_twsi_softc *sc; + uint32_t param; + + sc = device_get_softc(dev); + + switch (speed) { + case IIC_SLOW: + case IIC_FAST: + param = baud_rate[speed].param; + break; + case IIC_FASTEST: + case IIC_UNKNOWN: + default: + param = baud_rate[IIC_FAST].param; + break; + } + + mtx_lock(&sc->mutex); + TWSI_WRITE(sc, TWSI_SOFT_RESET, 0x0); + DELAY(2000); + TWSI_WRITE(sc, TWSI_BAUD_RATE, param); + TWSI_WRITE(sc, TWSI_CONTROL, TWSI_CONTROL_TWSIEN | TWSI_CONTROL_ACK); + DELAY(1000); + mtx_unlock(&sc->mutex); + + return (0); +} + +/* + * timeout is given in us + */ +static int +mv_twsi_repeated_start(device_t dev, u_char slave, int timeout) +{ + struct mv_twsi_softc *sc; + int rv; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + rv = twsi_locked_start(dev, sc, TWSI_STATUS_RPTD_START, slave, + timeout); + mtx_unlock(&sc->mutex); + + if (rv) { + mv_twsi_stop(dev); + return (rv); + } else + return (IIC_NOERR); +} + +/* + * timeout is given in us + */ +static int +mv_twsi_start(device_t dev, u_char slave, int timeout) +{ + struct mv_twsi_softc *sc; + int rv; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + rv = twsi_locked_start(dev, sc, TWSI_STATUS_START, slave, timeout); + mtx_unlock(&sc->mutex); + + if (rv) { + mv_twsi_stop(dev); + return (rv); + } else + return (IIC_NOERR); +} + +static int +mv_twsi_stop(device_t dev) +{ + struct mv_twsi_softc *sc; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + twsi_control_set(sc, TWSI_CONTROL_STOP); + DELAY(1000); + twsi_clear_iflg(sc); + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, int delay) +{ + struct mv_twsi_softc *sc; + uint32_t status; + int last_byte, rv; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + *read = 0; + while (*read < len) { + /* + * Check if we are reading last byte of the last buffer, + * do not send ACK then, per I2C specs + */ + last_byte = ((*read == len - 1) && last) ? 1 : 0; + if (last_byte) + twsi_control_clear(sc, TWSI_CONTROL_ACK); + else + twsi_control_set(sc, TWSI_CONTROL_ACK); + + DELAY (1000); + twsi_clear_iflg(sc); + + if (twsi_poll_ctrl(sc, delay, TWSI_CONTROL_IFLG)) { + debugf("timeout reading data\n"); + rv = IIC_ETIMEOUT; + goto out; + } + + status = TWSI_READ(sc, TWSI_STATUS); + if (status != (last_byte ? + TWSI_STATUS_DATA_RD_NOACK : TWSI_STATUS_DATA_RD_ACK)) { + debugf("wrong status (%02x) while reading\n", status); + rv = IIC_ESTATUS; + goto out; + } + + *buf++ = TWSI_READ(sc, TWSI_DATA); + (*read)++; + } + rv = IIC_NOERR; +out: + mtx_unlock(&sc->mutex); + return (rv); +} + +static int +mv_twsi_write(device_t dev, const char *buf, int len, int *sent, int timeout) +{ + struct mv_twsi_softc *sc; + uint32_t status; + int rv; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + *sent = 0; + while (*sent < len) { + TWSI_WRITE(sc, TWSI_DATA, *buf++); + + twsi_clear_iflg(sc); + if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { + debugf("timeout writing data\n"); + rv = IIC_ETIMEOUT; + goto out; + } + + status = TWSI_READ(sc, TWSI_STATUS); + if (status != TWSI_STATUS_DATA_WR_ACK) { + debugf("wrong status (%02x) while writing\n", status); + rv = IIC_ESTATUS; + goto out; + } + (*sent)++; + } + rv = IIC_NOERR; +out: + mtx_unlock(&sc->mutex); + return (rv); +} From owner-svn-src-head@freebsd.org Mon Feb 15 12:10:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C18AA9C13; Mon, 15 Feb 2016 12:10:34 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) by mx1.freebsd.org (Postfix) with ESMTP id AA8FE15E0; Mon, 15 Feb 2016 12:10:34 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id C212E3B9CB; Mon, 15 Feb 2016 13:00:34 +0100 (CET) Subject: Re: svn commit: r295557 - head/sys/dev/uart To: src-committers@freebsd.org References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> Cc: Marius Strobl , Bruce Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Michal Meloun X-Enigmail-Draft-Status: N1110 Organization: freebsd.org Message-ID: <56C1BDE2.8090300@freebsd.org> Date: Mon, 15 Feb 2016 13:00:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160213005801.GF15359@alchemy.franken.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Mon, 15 Feb 2016 13:00:34 +0100 (CET) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 12:10:35 -0000 Dne 13.02.2016 v 1:58 Marius Strobl napsal(a): > On Sat, Feb 13, 2016 at 06:53:25AM +1100, Bruce Evans wrote: >> On Fri, 12 Feb 2016, Marius Strobl wrote: >> >>> On Fri, Feb 12, 2016 at 05:14:58AM +0000, Michal Meloun wrote: >>>> Author: mmel >>>> Date: Fri Feb 12 05:14:58 2016 >>>> New Revision: 295557 >>>> URL: https://svnweb.freebsd.org/changeset/base/295557 >>>> >>>> Log: >>>> UART: Fix spurious interrupts generated by ns8250 and lpc drivers: >>>> - don't enable transmitter empty interrupt before filling TX FIFO. >>> >>> Are you sure this doesn't create a race that leads to lost TX ready >>> interrupts? For a single character, the TX FIFO very well may be empty >>> again at the point in time IER_ETXRDY is enabled now. With the varying >>> behavior of 8250/16x50 chips - some of which is documented in sio(4) - >> >> That is mostly FUD. More likely driver bugs than chip bugs. >> >> A non-broken xx50 interrupts after you (re)enable tx interrupts, iff >> the fifo is already empty. This gives a "spurious" interrupt. But >> perhaps depending on this is too fragile. Normal operation is to keep >> the tx interrupt enabled and depend on writing to the fifo causing a >> tx interrupt later. But it is a more common chip bug for tx interrupts >> later to not go away when they should (normally by reading the IIR), >> so some drivers toggle the tx interrupt enable dynamically. >> >> An example of a driver bug is only enabling tx interrupts for this. >> It takes a transition of the interrupt enable bit from off to on to >> get the interrupt. Other driver bugs may result in a missing transition >> because the bit was supposed to be off but is actually on. >> >>> I'd expect there are many that no longer generate a TX ready at all >>> with this change in place. In this case, receiving spurious interrupts >>> (which ones? IIR_NOPEND? IIR_TXRDY?) with some devices appears to be >>> the lesser evil. >> >> Not many. Only broken ones. > > In my experience many xx50 are broken, especially the integrated > on-board ones you still have in workstations and servers today. > >> The "spurious" interrupts are just normal >> ones from bon-broken chips: >> >> - uart first does a potentially-unbounded busy-wait before the doing >> anything to ensure that the fifo is empty. This should be unecessary >> since this function should not be called unless sc_txbusy is 0 and >> sc_txbusy should be nonzero if the fifo is not empty. If it is called >> when the fifo is not emptu, then the worst-case busy-wait is approx. >> 640 seconds for a 128-byte fifo at 2 bps. The 'broken_txfifo case' >> busy-waits for a long time in normal operation. >> - enabling the tx interrupt causes one immediately on non-broken uarts >> - the interrupt handler is normally called immediately. Then it always >> blocks on uart_lock() >> - then the main code fills the fifo and unlocks >> - then the interrupt handler runs. It normally finds that the fifo is >> not empty (since it has just been filled) and does nothing >> - another tx interrupt occurs later and the interrupt handler runs again. >> It normally doesn't hit the lock again, and normally finds the fifo >> empty, so it does something. > > You correctly describe what happens at r295556 with a non-broken xx50. > That revision causes a spurious interrupt with non-broken xx50 but > also ensures that the relevant TX interrupt isn't missed with broken > xx50 that do not issue an interrupt when enabling IER_ETXRDY. Besides, > as you say, the general approach of dynamically enabling TX interrupts > works around the common brokenness of these interrupts no longer going > away when they should. > >> But you are probably correct that a 1-byte write to the fifo often >> loses the race. This depends on how fast the hardware moves the byte >> from the fifo to the tx register. Actually, since we didn't wait >> for the tx register to become empty, it will often take a full character >> time before the move. After that, I think it might take 1 bit time but >> no more. > > My concern is that with r295557, when this race is lost no TX interrupt > is seen at all with broken xx50 that do not trigger an interrupt when > enabling IER_ETXRDY. > > Marius > No, Im not sure, nobody can be sure if we talking about ns8250 compatible device(s). Also, all UARTs known to me, generates an interrupt on TX unmasking (assuming level sensitive interrupt). Only IIR can reports bad priority so some very old 8250 (if memory still serve me). I only found following scenario on multiple ARM SOCs. Please note that ARM architecture does not have vectored interrupts, CPU must read actual interrupt source from external interrupt controller (GIC) register. This register contain predefined value if none of interrupts are active. 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. 2 - HW: UART interrupt is asserted, processed by GIC and signaled to CPU2. 3 - CPU2: enters interrupt service. 4 - CPU1: writes character to into REG_DATA register. 5 - HW: UART clear its interrupt request 6 - CPU2: reads interrupt source register. No active interrupt is found, spurious interrupt is signaled, and CPU leaves interrupted state. 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, and can be slow in some cases. 8 - HW: character from THR is transferred to shift register and UART signals TX empty interrupt again. 9 - Goto 3. Currently, GIC interrupts service routine (see [1]) reports spurious interrupt issue (interrupt requests disappears itself, without any HW action). This is very valuable indicator of driver problem for us (note, ARM needs special synchronization for related inter-device writes, see [2]), and I dont want to remove it. Also, at this time, UART driver is last one known to generate spurious interrupts in ARM world. So, whats now? I can #ifdef __arm__ change made in r295557 (for maximum safety), if you want this. Or we can just wait to see if someone reports a problem ... Michal [1] https://svnweb.freebsd.org/base/head/sys/arm/arm/gic.c?revision=294422&view=markup#l538 [2] https://reviews.freebsd.org/D4240 From owner-svn-src-head@freebsd.org Mon Feb 15 14:34:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53603AA83AD; Mon, 15 Feb 2016 14:34:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 270011B3E; Mon, 15 Feb 2016 14:34:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FEYaYd001851; Mon, 15 Feb 2016 14:34:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FEYa4j001850; Mon, 15 Feb 2016 14:34:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602151434.u1FEYa4j001850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 15 Feb 2016 14:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295625 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 14:34:37 -0000 Author: adrian Date: Mon Feb 15 14:34:35 2016 New Revision: 295625 URL: https://svnweb.freebsd.org/changeset/base/295625 Log: Allow MIPS INTRNG code to be built without FDT support. This patch allows the newly imported INTRNG code to be built without necessarily having FDT support in the kernel. This may be useful for some MIPS platforms that wish to move to INTRNG, but not to FDT at the same time. Basically all the code is already within ifdef's where FDT is concerned, it's just the headers that aren't. Submitted by: Stanislav Galabov Differential Revision: https://reviews.freebsd.org/D5249 Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon Feb 15 12:34:47 2016 (r295624) +++ head/sys/kern/subr_intr.c Mon Feb 15 14:34:35 2016 (r295625) @@ -60,11 +60,13 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT #include #include #include #include +#endif #ifdef DDB #include From owner-svn-src-head@freebsd.org Mon Feb 15 15:11:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14B1EAA98C1; Mon, 15 Feb 2016 15:11:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC3EF1614; Mon, 15 Feb 2016 15:11:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FFBRFG011835; Mon, 15 Feb 2016 15:11:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FFBRxi011815; Mon, 15 Feb 2016 15:11:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151511.u1FFBRxi011815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 15:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295626 - in head/sys: arm/allwinner arm/conf arm/mv dev/iicbus/twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 15:11:29 -0000 Author: andrew Date: Mon Feb 15 15:11:26 2016 New Revision: 295626 URL: https://svnweb.freebsd.org/changeset/base/295626 Log: Add support for the Allwinner i2c device. This is similar to the existing Marvell twsi part, however uses different register locations, as such split the existing driver into Marvell and Allwinner attachments. While here clean a few style issues. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D4846 Added: head/sys/dev/iicbus/twsi/a10_twsi.c (contents, props changed) head/sys/dev/iicbus/twsi/mv_twsi.c - copied, changed from r295622, head/sys/dev/iicbus/twsi/twsi.c head/sys/dev/iicbus/twsi/twsi.h (contents, props changed) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/A10 head/sys/arm/conf/A20 head/sys/arm/mv/files.mv head/sys/dev/iicbus/twsi/twsi.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/allwinner/a10_clk.c Mon Feb 15 15:11:26 2016 (r295626) @@ -401,6 +401,29 @@ a10_clk_mmc_cfg(int devid, int freq) } int +a10_clk_i2c_activate(int devid) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + a10_clk_pll6_enable(); + + /* Gating APB clock for I2C/TWI */ + reg_value = ccm_read_4(sc, CCM_APB1_GATING); + if (devid == 4) + reg_value |= CCM_APB1_GATING_TWI << 15; + else + reg_value |= CCM_APB1_GATING_TWI << devid; + ccm_write_4(sc, CCM_APB1_GATING, reg_value); + + return (0); +} + +int a10_clk_dmac_activate(void) { struct a10_ccm_softc *sc; Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/allwinner/a10_clk.h Mon Feb 15 15:11:26 2016 (r295626) @@ -121,6 +121,9 @@ /* AHB_GATING_REG1 */ #define CCM_AHB_GATING_GMAC (1 << 17) +/* APB1_GATING_REG */ +#define CCM_APB1_GATING_TWI (1 << 0) + #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) #define CCM_USB1_RESET (1 << 1) @@ -166,6 +169,7 @@ int a10_clk_gmac_activate(phandle_t); int a10_clk_ahci_activate(void); int a10_clk_mmc_activate(int); int a10_clk_mmc_cfg(int, int); +int a10_clk_i2c_activate(int); int a10_clk_dmac_activate(void); int a10_clk_codec_activate(unsigned int); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/allwinner/files.allwinner Mon Feb 15 15:11:26 2016 (r295626) @@ -12,4 +12,5 @@ arm/allwinner/a10_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard arm/allwinner/if_emac.c optional emac +dev/iicbus/twsi/a10_twsi.c optional twsi #arm/allwinner/console.c standard Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/conf/A10 Mon Feb 15 15:11:26 2016 (r295626) @@ -66,8 +66,9 @@ device md device random # Entropy device # I2C support -#device iicbus -#device iic +device iicbus +device iic +device twsi # GPIO device gpio Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/conf/A20 Mon Feb 15 15:11:26 2016 (r295626) @@ -75,8 +75,9 @@ device md device random # Entropy device # I2C support -#device iicbus -#device iic +device iicbus +device iic +device twsi # GPIO device gpio Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/arm/mv/files.mv Mon Feb 15 15:11:26 2016 (r295626) @@ -21,6 +21,7 @@ arm/mv/mv_ts.c standard arm/mv/timer.c standard dev/cesa/cesa.c optional cesa +dev/iicbus/twsi/mv_twsi.c optional twsi dev/mge/if_mge.c optional mge dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs Added: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Mon Feb 15 15:11:26 2016 (r295626) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "iicbus_if.h" + +#define TWI_ADDR 0x0 +#define TWI_XADDR 0x4 +#define TWI_DATA 0x8 +#define TWI_CNTR 0xC +#define TWI_STAT 0x10 +#define TWI_CCR 0x14 +#define TWI_SRST 0x18 +#define TWI_EFR 0x1C +#define TWI_LCR 0x20 + +static int +a10_twsi_probe(device_t dev) +{ + struct twsi_softc *sc; + + sc = device_get_softc(dev); + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-i2c")) + return (ENXIO); + + device_set_desc(dev, "Allwinner Integrated I2C Bus Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10_twsi_attach(device_t dev) +{ + struct twsi_softc *sc; + + sc = device_get_softc(dev); + + /* Activate clock */ + a10_clk_i2c_activate(device_get_unit(dev)); + + sc->reg_data = TWI_DATA; + sc->reg_slave_addr = TWI_ADDR; + sc->reg_slave_ext_addr = TWI_XADDR; + sc->reg_control = TWI_CNTR; + sc->reg_status = TWI_STAT; + sc->reg_baud_rate = TWI_CCR; + sc->reg_soft_reset = TWI_SRST; + + /* Setup baud rate params */ + sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(11, 2); + sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(11, 2); + sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 2); + + return (twsi_attach(dev)); +} + +static phandle_t +a10_twsi_get_node(device_t bus, device_t dev) +{ + return (ofw_bus_get_node(bus)); +} + +static device_method_t a10_twsi_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, a10_twsi_probe), + DEVMETHOD(device_attach, a10_twsi_attach), + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, a10_twsi_get_node), + + { 0, 0 } +}; + +DEFINE_CLASS_1(iichb, a10_twsi_driver, a10_twsi_methods, + sizeof(struct twsi_softc), twsi_driver); + +static devclass_t a10_twsi_devclass; + +DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driver, a10_twsi_devclass, 0, 0); +DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, 0, 0); +MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1); Copied and modified: head/sys/dev/iicbus/twsi/mv_twsi.c (from r295622, head/sys/dev/iicbus/twsi/twsi.c) ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Sun Feb 14 23:51:13 2016 (r295622, copy source) +++ head/sys/dev/iicbus/twsi/mv_twsi.c Mon Feb 15 15:11:26 2016 (r295626) @@ -31,7 +31,7 @@ /* * Driver for the TWSI (aka I2C, aka IIC) bus controller found on Marvell - * SoCs. Supports master operation only, and works in polling mode. + * and Allwinner SoCs. Supports master operation only, and works in polling mode. * * Calls to DELAY() are needed per Application Note AN-179 "TWSI Software * Guidelines for Discovery(TM), Horizon (TM) and Feroceon(TM) Devices". @@ -62,42 +62,27 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include "iicbus_if.h" #define MV_TWSI_NAME "twsi" #define IICBUS_DEVNAME "iicbus" -#define TWSI_SLAVE_ADDR 0x00 -#define TWSI_EXT_SLAVE_ADDR 0x10 -#define TWSI_DATA 0x04 - -#define TWSI_CONTROL 0x08 -#define TWSI_CONTROL_ACK (1 << 2) -#define TWSI_CONTROL_IFLG (1 << 3) -#define TWSI_CONTROL_STOP (1 << 4) -#define TWSI_CONTROL_START (1 << 5) -#define TWSI_CONTROL_TWSIEN (1 << 6) -#define TWSI_CONTROL_INTEN (1 << 7) - -#define TWSI_STATUS 0x0c -#define TWSI_STATUS_START 0x08 -#define TWSI_STATUS_RPTD_START 0x10 -#define TWSI_STATUS_ADDR_W_ACK 0x18 -#define TWSI_STATUS_DATA_WR_ACK 0x28 -#define TWSI_STATUS_ADDR_R_ACK 0x40 -#define TWSI_STATUS_DATA_RD_ACK 0x50 -#define TWSI_STATUS_DATA_RD_NOACK 0x58 +#define TWSI_ADDR 0x00 +#define TWSI_DATA 0x04 +#define TWSI_CNTR 0x08 +#define TWSI_XADDR 0x10 +#define TWSI_STAT 0x0c +#define TWSI_BAUD_RATE 0x0c +#define TWSI_SRST 0x1c -#define TWSI_BAUD_RATE 0x0c -#define TWSI_BAUD_RATE_PARAM(M,N) ((((M) << 3) | ((N) & 0x7)) & 0x7f) #define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N+1))) #define TWSI_BAUD_RATE_SLOW 50000 /* 50kHz */ #define TWSI_BAUD_RATE_FAST 100000 /* 100kHz */ -#define TWSI_SOFT_RESET 0x1c - #define TWSI_DEBUG #undef TWSI_DEBUG @@ -107,38 +92,8 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -struct mv_twsi_softc { - device_t dev; - struct resource *res[1]; /* SYS_RES_MEMORY */ - struct mtx mutex; - device_t iicbus; -}; - -static struct mv_twsi_baud_rate { - uint32_t raw; - int param; - int m; - int n; -} baud_rate[IIC_FASTEST + 1]; - static int mv_twsi_probe(device_t); static int mv_twsi_attach(device_t); -static int mv_twsi_detach(device_t); - -static int mv_twsi_reset(device_t dev, u_char speed, u_char addr, - u_char *oldaddr); -static int mv_twsi_repeated_start(device_t dev, u_char slave, int timeout); -static int mv_twsi_start(device_t dev, u_char slave, int timeout); -static int mv_twsi_stop(device_t dev); -static int mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, - int delay); -static int mv_twsi_write(device_t dev, const char *buf, int len, int *sent, - int timeout); - -static struct resource_spec res_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { -1, 0 } -}; static struct ofw_compat_data compat_data[] = { { "mrvl,twsi", true }, @@ -150,179 +105,46 @@ static device_method_t mv_twsi_methods[] /* device interface */ DEVMETHOD(device_probe, mv_twsi_probe), DEVMETHOD(device_attach, mv_twsi_attach), - DEVMETHOD(device_detach, mv_twsi_detach), - /* iicbus interface */ - DEVMETHOD(iicbus_callback, iicbus_null_callback), - DEVMETHOD(iicbus_repeated_start, mv_twsi_repeated_start), - DEVMETHOD(iicbus_start, mv_twsi_start), - DEVMETHOD(iicbus_stop, mv_twsi_stop), - DEVMETHOD(iicbus_write, mv_twsi_write), - DEVMETHOD(iicbus_read, mv_twsi_read), - DEVMETHOD(iicbus_reset, mv_twsi_reset), - DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), { 0, 0 } }; -static devclass_t mv_twsi_devclass; +DEFINE_CLASS_1(twsi, mv_twsi_driver, mv_twsi_methods, + sizeof(struct twsi_softc), twsi_driver); -static driver_t mv_twsi_driver = { - MV_TWSI_NAME, - mv_twsi_methods, - sizeof(struct mv_twsi_softc), -}; +static devclass_t mv_twsi_devclass; DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(twsi, iicbus, 1, 1, 1); -static __inline uint32_t -TWSI_READ(struct mv_twsi_softc *sc, bus_size_t off) -{ - - return (bus_read_4(sc->res[0], off)); -} - -static __inline void -TWSI_WRITE(struct mv_twsi_softc *sc, bus_size_t off, uint32_t val) -{ - - bus_write_4(sc->res[0], off, val); -} - -static __inline void -twsi_control_clear(struct mv_twsi_softc *sc, uint32_t mask) -{ - uint32_t val; - - val = TWSI_READ(sc, TWSI_CONTROL); - val &= ~mask; - TWSI_WRITE(sc, TWSI_CONTROL, val); -} - -static __inline void -twsi_control_set(struct mv_twsi_softc *sc, uint32_t mask) -{ - uint32_t val; - - val = TWSI_READ(sc, TWSI_CONTROL); - val |= mask; - TWSI_WRITE(sc, TWSI_CONTROL, val); -} - -static __inline void -twsi_clear_iflg(struct mv_twsi_softc *sc) -{ - - DELAY(1000); - twsi_control_clear(sc, TWSI_CONTROL_IFLG); - DELAY(1000); -} - - -/* - * timeout given in us - * returns - * 0 on sucessfull mask change - * non-zero on timeout - */ -static int -twsi_poll_ctrl(struct mv_twsi_softc *sc, int timeout, uint32_t mask) -{ - - timeout /= 10; - while (!(TWSI_READ(sc, TWSI_CONTROL) & mask)) { - DELAY(10); - if (--timeout < 0) - return (timeout); - } - return (0); -} - - -/* - * 'timeout' is given in us. Note also that timeout handling is not exact -- - * twsi_locked_start() total wait can be more than 2 x timeout - * (twsi_poll_ctrl() is called twice). 'mask' can be either TWSI_STATUS_START - * or TWSI_STATUS_RPTD_START - */ -static int -twsi_locked_start(device_t dev, struct mv_twsi_softc *sc, int32_t mask, - u_char slave, int timeout) -{ - int read_access, iflg_set = 0; - uint32_t status; - - mtx_assert(&sc->mutex, MA_OWNED); - - if (mask == TWSI_STATUS_RPTD_START) - /* read IFLG to know if it should be cleared later; from NBSD */ - iflg_set = TWSI_READ(sc, TWSI_CONTROL) & TWSI_CONTROL_IFLG; - - twsi_control_set(sc, TWSI_CONTROL_START); - - if (mask == TWSI_STATUS_RPTD_START && iflg_set) { - debugf("IFLG set, clearing\n"); - twsi_clear_iflg(sc); - } - - /* - * Without this delay we timeout checking IFLG if the timeout is 0. - * NBSD driver always waits here too. - */ - DELAY(1000); - - if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout sending %sSTART condition\n", - mask == TWSI_STATUS_START ? "" : "repeated "); - return (IIC_ETIMEOUT); - } - - status = TWSI_READ(sc, TWSI_STATUS); - if (status != mask) { - debugf("wrong status (%02x) after sending %sSTART condition\n", - status, mask == TWSI_STATUS_START ? "" : "repeated "); - return (IIC_ESTATUS); - } - - TWSI_WRITE(sc, TWSI_DATA, slave); - DELAY(1000); - twsi_clear_iflg(sc); - - if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout sending slave address\n"); - return (IIC_ETIMEOUT); - } - - read_access = (slave & 0x1) ? 1 : 0; - status = TWSI_READ(sc, TWSI_STATUS); - if (status != (read_access ? - TWSI_STATUS_ADDR_R_ACK : TWSI_STATUS_ADDR_W_ACK)) { - debugf("no ACK (status: %02x) after sending slave address\n", - status); - return (IIC_ENOACK); - } - - return (IIC_NOERR); -} - static int mv_twsi_probe(device_t dev) { + struct twsi_softc *sc; + sc = device_get_softc(dev); if (!ofw_bus_status_okay(dev)) return (ENXIO); if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); + sc->reg_data = TWSI_DATA; + sc->reg_slave_addr = TWSI_ADDR; + sc->reg_slave_ext_addr = TWSI_XADDR; + sc->reg_control = TWSI_CNTR; + sc->reg_status = TWSI_STAT; + sc->reg_baud_rate = TWSI_BAUD_RATE; + sc->reg_soft_reset = TWSI_SRST; + device_set_desc(dev, "Marvell Integrated I2C Bus Controller"); return (BUS_PROBE_DEFAULT); } #define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) static void -mv_twsi_cal_baud_rate(const uint32_t target, struct mv_twsi_baud_rate *rate) +mv_twsi_cal_baud_rate(const uint32_t target, struct twsi_baud_rate *rate) { uint32_t clk, cur, diff, diff0; int m, n, m0, n0; @@ -352,48 +174,33 @@ mv_twsi_cal_baud_rate(const uint32_t tar static int mv_twsi_attach(device_t dev) { - struct mv_twsi_softc *sc; + struct twsi_softc *sc; phandle_t child, iicbusnode; device_t childdev; struct iicbus_ivar *devi; char dname[32]; /* 32 is taken from struct u_device */ uint32_t paddr; - int len, error; + int len, error, ret; sc = device_get_softc(dev); - sc->dev = dev; - bzero(baud_rate, sizeof(baud_rate)); - mtx_init(&sc->mutex, device_get_nameunit(dev), MV_TWSI_NAME, MTX_DEF); - - /* Allocate IO resources */ - if (bus_alloc_resources(dev, res_spec, sc->res)) { - device_printf(dev, "could not allocate resources\n"); - mv_twsi_detach(dev); - return (ENXIO); - } - - mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_SLOW, &baud_rate[IIC_SLOW]); - mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_FAST, &baud_rate[IIC_FAST]); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_SLOW, &sc->baud_rate[IIC_SLOW]); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_FAST, &sc->baud_rate[IIC_FAST]); if (bootverbose) device_printf(dev, "calculated baud rates are:\n" " %" PRIu32 " kHz (M=%d, N=%d) for slow,\n" " %" PRIu32 " kHz (M=%d, N=%d) for fast.\n", - baud_rate[IIC_SLOW].raw / 1000, - baud_rate[IIC_SLOW].m, - baud_rate[IIC_SLOW].n, - baud_rate[IIC_FAST].raw / 1000, - baud_rate[IIC_FAST].m, - baud_rate[IIC_FAST].n); - - sc->iicbus = device_add_child(dev, IICBUS_DEVNAME, -1); - if (sc->iicbus == NULL) { - device_printf(dev, "could not add iicbus child\n"); - mv_twsi_detach(dev); - return (ENXIO); - } - /* Attach iicbus. */ - bus_generic_attach(dev); + sc->baud_rate[IIC_SLOW].raw / 1000, + sc->baud_rate[IIC_SLOW].m, + sc->baud_rate[IIC_SLOW].n, + sc->baud_rate[IIC_FAST].raw / 1000, + sc->baud_rate[IIC_FAST].m, + sc->baud_rate[IIC_FAST].n); + + + ret = twsi_attach(dev); + if (ret != 0) + return (ret); iicbusnode = 0; /* Find iicbus as the child devices in the device tree. */ @@ -443,202 +250,3 @@ attach_end: return (0); } - -static int -mv_twsi_detach(device_t dev) -{ - struct mv_twsi_softc *sc; - int rv; - - sc = device_get_softc(dev); - - if ((rv = bus_generic_detach(dev)) != 0) - return (rv); - - if (sc->iicbus != NULL) - if ((rv = device_delete_child(dev, sc->iicbus)) != 0) - return (rv); - - bus_release_resources(dev, res_spec, sc->res); - - mtx_destroy(&sc->mutex); - return (0); -} - -/* - * Only slave mode supported, disregard [old]addr - */ -static int -mv_twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) -{ - struct mv_twsi_softc *sc; - uint32_t param; - - sc = device_get_softc(dev); - - switch (speed) { - case IIC_SLOW: - case IIC_FAST: - param = baud_rate[speed].param; - break; - case IIC_FASTEST: - case IIC_UNKNOWN: - default: - param = baud_rate[IIC_FAST].param; - break; - } - - mtx_lock(&sc->mutex); - TWSI_WRITE(sc, TWSI_SOFT_RESET, 0x0); - DELAY(2000); - TWSI_WRITE(sc, TWSI_BAUD_RATE, param); - TWSI_WRITE(sc, TWSI_CONTROL, TWSI_CONTROL_TWSIEN | TWSI_CONTROL_ACK); - DELAY(1000); - mtx_unlock(&sc->mutex); - - return (0); -} - -/* - * timeout is given in us - */ -static int -mv_twsi_repeated_start(device_t dev, u_char slave, int timeout) -{ - struct mv_twsi_softc *sc; - int rv; - - sc = device_get_softc(dev); - - mtx_lock(&sc->mutex); - rv = twsi_locked_start(dev, sc, TWSI_STATUS_RPTD_START, slave, - timeout); - mtx_unlock(&sc->mutex); - - if (rv) { - mv_twsi_stop(dev); - return (rv); - } else - return (IIC_NOERR); -} - -/* - * timeout is given in us - */ -static int -mv_twsi_start(device_t dev, u_char slave, int timeout) -{ - struct mv_twsi_softc *sc; - int rv; - - sc = device_get_softc(dev); - - mtx_lock(&sc->mutex); - rv = twsi_locked_start(dev, sc, TWSI_STATUS_START, slave, timeout); - mtx_unlock(&sc->mutex); - - if (rv) { - mv_twsi_stop(dev); - return (rv); - } else - return (IIC_NOERR); -} - -static int -mv_twsi_stop(device_t dev) -{ - struct mv_twsi_softc *sc; - - sc = device_get_softc(dev); - - mtx_lock(&sc->mutex); - twsi_control_set(sc, TWSI_CONTROL_STOP); - DELAY(1000); - twsi_clear_iflg(sc); - mtx_unlock(&sc->mutex); - - return (IIC_NOERR); -} - -static int -mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, int delay) -{ - struct mv_twsi_softc *sc; - uint32_t status; - int last_byte, rv; - - sc = device_get_softc(dev); - - mtx_lock(&sc->mutex); - *read = 0; - while (*read < len) { - /* - * Check if we are reading last byte of the last buffer, - * do not send ACK then, per I2C specs - */ - last_byte = ((*read == len - 1) && last) ? 1 : 0; - if (last_byte) - twsi_control_clear(sc, TWSI_CONTROL_ACK); - else - twsi_control_set(sc, TWSI_CONTROL_ACK); - - DELAY (1000); - twsi_clear_iflg(sc); - - if (twsi_poll_ctrl(sc, delay, TWSI_CONTROL_IFLG)) { - debugf("timeout reading data\n"); - rv = IIC_ETIMEOUT; - goto out; - } - - status = TWSI_READ(sc, TWSI_STATUS); - if (status != (last_byte ? - TWSI_STATUS_DATA_RD_NOACK : TWSI_STATUS_DATA_RD_ACK)) { - debugf("wrong status (%02x) while reading\n", status); - rv = IIC_ESTATUS; - goto out; - } - - *buf++ = TWSI_READ(sc, TWSI_DATA); - (*read)++; - } - rv = IIC_NOERR; -out: - mtx_unlock(&sc->mutex); - return (rv); -} - -static int -mv_twsi_write(device_t dev, const char *buf, int len, int *sent, int timeout) -{ - struct mv_twsi_softc *sc; - uint32_t status; - int rv; - - sc = device_get_softc(dev); - - mtx_lock(&sc->mutex); - *sent = 0; - while (*sent < len) { - TWSI_WRITE(sc, TWSI_DATA, *buf++); - - twsi_clear_iflg(sc); - if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout writing data\n"); - rv = IIC_ETIMEOUT; - goto out; - } - - status = TWSI_READ(sc, TWSI_STATUS); - if (status != TWSI_STATUS_DATA_WR_ACK) { - debugf("wrong status (%02x) while writing\n", status); - rv = IIC_ESTATUS; - goto out; - } - (*sent)++; - } - rv = IIC_NOERR; -out: - mtx_unlock(&sc->mutex); - return (rv); -} Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Mon Feb 15 14:34:35 2016 (r295625) +++ head/sys/dev/iicbus/twsi/twsi.c Mon Feb 15 15:11:26 2016 (r295626) @@ -31,7 +31,7 @@ /* * Driver for the TWSI (aka I2C, aka IIC) bus controller found on Marvell - * SoCs. Supports master operation only, and works in polling mode. + * and Allwinner SoCs. Supports master operation only, and works in polling mode. * * Calls to DELAY() are needed per Application Note AN-179 "TWSI Software * Guidelines for Discovery(TM), Horizon (TM) and Feroceon(TM) Devices". @@ -62,156 +62,75 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iicbus_if.h" -#define MV_TWSI_NAME "twsi" -#define IICBUS_DEVNAME "iicbus" +#define TWSI_CONTROL_ACK (1 << 2) +#define TWSI_CONTROL_IFLG (1 << 3) +#define TWSI_CONTROL_STOP (1 << 4) +#define TWSI_CONTROL_START (1 << 5) +#define TWSI_CONTROL_TWSIEN (1 << 6) +#define TWSI_CONTROL_INTEN (1 << 7) + +#define TWSI_STATUS_START 0x08 +#define TWSI_STATUS_RPTD_START 0x10 +#define TWSI_STATUS_ADDR_W_ACK 0x18 +#define TWSI_STATUS_DATA_WR_ACK 0x28 +#define TWSI_STATUS_ADDR_R_ACK 0x40 +#define TWSI_STATUS_DATA_RD_ACK 0x50 +#define TWSI_STATUS_DATA_RD_NOACK 0x58 -#define TWSI_SLAVE_ADDR 0x00 -#define TWSI_EXT_SLAVE_ADDR 0x10 -#define TWSI_DATA 0x04 - -#define TWSI_CONTROL 0x08 -#define TWSI_CONTROL_ACK (1 << 2) -#define TWSI_CONTROL_IFLG (1 << 3) -#define TWSI_CONTROL_STOP (1 << 4) -#define TWSI_CONTROL_START (1 << 5) -#define TWSI_CONTROL_TWSIEN (1 << 6) -#define TWSI_CONTROL_INTEN (1 << 7) - -#define TWSI_STATUS 0x0c -#define TWSI_STATUS_START 0x08 -#define TWSI_STATUS_RPTD_START 0x10 -#define TWSI_STATUS_ADDR_W_ACK 0x18 -#define TWSI_STATUS_DATA_WR_ACK 0x28 -#define TWSI_STATUS_ADDR_R_ACK 0x40 -#define TWSI_STATUS_DATA_RD_ACK 0x50 -#define TWSI_STATUS_DATA_RD_NOACK 0x58 - -#define TWSI_BAUD_RATE 0x0c -#define TWSI_BAUD_RATE_PARAM(M,N) ((((M) << 3) | ((N) & 0x7)) & 0x7f) -#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N+1))) -#define TWSI_BAUD_RATE_SLOW 50000 /* 50kHz */ -#define TWSI_BAUD_RATE_FAST 100000 /* 100kHz */ - -#define TWSI_SOFT_RESET 0x1c - -#define TWSI_DEBUG +#define TWSI_DEBUG #undef TWSI_DEBUG -#ifdef TWSI_DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) +#ifdef TWSI_DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) #else -#define debugf(fmt, args...) +#define debugf(fmt, args...) #endif -struct mv_twsi_softc { - device_t dev; - struct resource *res[1]; /* SYS_RES_MEMORY */ - struct mtx mutex; - device_t iicbus; -}; - -static struct mv_twsi_baud_rate { - uint32_t raw; - int param; - int m; - int n; -} baud_rate[IIC_FASTEST + 1]; - -static int mv_twsi_probe(device_t); -static int mv_twsi_attach(device_t); -static int mv_twsi_detach(device_t); - -static int mv_twsi_reset(device_t dev, u_char speed, u_char addr, - u_char *oldaddr); -static int mv_twsi_repeated_start(device_t dev, u_char slave, int timeout); -static int mv_twsi_start(device_t dev, u_char slave, int timeout); -static int mv_twsi_stop(device_t dev); -static int mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, - int delay); -static int mv_twsi_write(device_t dev, const char *buf, int len, int *sent, - int timeout); - static struct resource_spec res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { -1, 0 } }; -static struct ofw_compat_data compat_data[] = { - { "mrvl,twsi", true }, - { "marvell,mv64xxx-i2c", true }, - { NULL, false } -}; - -static device_method_t mv_twsi_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, mv_twsi_probe), - DEVMETHOD(device_attach, mv_twsi_attach), - DEVMETHOD(device_detach, mv_twsi_detach), - - /* iicbus interface */ - DEVMETHOD(iicbus_callback, iicbus_null_callback), - DEVMETHOD(iicbus_repeated_start, mv_twsi_repeated_start), - DEVMETHOD(iicbus_start, mv_twsi_start), - DEVMETHOD(iicbus_stop, mv_twsi_stop), - DEVMETHOD(iicbus_write, mv_twsi_write), - DEVMETHOD(iicbus_read, mv_twsi_read), - DEVMETHOD(iicbus_reset, mv_twsi_reset), - DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), - { 0, 0 } -}; - -static devclass_t mv_twsi_devclass; - -static driver_t mv_twsi_driver = { - MV_TWSI_NAME, - mv_twsi_methods, - sizeof(struct mv_twsi_softc), -}; - -DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); -DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); -MODULE_DEPEND(twsi, iicbus, 1, 1, 1); - static __inline uint32_t -TWSI_READ(struct mv_twsi_softc *sc, bus_size_t off) +TWSI_READ(struct twsi_softc *sc, bus_size_t off) { return (bus_read_4(sc->res[0], off)); } static __inline void -TWSI_WRITE(struct mv_twsi_softc *sc, bus_size_t off, uint32_t val) +TWSI_WRITE(struct twsi_softc *sc, bus_size_t off, uint32_t val) { bus_write_4(sc->res[0], off, val); } static __inline void -twsi_control_clear(struct mv_twsi_softc *sc, uint32_t mask) +twsi_control_clear(struct twsi_softc *sc, uint32_t mask) { uint32_t val; - val = TWSI_READ(sc, TWSI_CONTROL); + val = TWSI_READ(sc, sc->reg_control); val &= ~mask; - TWSI_WRITE(sc, TWSI_CONTROL, val); + TWSI_WRITE(sc, sc->reg_control, val); } static __inline void -twsi_control_set(struct mv_twsi_softc *sc, uint32_t mask) +twsi_control_set(struct twsi_softc *sc, uint32_t mask) { uint32_t val; - val = TWSI_READ(sc, TWSI_CONTROL); + val = TWSI_READ(sc, sc->reg_control); val |= mask; - TWSI_WRITE(sc, TWSI_CONTROL, val); + TWSI_WRITE(sc, sc->reg_control, val); } static __inline void -twsi_clear_iflg(struct mv_twsi_softc *sc) +twsi_clear_iflg(struct twsi_softc *sc) { DELAY(1000); @@ -227,11 +146,11 @@ twsi_clear_iflg(struct mv_twsi_softc *sc * non-zero on timeout */ static int -twsi_poll_ctrl(struct mv_twsi_softc *sc, int timeout, uint32_t mask) +twsi_poll_ctrl(struct twsi_softc *sc, int timeout, uint32_t mask) { timeout /= 10; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 15 15:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BE0AA82AE; Mon, 15 Feb 2016 15:28:58 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 114E01628; Mon, 15 Feb 2016 15:28:57 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FFSu7T017680; Mon, 15 Feb 2016 15:28:56 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FFSu6O017678; Mon, 15 Feb 2016 15:28:56 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602151528.u1FFSu6O017678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 15 Feb 2016 15:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295627 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 15:28:58 -0000 Author: skra Date: Mon Feb 15 15:28:56 2016 New Revision: 295627 URL: https://svnweb.freebsd.org/changeset/base/295627 Log: Initial OMAP4 WUGEN pass-through driver. SPI interrupts are passed through WUGEN to GIC. Hardware initialization is left in state after reset as well as before. This is needed after an update of Linux dts files. Added: head/sys/arm/ti/omap4/omap4_wugen.c (contents, props changed) Modified: head/sys/arm/ti/omap4/files.omap4 Modified: head/sys/arm/ti/omap4/files.omap4 ============================================================================== --- head/sys/arm/ti/omap4/files.omap4 Mon Feb 15 15:11:26 2016 (r295626) +++ head/sys/arm/ti/omap4/files.omap4 Mon Feb 15 15:28:56 2016 (r295627) @@ -12,6 +12,7 @@ arm/ti/omap4/omap4_l2cache.c optional arm/ti/omap4/omap4_prcm_clks.c standard arm/ti/omap4/omap4_scm_padconf.c standard arm/ti/omap4/omap4_mp.c optional smp +arm/ti/omap4/omap4_wugen.c standard arm/ti/twl/twl.c optional twl arm/ti/twl/twl_vreg.c optional twl twl_vreg Added: head/sys/arm/ti/omap4/omap4_wugen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/omap4/omap4_wugen.c Mon Feb 15 15:28:56 2016 (r295627) @@ -0,0 +1,228 @@ +/*- + * Copyright (c) 2016 Svatopluk Kraus + * Copyright (c) 2016 Michal Meloun + * 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 +#include + +#include "pic_if.h" + +static struct ofw_compat_data compat_data[] = { + {"ti,omap4-wugen-mpu", 1}, + {NULL, 0} +}; + +struct omap4_wugen_sc { + device_t sc_dev; + struct resource *sc_mem_res; + device_t sc_parent; +}; + +static int +omap4_wugen_register(device_t dev, struct intr_irqsrc *isrc, + boolean_t *is_percpu) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + return (PIC_REGISTER(sc->sc_parent, isrc, is_percpu)); +} + +static int +omap4_wugen_unregister(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + return (PIC_UNREGISTER(sc->sc_parent, isrc)); +} + +static void +omap4_wugen_enable_source(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_ENABLE_SOURCE(sc->sc_parent, isrc); +} + +static void +omap4_wugen_disable_source(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_DISABLE_SOURCE(sc->sc_parent, isrc); +} + +static void +omap4_wugen_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_ENABLE_INTR(sc->sc_parent, isrc); +} + +static void +omap4_wugen_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_PRE_ITHREAD(sc->sc_parent, isrc); +} + + +static void +omap4_wugen_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_POST_ITHREAD(sc->sc_parent, isrc); +} + +static void +omap4_wugen_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + PIC_POST_FILTER(sc->sc_parent, isrc); +} + +#ifdef SMP +static int +omap4_wugen_bind(device_t dev, struct intr_irqsrc *isrc) +{ + struct omap4_wugen_sc *sc = device_get_softc(dev); + + return (PIC_BIND(sc->sc_parent, isrc)); +} +#endif + +static int +omap4_wugen_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + return (BUS_PROBE_DEFAULT); +} + +static int +omap4_wugen_detach(device_t dev) +{ + struct omap4_wugen_sc *sc; + + sc = device_get_softc(dev); + if (sc->sc_mem_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + sc->sc_mem_res = NULL; + } + return (0); +} + +static int +omap4_wugen_attach(device_t dev) +{ + struct omap4_wugen_sc *sc; + phandle_t node; + phandle_t parent_xref; + int rid, rv; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + node = ofw_bus_get_node(dev); + + rv = OF_getencprop(node, "interrupt-parent", &parent_xref, + sizeof(parent_xref)); + if (rv <= 0) { + device_printf(dev, "can't read parent node property\n"); + goto fail; + } + sc->sc_parent = OF_device_from_xref(parent_xref); + if (sc->sc_parent == NULL) { + device_printf(dev, "can't find parent controller\n"); + goto fail; + } + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(dev, "can't allocate resources\n"); + return (ENXIO); + } + + if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { + device_printf(dev, "can't register PIC\n"); + goto fail; + } + return (0); + +fail: + omap4_wugen_detach(dev); + return (ENXIO); +} + +static device_method_t omap4_wugen_methods[] = { + DEVMETHOD(device_probe, omap4_wugen_probe), + DEVMETHOD(device_attach, omap4_wugen_attach), + DEVMETHOD(device_detach, omap4_wugen_detach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_register, omap4_wugen_register), + DEVMETHOD(pic_unregister, omap4_wugen_unregister), + DEVMETHOD(pic_enable_source, omap4_wugen_enable_source), + DEVMETHOD(pic_disable_source, omap4_wugen_disable_source), + DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr), + DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread), + DEVMETHOD(pic_post_ithread, omap4_wugen_post_ithread), + DEVMETHOD(pic_post_filter, omap4_wugen_post_filter), +#ifdef SMP + DEVMETHOD(pic_bind, omap4_wugen_bind), +#endif + DEVMETHOD_END +}; +devclass_t omap4_wugen_devclass; +DEFINE_CLASS_0(omap4_wugen, omap4_wugen_driver, omap4_wugen_methods, + sizeof(struct omap4_wugen_sc)); +EARLY_DRIVER_MODULE(omap4_wugen, simplebus, omap4_wugen_driver, + omap4_wugen_devclass, NULL, NULL, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE + 1); From owner-svn-src-head@freebsd.org Mon Feb 15 16:55:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC56AA8995; Mon, 15 Feb 2016 16:55:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8561D62; Mon, 15 Feb 2016 16:55:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FGtivE044246; Mon, 15 Feb 2016 16:55:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FGtiIF044245; Mon, 15 Feb 2016 16:55:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151655.u1FGtiIF044245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 16:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295628 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 16:55:45 -0000 Author: andrew Date: Mon Feb 15 16:55:44 2016 New Revision: 295628 URL: https://svnweb.freebsd.org/changeset/base/295628 Log: Remove an unused static inline function. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/syscall.c Modified: head/sys/arm/arm/syscall.c ============================================================================== --- head/sys/arm/arm/syscall.c Mon Feb 15 15:28:56 2016 (r295627) +++ head/sys/arm/arm/syscall.c Mon Feb 15 16:55:44 2016 (r295628) @@ -98,17 +98,6 @@ __FBSDID("$FreeBSD$"); void swi_handler(struct trapframe *); -static __inline void -call_trapsignal(struct thread *td, int sig, u_long code) -{ - ksiginfo_t ksi; - - ksiginfo_init_trap(&ksi); - ksi.ksi_signo = sig; - ksi.ksi_code = (int)code; - trapsignal(td, &ksi); -} - int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { From owner-svn-src-head@freebsd.org Mon Feb 15 17:05:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 323B7AA8FBB; Mon, 15 Feb 2016 17:05:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0411015B8; Mon, 15 Feb 2016 17:05:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FH544D047333; Mon, 15 Feb 2016 17:05:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FH54kY047332; Mon, 15 Feb 2016 17:05:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151705.u1FH54kY047332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 17:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295629 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 17:05:05 -0000 Author: andrew Date: Mon Feb 15 17:05:03 2016 New Revision: 295629 URL: https://svnweb.freebsd.org/changeset/base/295629 Log: Remove an unused FDT header, fdt_common.h should only be needed in a few places, mostly in sys/dev/fdt and legacy code. Sponsored by: ABT Systems Ltd Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon Feb 15 16:55:44 2016 (r295628) +++ head/sys/kern/subr_intr.c Mon Feb 15 17:05:03 2016 (r295629) @@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include #endif #ifdef DDB From owner-svn-src-head@freebsd.org Mon Feb 15 17:14:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B575AA9510; Mon, 15 Feb 2016 17:14:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42A431D15; Mon, 15 Feb 2016 17:14:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FHEBh8050241; Mon, 15 Feb 2016 17:14:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FHEBr9050239; Mon, 15 Feb 2016 17:14:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151714.u1FHEBr9050239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 17:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295630 - head/sys/dev/iicbus/twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 17:14:12 -0000 Author: andrew Date: Mon Feb 15 17:14:10 2016 New Revision: 295630 URL: https://svnweb.freebsd.org/changeset/base/295630 Log: Fix the spelling of OF_getencprop. It will fix the data correctly for the endian of the CPU so there is no need to call fdt32_to_cpu. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/iicbus/twsi/mv_twsi.c head/sys/dev/iicbus/twsi/twsi.c Modified: head/sys/dev/iicbus/twsi/mv_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/mv_twsi.c Mon Feb 15 17:05:03 2016 (r295629) +++ head/sys/dev/iicbus/twsi/mv_twsi.c Mon Feb 15 17:14:10 2016 (r295630) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -225,9 +224,9 @@ mv_twsi_attach(device_t dev) /* Attach child devices onto iicbus. */ for (child = OF_child(iicbusnode); child != 0; child = OF_peer(child)) { /* Get slave address. */ - error = OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)); + error = OF_getencprop(child, "i2c-address", &paddr, sizeof(paddr)); if (error == -1) - error = OF_getprop(child, "reg", &paddr, sizeof(paddr)); + error = OF_getencprop(child, "reg", &paddr, sizeof(paddr)); if (error == -1) continue; @@ -239,10 +238,10 @@ mv_twsi_attach(device_t dev) if (bootverbose) device_printf(dev, "adding a device %s at %d.\n", - dname, fdt32_to_cpu(paddr)); + dname, paddr); childdev = BUS_ADD_CHILD(sc->iicbus, 0, dname, -1); devi = IICBUS_IVAR(childdev); - devi->addr = fdt32_to_cpu(paddr); + devi->addr = paddr; } attach_end: Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Mon Feb 15 17:05:03 2016 (r295629) +++ head/sys/dev/iicbus/twsi/twsi.c Mon Feb 15 17:14:10 2016 (r295630) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-head@freebsd.org Mon Feb 15 18:13:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C033AA955C; Mon, 15 Feb 2016 18:13:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBDF9674; Mon, 15 Feb 2016 18:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FIDXeV067327; Mon, 15 Feb 2016 18:13:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FIDXAt067326; Mon, 15 Feb 2016 18:13:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602151813.u1FIDXAt067326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Feb 2016 18:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295631 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 18:13:35 -0000 Author: pfg Date: Mon Feb 15 18:13:33 2016 New Revision: 295631 URL: https://svnweb.freebsd.org/changeset/base/295631 Log: fputs: Return the number of bytes written. POSIX.1-2008 requires that successful completion simply return a non-negative integer. We have regularly returned a constant value. Another, equally valid, implementation convention implies returning the number of bytes written. Adopt this last convention to be in line with what Apple's libc does. POSIX also explicitly notes: Note that this implementation convention cannot be adhered to for strings longer than {INT_MAX} bytes as the value would not be representable in the return type of the function. For backwards-compatibility, implementations can return the number of bytes for strings of up to {INT_MAX} bytes, and return {INT_MAX} for all longer strings. Developers shouldn't depend specifically on either convention but the change may help port software from Apple. Differential Revision: https://reviews.freebsd.org/D442 (Partial) Obtained from: Apple Inc. (Libc 997.90.3 with changes) Relnotes: yes Modified: head/lib/libc/stdio/fputs.c Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)fputs.c 8.1 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include #include "un-namespace.h" @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); FUNLOCKFILE(fp); + if (retval == 0) + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); return (retval); } From owner-svn-src-head@freebsd.org Mon Feb 15 18:14:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8DCAA95D1; Mon, 15 Feb 2016 18:14:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54027844; Mon, 15 Feb 2016 18:14:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FIELQp067399; Mon, 15 Feb 2016 18:14:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FIEL7w067397; Mon, 15 Feb 2016 18:14:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602151814.u1FIEL7w067397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Feb 2016 18:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295632 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 18:14:22 -0000 Author: pfg Date: Mon Feb 15 18:14:21 2016 New Revision: 295632 URL: https://svnweb.freebsd.org/changeset/base/295632 Log: getln: We cannot expand the buffer beyond INT_MAX. In such cases return ENOMEM. This is a limitation of our implementation, alternatively you may consider getline(3). Differential Revision: https://reviews.freebsd.org/D442 (Partial) Obtained from: Apple Inc. (Libc 997.90.3) Relnotes: yes Modified: head/lib/libc/stdio/fgetln.3 head/lib/libc/stdio/fgetln.c Modified: head/lib/libc/stdio/fgetln.3 ============================================================================== --- head/lib/libc/stdio/fgetln.3 Mon Feb 15 18:13:33 2016 (r295631) +++ head/lib/libc/stdio/fgetln.3 Mon Feb 15 18:14:21 2016 (r295632) @@ -28,7 +28,7 @@ .\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd February 15, 2016 .Dt FGETLN 3 .Os .Sh NAME @@ -97,6 +97,9 @@ These changes are lost as soon as the po The argument .Fa stream is not a stream open for reading. +.It Bq Er ENOMEM +The internal line buffer could not be expanded due to lack of available memory, +or because it would need to expand beyond INT_MAX in size. .El .Pp The Modified: head/lib/libc/stdio/fgetln.c ============================================================================== --- head/lib/libc/stdio/fgetln.c Mon Feb 15 18:13:33 2016 (r295631) +++ head/lib/libc/stdio/fgetln.c Mon Feb 15 18:14:21 2016 (r295632) @@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fgetln.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include +#include #include #include #include @@ -61,6 +63,10 @@ __slbexpand(FILE *fp, size_t newsize) #endif if (fp->_lb._size >= newsize) return (0); + if (newsize > INT_MAX) { + errno = ENOMEM; + return (-1); + } if ((p = realloc(fp->_lb._base, newsize)) == NULL) return (-1); fp->_lb._base = p; @@ -152,13 +158,14 @@ fgetln(FILE *fp, size_t *lenp) } *lenp = len; #ifdef notdef - fp->_lb._base[len] = 0; + fp->_lb._base[len] = '\0'; #endif FUNLOCKFILE(fp); return ((char *)fp->_lb._base); error: *lenp = 0; /* ??? */ + fp->_flags |= __SERR; FUNLOCKFILE(fp); return (NULL); /* ??? */ } From owner-svn-src-head@freebsd.org Mon Feb 15 19:14:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23725AA930B; Mon, 15 Feb 2016 19:14:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E54F89C2; Mon, 15 Feb 2016 19:14:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FJEOhw085445; Mon, 15 Feb 2016 19:14:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FJEOd5085444; Mon, 15 Feb 2016 19:14:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151914.u1FJEOd5085444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 19:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295633 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 19:14:26 -0000 Author: andrew Date: Mon Feb 15 19:14:24 2016 New Revision: 295633 URL: https://svnweb.freebsd.org/changeset/base/295633 Log: Set sc->clkfreq removed in r295470 Reported by: Jared McNeill Pointy-hat to: andrew Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Mon Feb 15 18:14:21 2016 (r295632) +++ head/sys/arm/arm/generic_timer.c Mon Feb 15 19:14:24 2016 (r295633) @@ -363,6 +363,8 @@ arm_tmr_attach(device_t dev) if (node > 0) { error = OF_getencprop(node, "clock-frequency", &clock, sizeof(clock)); + if (error > 0) + sc->clkfreq = clock; } #endif From owner-svn-src-head@freebsd.org Mon Feb 15 19:31:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518CFAA9C1A; Mon, 15 Feb 2016 19:31:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0671377; Mon, 15 Feb 2016 19:31:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FJVOOj090980; Mon, 15 Feb 2016 19:31:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FJVOu7090977; Mon, 15 Feb 2016 19:31:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151931.u1FJVOu7090977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 19:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295634 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 19:31:25 -0000 Author: andrew Date: Mon Feb 15 19:31:23 2016 New Revision: 295634 URL: https://svnweb.freebsd.org/changeset/base/295634 Log: Add support for the AXP209 Power System Management IC. This allows boards with this and an Allwinner SoC to power off. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D4954 Added: head/sys/arm/allwinner/axp209.c (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner Added: head/sys/arm/allwinner/axp209.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/axp209.c Mon Feb 15 19:31:23 2016 (r295634) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2015 Emmanuel Vadot + * 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$"); +/* +* X-Power AXP209 PMU for Allwinner SoCs +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "iicbus_if.h" + +/* Power State Register */ +#define AXP209_PSR 0x00 +#define AXP209_PSR_ACIN 0x80 +#define AXP209_PSR_VBUS 0x20 + +/* Shutdown and battery control */ +#define AXP209_SHUTBAT 0x32 +#define AXP209_SHUTBAT_SHUTDOWN 0x80 + +struct axp209_softc { + uint32_t addr; + struct intr_config_hook enum_hook; +}; + +static int +axp209_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + struct axp209_softc *sc = device_get_softc(dev); + struct iic_msg msg[2]; + + msg[0].slave = sc->addr; + msg[0].flags = IIC_M_WR; + msg[0].len = 1; + msg[0].buf = ® + + msg[1].slave = sc->addr; + msg[1].flags = IIC_M_RD; + msg[1].len = size; + msg[1].buf = data; + + return (iicbus_transfer(dev, msg, 2)); +} + +static int +axp209_write(device_t dev, uint8_t reg, uint8_t data) +{ + uint8_t buffer[2]; + struct axp209_softc *sc = device_get_softc(dev); + struct iic_msg msg; + + buffer[0] = reg; + buffer[1] = data; + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 2; + msg.buf = buffer; + + return (iicbus_transfer(dev, &msg, 1)); +} + +static void +axp209_shutdown(void *devp, int howto) +{ + device_t dev; + + if (!(howto & RB_POWEROFF)) + return; + dev = (device_t)devp; + + if (bootverbose) + device_printf(dev, "Shutdown AXP209\n"); + + axp209_write(dev, AXP209_SHUTBAT, AXP209_SHUTBAT_SHUTDOWN); +} + +static int +axp209_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "x-powers,axp209")) + return (ENXIO); + + device_set_desc(dev, "X-Power AXP209 Power Management Unit"); + + return (BUS_PROBE_DEFAULT); +} + +static int +axp209_attach(device_t dev) +{ + struct axp209_softc *sc; + uint8_t data; + uint8_t pwr_src; + char pwr_name[4][11] = {"Battery", "AC", "USB", "AC and USB"}; + + sc = device_get_softc(dev); + + sc->addr = iicbus_get_addr(dev); + + /* + * Read the Power State register + * bit 7 is AC presence, bit 5 is VBUS presence. + * If none are set then we are running from battery (obviously). + */ + axp209_read(dev, AXP209_PSR, &data, 1); + pwr_src = ((data & AXP209_PSR_ACIN) >> 7) | + ((data & AXP209_PSR_VBUS) >> 4); + + if (bootverbose) + device_printf(dev, "AXP209 Powered by %s\n", + pwr_name[pwr_src]); + + EVENTHANDLER_REGISTER(shutdown_final, axp209_shutdown, dev, + SHUTDOWN_PRI_LAST); + + return (0); +} + +static device_method_t axp209_methods[] = { + DEVMETHOD(device_probe, axp209_probe), + DEVMETHOD(device_attach, axp209_attach), + {0, 0}, +}; + +static driver_t axp209_driver = { + "axp209_pmu", + axp209_methods, + sizeof(struct axp209_softc), +}; + +static devclass_t axp209_devclass; + +DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass, 0, 0); +MODULE_VERSION(axp209, 1); +MODULE_DEPEND(axp209, iicbus, 1, 1, 1); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Feb 15 19:14:24 2016 (r295633) +++ head/sys/arm/allwinner/files.allwinner Mon Feb 15 19:31:23 2016 (r295634) @@ -11,6 +11,7 @@ arm/allwinner/a10_sramc.c standard arm/allwinner/a10_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard +arm/allwinner/axp209.c optional axp209 arm/allwinner/if_emac.c optional emac dev/iicbus/twsi/a10_twsi.c optional twsi #arm/allwinner/console.c standard From owner-svn-src-head@freebsd.org Mon Feb 15 19:56:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731F1AAA60A; Mon, 15 Feb 2016 19:56:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 436675E8; Mon, 15 Feb 2016 19:56:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FJuacm099685; Mon, 15 Feb 2016 19:56:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FJuZsf099678; Mon, 15 Feb 2016 19:56:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602151956.u1FJuZsf099678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Feb 2016 19:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295635 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 19:56:37 -0000 Author: andrew Date: Mon Feb 15 19:56:35 2016 New Revision: 295635 URL: https://svnweb.freebsd.org/changeset/base/295635 Log: Add support for the Allwinner DMA controller. This will be used by the at least the audio codec driver currently in review. Submitted by: Jared McNeill Differential Revision: https://reviews.freebsd.org/D5050 Added: head/sys/arm/allwinner/a10_dmac.c (contents, props changed) head/sys/arm/allwinner/a10_dmac.h (contents, props changed) head/sys/arm/allwinner/sunxi_dma_if.m (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/A10 head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Added: head/sys/arm/allwinner/a10_dmac.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_dmac.c Mon Feb 15 19:56:35 2016 (r295635) @@ -0,0 +1,453 @@ +/*- + * Copyright (c) 2014-2016 Jared D. McNeill + * 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 ``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 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. + * + */ + +/* + * Allwinner A10/A20 DMA controller + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include "sunxi_dma_if.h" + +#define NDMA_CHANNELS 8 +#define DDMA_CHANNELS 8 + +enum a10dmac_type { + CH_NDMA, + CH_DDMA +}; + +struct a10dmac_softc; + +struct a10dmac_channel { + struct a10dmac_softc * ch_sc; + uint8_t ch_index; + enum a10dmac_type ch_type; + void (*ch_callback)(void *); + void * ch_callbackarg; + uint32_t ch_regoff; +}; + +struct a10dmac_softc { + struct resource * sc_res[2]; + struct mtx sc_mtx; + void * sc_ih; + + struct a10dmac_channel sc_ndma_channels[NDMA_CHANNELS]; + struct a10dmac_channel sc_ddma_channels[DDMA_CHANNELS]; +}; + +static struct resource_spec a10dmac_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define DMA_READ(sc, reg) bus_read_4((sc)->sc_res[0], (reg)) +#define DMA_WRITE(sc, reg, val) bus_write_4((sc)->sc_res[0], (reg), (val)) +#define DMACH_READ(ch, reg) \ + DMA_READ((ch)->ch_sc, (reg) + (ch)->ch_regoff) +#define DMACH_WRITE(ch, reg, val) \ + DMA_WRITE((ch)->ch_sc, (reg) + (ch)->ch_regoff, (val)) + +static void a10dmac_intr(void *); + +static int +a10dmac_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-dma")) + return (ENXIO); + + device_set_desc(dev, "Allwinner DMA controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10dmac_attach(device_t dev) +{ + struct a10dmac_softc *sc; + unsigned int index; + int error; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, a10dmac_spec, sc->sc_res)) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "a10 dmac", NULL, MTX_SPIN); + + /* Activate DMA controller clock */ + a10_clk_dmac_activate(); + + /* Disable all interrupts and clear pending status */ + DMA_WRITE(sc, AWIN_DMA_IRQ_EN_REG, 0); + DMA_WRITE(sc, AWIN_DMA_IRQ_PEND_STA_REG, ~0); + + /* Initialize channels */ + for (index = 0; index < NDMA_CHANNELS; index++) { + sc->sc_ndma_channels[index].ch_sc = sc; + sc->sc_ndma_channels[index].ch_index = index; + sc->sc_ndma_channels[index].ch_type = CH_NDMA; + sc->sc_ndma_channels[index].ch_callback = NULL; + sc->sc_ndma_channels[index].ch_callbackarg = NULL; + sc->sc_ndma_channels[index].ch_regoff = AWIN_NDMA_REG(index); + DMACH_WRITE(&sc->sc_ndma_channels[index], AWIN_NDMA_CTL_REG, 0); + } + for (index = 0; index < DDMA_CHANNELS; index++) { + sc->sc_ddma_channels[index].ch_sc = sc; + sc->sc_ddma_channels[index].ch_index = index; + sc->sc_ddma_channels[index].ch_type = CH_DDMA; + sc->sc_ddma_channels[index].ch_callback = NULL; + sc->sc_ddma_channels[index].ch_callbackarg = NULL; + sc->sc_ddma_channels[index].ch_regoff = AWIN_DDMA_REG(index); + DMACH_WRITE(&sc->sc_ddma_channels[index], AWIN_DDMA_CTL_REG, 0); + } + + error = bus_setup_intr(dev, sc->sc_res[1], INTR_MPSAFE | INTR_TYPE_MISC, + NULL, a10dmac_intr, sc, &sc->sc_ih); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler\n"); + bus_release_resources(dev, a10dmac_spec, sc->sc_res); + mtx_destroy(&sc->sc_mtx); + return (ENXIO); + } + + return (0); +} + +static void +a10dmac_intr(void *priv) +{ + struct a10dmac_softc *sc = priv; + uint32_t sta, bit, mask; + uint8_t index; + + sta = DMA_READ(sc, AWIN_DMA_IRQ_PEND_STA_REG); + DMA_WRITE(sc, AWIN_DMA_IRQ_PEND_STA_REG, sta); + + while ((bit = ffs(sta & AWIN_DMA_IRQ_END_MASK)) != 0) { + mask = (1U << (bit - 1)); + sta &= ~mask; + /* + * Map status bit to channel number. The status register is + * encoded with two bits of status per channel (lowest bit + * is half transfer pending, highest bit is end transfer + * pending). The 8 normal DMA channel status are in the lower + * 16 bits and the 8 dedicated DMA channel status are in + * the upper 16 bits. The output is a channel number from 0-7. + */ + index = ((bit - 1) / 2) & 7; + if (mask & AWIN_DMA_IRQ_NDMA) { + if (sc->sc_ndma_channels[index].ch_callback == NULL) + continue; + sc->sc_ndma_channels[index].ch_callback( + sc->sc_ndma_channels[index].ch_callbackarg); + } else { + if (sc->sc_ddma_channels[index].ch_callback == NULL) + continue; + sc->sc_ddma_channels[index].ch_callback( + sc->sc_ddma_channels[index].ch_callbackarg); + } + } +} + +static uint32_t +a10dmac_read_ctl(struct a10dmac_channel *ch) +{ + if (ch->ch_type == CH_NDMA) { + return (DMACH_READ(ch, AWIN_NDMA_CTL_REG)); + } else { + return (DMACH_READ(ch, AWIN_DDMA_CTL_REG)); + } +} + +static void +a10dmac_write_ctl(struct a10dmac_channel *ch, uint32_t val) +{ + if (ch->ch_type == CH_NDMA) { + DMACH_WRITE(ch, AWIN_NDMA_CTL_REG, val); + } else { + DMACH_WRITE(ch, AWIN_DDMA_CTL_REG, val); + } +} + +static int +a10dmac_set_config(device_t dev, void *priv, const struct sunxi_dma_config *cfg) +{ + struct a10dmac_channel *ch = priv; + uint32_t val; + unsigned int dst_dw, dst_bl, dst_bs, dst_wc; + unsigned int src_dw, src_bl, src_bs, src_wc; + + switch (cfg->dst_width) { + case 8: + dst_dw = AWIN_DMA_CTL_DATA_WIDTH_8; + break; + case 16: + dst_dw = AWIN_DMA_CTL_DATA_WIDTH_16; + break; + case 32: + dst_dw = AWIN_DMA_CTL_DATA_WIDTH_32; + break; + default: + return (EINVAL); + } + switch (cfg->dst_burst_len) { + case 1: + dst_bl = AWIN_DMA_CTL_BURST_LEN_1; + break; + case 4: + dst_bl = AWIN_DMA_CTL_BURST_LEN_4; + break; + case 8: + dst_bl = AWIN_DMA_CTL_BURST_LEN_8; + break; + default: + return (EINVAL); + } + switch (cfg->src_width) { + case 8: + src_dw = AWIN_DMA_CTL_DATA_WIDTH_8; + break; + case 16: + src_dw = AWIN_DMA_CTL_DATA_WIDTH_16; + break; + case 32: + src_dw = AWIN_DMA_CTL_DATA_WIDTH_32; + break; + default: + return (EINVAL); + } + switch (cfg->src_burst_len) { + case 1: + src_bl = AWIN_DMA_CTL_BURST_LEN_1; + break; + case 4: + src_bl = AWIN_DMA_CTL_BURST_LEN_4; + break; + case 8: + src_bl = AWIN_DMA_CTL_BURST_LEN_8; + break; + default: + return (EINVAL); + } + + val = (dst_dw << AWIN_DMA_CTL_DST_DATA_WIDTH_SHIFT) | + (dst_bl << AWIN_DMA_CTL_DST_BURST_LEN_SHIFT) | + (cfg->dst_drqtype << AWIN_DMA_CTL_DST_DRQ_TYPE_SHIFT) | + (src_dw << AWIN_DMA_CTL_SRC_DATA_WIDTH_SHIFT) | + (src_bl << AWIN_DMA_CTL_SRC_BURST_LEN_SHIFT) | + (cfg->src_drqtype << AWIN_DMA_CTL_SRC_DRQ_TYPE_SHIFT); + if (cfg->dst_noincr) { + val |= AWIN_NDMA_CTL_DST_ADDR_NOINCR; + } + if (cfg->src_noincr) { + val |= AWIN_NDMA_CTL_SRC_ADDR_NOINCR; + } + + if (ch->ch_type == CH_NDMA) { + DMACH_WRITE(ch, AWIN_NDMA_CTL_REG, val); + } else { + DMACH_WRITE(ch, AWIN_DDMA_CTL_REG, val); + + dst_bs = cfg->dst_blksize - 1; + dst_wc = cfg->dst_wait_cyc - 1; + src_bs = cfg->src_blksize - 1; + src_wc = cfg->src_wait_cyc - 1; + + DMACH_WRITE(ch, AWIN_DDMA_PARA_REG, + (dst_bs << AWIN_DDMA_PARA_DST_DATA_BLK_SIZ_SHIFT) | + (dst_wc << AWIN_DDMA_PARA_DST_WAIT_CYC_SHIFT) | + (src_bs << AWIN_DDMA_PARA_SRC_DATA_BLK_SIZ_SHIFT) | + (src_wc << AWIN_DDMA_PARA_SRC_WAIT_CYC_SHIFT)); + } + + return (0); +} + +static void * +a10dmac_alloc(device_t dev, bool dedicated, void (*cb)(void *), void *cbarg) +{ + struct a10dmac_softc *sc = device_get_softc(dev); + struct a10dmac_channel *ch_list; + struct a10dmac_channel *ch = NULL; + uint32_t irqen; + uint8_t ch_count, index; + + if (dedicated) { + ch_list = sc->sc_ddma_channels; + ch_count = DDMA_CHANNELS; + } else { + ch_list = sc->sc_ndma_channels; + ch_count = NDMA_CHANNELS; + } + + mtx_lock_spin(&sc->sc_mtx); + for (index = 0; index < ch_count; index++) { + if (ch_list[index].ch_callback == NULL) { + ch = &ch_list[index]; + ch->ch_callback = cb; + ch->ch_callbackarg = cbarg; + + irqen = DMA_READ(sc, AWIN_DMA_IRQ_EN_REG); + if (ch->ch_type == CH_NDMA) + irqen |= AWIN_DMA_IRQ_NDMA_END(index); + else + irqen |= AWIN_DMA_IRQ_DDMA_END(index); + DMA_WRITE(sc, AWIN_DMA_IRQ_EN_REG, irqen); + + break; + } + } + mtx_unlock_spin(&sc->sc_mtx); + + return (ch); +} + +static void +a10dmac_free(device_t dev, void *priv) +{ + struct a10dmac_channel *ch = priv; + struct a10dmac_softc *sc = ch->ch_sc; + uint32_t irqen, sta, cfg; + + mtx_lock_spin(&sc->sc_mtx); + + irqen = DMA_READ(sc, AWIN_DMA_IRQ_EN_REG); + cfg = a10dmac_read_ctl(ch); + if (ch->ch_type == CH_NDMA) { + sta = AWIN_DMA_IRQ_NDMA_END(ch->ch_index); + cfg &= ~AWIN_NDMA_CTL_DMA_LOADING; + } else { + sta = AWIN_DMA_IRQ_DDMA_END(ch->ch_index); + cfg &= ~AWIN_DDMA_CTL_DMA_LOADING; + } + irqen &= ~sta; + a10dmac_write_ctl(ch, cfg); + DMA_WRITE(sc, AWIN_DMA_IRQ_EN_REG, irqen); + DMA_WRITE(sc, AWIN_DMA_IRQ_PEND_STA_REG, sta); + + ch->ch_callback = NULL; + ch->ch_callbackarg = NULL; + + mtx_unlock_spin(&sc->sc_mtx); +} + +static int +a10dmac_transfer(device_t dev, void *priv, bus_addr_t src, bus_addr_t dst, + size_t nbytes) +{ + struct a10dmac_channel *ch = priv; + uint32_t cfg; + + cfg = a10dmac_read_ctl(ch); + if (ch->ch_type == CH_NDMA) { + if (cfg & AWIN_NDMA_CTL_DMA_LOADING) + return (EBUSY); + + DMACH_WRITE(ch, AWIN_NDMA_SRC_ADDR_REG, src); + DMACH_WRITE(ch, AWIN_NDMA_DEST_ADDR_REG, dst); + DMACH_WRITE(ch, AWIN_NDMA_BC_REG, nbytes); + + cfg |= AWIN_NDMA_CTL_DMA_LOADING; + a10dmac_write_ctl(ch, cfg); + } else { + if (cfg & AWIN_DDMA_CTL_DMA_LOADING) + return (EBUSY); + + DMACH_WRITE(ch, AWIN_DDMA_SRC_START_ADDR_REG, src); + DMACH_WRITE(ch, AWIN_DDMA_DEST_START_ADDR_REG, dst); + DMACH_WRITE(ch, AWIN_DDMA_BC_REG, nbytes); + + cfg |= AWIN_DDMA_CTL_DMA_LOADING; + a10dmac_write_ctl(ch, cfg); + } + + return (0); +} + +static void +a10dmac_halt(device_t dev, void *priv) +{ + struct a10dmac_channel *ch = priv; + uint32_t cfg; + + cfg = a10dmac_read_ctl(ch); + if (ch->ch_type == CH_NDMA) { + cfg &= ~AWIN_NDMA_CTL_DMA_LOADING; + } else { + cfg &= ~AWIN_DDMA_CTL_DMA_LOADING; + } + a10dmac_write_ctl(ch, cfg); +} + +static device_method_t a10dmac_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a10dmac_probe), + DEVMETHOD(device_attach, a10dmac_attach), + + /* sunxi DMA interface */ + DEVMETHOD(sunxi_dma_alloc, a10dmac_alloc), + DEVMETHOD(sunxi_dma_free, a10dmac_free), + DEVMETHOD(sunxi_dma_set_config, a10dmac_set_config), + DEVMETHOD(sunxi_dma_transfer, a10dmac_transfer), + DEVMETHOD(sunxi_dma_halt, a10dmac_halt), + + DEVMETHOD_END +}; + +static driver_t a10dmac_driver = { + "a10dmac", + a10dmac_methods, + sizeof(struct a10dmac_softc) +}; + +static devclass_t a10dmac_devclass; + +DRIVER_MODULE(a10dmac, simplebus, a10dmac_driver, a10dmac_devclass, 0, 0); Added: head/sys/arm/allwinner/a10_dmac.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_dmac.h Mon Feb 15 19:56:35 2016 (r295635) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2014-2016 Jared D. McNeill + * 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 ``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 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$ + */ + +#ifndef _A10_DMAC_H_ +#define _A10_DMAC_H_ + +#define AWIN_DMA_IRQ_EN_REG 0x0000 +#define AWIN_DMA_IRQ_PEND_STA_REG 0x0004 +#define AWIN_NDMA_AUTO_GATE_REG 0x0008 +#define AWIN_NDMA_REG(n) (0x100+0x20*(n)) +#define AWIN_NDMA_CTL_REG 0x0000 +#define AWIN_NDMA_SRC_ADDR_REG 0x0004 +#define AWIN_NDMA_DEST_ADDR_REG 0x0008 +#define AWIN_NDMA_BC_REG 0x000c +#define AWIN_DDMA_REG(n) (0x300+0x20*(n)) +#define AWIN_DDMA_CTL_REG 0x0000 +#define AWIN_DDMA_SRC_START_ADDR_REG 0x0004 +#define AWIN_DDMA_DEST_START_ADDR_REG 0x0008 +#define AWIN_DDMA_BC_REG 0x000c +#define AWIN_DDMA_PARA_REG 0x0018 +#define AWIN_DMA_IRQ_END_MASK 0xaaaaaaaa +#define AWIN_DMA_IRQ_HF_MASK 0x55555555 +#define AWIN_DMA_IRQ_DDMA 0xffff0000 +#define AWIN_DMA_IRQ_DDMA_END(n) (1U << (17+2*(n))) +#define AWIN_DMA_IRQ_DDMA_HF(n) (1U << (16+2*(n))) +#define AWIN_DMA_IRQ_NDMA 0x0000ffff +#define AWIN_DMA_IRQ_NDMA_END(n) (1U << (1+2*(n))) +#define AWIN_DMA_IRQ_NDMA_HF(n) (1U << (0+2*(n))) +#define AWIN_NDMA_AUTO_GATING_DIS (1U << 16) +#define AWIN_DMA_CTL_DST_DATA_WIDTH_SHIFT 25 +#define AWIN_DMA_CTL_DST_DATA_WIDTH_MASK (3U << AWIN_DMA_CTL_DST_DATA_WIDTH_SHIFT) +#define AWIN_DMA_CTL_DATA_WIDTH_8 0 +#define AWIN_DMA_CTL_DATA_WIDTH_16 1 +#define AWIN_DMA_CTL_DATA_WIDTH_32 2 +#define AWIN_DMA_CTL_DST_BURST_LEN_SHIFT 23 +#define AWIN_DMA_CTL_DST_BURST_LEN_MASK (3 << AWIN_DMA_CTL_DST_BURST_LEN_SHIFT) +#define AWIN_DMA_CTL_BURST_LEN_1 0 +#define AWIN_DMA_CTL_BURST_LEN_4 1 +#define AWIN_DMA_CTL_BURST_LEN_8 2 +#define AWIN_DMA_CTL_DST_DRQ_TYPE_SHIFT 16 +#define AWIN_DMA_CTL_DST_DRQ_TYPE_MASK (0x1f << AWIN_DMA_CTL_DST_DRQ_TYPE_SHIFT) +#define AWIN_DMA_CTL_BC_REMAINING (1U << 15) +#define AWIN_DMA_CTL_SRC_DATA_WIDTH_SHIFT 9 +#define AWIN_DMA_CTL_SRC_DATA_WIDTH_MASK (3U << AWIN_DMA_CTL_SRC_DATA_WIDTH_SHIFT) +#define AWIN_DMA_CTL_SRC_BURST_LEN_SHIFT 7 +#define AWIN_DMA_CTL_SRC_BURST_LEN_MASK (3U << AWIN_DMA_CTL_SRC_BURST_LEN_SHIFT) +#define AWIN_DMA_CTL_SRC_DRQ_TYPE_SHIFT 0 +#define AWIN_DMA_CTL_SRC_DRQ_TYPE_MASK (0x1f << AWIN_DMA_CTL_SRC_DRQ_TYPE_SHIFT) +#define AWIN_NDMA_CTL_DMA_LOADING (1U << 31) +#define AWIN_NDMA_CTL_DMA_CONTIN_MODE (1U << 30) +#define AWIN_NDMA_CTL_WAIT_STATE_LOG2_SHIFT 27 +#define AWIN_NDMA_CTL_WAIT_STATE_LOG2_MASK (7U << AWIN_NDMA_CTL_WAIT_STATE_LOG2_SHIFT) +#define AWIN_NDMA_CTL_DST_NON_SECURE (1U << 22) +#define AWIN_NDMA_CTL_DST_ADDR_NOINCR (1U << 21) +#define AWIN_NDMA_CTL_DRQ_IRO 0 +#define AWIN_NDMA_CTL_DRQ_IR1 1 +#define AWIN_NDMA_CTL_DRQ_SPDIF 2 +#define AWIN_NDMA_CTL_DRQ_IISO 3 +#define AWIN_NDMA_CTL_DRQ_IIS1 4 +#define AWIN_NDMA_CTL_DRQ_AC97 5 +#define AWIN_NDMA_CTL_DRQ_IIS2 6 +#define AWIN_NDMA_CTL_DRQ_UARTO 8 +#define AWIN_NDMA_CTL_DRQ_UART1 9 +#define AWIN_NDMA_CTL_DRQ_UART2 10 +#define AWIN_NDMA_CTL_DRQ_UART3 11 +#define AWIN_NDMA_CTL_DRQ_UART4 12 +#define AWIN_NDMA_CTL_DRQ_UART5 13 +#define AWIN_NDMA_CTL_DRQ_UART6 14 +#define AWIN_NDMA_CTL_DRQ_UART7 15 +#define AWIN_NDMA_CTL_DRQ_DDC 16 +#define AWIN_NDMA_CTL_DRQ_USB_EP1 17 +#define AWIN_NDMA_CTL_DRQ_CODEC 19 +#define AWIN_NDMA_CTL_DRQ_SRAM 21 +#define AWIN_NDMA_CTL_DRQ_SDRAM 22 +#define AWIN_NDMA_CTL_DRQ_TP_AD 23 +#define AWIN_NDMA_CTL_DRQ_SPI0 24 +#define AWIN_NDMA_CTL_DRQ_SPI1 25 +#define AWIN_NDMA_CTL_DRQ_SPI2 26 +#define AWIN_NDMA_CTL_DRQ_SPI3 27 +#define AWIN_NDMA_CTL_DRQ_USB_EP2 28 +#define AWIN_NDMA_CTL_DRQ_USB_EP3 29 +#define AWIN_NDMA_CTL_DRQ_USB_EP4 30 +#define AWIN_NDMA_CTL_DRQ_USB_EP5 31 +#define AWIN_NDMA_CTL_SRC_NON_SECURE (1U << 6) +#define AWIN_NDMA_CTL_SRC_ADDR_NOINCR (1U << 5) +#define AWIN_NDMA_BC_COUNT 0x0003ffff +#define AWIN_DDMA_CTL_DMA_LOADING (1U << 31) +#define AWIN_DDMA_CTL_BUSY (1U << 30) +#define AWIN_DDMA_CTL_DMA_CONTIN_MODE (1U << 29) +#define AWIN_DDMA_CTL_DST_NON_SECURE (1U << 28) +#define AWIN_DDMA_CTL_DST_ADDR_MODE_SHIFT 21 +#define AWIN_DDMA_CTL_DST_ADDR_MODE_MASK (3U << AWIN_DDMA_CTL_DST_ADDR_MODE_SHIFT) +#define AWIN_DDMA_CTL_DMA_ADDR_LINEAR 0 +#define AWIN_DDMA_CTL_DMA_ADDR_IO 1 +#define AWIN_DDMA_CTL_DMA_ADDR_HPAGE 2 +#define AWIN_DDMA_CTL_DMA_ADDR_VPAGE 3 +#define AWIN_DDMA_CTL_DST_DRQ_TYPE_SHIFT 16 +#define AWIN_DDMA_CTL_DST_DRQ_TYPE_MASK (0x1f << AWIN_DDMA_CTL_DST_DRQ_TYPE_SHIFT) +#define AWIN_DDMA_CTL_DRQ_SRAM 0 +#define AWIN_DDMA_CTL_DRQ_SDRAM 1 +#define AWIN_DDMA_CTL_DRQ_NFC 3 +#define AWIN_DDMA_CTL_DRQ_USB0 4 +#define AWIN_DDMA_CTL_DRQ_EMAC_TX 6 +#define AWIN_DDMA_CTL_DRQ_EMAC_RX 7 +#define AWIN_DDMA_CTL_DRQ_SPI1_TX 8 +#define AWIN_DDMA_CTL_DRQ_SPI1_RX 9 +#define AWIN_DDMA_CTL_DRQ_SS_TX 10 +#define AWIN_DDMA_CTL_DRQ_SS_RX 11 +#define AWIN_DDMA_CTL_DRQ_TCON0 14 +#define AWIN_DDMA_CTL_DRQ_TCON1 15 +#define AWIN_DDMA_CTL_DRQ_MS_TX 23 +#define AWIN_DDMA_CTL_DRQ_MS_RX 23 +#define AWIN_DDMA_CTL_DRQ_HDMI_AUDIO 24 +#define AWIN_DDMA_CTL_DRQ_SPI0_TX 26 +#define AWIN_DDMA_CTL_DRQ_SPI0_RX 27 +#define AWIN_DDMA_CTL_DRQ_SPI2_TX 28 +#define AWIN_DDMA_CTL_DRQ_SPI2_RX 29 +#define AWIN_DDMA_CTL_DRQ_SPI3_TX 30 +#define AWIN_DDMA_CTL_DRQ_SPI3_RX 31 +#define AWIN_DDMA_CTL_SRC_NON_SECURE (1U << 12) +#define AWIN_DDMA_CTL_SRC_ADDR_MODE_SHIFT 5 +#define AWIN_DDMA_CTL_SRC_ADDR_MODE_MASK (3U << AWIN_DDMA_CTL_SRC_ADDR_MODE_SHIFT) +#define AWIN_DDMA_BC_COUNT 0x00003fff +#define AWIN_DDMA_PARA_DST_DATA_BLK_SIZ_SHIFT 24 +#define AWIN_DDMA_PARA_DST_DATA_BLK_SIZ_MASK (0xff << AWIN_DDMA_PARA_DST_DATA_BLK_SIZ_SHIFT) +#define AWIN_DDMA_PARA_DST_WAIT_CYC_SHIFT 16 +#define AWIN_DDMA_PARA_DST_WAIT_CYC_MASK (0xff << AWIN_DDMA_PARA_DST_WAIT_CYC_SHIFT) +#define AWIN_DDMA_PARA_SRC_DATA_BLK_SIZ_SHIFT 8 +#define AWIN_DDMA_PARA_SRC_DATA_BLK_SIZ_MASK (0xff << AWIN_DDMA_PARA_SRC_DATA_BLK_SIZ_SHIFT) +#define AWIN_DDMA_PARA_SRC_WAIT_CYC_SHIFT 0 +#define AWIN_DDMA_PARA_SRC_WAIT_CYC_MASK (0xff << AWIN_DDMA_PARA_SRC_WAIT_CYC_SHIFT) + +#endif /* !_A10_DMAC_H_ */ Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Feb 15 19:31:23 2016 (r295634) +++ head/sys/arm/allwinner/files.allwinner Mon Feb 15 19:56:35 2016 (r295635) @@ -4,6 +4,7 @@ kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard +arm/allwinner/a10_dmac.c standard arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc @@ -13,5 +14,6 @@ arm/allwinner/a20/a20_cpu_cfg.c standar arm/allwinner/allwinner_machdep.c standard arm/allwinner/axp209.c optional axp209 arm/allwinner/if_emac.c optional emac +arm/allwinner/sunxi_dma_if.m standard dev/iicbus/twsi/a10_twsi.c optional twsi #arm/allwinner/console.c standard Added: head/sys/arm/allwinner/sunxi_dma_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/sunxi_dma_if.m Mon Feb 15 19:56:35 2016 (r295635) @@ -0,0 +1,98 @@ +#- +# Copyright (c) 2016 Jared D. McNeill +# 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$ +# + +#include + +INTERFACE sunxi_dma; + +HEADER { + #include + + struct sunxi_dma_config { + unsigned int dst_width; + unsigned int dst_burst_len; + unsigned int dst_drqtype; + bool dst_noincr; + unsigned int dst_blksize; /* DDMA-only */ + unsigned int dst_wait_cyc; /* DDMA-only */ + unsigned int src_width; + unsigned int src_burst_len; + unsigned int src_drqtype; + bool src_noincr; + unsigned int src_blksize; /* DDMA-only */ + unsigned int src_wait_cyc; /* DDMA-only */ + }; + + typedef void (*sunxi_dma_callback)(void *); +} + +# +# Allocate DMA channel +# +METHOD void * alloc { + device_t dev; + bool dedicated; + sunxi_dma_callback callback; + void *callback_arg; +}; + +# +# Free DMA channel +# +METHOD void free { + device_t dev; + void *dmachan; +}; + +# +# Set DMA channel configuration +# +METHOD int set_config { + device_t dev; + void *dmachan; + const struct sunxi_dma_config *cfg; +}; + +# +# Start DMA channel transfer +# +METHOD int transfer { + device_t dev; + void *dmachan; + bus_addr_t src; + bus_addr_t dst; + size_t nbytes; +}; + +# +# Halt DMA channel transfer +# +METHOD void halt { + device_t dev; + void *dmachan; +}; Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Mon Feb 15 19:31:23 2016 (r295634) +++ head/sys/arm/conf/A10 Mon Feb 15 19:56:35 2016 (r295635) @@ -69,6 +69,7 @@ device random # Entropy device device iicbus device iic device twsi +device axp209 # AXP209 Power Management Unit # GPIO device gpio Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Mon Feb 15 19:31:23 2016 (r295634) +++ head/sys/arm/conf/A20 Mon Feb 15 19:56:35 2016 (r295635) @@ -78,6 +78,7 @@ device random # Entropy device device iicbus device iic device twsi +device axp209 # AXP209 Power Management Unit # GPIO device gpio Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Mon Feb 15 19:31:23 2016 (r295634) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Mon Feb 15 19:56:35 2016 (r295635) @@ -173,6 +173,13 @@ #address-cells = <1>; #size-cells = <0>; }; + + dma: dma-controller@01c02000 { + compatible = "allwinner,sun4i-a10-dma"; + reg = <0x01c02000 0x1000>; + interrupts = <27>; + interrupt-parent = <&GIC>; + }; }; }; From owner-svn-src-head@freebsd.org Mon Feb 15 20:26:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C55AA805A; Mon, 15 Feb 2016 20:26:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15C00153D; Mon, 15 Feb 2016 20:26:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FKQfdt008417; Mon, 15 Feb 2016 20:26:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FKQfSS008416; Mon, 15 Feb 2016 20:26:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602152026.u1FKQfSS008416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Feb 2016 20:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295636 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 20:26:42 -0000 Author: jhb Date: Mon Feb 15 20:26:40 2016 New Revision: 295636 URL: https://svnweb.freebsd.org/changeset/base/295636 Log: Sign extend the error value for failing Linux/i386 system calls. This restores the mapping of Linux errors to native FreeBSD errno values after the refactoring in r288424. Modified: head/usr.bin/truss/amd64-linux32.c Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Mon Feb 15 19:56:35 2016 (r295635) +++ head/usr.bin/truss/amd64-linux32.c Mon Feb 15 20:26:40 2016 (r295636) @@ -115,6 +115,8 @@ amd64_linux32_fetch_retval(struct trussi retval[0] = regs.r_rax & 0xffffffff; retval[1] = regs.r_rdx & 0xffffffff; *errorp = !!(regs.r_rflags & PSL_C); + if (*errorp) + retval[0] = (int)retval[0]; if (*errorp) { for (i = 0; i < nitems(bsd_to_linux_errno); i++) { From owner-svn-src-head@freebsd.org Mon Feb 15 20:27:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 130CBAA80EF; Mon, 15 Feb 2016 20:27:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D87D01790; Mon, 15 Feb 2016 20:27:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FKRGli008481; Mon, 15 Feb 2016 20:27:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FKRGsS008480; Mon, 15 Feb 2016 20:27:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602152027.u1FKRGsS008480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Feb 2016 20:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295637 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 20:27:18 -0000 Author: jhb Date: Mon Feb 15 20:27:16 2016 New Revision: 295637 URL: https://svnweb.freebsd.org/changeset/base/295637 Log: Correct the ABI name for Linux/i386 binaries under FreeBSD/i386. This allows truss to work for these binaries again after r288424. MFC after: 3 days Modified: head/usr.bin/truss/i386-linux.c Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Mon Feb 15 20:26:40 2016 (r295636) +++ head/usr.bin/truss/i386-linux.c Mon Feb 15 20:27:16 2016 (r295637) @@ -129,7 +129,7 @@ i386_linux_fetch_retval(struct trussinfo } static struct procabi i386_linux = { - "Linux ELF32", + "Linux ELF", SYSDECODE_ABI_LINUX, i386_linux_fetch_args, i386_linux_fetch_retval From owner-svn-src-head@freebsd.org Mon Feb 15 20:48:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E062AA8D68; Mon, 15 Feb 2016 20:48:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 69A9A38A; Mon, 15 Feb 2016 20:48:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id A71C3428A6F; Tue, 16 Feb 2016 07:48:01 +1100 (AEDT) Date: Tue, 16 Feb 2016 07:48:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295631 - head/lib/libc/stdio In-Reply-To: <201602151813.u1FIDXAt067326@repo.freebsd.org> Message-ID: <20160216073421.B1073@besplex.bde.org> References: <201602151813.u1FIDXAt067326@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=eSLwWqLpvfrKKQYTYqUA:9 a=AW_D2bVKUYMoeODe:21 a=L81pZzv6jk-Ry1xg:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 20:48:12 -0000 On Mon, 15 Feb 2016, Pedro F. Giffuni wrote: > Log: > fputs: Return the number of bytes written. > > POSIX.1-2008 requires that successful completion simply return a > non-negative integer. We have regularly returned a constant value. > Another, equally valid, implementation convention implies returning > the number of bytes written. > > Adopt this last convention to be in line with what Apple's libc > does. POSIX also explicitly notes: > > Note that this implementation convention cannot be adhered to for strings > longer than {INT_MAX} bytes as the value would not be representable in the > return type of the function. For backwards-compatibility, implementations > can return the number of bytes for strings of up to {INT_MAX} bytes, and > return {INT_MAX} for all longer strings. > > Developers shouldn't depend specifically on either convention but > the change may help port software from Apple. > > Differential Revision: https://reviews.freebsd.org/D442 (Partial) > Obtained from: Apple Inc. (Libc 997.90.3 with changes) > Relnotes: yes > > Modified: > head/lib/libc/stdio/fputs.c > > Modified: head/lib/libc/stdio/fputs.c > ============================================================================== > --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) > +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) > @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)fputs.c 8.1 > __FBSDID("$FreeBSD$"); > > #include "namespace.h" > +#include > #include > #include > #include "un-namespace.h" > @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * > ORIENT(fp, -1); > retval = __sfvwrite(fp, &uio); > FUNLOCKFILE(fp); > + if (retval == 0) > + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); > return (retval); > } Testing would have shown that this change has no effect except in the unusual case where iov.iov_len > INT_MAX. uio.resid is always reduced to 0 if all the output actually worked. Bruce From owner-svn-src-head@freebsd.org Mon Feb 15 21:12:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66447AA9997 for ; Mon, 15 Feb 2016 21:12:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm11-vm1.bullet.mail.bf1.yahoo.com (nm11-vm1.bullet.mail.bf1.yahoo.com [98.139.213.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 180DD14BB for ; Mon, 15 Feb 2016 21:12:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455570748; bh=QNDqizuqWmfPue+2SlIM7nhJOXqhM14KvUEf7wZ2ayo=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=geJQNDZI33cgu1Hdc/oygOV0CoGFQUjszNQ0efeTZozTtFyuCKXtWd3YFo6FnXDAGLm/rMFUqZbQYPPPLVh28SJohioeuCLXS9iCOuCErUZKgi8x8D4mYpPYtPIVtk10n2HswJg1VOtjQsECY0lbTGdO/3Ll7qtWoE8DVebd7a9gwD8cPb22MX/kzTDZsSUfRs+ypbiDJhz1tMcyLSuMGcHVTabE4ya4Lj9bGw/jHnuTK9ms7VwW0M55u7+hEbrJcN/8sU5DBPQ/AotkRUOrXRX/FuDvjpUk46+swP341Cc+/BE0IEy6X3AJYk/HH/kzJXTI4DBPKGTORFy4VuSy8w== Received: from [66.196.81.171] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 15 Feb 2016 21:12:28 -0000 Received: from [98.139.213.10] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 15 Feb 2016 21:12:28 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 15 Feb 2016 21:12:28 -0000 X-Yahoo-Newman-Id: 825340.12946.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: aa5ucRYVM1lYluJeJI9BV6lp4IxQNXwtcz3gw.jQjpb6dat 0OW2hX4eGLrgom_0.q8Ll8o2xagzj.0F8xiEQT1tkMlYdZDXD_U47FCOv9TZ .CMOQN4S8UvAlS1KTmMR8F9qdaxp47ZJLxXmOQ0Ta7dflG2RyAU2dgJS0oZ5 A.Jf3M0nIe7e7bBxdK4hy.jj4SbSSasEf8FclHrRfeKHs2H2_2GShiJNh95y Vpn87cqsVTQEqvaRGXLy3rFIczop4ZfJiCbVSDuDkTgztKGbyHZuheR5PCyi E0fDFk8Hc67a47a7CkX0zdFNfhknDElFipqLaDl_OUsXY8dcU5ncYn35AfTZ 8Q9f.BtWECUz0gp1t0rMTI5jpuutf1hyTzHmTZRNZvG50UXcxtNoCJjm_ifP kPbzo4xp0YicfhU0yTLaM7GwKFbZ08ZdBa6SCDujBigzIvDnkBy67fZarZX1 SSh1oC8MSkAPENwtBofhqSJ2LX3p00JGjELAaTYFEiULMT0HDvIr0Ph8WWLM Jxjb_8I_qeq8ciU.nuA5U9ZWH.dhWPLKu X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r295631 - head/lib/libc/stdio To: Bruce Evans References: <201602151813.u1FIDXAt067326@repo.freebsd.org> <20160216073421.B1073@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56C23F51.2070401@FreeBSD.org> Date: Mon, 15 Feb 2016 16:12:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160216073421.B1073@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 21:12:36 -0000 On 02/15/16 15:48, Bruce Evans wrote: > On Mon, 15 Feb 2016, Pedro F. Giffuni wrote: > >> Log: >> fputs: Return the number of bytes written. >> >> POSIX.1-2008 requires that successful completion simply return a >> non-negative integer. We have regularly returned a constant value. >> Another, equally valid, implementation convention implies returning >> the number of bytes written. >> >> Adopt this last convention to be in line with what Apple's libc >> does. POSIX also explicitly notes: >> >> Note that this implementation convention cannot be adhered to for >> strings >> longer than {INT_MAX} bytes as the value would not be representable >> in the >> return type of the function. For backwards-compatibility, >> implementations >> can return the number of bytes for strings of up to {INT_MAX} bytes, and >> return {INT_MAX} for all longer strings. >> >> Developers shouldn't depend specifically on either convention but >> the change may help port software from Apple. >> >> Differential Revision: https://reviews.freebsd.org/D442 (Partial) >> Obtained from: Apple Inc. (Libc 997.90.3 with changes) >> Relnotes: yes >> >> Modified: >> head/lib/libc/stdio/fputs.c >> >> Modified: head/lib/libc/stdio/fputs.c >> ============================================================================== >> >> --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) >> +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) >> @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)fputs.c 8.1 >> __FBSDID("$FreeBSD$"); >> >> #include "namespace.h" >> +#include >> #include >> #include >> #include "un-namespace.h" >> @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * >> ORIENT(fp, -1); >> retval = __sfvwrite(fp, &uio); >> FUNLOCKFILE(fp); >> + if (retval == 0) >> + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); >> return (retval); >> } > > Testing would have shown that this change has no effect except in the > unusual case where iov.iov_len > INT_MAX. uio.resid is always reduced > to 0 if all the output actually worked. > My mistake, obviously. It was a last minute change to avoid a cast. Will fix. Thanks! Pedro. > Bruce From owner-svn-src-head@freebsd.org Mon Feb 15 21:18:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA669AA9C1D; Mon, 15 Feb 2016 21:18:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2C917C6; Mon, 15 Feb 2016 21:18:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FLIqlQ023192; Mon, 15 Feb 2016 21:18:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FLIq5U023191; Mon, 15 Feb 2016 21:18:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602152118.u1FLIq5U023191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Feb 2016 21:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295638 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 21:18:53 -0000 Author: pfg Date: Mon Feb 15 21:18:52 2016 New Revision: 295638 URL: https://svnweb.freebsd.org/changeset/base/295638 Log: fputs: Return the number of bytes written. Fix r295631: wrong value. Pointy hat: pfg (me) Pointed out by: bde Modified: head/lib/libc/stdio/fputs.c Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Mon Feb 15 20:27:16 2016 (r295637) +++ head/lib/libc/stdio/fputs.c Mon Feb 15 21:18:52 2016 (r295638) @@ -64,6 +64,6 @@ fputs(const char * __restrict s, FILE * retval = __sfvwrite(fp, &uio); FUNLOCKFILE(fp); if (retval == 0) - return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); + return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len); return (retval); } From owner-svn-src-head@freebsd.org Mon Feb 15 22:19:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79167AA99C9; Mon, 15 Feb 2016 22:19:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B701A35; Mon, 15 Feb 2016 22:19:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f177.google.com with SMTP id z13so65766336ykd.0; Mon, 15 Feb 2016 14:19:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=KShgPuV9V8amBdmrw5cicJ9J+lokWZJ8GFj57KyG7RI=; b=aBbbY7gyqlkcCDbh6AOdHuaKx9JUhzH/Di/WWmlUMH8eM5iyKvQrmF3fm0k9bq5/JT 9jz8lCqeZURXlxsKRTODU7sZQu7JRMJLtdFoisYqYNqPVbyn4TDy4IWnobbhvlrQjQGz sJECu83B7dAUwgNDXLDDpd+tPKwssfa1XIsi1FvyN9xDJI1+C+NPCoCkj/ieoiw7kgWL y3qQmG42ezpoy/vY4DpPeOmBsq08oA+tjPn0siJQ/MuddtaXUhfEL4Oqv0UC7yWpJDTP 3x59sq2RCxyWHdFo/sUsZ0ybZ8+aY4stV4MjGs1ztxAB1ZkkSBj5tNkzvigNqxz0zTae +bbw== X-Gm-Message-State: AG10YORpXw8Y93VTtOk6Hii0AvVuusSid+5fHCVZ71nylTyPiwEukWvhRKrMJjlaiVGNTw== X-Received: by 10.37.92.6 with SMTP id q6mr1502963ybb.107.1455561150488; Mon, 15 Feb 2016 10:32:30 -0800 (PST) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com. [209.85.161.175]) by smtp.gmail.com with ESMTPSA id 204sm21384209ywr.32.2016.02.15.10.32.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Feb 2016 10:32:30 -0800 (PST) Received: by mail-yw0-f175.google.com with SMTP id e63so26060680ywc.3; Mon, 15 Feb 2016 10:32:29 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.31.67 with SMTP id f64mr9789193ywf.94.1455561149919; Mon, 15 Feb 2016 10:32:29 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.23 with HTTP; Mon, 15 Feb 2016 10:32:29 -0800 (PST) In-Reply-To: <201602151813.u1FIDXAt067326@repo.freebsd.org> References: <201602151813.u1FIDXAt067326@repo.freebsd.org> Date: Mon, 15 Feb 2016 10:32:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r295631 - head/lib/libc/stdio From: Conrad Meyer To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 22:19:25 -0000 On Mon, Feb 15, 2016 at 10:13 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Feb 15 18:13:33 2016 > New Revision: 295631 > URL: https://svnweb.freebsd.org/changeset/base/295631 > ... > Note that this implementation convention cannot be adhered to for strings > longer than {INT_MAX} bytes as the value would not be representable in the > return type of the function. For backwards-compatibility, implementations > can return the number of bytes for strings of up to {INT_MAX} bytes, and > return {INT_MAX} for all longer strings. > ... > --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) > +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) > ... > @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * > ORIENT(fp, -1); > retval = __sfvwrite(fp, &uio); > FUNLOCKFILE(fp); > + if (retval == 0) > + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); ^^^^^^^^^^^ why not uio.uio_resid here as well? > return (retval); > } Best, Conrad From owner-svn-src-head@freebsd.org Mon Feb 15 22:28:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D87AA9D9F; Mon, 15 Feb 2016 22:28:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 54F9E1EC1; Mon, 15 Feb 2016 22:28:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DF0BCD64A3C; Tue, 16 Feb 2016 09:28:26 +1100 (AEDT) Date: Tue, 16 Feb 2016 09:28:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Michal Meloun cc: src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart In-Reply-To: <56C1BDE2.8090300@freebsd.org> Message-ID: <20160216080249.F1233@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=igx6OY15m_A9cGQTTQIA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 22:28:35 -0000 On Mon, 15 Feb 2016, Michal Meloun wrote: > Dne 13.02.2016 v 1:58 Marius Strobl napsal(a): >> On Sat, Feb 13, 2016 at 06:53:25AM +1100, Bruce Evans wrote: >>> On Fri, 12 Feb 2016, Marius Strobl wrote: >>> >>>> On Fri, Feb 12, 2016 at 05:14:58AM +0000, Michal Meloun wrote: >>>>> Author: mmel >>>>> Date: Fri Feb 12 05:14:58 2016 >>>>> New Revision: 295557 >>>>> URL: https://svnweb.freebsd.org/changeset/base/295557 >>>>> >>>>> Log: >>>>> UART: Fix spurious interrupts generated by ns8250 and lpc drivers: >>>>> - don't enable transmitter empty interrupt before filling TX FIFO. >>>> >>>> Are you sure this doesn't create a race that leads to lost TX ready >>>> interrupts? For a single character, the TX FIFO very well may be empty >>>> again at the point in time IER_ETXRDY is enabled now. With the varyin= g >>>> behavior of 8250/16x50 chips - some of which is documented in sio(4) - >>> >>> That is mostly FUD. More likely driver bugs than chip bugs. >>> >>> A non-broken xx50 interrupts after you (re)enable tx interrupts, iff >>> the fifo is already empty. This gives a "spurious" interrupt. But >>> perhaps depending on this is too fragile. Normal operation is to keep >>> ... >>>> I'd expect there are many that no longer generate a TX ready at all >>>> with this change in place. In this case, receiving spurious interrupts >>>> (which ones? IIR_NOPEND? IIR_TXRDY?) with some devices appears to be >>>> the lesser evil. >>> >>> Not many. Only broken ones. >> >> In my experience many xx50 are broken, especially the integrated >> on-board ones you still have in workstations and servers today. I haven't seen any with this bug. But I haven't seen many newer ones or any in workstations or servers since I only use consumer-grade motherboards -- maybe those are better :-). Why would a new ASIC reimplement bugs that were in the original 8250? (IIRC, there was an 8250 with lots of bugs and limited production, and an 8250A that was better. FreeBSD is much newer than the 8250A so it might never have been used on an 8250.) >>> The "spurious" interrupts are just normal >>> ones from bon-broken chips: >>> >>> - uart first does a potentially-unbounded busy-wait before the doing >>> anything to ensure that the fifo is empty. This should be unecessar= y >>> since this function should not be called unless sc_txbusy is 0 and >>> sc_txbusy should be nonzero if the fifo is not empty. If it is call= ed >>> when the fifo is not emptu, then the worst-case busy-wait is approx. >>> 640 seconds for a 128-byte fifo at 2 bps. The 'broken_txfifo case' >>> busy-waits for a long time in normal operation. >>> - enabling the tx interrupt causes one immediately on non-broken uarts >>> - the interrupt handler is normally called immediately. Then it always >>> blocks on uart_lock() >>> - then the main code fills the fifo and unlocks >>> - then the interrupt handler runs. It normally finds that the fifo is >>> not empty (since it has just been filled) and does nothing >>> - another tx interrupt occurs later and the interrupt handler runs agai= n. >>> It normally doesn't hit the lock again, and normally finds the fifo >>> empty, so it does something. >> >> You correctly describe what happens at r295556 with a non-broken xx50. >> That revision causes a spurious interrupt with non-broken xx50 but >> also ensures that the relevant TX interrupt isn't missed with broken >> xx50 that do not issue an interrupt when enabling IER_ETXRDY. Besides, >> as you say, the general approach of dynamically enabling TX interrupts >> works around the common brokenness of these interrupts no longer going >> away when they should. >> >>> But you are probably correct that a 1-byte write to the fifo often >>> loses the race. This depends on how fast the hardware moves the byte >>> from the fifo to the tx register. Actually, since we didn't wait >>> for the tx register to become empty, it will often take a full characte= r >>> time before the move. After that, I think it might take 1 bit time but >>> no more. >> >> My concern is that with r295557, when this race is lost no TX interrupt >> is seen at all with broken xx50 that do not trigger an interrupt when >> enabling IER_ETXRDY. Certainly that is a concern if there are chips with the bug. > No, I=92m not sure, nobody can be sure if we talking about ns8250 > compatible device(s). Also, all UARTs known to me, generates an > interrupt on TX unmasking (assuming level sensitive interrupt). > Only IIR can reports bad priority so some very old 8250 (if > memory still serve me). Nah, compatible means only having bugs that are compatible, and a noremal xx50 doesn't have this bug :-). Strict compatibility with the original 8250 would give lots of bugs but it is unlikely that anything new is compatible with that. Driver bugs are still more likely. This reminds me that the most likely source of them is edge triggered ISA interrupts and drivers not doing enough in the interrupt handler to ensure getting a new interrupt. I think you remember correctly that bad priority was one of the bugs in the original 8250. > I only found following scenario on multiple ARM SOCs. > > Please note that ARM architecture does not have vectored interrupts, > CPU must read actual interrupt source from external interrupt > controller (GIC) register. This register contain predefined value if > none of interrupts are active. > > 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. > 2 - HW: UART interrupt is asserted, processed by GIC and signaled > to CPU2. > 3 - CPU2: enters interrupt service. It is blocked by uart_lock(), right? > 4 - CPU1: writes character to into REG_DATA register. > 5 - HW: UART clear its interrupt request > 6 - CPU2: reads interrupt source register. No active interrupt is > found, spurious interrupt is signaled, and CPU leaves interrupted > state. > 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, > and can be slow in some cases. It is not empty even on x86, although it probably should be. BTW, if arm needs the barrier, then how does it work with bus_space_barrier() referenced in just 25 files in all of /sys/dev? On x86, bus_space_barrier is a dummy locked memory increment by 0. Similar code for atomic ops was recently changed to null in all cases except for atomic_thread_fence_seq_cst() where it was optimized to use a better memory address. atomic_thread_fence_seq_cst() is not used by any other atomic primitive; it is used just twice in all of /sys (in sched_ule.c). Ordinary load/store on x86 is automatically strongly ordered. It is unclear what happens for memory-mapped and i/o-mapped devices. I think on x86, accesses to i/o-mapped devices are ordered even more strongly than for memory (and with respect to memory). The reason for existence of memory-mapped devices is defeated if their memory doesn't actually look like memory. I think accesses to them are ordered strongly on x86 too. However, something even stronger than atomic_thread_fence_seq_cst() might be needed to get an order related to physical events -- something to flush write buffers. i/o is slow enough even without the barriers, an on modern x86 the time taken by the useless barrier is on the noise compared with the time taken by the i/o. E.g., on a 4+GHz Haswell system, for this write loop in ns8250_bus_transmit(): X =09for (i =3D 0; i < sc->sc_txdatasz; i++) { X =09=09uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); X =09=09uart_barrier(bas); X =09} - uart_setreg() takes 1.5+ usec (6000+ cycles) for an ISA or PCI i/o-mapped bus write (plus a few more for software overheads) - uart_barrier() takes about another 20 cycles Why does uart use a loop with barrier after every i/o? bus_space_write_multi_N() doesn't use any barriers internally on x86. I'm not sure what it does on arm. If a barrier is needed after every i/o, then none of these 'multi' i/o functions can work in general. My version of sio uses bus_space_write_multi_1() here. On the same Haswell system, this takes the same 1.5+ usec per byte if i/o-mapped,=20 but for a PCI bus device it takes only 150 nsec per byte when memory mapped -- 10+ times faster than for uart. Unfortunately, PCI memory- mapped writes are the only faster case on the Haswell system. Older systems are much faster. The same serial card on a 16-year old 367 MHz system with the PCI bus overclocked 20% can do the fast case in 125 nsec and the slow cases in 400 nsec. 125 nsec is only 45 cycles at 367 MHz. uart's pessimizations work much better when the CPU is slower -- now the ~20 extra cycles and a few more for other overheads is about the same as the 45 cycles for the i/o, instead of in the noise. > 8 - HW: character from THR is transferred to shift register and UART > signals TX empty interrupt again. > 9 - Goto 3. This seems to be working as intended. > Currently, GIC interrupts service routine (see [1]) reports spurious > interrupt issue (interrupt requests disappears itself, without any HW > action). This is very valuable indicator of driver problem for us (note, > ARM needs special synchronization for related inter-device writes, see > [2]), and I don=92t want to remove it. It is indeed a valuable indicator. I think it just detected that the intended behaviour is a pessimizations. On fast systems, the overhead for extra interrupts is also in the noise. No one notices that interrupt overheads are a couple of thousands of cycles more than they should be when a single i/o takes 6000+ cycles. > Also, at this time, UART driver is last one known to generate spurious > interrupts in ARM world. >=20 > So, what=92s now? I can #ifdef __arm__ change made in r295557 (for maximu= m > safety), if you want this. Or we can just wait to see if someone reports > a problem ... Use better methods. Perhaps the detection of "extra" interrupts is not really good. Systems with shared interrupts can't even tell when they get "extra" interrupts. At best their interrupt handlers poll the device status registers as efficiently as possible. But when reading a single device register takes 6000+ cycles, "as efficiently as possible" is not very efficient. Bruce From owner-svn-src-head@freebsd.org Mon Feb 15 23:10:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA8C1AA9226; Mon, 15 Feb 2016 23:10:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928631597; Mon, 15 Feb 2016 23:10:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id z135so103887342iof.0; Mon, 15 Feb 2016 15:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Hz0oK6BF9XkI+dyBVROfjr7WojAxngzrPWvzOXfPlmM=; b=vSuvWXGd8UM9kTBfmBqSfBypmU4Ll4xF2ZsVLKggLkpjdLrXzUgemggngijRGxHodN 9fEdG1ijQFxUFeBQpthwTF8DBqqD1LM2y5KYy3n3WGQCaL/9UIbo57Ug22xru4hPW8v0 H3bKmbjkPpBtjgH2m33bw0n17b/SskEywKCT8EguHTUoOvDYlYlHpMa0aFb3VOyKLB3r /nJmdXfUyl3RA9ZqL9bkNfBPxPGTcMSa9MNts9pum34HCpd2bVZRVBcmR4do5cjT85xV C9jgfA6sQ2/qZGw1FiiOwDp1V8ZZ9IbZdIQhwvJogA/0e+5kg96n0jvG23XUa/jodNqE r0aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Hz0oK6BF9XkI+dyBVROfjr7WojAxngzrPWvzOXfPlmM=; b=ZFMIOyes5SkNqOk2aUDMgyeUMB5q7Pi+SZZrqhsBJD73CENfG1Sn/hspmHU7Yrhhga sURPJ5sCqriBeGwFvJBLKhslTzHcT1ZuOex4lJ22qfKDkIexbyYN44oJ4fJCtdIaUBEh cUJMJQwiBf7fOv9+WtM3hkvkBbjSR/DP0uQ2xFvyd/dhgrz8YYNMLQDvHAC7OTmd85UF K86U1OXi/pJjgxuwgdAZxFzHhGfSS6ttz2cxQFSrSPylqby2Om9xso62SA8bvxdrFFPd MO1DvVsxKdR6DvslLUXMYRipfXy75M0NzwWx8GMefY8CN/VMvgCi5864DySev8kV3JHx 0lLQ== X-Gm-Message-State: AG10YOSraJv94/CjE+gfkfCOAeEjQu4i0T8VEuTkCLghRn3BoSRIauE9Ob4w01o9ftIu6rg24u9aZ4p7EB90eg== MIME-Version: 1.0 X-Received: by 10.107.162.144 with SMTP id l138mr7557511ioe.123.1455577814032; Mon, 15 Feb 2016 15:10:14 -0800 (PST) Received: by 10.36.14.19 with HTTP; Mon, 15 Feb 2016 15:10:13 -0800 (PST) In-Reply-To: <20160216080249.F1233@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> Date: Mon, 15 Feb 2016 15:10:13 -0800 Message-ID: Subject: Re: svn commit: r295557 - head/sys/dev/uart From: Adrian Chadd To: Bruce Evans Cc: Michal Meloun , "src-committers@freebsd.org" , Marius Strobl , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 23:10:14 -0000 On 15 February 2016 at 14:28, Bruce Evans wrote: > > BTW, if arm needs the barrier, then how does it work with > bus_space_barrier() referenced in just 25 files in all of /sys/dev? likely the same reason it does for mips - everything's cache coherent on hardware that has pci/pcie slots, or people just didn't notice. For ppc they put an implicit barrier into the bus calls because too many drivers don't do barriers (but USB does, yay) and fixing it all was likely a terrible task. I'm doing it for the MIPS related pieces that need it, but it's slow going. -adrian From owner-svn-src-head@freebsd.org Mon Feb 15 23:37:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1AF6AA9D2F for ; Mon, 15 Feb 2016 23:37:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B58101F5 for ; Mon, 15 Feb 2016 23:37:55 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: bc0d024a-d43c-11e5-a023-11ad6df26ed1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 15 Feb 2016 23:35:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1FNbkIH025611; Mon, 15 Feb 2016 16:37:46 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1455579466.12873.23.camel@freebsd.org> Subject: Re: svn commit: r295557 - head/sys/dev/uart From: Ian Lepore To: Bruce Evans , Michal Meloun Cc: src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 15 Feb 2016 16:37:46 -0700 In-Reply-To: <20160216080249.F1233@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 15 Feb 2016 23:37:56 -0000 On Tue, 2016-02-16 at 09:28 +1100, Bruce Evans wrote: > On Mon, 15 Feb 2016, Michal Meloun wrote: > > > [...] > > Please note that ARM architecture does not have vectored interrupts, > > CPU must read actual interrupt source from external interrupt > > controller (GIC) register. This register contain predefined value if > > none of interrupts are active. > > > > 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. > > 2 - HW: UART interrupt is asserted, processed by GIC and signaled > > to CPU2. > > 3 - CPU2: enters interrupt service. > > It is blocked by uart_lock(), right? > > > 4 - CPU1: writes character to into REG_DATA register. > > 5 - HW: UART clear its interrupt request > > 6 - CPU2: reads interrupt source register. No active interrupt is > > found, spurious interrupt is signaled, and CPU leaves interrupted > > state. > > 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, > > and can be slow in some cases. > > It is not empty even on x86, although it probably should be. > > BTW, if arm needs the barrier, then how does it work with > bus_space_barrier() referenced in just 25 files in all of /sys/dev? > With a hack, of course. In the arm interrupt-controller drivers we always call bus_space_barrier() right before doing an EOI. It's not a 100% solution, but in practice it seems to work pretty well. Spurious interrupts which are not caused by driver bugs on arm tend to happen when the interrupt controller and some peripheral are on different internal busses, especially when the peripheral is on a slow bus and access to the PIC's registers is faster. In that case it often happens that the clearing of the condition at the source goes slower than the EOI and the PIC immediately re-interrupts. By time we've re -vectored back to the PIC driver and read the pending-irq register the slow write to the peripheral has completed and the interrupt has been deasserted, so the PIC returns the spurious-irq indication. The hack code does a drain-write-buffer which doesn't g'tee that the slow peripheral write has made it all the way to the device, but it does at least g'tee that the write to the bus the perhiperal is on has been posted and ack'd by any bus<->bus bridge, and that seems to be good enough in practice. (If there were multiple bridged busses downstream it probably wouldn't be, but so far things aren't that complicated inside the socs we support.) The g'teed way is to do a readback of the register written-to, or some nearby register if it's write-only. That's a hard thing to do in a bus_space_barrier implementation that has no knowledge of things like which registers in a device might be write-only. And of course, then you're still left with the problem of hundreds of drivers that don't do any barrier calls at all. > [...] > > > Also, at this time, UART driver is last one known to generate spurious > > interrupts in ARM world. > > > > So, whats now? I can #ifdef __arm__ change made in r295557 (for maximum > > safety), if you want this. Or we can just wait to see if someone reports > > a problem ... > > Use better methods. > How about a dev.uart..broken_txrdy tunable sysctl that defaults to the new behavior but can be turned on by anyone with the buggy hardware? -- Ian From owner-svn-src-head@freebsd.org Tue Feb 16 00:01:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB144AAA7C8; Tue, 16 Feb 2016 00:01:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 79918F85; Tue, 16 Feb 2016 00:01:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 0038E1A36E3; Tue, 16 Feb 2016 11:01:21 +1100 (AEDT) Date: Tue, 16 Feb 2016 11:01:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bruce Evans , Michal Meloun , src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart In-Reply-To: <1455579466.12873.23.camel@freebsd.org> Message-ID: <20160216103914.F1693@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> <1455579466.12873.23.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Jxn3YtIO9P2N7E73uhEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 00:01:29 -0000 On Mon, 15 Feb 2016, Ian Lepore wrote: > On Tue, 2016-02-16 at 09:28 +1100, Bruce Evans wrote: >> On Mon, 15 Feb 2016, Michal Meloun wrote: >> >>> [...] >>> Please note that ARM architecture does not have vectored interrupts, >>> CPU must read actual interrupt source from external interrupt >>> controller (GIC) register. This register contain predefined value if >>> none of interrupts are active. >>> >>> 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. >>> 2 - HW: UART interrupt is asserted, processed by GIC and signaled >>> to CPU2. >>> 3 - CPU2: enters interrupt service. >> >> It is blocked by uart_lock(), right? >> >>> 4 - CPU1: writes character to into REG_DATA register. >>> 5 - HW: UART clear its interrupt request >>> 6 - CPU2: reads interrupt source register. No active interrupt is >>> found, spurious interrupt is signaled, and CPU leaves interrupted >>> state. >>> 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, >>> and can be slow in some cases. >> >> It is not empty even on x86, although it probably should be. >> >> BTW, if arm needs the barrier, then how does it work with >> bus_space_barrier() referenced in just 25 files in all of /sys/dev? > > With a hack, of course. In the arm interrupt-controller drivers we > always call bus_space_barrier() right before doing an EOI. It's not a > 100% solution, but in practice it seems to work pretty well. I thought about the x86 behaviour a bit more and now see that it does need barriers but not the ones given by bus_space_barrier(). All (?) interrupt handlers use mutexes (if not driver ones, then higher-level ones). These might give stronger or different ordering than given by bus_space_barrier(). On x86, they use the same memory bus lock as the bus_space_barrier(). This is needed to give ordering across CPUs. But for accessing a single device, you only need program order for a single CPU. This is automatic on x86 provided a mutex is used to prevent other CPUs accessing the same device. And if you don't use a mutex, then bus_space_barrier() cannot give the necessary ordering since if cannot prevent other CPUs interfering. So how does bus_space_barrier() before EOI make much difference? It doesn't affect the order for a bunch of accesses on a single CPU. It must do more than a mutex to do something good across CPUs. Arguably, it is a bug in mutexes is they don't gives synchronization for device memory. > ... > The hack code does a drain-write-buffer which doesn't g'tee that the > slow peripheral write has made it all the way to the device, but it > does at least g'tee that the write to the bus the perhiperal is on has > been posted and ack'd by any bus<->bus bridge, and that seems to be > good enough in practice. (If there were multiple bridged busses > downstream it probably wouldn't be, but so far things aren't that > complicated inside the socs we support.) Hmm, so there is some automatic strong ordering but mutexes don't work for device memory? > The g'teed way is to do a readback of the register written-to, or some > nearby register if it's write-only. That's a hard thing to do in a > bus_space_barrier implementation that has no knowledge of things like > which registers in a device might be write-only. > > And of course, then you're still left with the problem of hundreds of > drivers that don't do any barrier calls at all. Mostly unimportant ones for fast NICs :-). These could be made even slower using lots of barriers. But the fast ones already have to use special interfaces DMA since single-word bus accesses are too slow. >> [...] >> >>> Also, at this time, UART driver is last one known to generate spurious >>> interrupts in ARM world. >>> >>> So, whats now? I can #ifdef __arm__ change made in r295557 (for maximum >>> safety), if you want this. Or we can just wait to see if someone reports >>> a problem ... >> >> Use better methods. > > How about a dev.uart..broken_txrdy tunable sysctl that defaults > to the new behavior but can be turned on by anyone with the buggy > hardware? It's difficult to know that such knobs even exist. Bruce From owner-svn-src-head@freebsd.org Tue Feb 16 00:15:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159A7AAADEE for ; Tue, 16 Feb 2016 00:15:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C281317B2 for ; Tue, 16 Feb 2016 00:15:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455581726; bh=ZWQEMoQ7aflgyYxFneoihjaw6b2V/Zsb4ErV2XIiWas=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=euTi7fVKMda/jupfYNoWR5lYk9YBeDk7xjJaUqjmg7WjD7+i/ex9+hiVK4vEfM3PT0O7JSBs8i7LDh4i5NGU/yM7Dfk/M3o+q4GD5fkzaSNtachkkUY9Vcl+HV8QLgK0Jw699qg4DXIRk1c+C2AkiWT/cULO+nXHaAWqNMYbLRYLKrc4GTkzy1c4PZVl8tpSM4PVoQ7yo/P8RcVeTSK7ujLiw6x8PnIsOlTQHwf12voib4TprmBcK3ny2CkZ0RbP5To/5R542aUMqsg0VSry4tothKp69KWQVXyMf7kw+57KYe8wWZ7s9whrtf7TSk+q944CevfpcmaB5GrLvgDE3g== Received: from [66.196.81.174] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 16 Feb 2016 00:15:26 -0000 Received: from [98.139.213.10] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 16 Feb 2016 00:15:26 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 16 Feb 2016 00:15:26 -0000 X-Yahoo-Newman-Id: 256945.67497.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hycdT.AVM1mYn6usmXFfRlcG6Zq5O_gQendZCK2xEqVyzpW __Dekd4dqO_1osFglJ2QL9Luqjpnmjdvm8FNKathyX.tt5loLGgFfThdFcNn xWZj9_S97yYFuZLONK.1sdTZTLUQuiMNehY_.NonqQbj5xMEj2hO7SqPHMoi aXyLZH99cbJjGzle8vjCXEprMLPHYuV1wSP631wBNwzGIHwIFbRXhb0PMKhw 2VNlLWzZaFqqOOy3NQ_Nf6dC.68Ly70zxwZiqASS.uPo6OlF3eyoyqrkoP1. 5T5dhz8Amxco50c.a34MV6wK4gjjgo9ip0HGpzzx2DSr1mASIL2ZPq.Qu7rD 5vj9h6t47uU7TAc9g5puf2x.xRMlymkeDIJZKZ.sS9Y5dNBVxhSbRYCMkXze zrPIIjtfg8uIKntqGQwSWPsmsJKIO2LFTIqBjlhLtA2PerxZNMCHx6xbXx8b ctG0QDn7Mlw9I98pG8UHZIzbooj.jStP0Lrq3UQCJY.9o0hJXP81p0Lf.c7x 6KTaGl4TwXGSgiftHsjfGt.qGIdfo8Z4i X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r295631 - head/lib/libc/stdio To: cem@FreeBSD.org References: <201602151813.u1FIDXAt067326@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56C26A34.1000300@FreeBSD.org> Date: Mon, 15 Feb 2016 19:15:48 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 00:15:35 -0000 On 02/15/16 13:32, Conrad Meyer wrote: > On Mon, Feb 15, 2016 at 10:13 AM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Feb 15 18:13:33 2016 >> New Revision: 295631 >> URL: https://svnweb.freebsd.org/changeset/base/295631 >> ... >> Note that this implementation convention cannot be adhered to for strings >> longer than {INT_MAX} bytes as the value would not be representable in the >> return type of the function. For backwards-compatibility, implementations >> can return the number of bytes for strings of up to {INT_MAX} bytes, and >> return {INT_MAX} for all longer strings. >> ... >> --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) >> +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) >> ... >> @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * >> ORIENT(fp, -1); >> retval = __sfvwrite(fp, &uio); >> FUNLOCKFILE(fp); >> + if (retval == 0) >> + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); > > ^^^^^^^^^^^ why not uio.uio_resid here as well? > Because uio.ui_resid is an int and it's likely to overflow before it keeps a useful value for that comparison, Of course, as Bruce noted, __sfwrite modifies uio so uio.uio_resid doesn't belong there at all. Hmm... we need some fputs() tests in the testsuite. Pedro. From owner-svn-src-head@freebsd.org Tue Feb 16 00:33:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64B44AA8689 for ; Tue, 16 Feb 2016 00:33:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45EFF106E for ; Tue, 16 Feb 2016 00:33:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: f0a3f716-d444-11e5-8dfb-c75234cc769e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 16 Feb 2016 00:33:46 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1G0XMrQ025685; Mon, 15 Feb 2016 17:33:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1455582802.12873.49.camel@freebsd.org> Subject: Re: svn commit: r295557 - head/sys/dev/uart From: Ian Lepore To: Bruce Evans Cc: Michal Meloun , src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 15 Feb 2016 17:33:22 -0700 In-Reply-To: <20160216103914.F1693@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> <1455579466.12873.23.camel@freebsd.org> <20160216103914.F1693@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 00:33:31 -0000 On Tue, 2016-02-16 at 11:01 +1100, Bruce Evans wrote: > On Mon, 15 Feb 2016, Ian Lepore wrote: > > > On Tue, 2016-02-16 at 09:28 +1100, Bruce Evans wrote: > >> On Mon, 15 Feb 2016, Michal Meloun wrote: > >> > >>> [...] > >>> Please note that ARM architecture does not have vectored interrupts, > >>> CPU must read actual interrupt source from external interrupt > >>> controller (GIC) register. This register contain predefined value if > >>> none of interrupts are active. > >>> > >>> 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. > >>> 2 - HW: UART interrupt is asserted, processed by GIC and signaled > >>> to CPU2. > >>> 3 - CPU2: enters interrupt service. > >> > >> It is blocked by uart_lock(), right? > >> > >>> 4 - CPU1: writes character to into REG_DATA register. > >>> 5 - HW: UART clear its interrupt request > >>> 6 - CPU2: reads interrupt source register. No active interrupt is > >>> found, spurious interrupt is signaled, and CPU leaves interrupted > >>> state. > >>> 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, > >>> and can be slow in some cases. > >> > >> It is not empty even on x86, although it probably should be. > >> > >> BTW, if arm needs the barrier, then how does it work with > >> bus_space_barrier() referenced in just 25 files in all of /sys/dev? > > > > With a hack, of course. In the arm interrupt-controller drivers we > > always call bus_space_barrier() right before doing an EOI. It's not a > > 100% solution, but in practice it seems to work pretty well. > > I thought about the x86 behaviour a bit more and now see that it does > need barriers but not the ones given by bus_space_barrier(). All (?) > interrupt handlers use mutexes (if not driver ones, then higher-level > ones). These might give stronger or different ordering than given by > bus_space_barrier(). On x86, they use the same memory bus lock as > the bus_space_barrier(). This is needed to give ordering across > CPUs. But for accessing a single device, you only need program order > for a single CPU. This is automatic on x86 provided a mutex is used > to prevent other CPUs accessing the same device. And if you don't use > a mutex, then bus_space_barrier() cannot give the necessary ordering > since if cannot prevent other CPUs interfering. > > So how does bus_space_barrier() before EOI make much difference? It > doesn't affect the order for a bunch of accesses on a single CPU. > It must do more than a mutex to do something good across CPUs. > Arguably, it is a bug in mutexes is they don't gives synchronization > for device memory. > > > ... > > The hack code does a drain-write-buffer which doesn't g'tee that the > > slow peripheral write has made it all the way to the device, but it > > does at least g'tee that the write to the bus the perhiperal is on has > > been posted and ack'd by any bus<->bus bridge, and that seems to be > > good enough in practice. (If there were multiple bridged busses > > downstream it probably wouldn't be, but so far things aren't that > > complicated inside the socs we support.) > > Hmm, so there is some automatic strong ordering but mutexes don't > work for device memory? > I guess you keep mentioning mutexes because on x86 their implementation uses some of the same instructions that are involved in bus_space barriers on x86? Otherwise I can't see what they have to do with anything related to the spurious interrupts that happen on arm. (You also mentioned multiple CPUs, which is not a requirement for this trouble on arm, it'll happen with a single core.) The piece of info you're missing might be the fact that memory-mapped device registers on arm are mapped with the Device attribute which gives stronger ordering than Normal memory. In particular, writes are in order and not combined, but they are buffered. In some designs there are multiple buffers, so there can be multiple writes that haven't reached the hardware yet. A read from the same region will stall until all writes to that region are done, and there is also an instruction that specifically forces out the buffers and stalls until they're empty. Without doing the drain-write-buffer (or a device read) after each write, the only g'tee you'd get is that each device sees the writes directed at it in the order they were issued. With devices A and B, you could write a sequence of A1 B1 A2 B2 A3 B3 and they could arrive at the devices as A1 A2 B1 B2 A3 B3, or any other permutation, as long as device A sees 123 and device B sees 123. So on arm the need for barriers arises primarily when two different devices interact with each other in some way and it matters that a series of interleaved writes reaches the devices in the same relative order they were issued by the cpu. That condition mostly comes up only in terms of the PIC interacting with basically every other device. I expect trouble to show up any time now as we start implementing DMA drivers in socs that have generic DMA engines that are only loosely coupled to the devices they're moving data for. That just seems like another place where a single driver is coordinating the actions of two different pieces of hardware that may be on different busses, and it's ripe for the lack of barriers to cause rare or intermittant failures. -- Ian From owner-svn-src-head@freebsd.org Tue Feb 16 02:07:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F64AA826A; Tue, 16 Feb 2016 02:07:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id CE2A21ABB; Tue, 16 Feb 2016 02:07:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 437B13C2F0D; Tue, 16 Feb 2016 12:46:29 +1100 (AEDT) Date: Tue, 16 Feb 2016 12:46:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bruce Evans , Michal Meloun , src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295557 - head/sys/dev/uart In-Reply-To: <1455582802.12873.49.camel@freebsd.org> Message-ID: <20160216115639.T2000@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> <1455579466.12873.23.camel@freebsd.org> <20160216103914.F1693@besplex.bde.org> <1455582802.12873.49.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=lvWph9oiYnskVHZbGikA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:07:01 -0000 On Mon, 15 Feb 2016, Ian Lepore wrote: > On Tue, 2016-02-16 at 11:01 +1100, Bruce Evans wrote: >> On Mon, 15 Feb 2016, Ian Lepore wrote: >> >>> On Tue, 2016-02-16 at 09:28 +1100, Bruce Evans wrote: >>>> On Mon, 15 Feb 2016, Michal Meloun wrote: >>>> >>>>> [...] >>>>> Please note that ARM architecture does not have vectored interrupts, >>>>> CPU must read actual interrupt source from external interrupt >>>>> controller (GIC) register. This register contain predefined value if >>>>> none of interrupts are active. >>>>> >>>>> 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. >>>>> 2 - HW: UART interrupt is asserted, processed by GIC and signaled >>>>> to CPU2. >>>>> 3 - CPU2: enters interrupt service. >>>> >>>> It is blocked by uart_lock(), right? >>>> >>>>> 4 - CPU1: writes character to into REG_DATA register. >>>>> 5 - HW: UART clear its interrupt request >>>>> 6 - CPU2: reads interrupt source register. No active interrupt is >>>>> found, spurious interrupt is signaled, and CPU leaves interrupted >>>>> state. >>>>> 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, >>>>> and can be slow in some cases. >>>> >>>> It is not empty even on x86, although it probably should be. >>>> >>>> BTW, if arm needs the barrier, then how does it work with >>>> bus_space_barrier() referenced in just 25 files in all of /sys/dev? >>> >>> With a hack, of course. In the arm interrupt-controller drivers we >>> always call bus_space_barrier() right before doing an EOI. It's not a >>> 100% solution, but in practice it seems to work pretty well. >> >> I thought about the x86 behaviour a bit more and now see that it does >> need barriers but not the ones given by bus_space_barrier(). All (?) >> interrupt handlers use mutexes (if not driver ones, then higher-level >> ones). These might give stronger or different ordering than given by >> bus_space_barrier(). On x86, they use the same memory bus lock as >> the bus_space_barrier(). This is needed to give ordering across >> CPUs. But for accessing a single device, you only need program order >> for a single CPU. This is automatic on x86 provided a mutex is used >> to prevent other CPUs accessing the same device. And if you don't use >> a mutex, then bus_space_barrier() cannot give the necessary ordering >> since if cannot prevent other CPUs interfering. >> >> So how does bus_space_barrier() before EOI make much difference? It >> doesn't affect the order for a bunch of accesses on a single CPU. >> It must do more than a mutex to do something good across CPUs. >> Arguably, it is a bug in mutexes is they don't gives synchronization >> for device memory. >>> ... >>> The hack code does a drain-write-buffer which doesn't g'tee that the >>> slow peripheral write has made it all the way to the device, but it >>> does at least g'tee that the write to the bus the perhiperal is on has >>> been posted and ack'd by any bus<->bus bridge, and that seems to be >>> good enough in practice. (If there were multiple bridged busses >>> downstream it probably wouldn't be, but so far things aren't that >>> complicated inside the socs we support.) >> >> Hmm, so there is some automatic strong ordering but mutexes don't >> work for device memory? > > I guess you keep mentioning mutexes because on x86 their implementation > uses some of the same instructions that are involved in bus_space > barriers on x86? Otherwise I can't see what they have to do with > anything related to the spurious interrupts that happen on arm. (You > also mentioned multiple CPUs, which is not a requirement for this > trouble on arm, it'll happen with a single core.) Partly. I wasn't worrying about this "spurious" interrupt but locking in general. Now I don't see how mutexes can work unless they order device accesses in exactly the same way as ordinary memory accesses. > The piece of info you're missing might be the fact that memory-mapped > device registers on arm are mapped with the Device attribute which > gives stronger ordering than Normal memory. In particular, writes are > in order and not combined, but they are buffered. arm doesn't need the barrier after each output byte then, and in general bus_space_write_multi_N() shouldn't need a barrier after each write, but only it can reasonably know if it does, so any barrier(s) for it belong in it and not in callers. Drivers for arm could also do a bunch of unrelated writes (and reads?) followed by a single barrier. But this is even more MD. > In some designs > there are multiple buffers, so there can be multiple writes that > haven't reached the hardware yet. A read from the same region will > stall until all writes to that region are done, and there is also an > instruction that specifically forces out the buffers and stalls until > they're empty. The multiple regions should be in separate bus spaces so that the barriers can be optimized to 1 at the end. I now see how the optimization can almost be done at the bus_space level -- drivers call bus_space_maybe_barrier() after every access, but this is a no-op on bus spaces with sufficient ordering iff the bus space hasn't changed; drivers call bus_space_sync_barriers() at the end. I think the DMA sync functions work a bit like this. A well-written interrupt handler would have just 1 bus_space_sync_barriers() at the end. This works like the EOI hack. If all arches have sufficiently strong ordering then bus_space_maybe_barrier() is not needed but more careful syncing is needed when switching the bus space. > Without doing the drain-write-buffer (or a device read) after each > write, the only g'tee you'd get is that each device sees the writes > directed at it in the order they were issued. With devices A and B, > you could write a sequence of A1 B1 A2 B2 A3 B3 and they could arrive > at the devices as A1 A2 B1 B2 A3 B3, or any other permutation, as long > as device A sees 123 and device B sees 123. I think it is even more important that the order is synchronized relative to memory for mutex locking. Mutex locking presumably doesn't issue bus barriers because that would be too wasteful for the usual case. So before almost every mutex unlock for a driver, there must be a bus_space_sync_barriers() call and this must flush all the write buffers for devices before all memory accesses for the mutex, so that the mutex works as expected. But is this automatic on arm? Ordinary memory is like a different bus space that has a different write buffer which might be flushed in a different order. > So on arm the need for barriers arises primarily when two different > devices interact with each other in some way and it matters that a > series of interleaved writes reaches the devices in the same relative > order they were issued by the cpu. That condition mostly comes up only > in terms of the PIC interacting with basically every other device. The code under discussion seems to provide a good example of why you need ordering relative to ordinary memory too. In the old version, CPU2 is waiting for the unlock. If it sees this before the device memory is flushed, then it might be confused. I guess if the device memory is strongly ordered (but buffered) CPU2 would not see reads out of order for the device memory, but it might see everything for device memory out order relative to ordinary memory. However, the sprinkled bs barriers order everything. > I expect trouble to show up any time now as we start implementing DMA > drivers in socs that have generic DMA engines that are only loosely > coupled to the devices they're moving data for. That just seems like > another place where a single driver is coordinating the actions of two > different pieces of hardware that may be on different busses, and it's > ripe for the lack of barriers to cause rare or intermittant failures. I don't understand DMA syncs for most NICs either. They seem too simple to work. Mutex locking isn't going to control the order of host DMA. Bruce From owner-svn-src-head@freebsd.org Tue Feb 16 02:09:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8071AA83D1; Tue, 16 Feb 2016 02:09:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFE01CE7; Tue, 16 Feb 2016 02:09:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G29nkb008145; Tue, 16 Feb 2016 02:09:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G29mVF008140; Tue, 16 Feb 2016 02:09:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160209.u1G29mVF008140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295641 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:09:50 -0000 Author: bdrewery Date: Tue Feb 16 02:09:48 2016 New Revision: 295641 URL: https://svnweb.freebsd.org/changeset/base/295641 Log: Consolidate common beforebuild logic. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.init.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.obj.mk head/share/mk/bsd.prog.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Tue Feb 16 01:18:49 2016 (r295640) +++ head/share/mk/bsd.init.mk Tue Feb 16 02:09:48 2016 (r295641) @@ -15,6 +15,10 @@ ____: .endif .include .MAIN: all +beforebuild: .PHONY .NOTMAIN +.if !defined(_SKIP_BUILD) +all: beforebuild .WAIT +.endif .if ${.MAKE.LEVEL:U1} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no" && !make(clean*) # this tells lib.mk and prog.mk to not actually build anything Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Feb 16 01:18:49 2016 (r295640) +++ head/share/mk/bsd.lib.mk Tue Feb 16 02:09:48 2016 (r295641) @@ -128,11 +128,6 @@ PO_FLAG=-pg -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.if !defined(_SKIP_BUILD) -all: beforebuild .WAIT -beforebuild: objwarn -.endif - _LIBDIR:=${LIBDIR} _SHLIBDIR:=${SHLIBDIR} Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Tue Feb 16 01:18:49 2016 (r295640) +++ head/share/mk/bsd.obj.mk Tue Feb 16 02:09:48 2016 (r295641) @@ -89,6 +89,7 @@ objwarn: canonical ${CANONICALOBJDIR}" .endif .endif +beforebuild: objwarn .if !defined(NO_OBJ) .if !target(obj) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Tue Feb 16 01:18:49 2016 (r295640) +++ head/share/mk/bsd.prog.mk Tue Feb 16 02:09:48 2016 (r295641) @@ -148,8 +148,7 @@ MAN1= ${MAN} .if defined(_SKIP_BUILD) all: .else -all: beforebuild .WAIT ${PROG} ${SCRIPTS} -beforebuild: objwarn +all: ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no" all: _manpages .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Feb 16 01:18:49 2016 (r295640) +++ head/sys/conf/kmod.mk Tue Feb 16 02:09:48 2016 (r295641) @@ -249,8 +249,7 @@ _ILINKS+=x86 .endif CLEANFILES+=${_ILINKS} -all: beforebuild .WAIT ${PROG} -beforebuild: objwarn +all: ${PROG} beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} From owner-svn-src-head@freebsd.org Tue Feb 16 02:13:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A83FAA86D8; Tue, 16 Feb 2016 02:13:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAF41072; Tue, 16 Feb 2016 02:13:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2DuBc010937; Tue, 16 Feb 2016 02:13:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2DtHc010935; Tue, 16 Feb 2016 02:13:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602160213.u1G2DtHc010935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Feb 2016 02:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295642 - in head/sys/powerpc: booke include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:13:57 -0000 Author: jhibbits Date: Tue Feb 16 02:13:55 2016 New Revision: 295642 URL: https://svnweb.freebsd.org/changeset/base/295642 Log: Fix a panic bug that cropped up in the PTE rewrite. PTE was getting overwritten by just the flags. Pointy-hat to: jhibbits Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Feb 16 02:09:48 2016 (r295641) +++ head/sys/powerpc/booke/pmap.c Tue Feb 16 02:13:55 2016 (r295642) @@ -1759,7 +1759,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t tlb_miss_lock(); tlb0_flush_entry(va); - *pte = flags; + *pte &= ~PTE_FLAGS_MASK; + *pte |= flags; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Tue Feb 16 02:09:48 2016 (r295641) +++ head/sys/powerpc/include/pte.h Tue Feb 16 02:13:55 2016 (r295642) @@ -270,6 +270,7 @@ typedef uint64_t pte_t; /* Macro argument must of pte_t type. */ #define PTE_ARPN_SHIFT 12 +#define PTE_FLAGS_MASK 0x00ffffff #define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) #define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) #define PTE_ISVALID(pte) ((*pte) & PTE_VALID) From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC558AA86F8; Tue, 16 Feb 2016 02:14:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B14EE10A4; Tue, 16 Feb 2016 02:14:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2DxCW010990; Tue, 16 Feb 2016 02:13:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2DxaT010982; Tue, 16 Feb 2016 02:13:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160213.u1G2DxaT010982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295643 - in head: bin/sh/tests cddl/usr.sbin/dtrace/tests/common share/mk tests/sys tests/sys/pjdfstest/tests usr.bin/bmake/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:01 -0000 Author: bdrewery Date: Tue Feb 16 02:13:59 2016 New Revision: 295643 URL: https://svnweb.freebsd.org/changeset/base/295643 Log: Test directories can build in parallel fine. Sponsored by: EMC / Isilon Storage Division Added: head/usr.bin/bmake/tests/Makefile.inc (contents, props changed) Modified: head/bin/sh/tests/Makefile head/cddl/usr.sbin/dtrace/tests/common/Makefile head/share/mk/bsd.test.mk head/tests/sys/Makefile head/tests/sys/pjdfstest/tests/Makefile Modified: head/bin/sh/tests/Makefile ============================================================================== --- head/bin/sh/tests/Makefile Tue Feb 16 02:13:55 2016 (r295642) +++ head/bin/sh/tests/Makefile Tue Feb 16 02:13:59 2016 (r295643) @@ -10,6 +10,4 @@ TESTS_SUBDIRS+= parameters TESTS_SUBDIRS+= parser TESTS_SUBDIRS+= set-e -SUBDIR_PARALLEL= - .include Modified: head/cddl/usr.sbin/dtrace/tests/common/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Feb 16 02:13:55 2016 (r295642) +++ head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Feb 16 02:13:59 2016 (r295643) @@ -86,6 +86,4 @@ TESTS_SUBDIRS+= aggs \ .PATH: ${.CURDIR:H:H:H:H:H}/tests KYUAFILE= YES -SUBDIR_PARALLEL= - .include Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Tue Feb 16 02:13:55 2016 (r295642) +++ head/share/mk/bsd.test.mk Tue Feb 16 02:13:59 2016 (r295643) @@ -68,6 +68,7 @@ _TESTS= SUBDIR+= ${ts} .endif .endfor +SUBDIR_PARALLEL= t .endif # it is rare for test cases to have man pages Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Tue Feb 16 02:13:55 2016 (r295642) +++ head/tests/sys/Makefile Tue Feb 16 02:13:59 2016 (r295643) @@ -22,6 +22,4 @@ TESTS_SUBDIRS+= vm # Items not integrated into kyua runs by default SUBDIR+= pjdfstest -SUBDIR_PARALLEL= - .include Modified: head/tests/sys/pjdfstest/tests/Makefile ============================================================================== --- head/tests/sys/pjdfstest/tests/Makefile Tue Feb 16 02:13:55 2016 (r295642) +++ head/tests/sys/pjdfstest/tests/Makefile Tue Feb 16 02:13:59 2016 (r295643) @@ -36,6 +36,4 @@ TESTS_SUBDIRS+= symlink TESTS_SUBDIRS+= truncate TESTS_SUBDIRS+= unlink -SUBDIR_PARALLEL= - .include Added: head/usr.bin/bmake/tests/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bmake/tests/Makefile.inc Tue Feb 16 02:13:59 2016 (r295643) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR_PARALLEL= t From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35A45AA872C; Tue, 16 Feb 2016 02:14:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07F5F130F; Tue, 16 Feb 2016 02:14:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EA8h011044; Tue, 16 Feb 2016 02:14:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EA8s011043; Tue, 16 Feb 2016 02:14:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EA8s011043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295644 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:11 -0000 Author: bdrewery Date: Tue Feb 16 02:14:09 2016 New Revision: 295644 URL: https://svnweb.freebsd.org/changeset/base/295644 Log: Don't descend into test directories for distribution->installconfig. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Feb 16 02:13:59 2016 (r295643) +++ head/Makefile.inc1 Tue Feb 16 02:14:09 2016 (r295644) @@ -1090,7 +1090,7 @@ distrib-dirs distribution: .MAKE .PHONY .if make(distribution) ${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \ - METALOG=${METALOG} installconfig + METALOG=${METALOG} MK_TESTS=no installconfig .endif # From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 354EAAA879D; Tue, 16 Feb 2016 02:14:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 072881343; Tue, 16 Feb 2016 02:14:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EDXF011091; Tue, 16 Feb 2016 02:14:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2ED8E011090; Tue, 16 Feb 2016 02:14:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2ED8E011090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295645 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:14 -0000 Author: bdrewery Date: Tue Feb 16 02:14:12 2016 New Revision: 295645 URL: https://svnweb.freebsd.org/changeset/base/295645 Log: Use built-in :tA here rather than realpath(1). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Feb 16 02:14:09 2016 (r295644) +++ head/sys/conf/kern.post.mk Tue Feb 16 02:14:12 2016 (r295645) @@ -50,7 +50,7 @@ modules-${target}: LOCALBASE?= /usr/local # SRC_BASE is how the ports tree refers to the location of the base source files .if !defined(SRC_BASE) -SRC_BASE!= realpath "${SYSDIR:H}/" +SRC_BASE= ${SYSDIR:H:tA} .endif # OSVERSION is used by some ports to determine build options .if !defined(OSRELDATE) From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44844AA87C3; Tue, 16 Feb 2016 02:14:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 070F41457; Tue, 16 Feb 2016 02:14:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EGIM011137; Tue, 16 Feb 2016 02:14:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EG2G011136; Tue, 16 Feb 2016 02:14:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EG2G011136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295646 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:17 -0000 Author: bdrewery Date: Tue Feb 16 02:14:15 2016 New Revision: 295646 URL: https://svnweb.freebsd.org/changeset/base/295646 Log: Add an .ORDER for all/install. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Tue Feb 16 02:14:12 2016 (r295645) +++ head/share/mk/bsd.subdir.mk Tue Feb 16 02:14:15 2016 (r295646) @@ -89,6 +89,7 @@ ${__stage}install: install: beforeinstall realinstall afterinstall .ORDER: beforeinstall realinstall afterinstall .endif +.ORDER: all install # SUBDIR recursing may be disabled for MK_DIRDEPS_BUILD .if !target(_SUBDIR) From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41DFFAA87EC; Tue, 16 Feb 2016 02:14:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2B715AE; Tue, 16 Feb 2016 02:14:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EJXl011182; Tue, 16 Feb 2016 02:14:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EJKS011181; Tue, 16 Feb 2016 02:14:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EJKS011181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295647 - head/usr.sbin/amd/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:20 -0000 Author: bdrewery Date: Tue Feb 16 02:14:18 2016 New Revision: 295647 URL: https://svnweb.freebsd.org/changeset/base/295647 Log: Add missing dependency on sys/conf/newvers.sh. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/amd/include/Makefile Modified: head/usr.sbin/amd/include/Makefile ============================================================================== --- head/usr.sbin/amd/include/Makefile Tue Feb 16 02:14:15 2016 (r295646) +++ head/usr.sbin/amd/include/Makefile Tue Feb 16 02:14:18 2016 (r295647) @@ -17,9 +17,9 @@ CLEANFILES= ${SRCS} all depend: ${SRCS} -config_local.h: newvers.sh +config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh @rm -f ${.TARGET} - sh ${.ALLSRC} ${.CURDIR}/../../../sys/conf/newvers.sh > ${.TARGET} + sh ${.ALLSRC} > ${.TARGET} localconfig.h: @rm -f ${.TARGET} From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB2AAA881E; Tue, 16 Feb 2016 02:14:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28ED31784; Tue, 16 Feb 2016 02:14:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EM8g011230; Tue, 16 Feb 2016 02:14:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EMVd011229; Tue, 16 Feb 2016 02:14:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EMVd011229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295648 - head/usr.sbin/amd/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:23 -0000 Author: bdrewery Date: Tue Feb 16 02:14:21 2016 New Revision: 295648 URL: https://svnweb.freebsd.org/changeset/base/295648 Log: Remove the need for overriding depend. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/amd/include/Makefile Modified: head/usr.sbin/amd/include/Makefile ============================================================================== --- head/usr.sbin/amd/include/Makefile Tue Feb 16 02:14:18 2016 (r295647) +++ head/usr.sbin/amd/include/Makefile Tue Feb 16 02:14:21 2016 (r295648) @@ -9,13 +9,13 @@ .include -SRCS= config_local.h +HDRS= config_local.h .if ${MK_NIS} == "no" -SRCS+= localconfig.h +HDRS+= localconfig.h .endif -CLEANFILES= ${SRCS} +CLEANFILES= ${HDRS} -all depend: ${SRCS} +all: ${HDRS} config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh @rm -f ${.TARGET} From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A65DAAA885B; Tue, 16 Feb 2016 02:14:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6073318DF; Tue, 16 Feb 2016 02:14:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EPGq011275; Tue, 16 Feb 2016 02:14:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EP1C011274; Tue, 16 Feb 2016 02:14:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EP1C011274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295649 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:26 -0000 Author: bdrewery Date: Tue Feb 16 02:14:25 2016 New Revision: 295649 URL: https://svnweb.freebsd.org/changeset/base/295649 Log: Filemon: Fix panic when fork1() is called from kproc_create(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Feb 16 02:14:21 2016 (r295648) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Feb 16 02:14:25 2016 (r295649) @@ -96,7 +96,7 @@ filemon_pid_check(struct proc *p) return (NULL); } sx_slock(&proctree_lock); - while (p != initproc) { + while (p->p_pid != 0) { TAILQ_FOREACH(filemon, &filemons_inuse, link) { if (p == filemon->p) { sx_sunlock(&proctree_lock); From owner-svn-src-head@freebsd.org Tue Feb 16 02:14:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68504AA88BD; Tue, 16 Feb 2016 02:14:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 273B21BE5; Tue, 16 Feb 2016 02:14:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2EVJg011331; Tue, 16 Feb 2016 02:14:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2EU2H011322; Tue, 16 Feb 2016 02:14:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602160214.u1G2EU2H011322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 02:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295650 - in head: lib/libpe sbin/kldstat secure/lib/libssh sys/boot/efi/boot1 targets/pseudo/userland/lib usr.bin/elfcopy usr.bin/kdump usr.bin/truss usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:14:32 -0000 Author: bdrewery Date: Tue Feb 16 02:14:30 2016 New Revision: 295650 URL: https://svnweb.freebsd.org/changeset/base/295650 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libpe/Makefile.depend - copied, changed from r295649, head/sys/boot/efi/boot1/Makefile.depend head/usr.bin/truss/Makefile.depend - copied, changed from r295649, head/sbin/kldstat/Makefile.depend Deleted: head/usr.bin/truss/Makefile.depend.amd64 Modified: head/sbin/kldstat/Makefile.depend head/secure/lib/libssh/Makefile.depend head/sys/boot/efi/boot1/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend head/usr.bin/elfcopy/Makefile.depend head/usr.bin/kdump/Makefile.depend head/usr.sbin/ctld/Makefile.depend Copied and modified: head/lib/libpe/Makefile.depend (from r295649, head/sys/boot/efi/boot1/Makefile.depend) ============================================================================== --- head/sys/boot/efi/boot1/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649, copy source) +++ head/lib/libpe/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -3,6 +3,7 @@ DIRDEPS = \ include \ + include/xlocale \ .include Modified: head/sbin/kldstat/Makefile.depend ============================================================================== --- head/sbin/kldstat/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/sbin/kldstat/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -8,6 +8,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libutil \ .include Modified: head/secure/lib/libssh/Makefile.depend ============================================================================== --- head/secure/lib/libssh/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/secure/lib/libssh/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -6,6 +6,7 @@ DIRDEPS = \ gnu/lib/libgcc \ include \ include/arpa \ + include/gssapi \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ Modified: head/sys/boot/efi/boot1/Makefile.depend ============================================================================== --- head/sys/boot/efi/boot1/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/sys/boot/efi/boot1/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -3,6 +3,8 @@ DIRDEPS = \ include \ + include/xlocale \ + lib/libstand \ .include Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/targets/pseudo/userland/lib/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -46,6 +46,7 @@ DIRDEPS = \ lib/libdwarf \ lib/libedit/edit/readline \ lib/libelf \ + lib/libelftc \ lib/libevent \ lib/libexecinfo \ lib/libexpat \ @@ -118,6 +119,7 @@ DIRDEPS = \ lib/libpam/modules/pam_tacplus \ lib/libpam/modules/pam_unix \ lib/libpcap \ + lib/libpe \ lib/libpjdlog \ lib/libpmc \ lib/libproc \ Modified: head/usr.bin/elfcopy/Makefile.depend ============================================================================== --- head/usr.bin/elfcopy/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/usr.bin/elfcopy/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -15,6 +15,7 @@ DIRDEPS = \ lib/libelftc \ lib/libexpat \ lib/liblzma \ + lib/libpe \ lib/libthr \ lib/libz \ secure/lib/libcrypto \ Modified: head/usr.bin/kdump/Makefile.depend ============================================================================== --- head/usr.bin/kdump/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/usr.bin/kdump/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -20,11 +20,7 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree kdump.o: kdump_subr.h -kdump.o: linux32_syscalls.c -kdump.o: linux_syscalls.c kdump.po: kdump_subr.h -kdump.po: linux32_syscalls.c -kdump.po: linux_syscalls.c kdump_subr.o: kdump_subr.c kdump_subr.o: kdump_subr.h kdump_subr.po: kdump_subr.c Copied and modified: head/usr.bin/truss/Makefile.depend (from r295649, head/sbin/kldstat/Makefile.depend) ============================================================================== --- head/sbin/kldstat/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649, copy source) +++ head/usr.bin/truss/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -5,9 +5,12 @@ DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ include \ + include/arpa \ + include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libsysdecode \ .include Modified: head/usr.sbin/ctld/Makefile.depend ============================================================================== --- head/usr.sbin/ctld/Makefile.depend Tue Feb 16 02:14:25 2016 (r295649) +++ head/usr.sbin/ctld/Makefile.depend Tue Feb 16 02:14:30 2016 (r295650) @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libexpat \ lib/libmd \ lib/libsbuf \ + lib/libucl \ lib/libutil \ + lib/msun \ usr.bin/lex/lib \ usr.bin/yacc.host \ From owner-svn-src-head@freebsd.org Tue Feb 16 02:23:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ADA2AA8FDC; Tue, 16 Feb 2016 02:23:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BAF913BF; Tue, 16 Feb 2016 02:23:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1G2NevJ014245; Tue, 16 Feb 2016 02:23:40 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1G2Nehc014244; Tue, 16 Feb 2016 02:23:40 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201602160223.u1G2Nehc014244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 16 Feb 2016 02:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295651 - head/sys/dev/ichsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 02:23:41 -0000 Author: vangyzen Date: Tue Feb 16 02:23:39 2016 New Revision: 295651 URL: https://svnweb.freebsd.org/changeset/base/295651 Log: ichsmb: add PCI device ID for Intel Sunrise Point-H SMBus controller MFC after: 3 days Sponsored by: Dell Inc. Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Tue Feb 16 02:14:30 2016 (r295650) +++ head/sys/dev/ichsmb/ichsmb_pci.c Tue Feb 16 02:23:39 2016 (r295651) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #define ID_WCPT 0x8ca28086 #define ID_WCPTLP 0x9ca28086 #define ID_WELLSBURG 0x8d228086 +#define ID_SRPT 0xa1238086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -216,6 +217,9 @@ ichsmb_pci_probe(device_t dev) case ID_WELLSBURG: device_set_desc(dev, "Intel Wellsburg SMBus controller"); break; + case ID_SRPT: + device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); + break; default: return (ENXIO); } From owner-svn-src-head@freebsd.org Tue Feb 16 10:33:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F3BAAAE59; Tue, 16 Feb 2016 10:33:47 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8DE1BDC; Tue, 16 Feb 2016 10:33:46 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GAXjOI057483; Tue, 16 Feb 2016 10:33:45 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GAXjbs057481; Tue, 16 Feb 2016 10:33:45 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201602161033.u1GAXjbs057481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 16 Feb 2016 10:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295653 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 10:33:47 -0000 Author: olivier (ports committer) Date: Tue Feb 16 10:33:45 2016 New Revision: 295653 URL: https://svnweb.freebsd.org/changeset/base/295653 Log: Add myself as ports committer (including calendar) Approved by: jadawin Differential Revision: https://reviews.freebsd.org/D5295 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 Feb 16 03:50:56 2016 (r295652) +++ head/share/misc/committers-ports.dot Tue Feb 16 10:33:45 2016 (r295653) @@ -175,6 +175,7 @@ nork [label="Norikatsu Shigemura\nnork@F novel [label="Roman Bogorodskiy\nnovel@FreeBSD.org\n2005/03/07"] nox [label="Juergen Lock\nnox@FreeBSD.org\n2006/12/22"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] +olivier [label="Olivier Cochard-Labbe\nolivier@FreeBSD.org\n2016/02/02"] olivierd [label="Olivier Duchateau\nolivierd@FreeBSD.org\n2012/05/29"] osa [label="Sergey A. Osokin\nosa@FreeBSD.org\n2003/06/04"] pat [label="Patrick Li\npat@FreeBSD.org\n2001/11/14"] @@ -400,6 +401,7 @@ itetcu -> sylvio jadawin -> bapt jadawin -> flo +jadawin -> olivier jadawin -> riggs jadawin -> sbz jadawin -> wen Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Feb 16 03:50:56 2016 (r295652) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Feb 16 10:33:45 2016 (r295653) @@ -224,6 +224,7 @@ 07/02 Vasil Venelinov Dimov born in Shumen, Bulgaria, 1982 07/04 Motoyuki Konno born in Musashino, Tokyo, Japan, 1969 07/04 Florent Thoumie born in Montmorency, Val d'Oise, France, 1982 +07/05 Olivier Cochard-Labbe born in Brest, France, 1977 07/05 Sergey Kandaurov born in Gubkin, Russian Federation, 1985 07/07 Andrew Thompson born in Lower Hutt, Wellington, New Zealand, 1979 07/07 Maxime Henrion born in Metz, France, 1981 From owner-svn-src-head@freebsd.org Tue Feb 16 10:57:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910BDAA9971; Tue, 16 Feb 2016 10:57:47 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv25.fwdcdn.com (frv25.fwdcdn.com [212.42.77.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3A13A18B1; Tue, 16 Feb 2016 10:57:46 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from [10.10.14.26] (helo=frv157.fwdcdn.com) by frv25.fwdcdn.com QID:1aVd2u-000PTU-7Q/RC:4; Tue, 16 Feb 2016 12:39:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=zRVQkzPLnvq19bbYybjtz2UfXulOAEubq9LsFt+b34o=; b=BHCI3R8MMDq5P0Et2pmvEmWK4YOi0kNJ8wWICashHSChcoSg/L4/WvfC3c2A78n+e6s4MgdHpSrqI2Pkk+KUYwJqX2GroCuPZZnyhvfiG4Y81rXZ62u9+94Fvg/iEQCAJs2t9AEgWU8N4ylpJKEVGB1PzJ1jJer6XygybWsaBks=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1aVd2l-000A9j-PF ; Tue, 16 Feb 2016 12:39:43 +0200 Date: Tue, 16 Feb 2016 12:39:37 +0200 From: Ivan Klymenko To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295647 - head/usr.sbin/amd/include Message-ID: <20160216123937.7ba18ddc@nonamehost.local> In-Reply-To: <201602160214.u1G2EJKS011181@repo.freebsd.org> References: <201602160214.u1G2EJKS011181@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-Ukrnet-Yellow: 0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 10:57:47 -0000 On Tue, 16 Feb 2016 02:14:19 +0000 (UTC) Bryan Drewery wrote: > Author: bdrewery > Date: Tue Feb 16 02:14:18 2016 > New Revision: 295647 > URL: https://svnweb.freebsd.org/changeset/base/295647 > > Log: > Add missing dependency on sys/conf/newvers.sh. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.sbin/amd/include/Makefile > > Modified: head/usr.sbin/amd/include/Makefile > ============================================================================== > --- head/usr.sbin/amd/include/Makefile Tue Feb 16 02:14:15 > 2016 (r295646) +++ head/usr.sbin/amd/include/Makefile > Tue Feb 16 02:14:18 2016 (r295647) @@ -17,9 +17,9 @@ > CLEANFILES= ${SRCS} > all depend: ${SRCS} > > -config_local.h: newvers.sh > +config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh > @rm -f ${.TARGET} > - sh ${.ALLSRC} ${.CURDIR}/../../../sys/conf/newvers.sh > > ${.TARGET} > + sh ${.ALLSRC} > ${.TARGET} > > localconfig.h: > @rm -f ${.TARGET} > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" ... --- .depend --- rm -f .depend CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -I/usr/src/usr.bin/clang/llc/../../../contrib/llvm/include -I/usr/src/usr.bin/clang/llc/../../../contrib/llvm/tools/clang/include -I/usr/src/usr.bin/clang/llc/../../../contrib/llvm/tools/llc -I. -I/usr/src/usr.bin/clang/llc/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_STATIC_ANALYZER -DLLVM_DEFAULT_TARGET_TRIPLE=\"x86_64-unknown-freebsd11.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd11.0\" -DDEFAULT_SYSROOT=\"\" -std=c++11 -stdlib=libc++ /usr/src/usr.bin/clang/llc/../../../contrib/llvm/tools/llc/llc.cpp --- depend_subdir_usr.sbin --- --- xdr_func_%undef.c --- unifdef -DHAVE_XDR_ATTRSTAT -DHAVE_XDR_CREATEARGS -DHAVE_XDR_DIRLIST -DHAVE_XDR_DIROPARGS -DHAVE_XDR_DIROPOKRES -DHAVE_XDR_DIROPRES -DHAVE_XDR_DIRPATH -DHAVE_XDR_ENTRY -DHAVE_XDR_EXPORTNODE -DHAVE_XDR_EXPORTS -DHAVE_XDR_FATTR -DHAVE_XDR_FHANDLE -DHAVE_XDR_FHSTATUS -DHAVE_XDR_FILENAME -DHAVE_XDR_FTYPE -DHAVE_XDR_GROUPNODE -DHAVE_XDR_GROUPS -DHAVE_XDR_LINKARGS -DHAVE_XDR_MOUNTBODY -DHAVE_XDR_MOUNTLIST -DHAVE_XDR_NAME -DHAVE_XDR_NFS_FH -DHAVE_XDR_NFSCOOKIE -DHAVE_XDR_NFSPATH -DHAVE_XDR_NFSSTAT -DHAVE_XDR_NFSTIME -DHAVE_XDR_POINTER -DHAVE_XDR_READARGS -DHAVE_XDR_READDIRARGS -DHAVE_XDR_READDIRRES -DHAVE_XDR_READLINKRES -DHAVE_XDR_READOKRES -DHAVE_XDR_READRES -DHAVE_XDR_RENAMEARGS -DHAVE_XDR_SATTR -DHAVE_XDR_SATTRARGS -DHAVE_XDR_STATFSOKRES -DHAVE_XDR_STATFSRES -DHAVE_XDR_SYMLINKARGS -DHAVE_XDR_WRITEARGS < /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/xdr_func.c > xdr_func_%undef.c --- .depend --- rm -f .depend CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -I/usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu -I/media/da0s1/obj/usr/src/tmp/usr/include/rpcsvc -I. -I/usr/src/usr.sbin/amd/libamu -I/usr/src/usr.sbin/amd/libamu/../include -I/media/da0s1/obj/usr/src/usr.sbin/amd/libamu/../include -I/usr/src/usr.sbin/amd/libamu/../../../contrib/amd/include -I/usr/src/usr.sbin/amd/libamu/../../../contrib/amd -DHAVE_CONFIG_H -DHOST_CPU=\"amd64\" -DHOST_ARCH=\"amd64\" -std=gnu99 /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/hasmntopt.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/misc_rpc.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/mount_fs.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/mtab.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/nfs_prot_xdr.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/li bamu/strutil.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/wire.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/xutil.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/transp/transp_sockets.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/mtab/mtab_bsd.c /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/umount/umount_bsd44.c nfs_prot_x.c xdr_func_%undef.c In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/hasmntopt.c:45: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/misc_rpc.c:49: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/mount_fs.c:45: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- echo llc: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmirparser/libllvmmirparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmirreader/libllvmirreader.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmasmparser/libllvmasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64disassembler/libllvmaarch64disassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64codegen/libllvmaarch64codegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64asmparser/libllvmaarch64asmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64desc/libllvmaarch64desc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64info/libllvmaarch64info.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64instprinter/libllvmaarch64instprin ter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmaarch64utils/libllvmaarch64utils.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarmdisassembler/libllvmarmdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarmcodegen/libllvmarmcodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarmasmparser/libllvmarmasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarmdesc/libllvmarmdesc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarminfo/libllvmarminfo.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmarminstprinter/libllvmarminstprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmipsdisassembler/libllvmmipsdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmipscodegen/libllvmmipscodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/l ibllvmmipsasmparser/libllvmmipsasmparser.a /media/da0--- depend_subdir_usr.sbin --- --- depend_subdir_audit --- --- depend_subdir_usr.bin --- s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmipsdesc/libllvmmipsdesc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmipsinfo/libllvmmipsinfo.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmipsinstprinter/libllvmmipsinstprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpcdisassembler/libllvmpowerpcdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpccodegen/libllvmpowerpccodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpcasmparser/libllvmpowerpcasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpcdesc/libllvmpowerpcdesc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpcinfo/libllvmpowerpcinfo.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmpowerpcinstprinter/libllvmpowerpcinstprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../.. /../lib/clang/libllvmsparcdisassembler/libllvmsparcdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsparccodegen/libllvmsparccodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsparcasmparser/libllvmsparcasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsparcdesc/libllvmsparcdesc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsparcinfo/libllvmsparcinfo.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsparcinstprinter/libllvmsparcinstprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86disassembler/libllvmx86disassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86asmparser/libllvmx86asmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86codegen/libllvmx86codegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmselectiondag/libllvmselectio ndag.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmasmprinter/libllvmasmprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmcodegen/libllvmcodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmtarget/libllvmtarget.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmscalaropts/libllvmscalaropts.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmprofiledata/libllvmprofiledata.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvminstcombine/libllvminstcombine.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvminstrumentation/libllvminstrumentation.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmtransformutils/libllvmtransformutils.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmipa/libllvmipa.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmanalysis/libllvmanalysis.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86desc/lib--- depend_subdir_usr.sbin --- ===> usr.sbin/audit (depend) --- depend_subdir_usr.bin --- llvmx86desc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmobject/libllvmobject.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmcparser/libllvmmcparser.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmbitreader/libllvmbitreader.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmcdisassembler/libllvmmcdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86info/libllvmx86info.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86instprinter/libllvmx86instprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmmc/libllvmmc.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmx86utils/libllvmx86utils.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmcore/libllvmcore.a /media/da0s1/obj/usr/src/usr.bin/clang/llc/../../../lib/clang/libllvmsupport/libllvmsupport.a /media/da0s1/obj/usr/src/t mp/usr/lib/libz.a /media/da0s1/obj/usr/src/tmp/usr/lib/libncursesw.a /media/da0s1/obj/usr/src/tmp/usr/lib/libpthread.a >> .depend echo llc: /media/da0s1/obj/usr/src/tmp/usr/lib/libc++.a >> .depend --- depend_subdir_usr.sbin --- --- depend_subdir_amd --- 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/mtab.c:45: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ 1 error generated. --- depend_subdir_audit --- --- .depend --- rm -f .depend CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -I/usr/src/usr.sbin/audit/../../contrib/openbsm -std=gnu99 /usr/src/usr.sbin/audit/../../contrib/openbsm/bin/audit/audit.c --- depend_subdir_amd --- In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/nfs_prot_xdr.c:45: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/strutil.c:49: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_audit --- echo audit: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/tmp/usr/lib/libbsm.a >> .depend --- depend_subdir_usr.bin --- --- depend_subdir_file --- ===> usr.bin/file (depend) --- depend_subdir_clang --- --- depend_subdir_bugpoint --- echo bugpoint: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmcodegen/libllvmcodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmtarget/libllvmtarget.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmobjcarcopts/libllvmobjcarcopts.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmirreader/libllvmirreader.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmbitwriter/libllvmbitwriter.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmlinker/libllvmlinker.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmipo/libllvmipo.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmvectorize/libllvmvectorize.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmscalaropts/libllvmscalaropts.a /media/da0s1/obj/usr/src/usr.bin/cla ng/bugpoint/../../../lib/clang/libllvmprofiledata/libllvmprofiledata.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmobject/libllvmobject.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmmcparser/libllvmmcparser.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmbitreader/libllvmbitreader.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvminstcombine/libllvminstcombine.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvminstrumentation/libllvminstrumentation.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmtransformutils/libllvmtransformutils.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmipa/libllvmipa.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmmc/libllvmmc.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmanalysis/libllvmanalysis.a /media/da 0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmasmparser/libllvmasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmcore/libllvmcore.a /media/da0s1/obj/usr/src/usr.bin/clang/bugpoint/../../../lib/clang/libllvmsupport/libllvmsupport.a /media/da0s1/obj/usr/src/tmp/usr/lib/libncursesw.a /media/da0s1/obj/usr/src/tmp/usr/lib/libpthread.a >> .depend echo bugpoint: /media/da0s1/obj/usr/src/tmp/usr/lib/libc++.a >> .depend --- depend_subdir_usr.sbin --- --- depend_subdir_auditd --- ===> usr.sbin/auditd (depend) --- depend_subdir_amd --- 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/wire.c:57: --- depend_subdir_usr.bin --- --- depend_subdir_file --- --- .depend --- rm -f .depend --- depend_subdir_usr.sbin --- /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -DMAGIC='"/usr/share/misc/magic"' -DHAVE_CONFIG_H -I/usr/src/usr.bin/file/../../lib/libmagic -std=gnu99 /usr/src/usr.bin/file/../../contrib/file/src/file.c --- depend_subdir_usr.sbin --- --- depend_subdir_auditd --- --- .depend --- rm -f .depend CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -I/usr/src/usr.sbin/auditd/../../contrib/openbsm -std=gnu99 /usr/src/usr.sbin/auditd/../../contrib/openbsm/bin/auditd/auditd.c /usr/src/usr.sbin/auditd/../../contrib/openbsm/bin/auditd/audit_warn.c /usr/src/usr.sbin/auditd/../../contrib/openbsm/bin/auditd/auditd_fbsd.c --- depend_subdir_amd --- 1 error generated. --- depend_subdir_usr.bin --- echo file: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/tmp/usr/lib/libmagic.a >> .depend --- depend_subdir_usr.sbin --- In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/libamu/xutil.c:49: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- --- depend_subdir_clang --- --- depend_subdir_lli --- ===> usr.bin/clang/lli (depend) --- depend_subdir_usr.sbin --- 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/transp/transp_sockets.c:47: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- --- .depend --- rm -f .depend --- depend_subdir_usr.sbin --- --- depend_subdir_auditd --- echo auditd: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/tmp/usr/lib/libauditd.a /media/da0s1/obj/usr/src/tmp/usr/lib/libbsm.a >> .depend --- depend_subdir_usr.bin --- CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -I/usr/src/usr.bin/clang/lli/../../../contrib/llvm/include -I/usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/clang/include -I/usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/lli -I. -I/usr/src/usr.bin/clang/lli/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_STATIC_ANALYZER -DLLVM_DEFAULT_TARGET_TRIPLE=\"x86_64-unknown-freebsd11.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd11.0\" -DDEFAULT_SYSROOT=\"\" -std=c++11 -stdlib=libc++ /usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/lli/OrcLazyJIT.cpp /usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/lli/RemoteMemoryManager.cpp /usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/lli/RemoteTarget.cpp /usr/src/usr.bin/clan g/lli/../../../contrib/llvm/tools/lli/RemoteTargetExternal.cpp /usr/src/usr.bin/clang/lli/../../../contrib/llvm/tools/lli/lli.cpp --- depend_subdir_finger --- ===> usr.bin/finger (depend) --- depend_subdir_usr.sbin --- --- depend_subdir_amd --- 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/mtab/mtab_bsd.c:51: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- --- .depend --- rm -f .depend CC='/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin' mkdep -f .depend -a -std=gnu99 /usr/src/usr.bin/finger/finger.c /usr/src/usr.bin/finger/lprint.c /usr/src/usr.bin/finger/net.c /usr/src/usr.bin/finger/sprint.c /usr/src/usr.bin/finger/util.c --- depend_subdir_usr.sbin --- 1 error generated. In file included from /usr/src/usr.sbin/amd/libamu/../../../contrib/amd/conf/umount/umount_bsd44.c:49: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ 1 error generated. In file included from xdr_func_%undef.c:48: /usr/src/usr.sbin/amd/libamu/../include/config.h:12:10: fatal error: 'config_local.h' file not found #include "config_local.h" ^ --- depend_subdir_usr.bin --- echo finger: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a >> .depend --- depend_subdir_usr.sbin --- --- depend_subdir_auditdistd --- ===> usr.sbin/auditdistd (depend) --- depend_subdir_amd --- 1 error generated. mkdep: compile failed *** [.depend] Error code 1 make[5]: stopped in /usr/src/usr.sbin/amd/libamu 1 error make[5]: stopped in /usr/src/usr.sbin/amd/libamu *** [depend_subdir_libamu] Error code 2 make[4]: stopped in /usr/src/usr.sbin/amd 1 error make[4]: stopped in /usr/src/usr.sbin/amd *** [depend_subdir_amd] Error code 2 make[3]: stopped in /usr/src/usr.sbin --- depend_subdir_auditdistd --- A failure has been detected in another branch of the parallel make make[4]: stopped in /usr/src/usr.sbin/auditdistd *** [depend_subdir_auditdistd] Error code 2 make[3]: stopped in /usr/src/usr.sbin --- depend_subdir_usr.bin --- --- depend_subdir_clang --- echo lli: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86disassembler/libllvmx86disassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86asmparser/libllvmx86asmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmirreader/libllvmirreader.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmasmparser/libllvmasmparser.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86codegen/libllvmx86codegen.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86desc/libllvmx86desc.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86info/libllvmx86info.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmmcdisassembler/libllvmmcdisassembler.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmx86instprinter/libllvmx86instprinter.a /media/da0s1/obj/usr/src/usr.bin /clang/lli/../../../lib/clang/libllvmx86utils/libllvmx86utils.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmselectiondag/libllvmselectiondag.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmasmprinter/libllvmasmprinter.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvminterpreter/libllvminterpreter.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmcodegen/libllvmcodegen.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmscalaropts/libllvmscalaropts.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmprofiledata/libllvmprofiledata.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvminstcombine/libllvminstcombine.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvminstrumentation/libllvminstrumentation.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmorcjit/libllvmorcjit.a /media/da0s1/obj/usr/src/us r.bin/clang/lli/../../../lib/clang/libllvmtransformutils/libllvmtransformutils.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmipa/libllvmipa.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmmcjit/libllvmmcjit.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmexecutionengine/libllvmexecutionengine.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmtarget/libllvmtarget.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmanalysis/libllvmanalysis.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmruntimedyld/libllvmruntimedyld.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmobject/libllvmobject.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmmcparser/libllvmmcparser.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmbitreader/libllvmbitreader.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../li b/clang/libllvmmc/libllvmmc.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmcore/libllvmcore.a /media/da0s1/obj/usr/src/usr.bin/clang/lli/../../../lib/clang/libllvmsupport/libllvmsupport.a /media/da0s1/obj/usr/src/tmp/usr/lib/libz.a /media/da0s1/obj/usr/src/tmp/usr/lib/libncursesw.a /media/da0s1/obj/usr/src/tmp/usr/lib/libpthread.a >> .depend echo lli: /media/da0s1/obj/usr/src/tmp/usr/lib/libc++.a >> .depend A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/usr.bin/clang/lli *** [depend_subdir_lli] Error code 2 make[4]: stopped in /usr/src/usr.bin/clang --- depend_subdir_tblgen --- echo tblgen: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmtablegen/libllvmtablegen.a /media/da0s1/obj/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a /media/da0s1/obj/usr/src/tmp/usr/lib/libncursesw.a /media/da0s1/obj/usr/src/tmp/usr/lib/libpthread.a >> .depend echo tblgen: /media/da0s1/obj/usr/src/tmp/usr/lib/libc++.a >> .depend A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/usr.bin/clang/tblgen *** [depend_subdir_tblgen] Error code 2 make[4]: stopped in /usr/src/usr.bin/clang 2 errors make[4]: stopped in /usr/src/usr.bin/clang *** [depend_subdir_clang] Error code 2 make[3]: stopped in /usr/src/usr.bin 1 error make[3]: stopped in /usr/src/usr.bin *** [depend_subdir_usr.bin] Error code 2 make[2]: stopped in /usr/src --- depend_subdir_usr.sbin --- --- depend_subdir_tcpdump --- echo tcpdump: /media/da0s1/obj/usr/src/tmp/usr/lib/libc.a /media/da0s1/obj/usr/src/tmp/usr/lib/libl.a /media/da0s1/obj/usr/src/tmp/usr/lib/libpcap.a /media/da0s1/obj/usr/src/tmp/usr/lib/libcapsicum.a /media/da0s1/obj/usr/src/tmp/usr/lib/libcrypto.a >> .depend A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/usr.sbin/tcpdump/tcpdump *** [depend] Error code 2 make[4]: stopped in /usr/src/usr.sbin/tcpdump 1 error make[4]: stopped in /usr/src/usr.sbin/tcpdump *** [depend_subdir_tcpdump] Error code 2 make[3]: stopped in /usr/src/usr.sbin 3 errors make[3]: stopped in /usr/src/usr.sbin *** [depend_subdir_usr.sbin] Error code 2 make[2]: stopped in /usr/src 2 errors make[2]: stopped in /usr/src *** [_depend] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src root@nonamehost:/usr/src # From owner-svn-src-head@freebsd.org Tue Feb 16 11:03:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568A7AA9D1E; Tue, 16 Feb 2016 11:03:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3E81D21; Tue, 16 Feb 2016 11:03:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GB3Mve066242; Tue, 16 Feb 2016 11:03:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GB3MpW066241; Tue, 16 Feb 2016 11:03:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602161103.u1GB3MpW066241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Feb 2016 11:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295654 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 11:03:23 -0000 Author: andrew Date: Tue Feb 16 11:03:21 2016 New Revision: 295654 URL: https://svnweb.freebsd.org/changeset/base/295654 Log: Only read the power state register when we will be using its value. While here remove magic shifts, and cleanup pwr_name. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/allwinner/axp209.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Tue Feb 16 10:33:45 2016 (r295653) +++ head/sys/arm/allwinner/axp209.c Tue Feb 16 11:03:21 2016 (r295654) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); /* Power State Register */ #define AXP209_PSR 0x00 #define AXP209_PSR_ACIN 0x80 +#define AXP209_PSR_ACIN_SHIFT 7 #define AXP209_PSR_VBUS 0x20 +#define AXP209_PSR_VBUS_SHIFT 5 /* Shutdown and battery control */ #define AXP209_SHUTBAT 0x32 @@ -136,26 +138,27 @@ static int axp209_attach(device_t dev) { struct axp209_softc *sc; + const char *pwr_name[] = {"Battery", "AC", "USB", "AC and USB"}; uint8_t data; uint8_t pwr_src; - char pwr_name[4][11] = {"Battery", "AC", "USB", "AC and USB"}; sc = device_get_softc(dev); sc->addr = iicbus_get_addr(dev); - /* - * Read the Power State register - * bit 7 is AC presence, bit 5 is VBUS presence. - * If none are set then we are running from battery (obviously). - */ - axp209_read(dev, AXP209_PSR, &data, 1); - pwr_src = ((data & AXP209_PSR_ACIN) >> 7) | - ((data & AXP209_PSR_VBUS) >> 4); + if (bootverbose) { + /* + * Read the Power State register. + * Shift the AC presence into bit 0. + * Shift the Battery presence into bit 1. + */ + axp209_read(dev, AXP209_PSR, &data, 1); + pwr_src = ((data & AXP209_PSR_ACIN) >> AXP209_PSR_ACIN_SHIFT) | + ((data & AXP209_PSR_VBUS) >> (AXP209_PSR_VBUS_SHIFT - 1)); - if (bootverbose) device_printf(dev, "AXP209 Powered by %s\n", pwr_name[pwr_src]); + } EVENTHANDLER_REGISTER(shutdown_final, axp209_shutdown, dev, SHUTDOWN_PRI_LAST); From owner-svn-src-head@freebsd.org Tue Feb 16 11:38:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4EB7AAADD5; Tue, 16 Feb 2016 11:38:39 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 960BA1210; Tue, 16 Feb 2016 11:38:39 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GBccvk075040; Tue, 16 Feb 2016 11:38:38 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GBcca2075039; Tue, 16 Feb 2016 11:38:38 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602161138.u1GBcca2075039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 16 Feb 2016 11:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295655 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 11:38:39 -0000 Author: skra Date: Tue Feb 16 11:38:38 2016 New Revision: 295655 URL: https://svnweb.freebsd.org/changeset/base/295655 Log: Temporary overwrite bad definition of elm interrupt property in Linux dts files. It may be removed once it will be fixed upstream. This is done just to supresses a warning during dtb evaluation as there is no elm driver in tree at present. Modified: head/sys/boot/fdt/dts/arm/pandaboard-common.dtsi Modified: head/sys/boot/fdt/dts/arm/pandaboard-common.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/pandaboard-common.dtsi Tue Feb 16 11:03:21 2016 (r295654) +++ head/sys/boot/fdt/dts/arm/pandaboard-common.dtsi Tue Feb 16 11:38:38 2016 (r295655) @@ -41,6 +41,10 @@ reg = <0x48240200 0x20>; interrupts = ; }; + + elm: elm@48078000 { + interrupts = ; + }; }; chosen { stdin = "serial2"; From owner-svn-src-head@freebsd.org Tue Feb 16 11:43:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B8EAA9081; Tue, 16 Feb 2016 11:43:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A403D163F; Tue, 16 Feb 2016 11:43:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GBhvsQ077816; Tue, 16 Feb 2016 11:43:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GBhvkl077811; Tue, 16 Feb 2016 11:43:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602161143.u1GBhvkl077811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 16 Feb 2016 11:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295656 - in head/sys: arm64/cavium conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 11:43:59 -0000 Author: zbb Date: Tue Feb 16 11:43:57 2016 New Revision: 295656 URL: https://svnweb.freebsd.org/changeset/base/295656 Log: Support PEM that is not a PCI endpoint on ThunderX Some chip revisions don't have their external PCIe buses behind the internal bridge. Add support for FDT-configurable PEMs but keep ability for PCIe enumeration. Reviewed by: andrew, wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5285 Added: head/sys/arm64/cavium/thunder_pcie_pem.h (contents, props changed) head/sys/arm64/cavium/thunder_pcie_pem_fdt.c (contents, props changed) Modified: head/sys/arm64/cavium/thunder_pcie_common.h head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/conf/files.arm64 Modified: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.h Tue Feb 16 11:38:38 2016 (r295655) +++ head/sys/arm64/cavium/thunder_pcie_common.h Tue Feb 16 11:43:57 2016 (r295656) @@ -33,6 +33,7 @@ #define RANGES_TUPLES_INVALID (RANGES_TUPLES_MAX + 1) DECLARE_CLASS(thunder_pcie_driver); +DECLARE_CLASS(thunder_pem_driver); MALLOC_DECLARE(M_THUNDER_PCIE); Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Tue Feb 16 11:38:38 2016 (r295655) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Tue Feb 16 11:43:57 2016 (r295656) @@ -49,12 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include "thunder_pcie_common.h" +#include +#include #include "pcib_if.h" #define THUNDER_PEM_DEVICE_ID 0xa020 #define THUNDER_PEM_VENDOR_ID 0x177d -#define THUNDER_PEM_DESC "ThunderX PEM" /* ThunderX specific defines */ #define THUNDER_PEMn_REG_BASE(unit) (0x87e0c0000000UL | ((unit) << 24)) @@ -109,21 +109,7 @@ __FBSDID("$FreeBSD$"); #define PCI_MEMORY_BASE PCI_IO_SIZE #define PCI_MEMORY_SIZE 0xFFF00000UL -struct thunder_pem_softc { - device_t dev; - struct resource *reg; - bus_space_tag_t reg_bst; - bus_space_handle_t reg_bsh; - struct pcie_range ranges[RANGES_TUPLES_MAX]; - struct rman mem_rman; - struct rman io_rman; - bus_space_handle_t pem_sli_base; - uint32_t node; - uint32_t id; - uint32_t sli; - uint32_t sli_group; - uint64_t sli_window_base; -}; +#define RID_PEM_SPACE 1 static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); @@ -174,11 +160,13 @@ static device_method_t thunder_pem_metho DEVMETHOD_END }; -static driver_t thunder_pem_driver = { - "pcib", - thunder_pem_methods, - sizeof(struct thunder_pem_softc), -}; +DEFINE_CLASS_0(pcib, thunder_pem_driver, thunder_pem_methods, + sizeof(struct thunder_pem_softc)); + +static devclass_t thunder_pem_devclass; + +DRIVER_MODULE(thunder_pem, pci, thunder_pem_driver, thunder_pem_devclass, 0, 0); +MODULE_DEPEND(thunder_pem, pci, 1, 1, 1); static int thunder_pem_maxslots(device_t dev) @@ -526,6 +514,8 @@ thunder_pem_probe(device_t dev) static int thunder_pem_attach(device_t dev) { + devclass_t pci_class; + device_t parent; struct thunder_pem_softc *sc; int error; int rid; @@ -533,8 +523,14 @@ thunder_pem_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - /* Allocate memory for BAR(0) */ - rid = PCIR_BAR(0); + /* Allocate memory for resource */ + pci_class = devclass_find("pci"); + parent = device_get_parent(dev); + if (device_get_devclass(parent) == pci_class) + rid = PCIR_BAR(0); + else + rid = RID_PEM_SPACE; + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->reg == NULL) { @@ -583,6 +579,13 @@ thunder_pem_attach(device_t dev) goto fail_mem; } + /* + * We ignore the values that may have been provided in FDT + * and configure ranges according to the below formula + * for all types of devices. This is because some DTBs provided + * by EFI do not have proper ranges property or don't have them + * at all. + */ /* Fill memory window */ sc->ranges[0].pci_base = PCI_MEMORY_BASE; sc->ranges[0].size = PCI_MEMORY_SIZE; @@ -639,8 +642,3 @@ thunder_pem_detach(device_t dev) return (0); } - -static devclass_t thunder_pem_devclass; - -DRIVER_MODULE(thunder_pem, pci, thunder_pem_driver, thunder_pem_devclass, 0, 0); -MODULE_DEPEND(thunder_pem, pci, 1, 1, 1); Added: head/sys/arm64/cavium/thunder_pcie_pem.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_pem.h Tue Feb 16 11:43:57 2016 (r295656) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * 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$ + * + */ + +#ifndef __THUNDER_PCIE_PEM_H__ +#define __THUNDER_PCIE_PEM_H__ + +#define THUNDER_PEM_DESC "ThunderX PEM" + +struct thunder_pem_softc { + device_t dev; + struct resource *reg; + bus_space_tag_t reg_bst; + bus_space_handle_t reg_bsh; + struct pcie_range ranges[RANGES_TUPLES_MAX]; + struct rman mem_rman; + struct rman io_rman; + bus_space_handle_t pem_sli_base; + uint32_t node; + uint32_t id; + uint32_t sli; + uint32_t sli_group; + uint64_t sli_window_base; +}; + +#endif Added: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Tue Feb 16 11:43:57 2016 (r295656) @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 + +#include +#include +#include + +#include "thunder_pcie_common.h" +#include "thunder_pcie_pem.h" + +static int thunder_pem_fdt_probe(device_t); + +static device_method_t thunder_pem_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, thunder_pem_fdt_probe), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pcib, thunder_pem_fdt_driver, thunder_pem_fdt_methods, + sizeof(struct thunder_pem_softc), thunder_pem_driver); + +static devclass_t thunder_pem_fdt_devclass; + +DRIVER_MODULE(thunder_pem, simplebus, thunder_pem_fdt_driver, + thunder_pem_fdt_devclass, 0, 0); +DRIVER_MODULE(thunder_pem, ofwbus, thunder_pem_fdt_driver, + thunder_pem_fdt_devclass, 0, 0); + +static int +thunder_pem_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "cavium,pci-host-thunder-pem")) { + device_set_desc(dev, THUNDER_PEM_DESC); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Feb 16 11:38:38 2016 (r295655) +++ head/sys/conf/files.arm64 Tue Feb 16 11:43:57 2016 (r295656) @@ -52,10 +52,11 @@ arm64/arm64/uma_machdep.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard -arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci -arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt -arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci -arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie_pem_fdt.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb From owner-svn-src-head@freebsd.org Tue Feb 16 11:45:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC315AA916E; Tue, 16 Feb 2016 11:45:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 723D618FB; Tue, 16 Feb 2016 11:45:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GBjkbk077939; Tue, 16 Feb 2016 11:45:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GBjkjg077935; Tue, 16 Feb 2016 11:45:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602161145.u1GBjkjg077935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Feb 2016 11:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295657 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 11:45:47 -0000 Author: andrew Date: Tue Feb 16 11:45:46 2016 New Revision: 295657 URL: https://svnweb.freebsd.org/changeset/base/295657 Log: Add an analog audio driver for the audio codec found on the Allwinner A10/A20 SoC. Based loosely on the submitters NetBSD driver, tested on Cubieboard 2. Playback and capture are supported. Submitted by: Jared McNeill Differential Revision: https://reviews.freebsd.org/D5202 Added: head/sys/arm/allwinner/a10_codec.c (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Added: head/sys/arm/allwinner/a10_codec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_codec.c Tue Feb 16 11:45:46 2016 (r295657) @@ -0,0 +1,850 @@ +/*- + * Copyright (c) 2014-2016 Jared D. McNeill + * 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 ``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 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$ + */ + +/* + * Allwinner A10/A20 Audio Codec + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include "sunxi_dma_if.h" +#include "mixer_if.h" +#include "gpio_if.h" + +#define TX_TRIG_LEVEL 0xf +#define RX_TRIG_LEVEL 0x7 +#define DRQ_CLR_CNT 0x3 + +#define AC_DAC_DPC 0x00 +#define DAC_DPC_EN_DA 0x80000000 +#define AC_DAC_FIFOC 0x04 +#define DAC_FIFOC_FS_SHIFT 29 +#define DAC_FIFOC_FS_MASK (7U << DAC_FIFOC_FS_SHIFT) +#define DAC_FS_48KHZ 0 +#define DAC_FS_32KHZ 1 +#define DAC_FS_24KHZ 2 +#define DAC_FS_16KHZ 3 +#define DAC_FS_12KHZ 4 +#define DAC_FS_8KHZ 5 +#define DAC_FS_192KHZ 6 +#define DAC_FS_96KHZ 7 +#define DAC_FIFOC_FIFO_MODE_SHIFT 24 +#define DAC_FIFOC_FIFO_MODE_MASK (3U << DAC_FIFOC_FIFO_MODE_SHIFT) +#define FIFO_MODE_24_31_8 0 +#define FIFO_MODE_16_31_16 0 +#define FIFO_MODE_16_15_0 1 +#define DAC_FIFOC_DRQ_CLR_CNT_SHIFT 21 +#define DAC_FIFOC_DRQ_CLR_CNT_MASK (3U << DAC_FIFOC_DRQ_CLR_CNT_SHIFT) +#define DAC_FIFOC_TX_TRIG_LEVEL_SHIFT 8 +#define DAC_FIFOC_TX_TRIG_LEVEL_MASK (0x7f << DAC_FIFOC_TX_TRIG_LEVEL_SHIFT) +#define DAC_FIFOC_MONO_EN (1U << 6) +#define DAC_FIFOC_TX_BITS (1U << 5) +#define DAC_FIFOC_DRQ_EN (1U << 4) +#define DAC_FIFOC_FIFO_FLUSH (1U << 0) +#define AC_DAC_FIFOS 0x08 +#define AC_DAC_TXDATA 0x0c +#define AC_DAC_ACTL 0x10 +#define DAC_ACTL_DACAREN (1U << 31) +#define DAC_ACTL_DACALEN (1U << 30) +#define DAC_ACTL_MIXEN (1U << 29) +#define DAC_ACTL_DACPAS (1U << 8) +#define DAC_ACTL_PAMUTE (1U << 6) +#define DAC_ACTL_PAVOL_SHIFT 0 +#define DAC_ACTL_PAVOL_MASK (0x3f << DAC_ACTL_PAVOL_SHIFT) +#define AC_ADC_FIFOC 0x1c +#define ADC_FIFOC_FS_SHIFT 29 +#define ADC_FIFOC_FS_MASK (7U << ADC_FIFOC_FS_SHIFT) +#define ADC_FS_48KHZ 0 +#define ADC_FIFOC_EN_AD (1U << 28) +#define ADC_FIFOC_RX_FIFO_MODE (1U << 24) +#define ADC_FIFOC_RX_TRIG_LEVEL_SHIFT 8 +#define ADC_FIFOC_RX_TRIG_LEVEL_MASK (0x1f << ADC_FIFOC_RX_TRIG_LEVEL_SHIFT) +#define ADC_FIFOC_MONO_EN (1U << 7) +#define ADC_FIFOC_RX_BITS (1U << 6) +#define ADC_FIFOC_DRQ_EN (1U << 4) +#define ADC_FIFOC_FIFO_FLUSH (1U << 1) +#define AC_ADC_FIFOS 0x20 +#define AC_ADC_RXDATA 0x24 +#define AC_ADC_ACTL 0x28 +#define ADC_ACTL_ADCREN (1U << 31) +#define ADC_ACTL_ADCLEN (1U << 30) +#define ADC_ACTL_PREG1EN (1U << 29) +#define ADC_ACTL_PREG2EN (1U << 28) +#define ADC_ACTL_VMICEN (1U << 27) +#define ADC_ACTL_ADCG_SHIFT 20 +#define ADC_ACTL_ADCG_MASK (7U << ADC_ACTL_ADCG_SHIFT) +#define ADC_ACTL_ADCIS_SHIFT 17 +#define ADC_ACTL_ADCIS_MASK (7U << ADC_ACTL_ADCIS_SHIFT) +#define ADC_IS_LINEIN 0 +#define ADC_IS_FMIN 1 +#define ADC_IS_MIC1 2 +#define ADC_IS_MIC2 3 +#define ADC_IS_MIC1_L_MIC2_R 4 +#define ADC_IS_MIC1_LR_MIC2_LR 5 +#define ADC_IS_OMIX 6 +#define ADC_IS_LINEIN_L_MIC1_R 7 +#define ADC_ACTL_LNRDF (1U << 16) +#define ADC_ACTL_LNPREG_SHIFT 13 +#define ADC_ACTL_LNPREG_MASK (7U << ADC_ACTL_LNPREG_SHIFT) +#define ADC_ACTL_PA_EN (1U << 4) +#define ADC_ACTL_DDE (1U << 3) +#define AC_DAC_CNT 0x30 +#define AC_ADC_CNT 0x34 + +static uint32_t a10codec_fmt[] = { + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps a10codec_pcaps = { 8000, 192000, a10codec_fmt, 0 }; +static struct pcmchan_caps a10codec_rcaps = { 8000, 48000, a10codec_fmt, 0 }; + +struct a10codec_info; + +struct a10codec_chinfo { + struct snd_dbuf *buffer; + struct pcm_channel *channel; + struct a10codec_info *parent; + bus_dmamap_t dmamap; + void *dmaaddr; + bus_addr_t physaddr; + bus_size_t fifo; + device_t dmac; + void *dmachan; + + int dir; + int run; + uint32_t pos; + uint32_t format; + uint32_t blocksize; + uint32_t speed; +}; + +struct a10codec_info { + device_t dev; + struct resource *res[2]; + struct mtx *lock; + bus_dma_tag_t dmat; + unsigned dmasize; + void *ih; + + unsigned drqtype_codec; + unsigned drqtype_sdram; + + struct a10codec_chinfo play; + struct a10codec_chinfo rec; +}; + +static struct resource_spec a10codec_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define CODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +/* + * Mixer interface + */ + +static int +a10codec_mixer_init(struct snd_mixer *m) +{ + struct a10codec_info *sc = mix_getdevinfo(m); + pcell_t prop[4]; + phandle_t node; + device_t gpio; + uint32_t val; + ssize_t len; + int pin; + + mix_setdevs(m, SOUND_MASK_VOLUME | SOUND_MASK_LINE | SOUND_MASK_RECLEV); + mix_setrecdevs(m, SOUND_MASK_LINE | SOUND_MASK_LINE1 | SOUND_MASK_MIC); + + /* Unmute input source to PA */ + val = CODEC_READ(sc, AC_DAC_ACTL); + val |= DAC_ACTL_PAMUTE; + CODEC_WRITE(sc, AC_DAC_ACTL, val); + + /* Enable PA */ + val = CODEC_READ(sc, AC_ADC_ACTL); + val |= ADC_ACTL_PA_EN; + CODEC_WRITE(sc, AC_ADC_ACTL, val); + + /* Unmute PA */ + node = ofw_bus_get_node(sc->dev); + len = OF_getencprop(node, "allwinner,pa-gpios", prop, sizeof(prop)); + if (len > 0 && (len / sizeof(prop[0])) == 4) { + gpio = OF_device_from_xref(prop[0]); + if (gpio != NULL) { + pin = prop[1] * 32 + prop[2]; + GPIO_PIN_SETFLAGS(gpio, pin, GPIO_PIN_OUTPUT); + GPIO_PIN_SET(gpio, pin, GPIO_PIN_LOW); + } + } + + return (0); +} + +static const struct a10codec_mixer { + unsigned reg; + unsigned mask; + unsigned shift; +} a10codec_mixers[SOUND_MIXER_NRDEVICES] = { + [SOUND_MIXER_VOLUME] = { AC_DAC_ACTL, DAC_ACTL_PAVOL_MASK, + DAC_ACTL_PAVOL_SHIFT }, + [SOUND_MIXER_LINE] = { AC_ADC_ACTL, ADC_ACTL_LNPREG_MASK, + ADC_ACTL_LNPREG_SHIFT }, + [SOUND_MIXER_RECLEV] = { AC_ADC_ACTL, ADC_ACTL_ADCG_MASK, + ADC_ACTL_ADCG_SHIFT }, +}; + +static int +a10codec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, + unsigned right) +{ + struct a10codec_info *sc = mix_getdevinfo(m); + uint32_t val; + unsigned nvol, max; + + max = a10codec_mixers[dev].mask >> a10codec_mixers[dev].shift; + nvol = (left * max) / 100; + + val = CODEC_READ(sc, a10codec_mixers[dev].reg); + val &= ~a10codec_mixers[dev].mask; + val |= (nvol << a10codec_mixers[dev].shift); + CODEC_WRITE(sc, a10codec_mixers[dev].reg, val); + + left = right = (left * 100) / max; + return (left | (right << 8)); +} + +static uint32_t +a10codec_mixer_setrecsrc(struct snd_mixer *m, uint32_t src) +{ + struct a10codec_info *sc = mix_getdevinfo(m); + uint32_t val; + + val = CODEC_READ(sc, AC_ADC_ACTL); + + switch (src) { + case SOUND_MASK_LINE: /* line-in */ + val &= ~ADC_ACTL_ADCIS_MASK; + val |= (ADC_IS_LINEIN << ADC_ACTL_ADCIS_SHIFT); + break; + case SOUND_MASK_MIC: /* MIC1 */ + val &= ~ADC_ACTL_ADCIS_MASK; + val |= (ADC_IS_MIC1 << ADC_ACTL_ADCIS_SHIFT); + break; + case SOUND_MASK_LINE1: /* MIC2 */ + val &= ~ADC_ACTL_ADCIS_MASK; + val |= (ADC_IS_MIC2 << ADC_ACTL_ADCIS_SHIFT); + break; + default: + break; + } + + CODEC_WRITE(sc, AC_ADC_ACTL, val); + + switch ((val & ADC_ACTL_ADCIS_MASK) >> ADC_ACTL_ADCIS_SHIFT) { + case ADC_IS_LINEIN: + return (SOUND_MASK_LINE); + case ADC_IS_MIC1: + return (SOUND_MASK_MIC); + case ADC_IS_MIC2: + return (SOUND_MASK_LINE1); + default: + return (0); + } +} + +static kobj_method_t a10codec_mixer_methods[] = { + KOBJMETHOD(mixer_init, a10codec_mixer_init), + KOBJMETHOD(mixer_set, a10codec_mixer_set), + KOBJMETHOD(mixer_setrecsrc, a10codec_mixer_setrecsrc), + KOBJMETHOD_END +}; +MIXER_DECLARE(a10codec_mixer); + + +/* + * Channel interface + */ + +static void +a10codec_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + struct a10codec_chinfo *ch = arg; + + if (error != 0) + return; + + ch->physaddr = segs[0].ds_addr; +} + +static void +a10codec_transfer(struct a10codec_chinfo *ch) +{ + bus_addr_t src, dst; + int error; + + if (ch->dir == PCMDIR_PLAY) { + src = ch->physaddr + ch->pos; + dst = ch->fifo; + } else { + src = ch->fifo; + dst = ch->physaddr + ch->pos; + } + + error = SUNXI_DMA_TRANSFER(ch->dmac, ch->dmachan, src, dst, + ch->blocksize); + if (error) { + ch->run = 0; + device_printf(ch->parent->dev, "DMA transfer failed: %d\n", + error); + } +} + +static void +a10codec_dmaconfig(struct a10codec_chinfo *ch) +{ + struct a10codec_info *sc = ch->parent; + struct sunxi_dma_config conf; + + memset(&conf, 0, sizeof(conf)); + conf.src_width = conf.dst_width = 16; + conf.src_burst_len = conf.dst_burst_len = 4; + + if (ch->dir == PCMDIR_PLAY) { + conf.dst_noincr = true; + conf.src_drqtype = sc->drqtype_sdram; + conf.dst_drqtype = sc->drqtype_codec; + } else { + conf.src_noincr = true; + conf.src_drqtype = sc->drqtype_codec; + conf.dst_drqtype = sc->drqtype_sdram; + } + + SUNXI_DMA_SET_CONFIG(ch->dmac, ch->dmachan, &conf); +} + +static void +a10codec_dmaintr(void *priv) +{ + struct a10codec_chinfo *ch = priv; + unsigned bufsize; + + bufsize = sndbuf_getsize(ch->buffer); + + ch->pos += ch->blocksize; + if (ch->pos >= bufsize) + ch->pos -= bufsize; + + if (ch->run) { + chn_intr(ch->channel); + a10codec_transfer(ch); + } +} + +static unsigned +a10codec_fs(struct a10codec_chinfo *ch) +{ + switch (ch->speed) { + case 48000: + return (DAC_FS_48KHZ); + case 24000: + return (DAC_FS_24KHZ); + case 12000: + return (DAC_FS_12KHZ); + case 192000: + return (DAC_FS_192KHZ); + case 32000: + return (DAC_FS_32KHZ); + case 16000: + return (DAC_FS_16KHZ); + case 8000: + return (DAC_FS_8KHZ); + case 96000: + return (DAC_FS_96KHZ); + default: + return (DAC_FS_48KHZ); + } +} + +static void +a10codec_start(struct a10codec_chinfo *ch) +{ + struct a10codec_info *sc = ch->parent; + uint32_t val; + + ch->pos = 0; + + if (ch->dir == PCMDIR_PLAY) { + /* Flush DAC FIFO */ + CODEC_WRITE(sc, AC_DAC_FIFOC, DAC_FIFOC_FIFO_FLUSH); + + /* Clear DAC FIFO status */ + CODEC_WRITE(sc, AC_DAC_FIFOS, CODEC_READ(sc, AC_DAC_FIFOS)); + + /* Enable DAC analog left/right channels and output mixer */ + val = CODEC_READ(sc, AC_DAC_ACTL); + val |= DAC_ACTL_DACAREN; + val |= DAC_ACTL_DACALEN; + val |= DAC_ACTL_DACPAS; + CODEC_WRITE(sc, AC_DAC_ACTL, val); + + /* Configure DAC DMA channel */ + a10codec_dmaconfig(ch); + + /* Configure DAC FIFO */ + CODEC_WRITE(sc, AC_DAC_FIFOC, + (AFMT_CHANNEL(ch->format) == 1 ? DAC_FIFOC_MONO_EN : 0) | + (a10codec_fs(ch) << DAC_FIFOC_FS_SHIFT) | + (FIFO_MODE_16_15_0 << DAC_FIFOC_FIFO_MODE_SHIFT) | + (DRQ_CLR_CNT << DAC_FIFOC_DRQ_CLR_CNT_SHIFT) | + (TX_TRIG_LEVEL << DAC_FIFOC_TX_TRIG_LEVEL_SHIFT)); + + /* Enable DAC DRQ */ + val = CODEC_READ(sc, AC_DAC_FIFOC); + val |= DAC_FIFOC_DRQ_EN; + CODEC_WRITE(sc, AC_DAC_FIFOC, val); + } else { + /* Flush ADC FIFO */ + CODEC_WRITE(sc, AC_ADC_FIFOC, ADC_FIFOC_FIFO_FLUSH); + + /* Clear ADC FIFO status */ + CODEC_WRITE(sc, AC_ADC_FIFOS, CODEC_READ(sc, AC_ADC_FIFOS)); + + /* Enable ADC analog left/right channels, MIC1 preamp, + * and VMIC pin voltage + */ + val = CODEC_READ(sc, AC_ADC_ACTL); + val |= ADC_ACTL_ADCREN; + val |= ADC_ACTL_ADCLEN; + val |= ADC_ACTL_PREG1EN; + val |= ADC_ACTL_VMICEN; + CODEC_WRITE(sc, AC_ADC_ACTL, val); + + /* Configure ADC DMA channel */ + a10codec_dmaconfig(ch); + + /* Configure ADC FIFO */ + CODEC_WRITE(sc, AC_ADC_FIFOC, + ADC_FIFOC_EN_AD | + ADC_FIFOC_RX_FIFO_MODE | + (AFMT_CHANNEL(ch->format) == 1 ? ADC_FIFOC_MONO_EN : 0) | + (a10codec_fs(ch) << ADC_FIFOC_FS_SHIFT) | + (RX_TRIG_LEVEL << ADC_FIFOC_RX_TRIG_LEVEL_SHIFT)); + + /* Enable ADC DRQ */ + val = CODEC_READ(sc, AC_ADC_FIFOC); + val |= ADC_FIFOC_DRQ_EN; + CODEC_WRITE(sc, AC_ADC_FIFOC, val); + } + + /* Start DMA transfer */ + a10codec_transfer(ch); +} + +static void +a10codec_stop(struct a10codec_chinfo *ch) +{ + struct a10codec_info *sc = ch->parent; + uint32_t val; + + /* Disable DMA channel */ + SUNXI_DMA_HALT(ch->dmac, ch->dmachan); + + if (ch->dir == PCMDIR_PLAY) { + /* Disable DAC analog left/right channels and output mixer */ + val = CODEC_READ(sc, AC_DAC_ACTL); + val &= ~DAC_ACTL_DACAREN; + val &= ~DAC_ACTL_DACALEN; + val &= ~DAC_ACTL_DACPAS; + CODEC_WRITE(sc, AC_DAC_ACTL, val); + + /* Disable DAC DRQ */ + CODEC_WRITE(sc, AC_DAC_FIFOC, 0); + } else { + /* Disable ADC analog left/right channels, MIC1 preamp, + * and VMIC pin voltage + */ + val = CODEC_READ(sc, AC_ADC_ACTL); + val &= ~ADC_ACTL_ADCREN; + val &= ~ADC_ACTL_ADCLEN; + val &= ~ADC_ACTL_PREG1EN; + val &= ~ADC_ACTL_VMICEN; + CODEC_WRITE(sc, AC_ADC_ACTL, val); + + /* Disable ADC DRQ */ + CODEC_WRITE(sc, AC_ADC_FIFOC, 0); + } +} + +static void * +a10codec_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct a10codec_info *sc = devinfo; + struct a10codec_chinfo *ch = dir == PCMDIR_PLAY ? &sc->play : &sc->rec; + int error; + + ch->parent = sc; + ch->channel = c; + ch->buffer = b; + ch->dir = dir; + ch->fifo = rman_get_start(sc->res[0]) + + (dir == PCMDIR_REC ? AC_ADC_RXDATA : AC_DAC_TXDATA); + + ch->dmac = devclass_get_device(devclass_find("a10dmac"), 0); + if (ch->dmac == NULL) { + device_printf(sc->dev, "cannot find DMA controller\n"); + return (NULL); + } + ch->dmachan = SUNXI_DMA_ALLOC(ch->dmac, false, a10codec_dmaintr, ch); + if (ch->dmachan == NULL) { + device_printf(sc->dev, "cannot allocate DMA channel\n"); + return (NULL); + } + + error = bus_dmamem_alloc(sc->dmat, &ch->dmaaddr, + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &ch->dmamap); + if (error != 0) { + device_printf(sc->dev, "cannot allocate channel buffer\n"); + return (NULL); + } + error = bus_dmamap_load(sc->dmat, ch->dmamap, ch->dmaaddr, + sc->dmasize, a10codec_dmamap_cb, ch, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->dev, "cannot load DMA map\n"); + return (NULL); + } + memset(ch->dmaaddr, 0, sc->dmasize); + + if (sndbuf_setup(ch->buffer, ch->dmaaddr, sc->dmasize) != 0) { + device_printf(sc->dev, "cannot setup sndbuf\n"); + return (NULL); + } + + return (ch); +} + +static int +a10codec_chan_free(kobj_t obj, void *data) +{ + struct a10codec_chinfo *ch = data; + struct a10codec_info *sc = ch->parent; + + SUNXI_DMA_FREE(ch->dmac, ch->dmachan); + bus_dmamap_unload(sc->dmat, ch->dmamap); + bus_dmamem_free(sc->dmat, ch->dmaaddr, ch->dmamap); + + return (0); +} + +static int +a10codec_chan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct a10codec_chinfo *ch = data; + + ch->format = format; + + return (0); +} + +static uint32_t +a10codec_chan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct a10codec_chinfo *ch = data; + + /* + * The codec supports full duplex operation but both DAC and ADC + * use the same source clock (PLL2). Limit the available speeds to + * those supported by a 24576000 Hz input. + */ + switch (speed) { + case 8000: + case 12000: + case 16000: + case 24000: + case 32000: + case 48000: + ch->speed = speed; + break; + case 96000: + case 192000: + /* 96 KHz / 192 KHz mode only supported for playback */ + if (ch->dir == PCMDIR_PLAY) { + ch->speed = speed; + } else { + ch->speed = 48000; + } + break; + case 44100: + ch->speed = 48000; + break; + case 22050: + ch->speed = 24000; + break; + case 11025: + ch->speed = 12000; + break; + default: + ch->speed = 48000; + break; + } + + return (ch->speed); +} + +static uint32_t +a10codec_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct a10codec_chinfo *ch = data; + + ch->blocksize = blocksize & ~3; + + return (ch->blocksize); +} + +static int +a10codec_chan_trigger(kobj_t obj, void *data, int go) +{ + struct a10codec_chinfo *ch = data; + struct a10codec_info *sc = ch->parent; + + if (!PCMTRIG_COMMON(go)) + return (0); + + snd_mtxlock(sc->lock); + switch (go) { + case PCMTRIG_START: + ch->run = 1; + a10codec_start(ch); + break; + case PCMTRIG_STOP: + case PCMTRIG_ABORT: + ch->run = 0; + a10codec_stop(ch); + break; + default: + break; + } + snd_mtxunlock(sc->lock); + + return (0); +} + +static uint32_t +a10codec_chan_getptr(kobj_t obj, void *data) +{ + struct a10codec_chinfo *ch = data; + + return (ch->pos); +} + +static struct pcmchan_caps * +a10codec_chan_getcaps(kobj_t obj, void *data) +{ + struct a10codec_chinfo *ch = data; + + if (ch->dir == PCMDIR_PLAY) { + return (&a10codec_pcaps); + } else { + return (&a10codec_rcaps); + } +} + +static kobj_method_t a10codec_chan_methods[] = { + KOBJMETHOD(channel_init, a10codec_chan_init), + KOBJMETHOD(channel_free, a10codec_chan_free), + KOBJMETHOD(channel_setformat, a10codec_chan_setformat), + KOBJMETHOD(channel_setspeed, a10codec_chan_setspeed), + KOBJMETHOD(channel_setblocksize, a10codec_chan_setblocksize), + KOBJMETHOD(channel_trigger, a10codec_chan_trigger), + KOBJMETHOD(channel_getptr, a10codec_chan_getptr), + KOBJMETHOD(channel_getcaps, a10codec_chan_getcaps), + KOBJMETHOD_END +}; +CHANNEL_DECLARE(a10codec_chan); + + +/* + * Device interface + */ + +static int +a10codec_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-codec")) + return (ENXIO); + + device_set_desc(dev, "Allwinner Audio Codec"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10codec_attach(device_t dev) +{ + struct a10codec_info *sc; + char status[SND_STATUSLEN]; + uint32_t val; + int error; + + sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); + sc->dev = dev; + sc->lock = snd_mtxcreate(device_get_nameunit(dev), "a10codec softc"); + + if (bus_alloc_resources(dev, a10codec_spec, sc->res)) { + device_printf(dev, "cannot allocate resources for device\n"); + error = ENXIO; + goto fail; + } + + /* XXX DRQ types should come from FDT, but how? */ + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-codec") || + ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-codec")) { + sc->drqtype_codec = 19; + sc->drqtype_sdram = 22; + } else { + device_printf(dev, "DRQ types not known for this SoC\n"); + error = ENXIO; + goto fail; + } + + sc->dmasize = 131072; + error = bus_dma_tag_create( + bus_get_dma_tag(dev), + 4, sc->dmasize, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sc->dmasize, 1, /* maxsize, nsegs */ + sc->dmasize, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dmat); + if (error != 0) { + device_printf(dev, "cannot create DMA tag\n"); + goto fail; + } + + /* Activate audio codec clock. According to the A10 and A20 user + * manuals, Audio_pll can be either 24.576MHz or 22.5792MHz. Most + * audio sampling rates require an 24.576MHz input clock with the + * exception of 44.1kHz, 22.05kHz, and 11.025kHz. Unfortunately, + * both capture and playback use the same clock source so to + * safely support independent full duplex operation, we use a fixed + * 24.576MHz clock source and don't advertise native support for + * the three sampling rates that require a 22.5792MHz input. + */ + a10_clk_codec_activate(24576000); + + /* Enable DAC */ + val = CODEC_READ(sc, AC_DAC_DPC); + val |= DAC_DPC_EN_DA; + CODEC_WRITE(sc, AC_DAC_DPC, val); + +#ifdef notdef + error = snd_setup_intr(dev, sc->irq, INTR_MPSAFE, a10codec_intr, sc, + &sc->ih); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler\n"); + goto fail; + } +#endif + + if (mixer_init(dev, &a10codec_mixer_class, sc)) { + device_printf(dev, "mixer_init failed\n"); + goto fail; + } + + pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); + + if (pcm_register(dev, sc, 1, 1)) { + device_printf(dev, "pcm_register failed\n"); + goto fail; + } + + pcm_addchan(dev, PCMDIR_PLAY, &a10codec_chan_class, sc); + pcm_addchan(dev, PCMDIR_REC, &a10codec_chan_class, sc); + + snprintf(status, SND_STATUSLEN, "at %s", ofw_bus_get_name(dev)); + pcm_setstatus(dev, status); + + return (0); + +fail: + bus_release_resources(dev, a10codec_spec, sc->res); + snd_mtxfree(sc->lock); + free(sc, M_DEVBUF); + + return (error); +} + +static device_method_t a10codec_pcm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a10codec_probe), + DEVMETHOD(device_attach, a10codec_attach), + + DEVMETHOD_END +}; + +static driver_t a10codec_pcm_driver = { + "pcm", + a10codec_pcm_methods, + PCM_SOFTC_SIZE, +}; + +DRIVER_MODULE(a10codec, simplebus, a10codec_pcm_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(a10codec, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(a10codec, 1); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Feb 16 11:43:57 2016 (r295656) +++ head/sys/arm/allwinner/files.allwinner Tue Feb 16 11:45:46 2016 (r295657) @@ -3,6 +3,7 @@ kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_clk.c standard +arm/allwinner/a10_codec.c optional sound arm/allwinner/a10_common.c standard arm/allwinner/a10_dmac.c standard arm/allwinner/a10_ehci.c optional ehci Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Tue Feb 16 11:43:57 2016 (r295656) +++ head/sys/arm/conf/A20 Tue Feb 16 11:45:46 2016 (r295657) @@ -112,6 +112,9 @@ device dwc # 10/100/1000 integrated G # USB ethernet support, requires miibus device miibus +# Sound support +device sound + # Flattened Device Tree options FDT # Configure using FDT/DTB data makeoptions MODULES_EXTRA=dtb/allwinner Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Tue Feb 16 11:43:57 2016 (r295656) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Tue Feb 16 11:45:46 2016 (r295657) @@ -180,6 +180,14 @@ interrupts = <27>; interrupt-parent = <&GIC>; }; + + codec: codec@01c22c00 { + compatible = "allwinner,sun7i-a20-codec"; + reg = <0x01c22c00 0x40>; + interrupts = <30>; + interrupt-parent = <&GIC>; + status = "disabled"; + }; }; }; From owner-svn-src-head@freebsd.org Tue Feb 16 11:51:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D916CAA9505; Tue, 16 Feb 2016 11:51:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9224A1D12; Tue, 16 Feb 2016 11:51:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GBpsTZ080736; Tue, 16 Feb 2016 11:51:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GBpsfU080735; Tue, 16 Feb 2016 11:51:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602161151.u1GBpsfU080735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Feb 2016 11:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295658 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 11:51:55 -0000 Author: andrew Date: Tue Feb 16 11:51:54 2016 New Revision: 295658 URL: https://svnweb.freebsd.org/changeset/base/295658 Log: Add a sysctl to read the internal temperature of the AXP209 Power Management IC. Submitted by: Jared McNeill Differential Revision: https://reviews.freebsd.org/D5298 Modified: head/sys/arm/allwinner/axp209.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Tue Feb 16 11:45:46 2016 (r295657) +++ head/sys/arm/allwinner/axp209.c Tue Feb 16 11:51:54 2016 (r295658) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,11 +63,23 @@ __FBSDID("$FreeBSD$"); #define AXP209_SHUTBAT 0x32 #define AXP209_SHUTBAT_SHUTDOWN 0x80 +/* Temperature monitor */ +#define AXP209_TEMPMON 0x5e +#define AXP209_TEMPMON_H(a) ((a) << 4) +#define AXP209_TEMPMON_L(a) ((a) & 0xf) +#define AXP209_TEMPMON_MIN 1447 /* -144.7C */ + +#define AXP209_0C_TO_K 2732 + struct axp209_softc { uint32_t addr; struct intr_config_hook enum_hook; }; +enum axp209_sensor { + AXP209_TEMP +}; + static int axp209_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { @@ -104,6 +117,28 @@ axp209_write(device_t dev, uint8_t reg, return (iicbus_transfer(dev, &msg, 1)); } +static int +axp209_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = arg1; + enum axp209_sensor sensor = arg2; + uint8_t data[2]; + int val, error; + + if (sensor != AXP209_TEMP) + return (ENOENT); + + error = axp209_read(dev, AXP209_TEMPMON, data, 2); + if (error != 0) + return (error); + + /* Temperature is between -144.7C and 264.8C, step +0.1C */ + val = (AXP209_TEMPMON_H(data[0]) | AXP209_TEMPMON_L(data[1])) - + AXP209_TEMPMON_MIN + AXP209_0C_TO_K; + + return sysctl_handle_opaque(oidp, &val, sizeof(val), req); +} + static void axp209_shutdown(void *devp, int howto) { @@ -163,6 +198,12 @@ axp209_attach(device_t dev) EVENTHANDLER_REGISTER(shutdown_final, axp209_shutdown, dev, SHUTDOWN_PRI_LAST); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "temp", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_TEMP, axp209_sysctl, "IK", "Internal temperature"); + return (0); } From owner-svn-src-head@freebsd.org Tue Feb 16 12:19:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CF9AAA930; Tue, 16 Feb 2016 12:19:08 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42B8210C6; Tue, 16 Feb 2016 12:19:08 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GCJ7pg087351; Tue, 16 Feb 2016 12:19:07 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GCJ706087348; Tue, 16 Feb 2016 12:19:07 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602161219.u1GCJ706087348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 16 Feb 2016 12:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295659 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 12:19:08 -0000 Author: skra Date: Tue Feb 16 12:19:06 2016 New Revision: 295659 URL: https://svnweb.freebsd.org/changeset/base/295659 Log: Do not use DMA channels used by GPU. (1) The channel mask is get from "brcm,dma-channel-mask" property of dma node, and if not provided, from "broadcom,channels" property. (2) Consequently, sdhci driver does not allocate any specific channel. (3) Use CS_RESET bit for initial channel reset. Differential Revision: https://reviews.freebsd.org/D4303 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.h head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Tue Feb 16 11:51:54 2016 (r295658) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Tue Feb 16 12:19:06 2016 (r295659) @@ -104,6 +104,15 @@ __FBSDID("$FreeBSD$"); /* relative offset from BCM_VC_DMA0_BASE (p.39) */ #define BCM_DMA_CH(n) (0x100*(n)) +/* channels used by GPU */ +#define BCM_DMA_CH_BULK 0 +#define BCM_DMA_CH_FAST1 2 +#define BCM_DMA_CH_FAST2 3 + +#define BCM_DMA_CH_GPU_MASK ((1 << BCM_DMA_CH_BULK) | \ + (1 << BCM_DMA_CH_FAST1) | \ + (1 << BCM_DMA_CH_FAST2)) + /* DMA Control Block - 256bit aligned (p.40) */ struct bcm_dma_cb { uint32_t info; /* Transfer Information */ @@ -143,6 +152,7 @@ struct bcm_dma_softc { }; static struct bcm_dma_softc *bcm_dma_sc = NULL; +static uint32_t bcm_dma_channel_mask; static void bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs, @@ -205,16 +215,32 @@ static int bcm_dma_init(device_t dev) { struct bcm_dma_softc *sc = device_get_softc(dev); - uint32_t mask; + uint32_t reg; struct bcm_dma_ch *ch; void *cb_virt; vm_paddr_t cb_phys; int err; int i; - /* disable and clear interrupt status */ - bus_write_4(sc->sc_mem, BCM_DMA_ENABLE, 0); - bus_write_4(sc->sc_mem, BCM_DMA_INT_STATUS, 0); + /* + * Only channels set in bcm_dma_channel_mask can be controlled by us. + * The others are out of our control as well as the corresponding bits + * in both BCM_DMA_ENABLE and BCM_DMA_INT_STATUS global registers. As + * these registers are RW ones, there is no safe way how to write only + * the bits which can be controlled by us. + * + * Fortunately, after reset, all channels are enabled in BCM_DMA_ENABLE + * register and all statuses are cleared in BCM_DMA_INT_STATUS one. + * Not touching these registers is a trade off between correct + * initialization which does not count on anything and not messing up + * something we have no control over. + */ + reg = bus_read_4(sc->sc_mem, BCM_DMA_ENABLE); + if ((reg & bcm_dma_channel_mask) != bcm_dma_channel_mask) + device_printf(dev, "channels are not enabled\n"); + reg = bus_read_4(sc->sc_mem, BCM_DMA_INT_STATUS); + if ((reg & bcm_dma_channel_mask) != 0) + device_printf(dev, "statuses are not cleared\n"); /* Allocate DMA chunks control blocks */ /* p.40 of spec - control block should be 32-bit aligned */ @@ -227,7 +253,7 @@ bcm_dma_init(device_t dev) &sc->sc_dma_tag); if (err) { - device_printf(dev, "failed allocate DMA tag"); + device_printf(dev, "failed allocate DMA tag\n"); return (err); } @@ -235,6 +261,13 @@ bcm_dma_init(device_t dev) for (i = 0; i < BCM_DMA_CH_MAX; i++) { ch = &sc->sc_dma_ch[i]; + bzero(ch, sizeof(struct bcm_dma_ch)); + ch->ch = i; + ch->flags = BCM_DMA_CH_UNMAP; + + if ((bcm_dma_channel_mask & (1 << i)) == 0) + continue; + err = bus_dmamem_alloc(sc->sc_dma_tag, &cb_virt, BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, &ch->dma_map); @@ -263,33 +296,15 @@ bcm_dma_init(device_t dev) break; } - bzero(ch, sizeof(struct bcm_dma_ch)); - ch->ch = i; ch->cb = cb_virt; ch->vc_cb = cb_phys; - ch->intr_func = NULL; - ch->intr_arg = NULL; - ch->flags = BCM_DMA_CH_UNMAP; - + ch->flags = BCM_DMA_CH_FREE; ch->cb->info = INFO_WAIT_RESP; /* reset DMA engine */ - bcm_dma_reset(dev, i); + bus_write_4(sc->sc_mem, BCM_DMA_CS(i), CS_RESET); } - /* now use DMA2/DMA3 only */ - sc->sc_dma_ch[2].flags = BCM_DMA_CH_FREE; - sc->sc_dma_ch[3].flags = BCM_DMA_CH_FREE; - - /* enable DMAs */ - mask = 0; - - for (i = 0; i < BCM_DMA_CH_MAX; i++) - if (sc->sc_dma_ch[i].flags & BCM_DMA_CH_FREE) - mask |= (1 << i); - - bus_write_4(sc->sc_mem, BCM_DMA_ENABLE, mask); - return (0); } @@ -599,8 +614,11 @@ bcm_dma_intr(void *arg) /* my interrupt? */ cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch->ch)); - if (!(cs & (CS_INT | CS_ERR))) + if (!(cs & (CS_INT | CS_ERR))) { + device_printf(sc->sc_dev, + "unexpected DMA intr CH=%d, CS=%x\n", ch->ch, cs); return; + } /* running? */ if (!(ch->flags & BCM_DMA_CH_USED)) { @@ -651,6 +669,7 @@ static int bcm_dma_attach(device_t dev) { struct bcm_dma_softc *sc = device_get_softc(dev); + phandle_t node; int rid, err = 0; int i; @@ -664,6 +683,19 @@ bcm_dma_attach(device_t dev) sc->sc_intrhand[i] = NULL; } + /* Get DMA channel mask. */ + node = ofw_bus_get_node(sc->sc_dev); + if (OF_getencprop(node, "brcm,dma-channel-mask", &bcm_dma_channel_mask, + sizeof(bcm_dma_channel_mask)) == -1 && + OF_getencprop(node, "broadcom,channels", &bcm_dma_channel_mask, + sizeof(bcm_dma_channel_mask)) == -1) { + device_printf(dev, "could not get channel mask property\n"); + return (ENXIO); + } + + /* Mask out channels used by GPU. */ + bcm_dma_channel_mask &= ~BCM_DMA_CH_GPU_MASK; + /* DMA0 - DMA14 */ rid = 0; sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -674,6 +706,9 @@ bcm_dma_attach(device_t dev) /* IRQ DMA0 - DMA11 XXX NOT USE DMA12(spurious?) */ for (rid = 0; rid < BCM_DMA_CH_MAX; rid++) { + if ((bcm_dma_channel_mask & (1 << rid)) == 0) + continue; + sc->sc_irq[rid] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq[rid] == NULL) { Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.h Tue Feb 16 11:51:54 2016 (r295658) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.h Tue Feb 16 12:19:06 2016 (r295659) @@ -37,8 +37,6 @@ /* request CH for any nubmer */ #define BCM_DMA_CH_INVALID (-1) #define BCM_DMA_CH_ANY (-1) -#define BCM_DMA_CH_FAST1 (2) -#define BCM_DMA_CH_FAST2 (3) /* Peripheral DREQ Signals (4.2.1.3) */ #define BCM_DMA_DREQ_NONE 0 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 16 11:51:54 2016 (r295658) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 16 12:19:06 2016 (r295659) @@ -214,11 +214,7 @@ bcm_sdhci_attach(device_t dev) sdhci_init_slot(dev, &sc->sc_slot, 0); - sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_FAST1); - if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) - sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_FAST2); - if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) - sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); + sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) goto fail; From owner-svn-src-head@freebsd.org Tue Feb 16 13:40:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54DFAAAA1A1; Tue, 16 Feb 2016 13:40:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 265221E8E; Tue, 16 Feb 2016 13:40:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GDeOEw011921; Tue, 16 Feb 2016 13:40:24 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GDeOUE011920; Tue, 16 Feb 2016 13:40:24 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602161340.u1GDeOUE011920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 16 Feb 2016 13:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295660 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 13:40:25 -0000 Author: skra Date: Tue Feb 16 13:40:23 2016 New Revision: 295660 URL: https://svnweb.freebsd.org/changeset/base/295660 Log: Use EARLY_DRIVER_MODULE() for ti_scm driver to be attached before am335x_prcm driver which uses it. Used BUS_PASS_BUS is a quick pick for now and may be revised when other drivers start using multipass feature. This is needed after an update of Linux dts files done in r295436. Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Tue Feb 16 12:19:06 2016 (r295659) +++ head/sys/arm/ti/ti_scm.c Tue Feb 16 13:40:23 2016 (r295660) @@ -170,4 +170,5 @@ static driver_t ti_scm_driver = { static devclass_t ti_scm_devclass; -DRIVER_MODULE(ti_scm, simplebus, ti_scm_driver, ti_scm_devclass, 0, 0); +EARLY_DRIVER_MODULE(ti_scm, simplebus, ti_scm_driver, ti_scm_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Tue Feb 16 14:03:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA6DFAAACBE; Tue, 16 Feb 2016 14:03:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1911E7C; Tue, 16 Feb 2016 14:03:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GE3Pe4020405; Tue, 16 Feb 2016 14:03:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GE3Pig020404; Tue, 16 Feb 2016 14:03:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602161403.u1GE3Pig020404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 Feb 2016 14:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295661 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 14:03:26 -0000 Author: emaste Date: Tue Feb 16 14:03:25 2016 New Revision: 295661 URL: https://svnweb.freebsd.org/changeset/base/295661 Log: Allow elfcopy to convert between two non-ELF formats If the output object is not an ELF file, choose an arbitrary ELF format for the intermediate file. srec, ihex and binary formats are independent of class, endianness and machine type so these choices do not affect the output. ELF Tool Chain ticket #517 Reviewed by: kai Obtained from: ELF Tool Chain r3411 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Tue Feb 16 13:40:23 2016 (r295660) +++ head/contrib/elftoolchain/elfcopy/main.c Tue Feb 16 14:03:25 2016 (r295661) @@ -641,6 +641,18 @@ create_file(struct elfcopy *ecp, const c * ELF object before processing. */ if (ecp->itf != ETF_ELF) { + /* + * If the output object is not an ELF file, choose an arbitrary + * ELF format for the intermediate file. srec, ihex and binary + * formats are independent of class, endianness and machine + * type so these choices do not affect the output. + */ + if (ecp->otf != ETF_ELF) { + if (ecp->oec == ELFCLASSNONE) + ecp->oec = ELFCLASS64; + if (ecp->oed == ELFDATANONE) + ecp->oed = ELFDATA2LSB; + } create_tempfile(&elftemp, &efd); if ((ecp->eout = elf_begin(efd, ELF_C_WRITE, NULL)) == NULL) errx(EXIT_FAILURE, "elf_begin() failed: %s", From owner-svn-src-head@freebsd.org Tue Feb 16 15:11:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EEEAAAD53 for ; Tue, 16 Feb 2016 15:11:15 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B895AE4 for ; Tue, 16 Feb 2016 15:11:15 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8e3460bf-d4bf-11e5-8de6-958346fd02ba X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 16 Feb 2016 15:11:29 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u1GFA4nV027192; Tue, 16 Feb 2016 08:10:05 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1455635404.12873.78.camel@freebsd.org> Subject: Re: svn commit: r295557 - head/sys/dev/uart From: Ian Lepore To: Bruce Evans Cc: Michal Meloun , src-committers@freebsd.org, Marius Strobl , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 16 Feb 2016 08:10:04 -0700 In-Reply-To: <20160216115639.T2000@besplex.bde.org> References: <201602120514.u1C5EwWt053622@repo.freebsd.org> <20160212164755.GC4980@alchemy.franken.de> <20160213041246.V1974@besplex.bde.org> <20160213005801.GF15359@alchemy.franken.de> <56C1BDE2.8090300@freebsd.org> <20160216080249.F1233@besplex.bde.org> <1455579466.12873.23.camel@freebsd.org> <20160216103914.F1693@besplex.bde.org> <1455582802.12873.49.camel@freebsd.org> <20160216115639.T2000@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 15:11:15 -0000 On Tue, 2016-02-16 at 12:46 +1100, Bruce Evans wrote: > On Mon, 15 Feb 2016, Ian Lepore wrote: > > > On Tue, 2016-02-16 at 11:01 +1100, Bruce Evans wrote: > >> On Mon, 15 Feb 2016, Ian Lepore wrote: > >> > >>> On Tue, 2016-02-16 at 09:28 +1100, Bruce Evans wrote: > >>>> On Mon, 15 Feb 2016, Michal Meloun wrote: > >>>> > >>>>> [...] > >>>>> Please note that ARM architecture does not have vectored interrupts, > >>>>> CPU must read actual interrupt source from external interrupt > >>>>> controller (GIC) register. This register contain predefined value if > >>>>> none of interrupts are active. > >>>>> > >>>>> 1 - CPU1: enters ns8250_bus_transmit() and sets IER_ETXRDY. > >>>>> 2 - HW: UART interrupt is asserted, processed by GIC and signaled > >>>>> to CPU2. > >>>>> 3 - CPU2: enters interrupt service. > >>>> > >>>> It is blocked by uart_lock(), right? > >>>> > >>>>> 4 - CPU1: writes character to into REG_DATA register. > >>>>> 5 - HW: UART clear its interrupt request > >>>>> 6 - CPU2: reads interrupt source register. No active interrupt is > >>>>> found, spurious interrupt is signaled, and CPU leaves interrupted > >>>>> state. > >>>>> 7 - CPU1: executes uart_barrier(). This function is not empty on ARM, > >>>>> and can be slow in some cases. > >>>> > >>>> It is not empty even on x86, although it probably should be. > >>>> > >>>> BTW, if arm needs the barrier, then how does it work with > >>>> bus_space_barrier() referenced in just 25 files in all of /sys/dev? > >>> > >>> With a hack, of course. In the arm interrupt-controller drivers we > >>> always call bus_space_barrier() right before doing an EOI. It's not a > >>> 100% solution, but in practice it seems to work pretty well. > >> > >> I thought about the x86 behaviour a bit more and now see that it does > >> need barriers but not the ones given by bus_space_barrier(). All (?) > >> interrupt handlers use mutexes (if not driver ones, then higher-level > >> ones). These might give stronger or different ordering than given by > >> bus_space_barrier(). On x86, they use the same memory bus lock as > >> the bus_space_barrier(). This is needed to give ordering across > >> CPUs. But for accessing a single device, you only need program order > >> for a single CPU. This is automatic on x86 provided a mutex is used > >> to prevent other CPUs accessing the same device. And if you don't use > >> a mutex, then bus_space_barrier() cannot give the necessary ordering > >> since if cannot prevent other CPUs interfering. > >> > >> So how does bus_space_barrier() before EOI make much difference? It > >> doesn't affect the order for a bunch of accesses on a single CPU. > >> It must do more than a mutex to do something good across CPUs. > >> Arguably, it is a bug in mutexes is they don't gives synchronization > >> for device memory. > >>> ... > >>> The hack code does a drain-write-buffer which doesn't g'tee that the > >>> slow peripheral write has made it all the way to the device, but it > >>> does at least g'tee that the write to the bus the perhiperal is on has > >>> been posted and ack'd by any bus<->bus bridge, and that seems to be > >>> good enough in practice. (If there were multiple bridged busses > >>> downstream it probably wouldn't be, but so far things aren't that > >>> complicated inside the socs we support.) > >> > >> Hmm, so there is some automatic strong ordering but mutexes don't > >> work for device memory? > > > > I guess you keep mentioning mutexes because on x86 their implementation > > uses some of the same instructions that are involved in bus_space > > barriers on x86? Otherwise I can't see what they have to do with > > anything related to the spurious interrupts that happen on arm. (You > > also mentioned multiple CPUs, which is not a requirement for this > > trouble on arm, it'll happen with a single core.) > > Partly. I wasn't worrying about this "spurious" interrupt but locking > in general. Now I don't see how mutexes can work unless they order > device accesses in exactly the same way as ordinary memory accesses. > Mutexes on arm are implemented with entirely different instructions, which do not cause any of this buffer draining or influence the ordering of surrouding accesses to non-mutex data. When a mutex is used to prevent concurrent hardware access between the interrupt and non-interrupt parts of a driver, or multiple cores accessing the hardware, a bus_space_barrier() is required after writing to the hardware and before releasing the mutex. Of course, such barriers don't exist in most drivers, especially ones not written for soc-specific hardware, and to the degree those drivers work, it's by accident. ::sigh:: There's no easy way to slip in a "mostly fixes all drivers" hack like the EOI hack, short of doing a barrier at the end of every bus_space access, and that's too expensive. > > The piece of info you're missing might be the fact that memory-mapped > > device registers on arm are mapped with the Device attribute which > > gives stronger ordering than Normal memory. In particular, writes are > > in order and not combined, but they are buffered. > > arm doesn't need the barrier after each output byte then, and in general > bus_space_write_multi_N() shouldn't need a barrier after each write, but > only it can reasonably know if it does, so any barrier(s) for it belong > in it and not in callers. > There is certainly no need for a barrier call after each byte is written into the fifo (on any hardware that I know of). A single barrier at the end of the loop should suffice. Hmmm, I wonder if that implies that another way to fix the original problem, one that would work with buggy hardware too, would be: enable interrupt barrier loop to fill the fifo barrier The first barrier would ensure the interrupt-enable reaches its register before any data gets to the fifo (probably not needed but safe and not-too-expensive). The second barrier should ensure that at least one byte has gotten to the TX register and that should result in de -asserting the TXRDY before control leaves the uart interrupt routines. > Drivers for arm could also do a bunch of unrelated writes (and reads?) > followed by a single barrier. But this is even more MD. > That's what virtually all soc-specific drivers should be doing on arm, but even that close to the metal, most of them don't. (I'm as guilty as anyone on that front -- some of this knowledge was acquired after drivers were written, and I haven't gone back and cleaned up.) > > In some designs > > there are multiple buffers, so there can be multiple writes that > > haven't reached the hardware yet. A read from the same region will > > stall until all writes to that region are done, and there is also an > > instruction that specifically forces out the buffers and stalls until > > they're empty. > > The multiple regions should be in separate bus spaces so that the barriers > can be optimized to 1 at the end. I now see how the optimization can > almost be done at the bus_space level -- drivers call > bus_space_maybe_barrier() after every access, but this is a no-op on bus > spaces with sufficient ordering iff the bus space hasn't changed; > drivers call bus_space_sync_barriers() at the end. I think the DMA sync > functions work a bit like this. A well-written interrupt handler would > have just 1 bus_space_sync_barriers() at the end. This works like the > EOI hack. If all arches have sufficiently strong ordering then > bus_space_maybe_barrier() is not needed but more careful syncing is > needed when switching the bus space. > There is a special place in my heart for any solution that includes a function with "maybe" in the name. Beyond that, I'm going to have to ponder this one. The part that sounds expensive at runtime is keeping track of which bus_space was last accessed so that barriers can be automatically inserted between writes to difference spaces. (Or semi-automatically if it's done only on a maybe_barrier, but the bookkeeping is the same.) > > Without doing the drain-write-buffer (or a device read) after each > > write, the only g'tee you'd get is that each device sees the writes > > directed at it in the order they were issued. With devices A and B, > > you could write a sequence of A1 B1 A2 B2 A3 B3 and they could arrive > > at the devices as A1 A2 B1 B2 A3 B3, or any other permutation, as long > > as device A sees 123 and device B sees 123. > > I think it is even more important that the order is synchronized relative > to memory for mutex locking. Mutex locking presumably doesn't issue > bus barriers because that would be too wasteful for the usual case. So > before almost every mutex unlock for a driver, there must be a > bus_space_sync_barriers() call and this must flush all the write buffers > for devices before all memory accesses for the mutex, so that the mutex > works as expected. But is this automatic on arm? Ordinary memory is > like a different bus space that has a different write buffer which might > be flushed in a different order. > Looks like what I wrote in my first paragraphs might have been more in context here. Ordinary memory is literally another bus here. > > So on arm the need for barriers arises primarily when two different > > devices interact with each other in some way and it matters that a > > series of interleaved writes reaches the devices in the same relative > > order they were issued by the cpu. That condition mostly comes up only > > in terms of the PIC interacting with basically every other device. > > The code under discussion seems to provide a good example of why you > need ordering relative to ordinary memory too. In the old version, > CPU2 is waiting for the unlock. If it sees this before the device > memory is flushed, then it might be confused. I guess if the device > memory is strongly ordered (but buffered) CPU2 would not see reads out > of order for the device memory, but it might see everything for device > memory out order relative to ordinary memory. However, the sprinkled > bs barriers order everything. > Yes, the bus_space_barrier that is done for the EOI hack is also a barrier for any preceeding ordinary memory accesses. But it usually happens right after a mutex has been released in an interrupt routine, so there's still that big dose of "works by accident". > > I expect trouble to show up any time now as we start implementing DMA > > drivers in socs that have generic DMA engines that are only loosely > > coupled to the devices they're moving data for. That just seems like > > another place where a single driver is coordinating the actions of two > > different pieces of hardware that may be on different busses, and it's > > ripe for the lack of barriers to cause rare or intermittant failures. > > I don't understand DMA syncs for most NICs either. They seem too simple > to work. Mutex locking isn't going to control the order of host DMA. > On arm, the cache sync operations for DMA all end with the same drain write buffer sequence used in the EOI hack. -- Ian From owner-svn-src-head@freebsd.org Tue Feb 16 15:18:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47165AAA089; Tue, 16 Feb 2016 15:18:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21F3DFA2; Tue, 16 Feb 2016 15:18:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GFIEr4041049; Tue, 16 Feb 2016 15:18:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GFIDqn041039; Tue, 16 Feb 2016 15:18:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602161518.u1GFIDqn041039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Feb 2016 15:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295662 - in head/sys: arm/arm arm64/arm64 dev/ofw dev/tsec dev/uart dev/vt/hw/ofwfb mips/mips powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 15:18:15 -0000 Author: andrew Date: Tue Feb 16 15:18:12 2016 New Revision: 295662 URL: https://svnweb.freebsd.org/changeset/base/295662 Log: Allow callers of OF_decode_addr to get the size of the found mapping. This will allow for code that uses the old fdt_get_range and fdt_regsize functions to find a range, map it, access, then unmap to replace this, up to and including the map, with a call to OF_decode_addr. As this function should only be used in the early boot code the unmap is mostly do document we no longer need the mapping as it's a no-op, at least on arm. Reviewed by: jhibbits Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5258 Modified: head/sys/arm/arm/ofw_machdep.c head/sys/arm64/arm64/ofw_machdep.c head/sys/dev/ofw/openfirm.h head/sys/dev/tsec/if_tsec_fdt.c head/sys/dev/uart/uart_cpu_fdt.c head/sys/dev/uart/uart_cpu_powerpc.c head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/mips/mips/ofw_machdep.c head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/arm/arm/ofw_machdep.c ============================================================================== --- head/sys/arm/arm/ofw_machdep.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/arm/arm/ofw_machdep.c Tue Feb 16 15:18:12 2016 (r295662) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, - bus_space_handle_t *handle) + bus_space_handle_t *handle, bus_size_t *sz) { bus_addr_t addr; bus_size_t size; @@ -66,6 +66,10 @@ OF_decode_addr(phandle_t dev, int regno, *tag = fdtbus_bs_tag; flags = 0; #endif + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } Modified: head/sys/arm64/arm64/ofw_machdep.c ============================================================================== --- head/sys/arm64/arm64/ofw_machdep.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/arm64/arm64/ofw_machdep.c Tue Feb 16 15:18:12 2016 (r295662) @@ -39,7 +39,7 @@ extern struct bus_space memmap_bus; int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, - bus_space_handle_t *handle) + bus_space_handle_t *handle, bus_size_t *sz) { bus_addr_t addr; bus_size_t size; @@ -50,5 +50,9 @@ OF_decode_addr(phandle_t dev, int regno, return (err); *tag = &memmap_bus; + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, 0, handle)); } Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/dev/ofw/openfirm.h Tue Feb 16 15:18:12 2016 (r295662) @@ -176,7 +176,7 @@ int OF_interpret(const char *cmd, int n */ #ifndef __sparc64__ int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *ptag, - bus_space_handle_t *phandle); + bus_space_handle_t *phandle, bus_size_t *sz); #endif #endif /* _KERNEL */ Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/dev/tsec/if_tsec_fdt.c Tue Feb 16 15:18:12 2016 (r295662) @@ -167,7 +167,7 @@ tsec_fdt_attach(device_t dev) } phy = OF_node_from_xref(phy); - OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh); + OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh, NULL); OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr)); /* Init timer */ Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 16 15:18:12 2016 (r295662) @@ -212,5 +212,5 @@ uart_cpu_getdev(int devtype, struct uart di->stopbits = 1; di->parity = UART_PARITY_NONE; - return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh)); + return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL)); } Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/dev/uart/uart_cpu_powerpc.c Tue Feb 16 15:18:12 2016 (r295662) @@ -180,7 +180,7 @@ uart_cpu_getdev(int devtype, struct uart if (class == NULL) return (ENXIO); - error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh); + error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh, NULL); if (error) return (error); Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Tue Feb 16 15:18:12 2016 (r295662) @@ -480,7 +480,8 @@ ofwfb_init(struct vt_device *vd) return (CN_DEAD); #if defined(__powerpc__) - OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase); + OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase, + NULL); sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */ #ifdef __powerpc64__ /* Real mode under a hypervisor probably doesn't cover FB */ Modified: head/sys/mips/mips/ofw_machdep.c ============================================================================== --- head/sys/mips/mips/ofw_machdep.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/mips/mips/ofw_machdep.c Tue Feb 16 15:18:12 2016 (r295662) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, - bus_space_handle_t *handle) + bus_space_handle_t *handle, bus_size_t *sz) { bus_addr_t addr; bus_size_t size; @@ -66,5 +66,9 @@ OF_decode_addr(phandle_t dev, int regno, *tag = fdtbus_bs_tag; flags = 0; #endif + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/powerpc/ofw/ofw_machdep.c Tue Feb 16 15:18:12 2016 (r295662) @@ -565,7 +565,7 @@ OF_getetheraddr(device_t dev, u_char *ad */ int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, - bus_space_handle_t *handle) + bus_space_handle_t *handle, bus_size_t *sz) { bus_addr_t addr; bus_size_t size; @@ -585,6 +585,9 @@ OF_decode_addr(phandle_t dev, int regno, BUS_SPACE_MAP_PREFETCHABLE: 0; } + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Feb 16 14:03:25 2016 (r295661) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Feb 16 15:18:12 2016 (r295662) @@ -342,7 +342,7 @@ ofwfb_configure(int flags) if (fb_phys == sc->sc_num_pciaddrs) return (0); - OF_decode_addr(node, fb_phys, &sc->sc_tag, &sc->sc_addr); + OF_decode_addr(node, fb_phys, &sc->sc_tag, &sc->sc_addr, NULL); } ofwfb_init(0, &sc->sc_va, 0); From owner-svn-src-head@freebsd.org Tue Feb 16 16:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD49FAA9784; Tue, 16 Feb 2016 16:07:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F1D8991; Tue, 16 Feb 2016 16:07:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GG7C0M056214; Tue, 16 Feb 2016 16:07:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GG7CDx056213; Tue, 16 Feb 2016 16:07:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602161607.u1GG7CDx056213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 16:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295663 - head/usr.sbin/amd/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 16:07:13 -0000 Author: bdrewery Date: Tue Feb 16 16:07:12 2016 New Revision: 295663 URL: https://svnweb.freebsd.org/changeset/base/295663 Log: Revert r295648 for now. This builds fine with FAST_DEPEND but the mkdep method requires that include/ generates the headers during 'make depend' so the subsequent directories can find them when running mkdep. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/amd/include/Makefile Modified: head/usr.sbin/amd/include/Makefile ============================================================================== --- head/usr.sbin/amd/include/Makefile Tue Feb 16 15:18:12 2016 (r295662) +++ head/usr.sbin/amd/include/Makefile Tue Feb 16 16:07:12 2016 (r295663) @@ -9,13 +9,13 @@ .include -HDRS= config_local.h +SRCS= config_local.h .if ${MK_NIS} == "no" -HDRS+= localconfig.h +SRCS+= localconfig.h .endif -CLEANFILES= ${HDRS} +CLEANFILES= ${SRCS} -all: ${HDRS} +all depend: ${SRCS} config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh @rm -f ${.TARGET} From owner-svn-src-head@freebsd.org Tue Feb 16 17:55:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63895AA953C; Tue, 16 Feb 2016 17:55:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16DDC1D93; Tue, 16 Feb 2016 17:55:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GHtBmD088514; Tue, 16 Feb 2016 17:55:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GHtA1B088512; Tue, 16 Feb 2016 17:55:10 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602161755.u1GHtA1B088512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Feb 2016 17:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295664 - in head/sys/dev: ata/chipsets pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 17:55:12 -0000 Author: jhibbits Date: Tue Feb 16 17:55:10 2016 New Revision: 295664 URL: https://svnweb.freebsd.org/changeset/base/295664 Log: Convert a few more long -> rman_res_t. Modified: head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Tue Feb 16 16:07:12 2016 (r295663) +++ head/sys/dev/ata/chipsets/ata-promise.c Tue Feb 16 17:55:10 2016 (r295664) @@ -191,7 +191,7 @@ ata_promise_probe(device_t dev) !BUS_READ_IVAR(device_get_parent(GRANDPARENT(dev)), GRANDPARENT(dev), PCI_IVAR_DEVID, &devid) && ((devid == ATA_DEC_21150) || (devid == ATA_DEC_21150_1))) { - static long start = 0, end = 0; + static rman_res_t start = 0, end = 0; if (pci_get_slot(dev) == 1) { bus_get_resource(dev, SYS_RES_IRQ, 0, &start, &end); Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Feb 16 16:07:12 2016 (r295663) +++ head/sys/dev/pci/pci_pci.c Tue Feb 16 17:55:10 2016 (r295664) @@ -388,7 +388,7 @@ pcib_alloc_window(struct pcib_softc *sc, char buf[64]; int error, rid; - if (max_address != (u_long)max_address) + if (max_address != (rman_res_t)max_address) max_address = ~0ul; w->rman.rm_start = 0; w->rman.rm_end = max_address; @@ -1247,14 +1247,14 @@ pcib_alloc_new_window(struct pcib_softc return (ENOSPC); } - wmask = (1ul << w->step) - 1; + wmask = ((rman_res_t)1 << w->step) - 1; if (RF_ALIGNMENT(flags) < w->step) { flags &= ~RF_ALIGNMENT_MASK; flags |= RF_ALIGNMENT_LOG2(w->step); } start &= ~wmask; end |= wmask; - count = roundup2(count, 1ul << w->step); + count = roundup2(count, (rman_res_t)1 << w->step); rid = w->reg; res = bus_alloc_resource(sc->dev, type, &rid, start, end, count, flags & ~RF_ACTIVE); @@ -1389,7 +1389,7 @@ pcib_grow_window(struct pcib_softc *sc, end = w->rman.rm_end; if (start + count - 1 > end || start + count < start) return (EINVAL); - wmask = (1ul << w->step) - 1; + wmask = ((rman_res_t)1 << w->step) - 1; /* * If there is no resource at all, just try to allocate enough @@ -1435,7 +1435,7 @@ pcib_grow_window(struct pcib_softc *sc, device_printf(sc->dev, "attempting to grow %s window for (%#lx-%#lx,%#lx)\n", w->name, start, end, count); - align = 1ul << RF_ALIGNMENT(flags); + align = (rman_res_t)1 << RF_ALIGNMENT(flags); if (start < w->base) { if (rman_first_free_region(&w->rman, &start_free, &end_free) != 0 || start_free != w->base) From owner-svn-src-head@freebsd.org Tue Feb 16 19:00:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01BCCAAA369; Tue, 16 Feb 2016 19:00:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C92A71182; Tue, 16 Feb 2016 19:00:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GJ0MaI006831; Tue, 16 Feb 2016 19:00:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GJ0MkP006830; Tue, 16 Feb 2016 19:00:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602161900.u1GJ0MkP006830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 19:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295665 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 19:00:24 -0000 Author: bdrewery Date: Tue Feb 16 19:00:22 2016 New Revision: 295665 URL: https://svnweb.freebsd.org/changeset/base/295665 Log: Remove temporary hack from r294370 for SSH upgrades. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Feb 16 17:55:10 2016 (r295664) +++ head/share/mk/bsd.dep.mk Tue Feb 16 19:00:22 2016 (r295665) @@ -205,14 +205,6 @@ depend: beforedepend ${DEPENDFILE} after # This could be simpler with bmake :tW but needs to support fmake for MFC. _CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} _CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} -# XXX: Temporary hack to workaround .depend files not tracking -include -_hdrincludes=${_CFLAGS_INCLUDES:M*.h} ${_CXXFLAGS_INCLUDES:M*.h} -.for _hdr in ${_hdrincludes:O:u} -.if exists(${_hdr}) -${OBJS} ${POBJS} ${SOBJS}: ${_hdr} -.endif -.endfor -.undef _hdrincludes # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. From owner-svn-src-head@freebsd.org Tue Feb 16 19:02:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20447AAA56F; Tue, 16 Feb 2016 19:02:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4E851583; Tue, 16 Feb 2016 19:02:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GJ24gv009479; Tue, 16 Feb 2016 19:02:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GJ24Na009478; Tue, 16 Feb 2016 19:02:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602161902.u1GJ24Na009478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 19:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295666 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 19:02:06 -0000 Author: bdrewery Date: Tue Feb 16 19:02:04 2016 New Revision: 295666 URL: https://svnweb.freebsd.org/changeset/base/295666 Log: Always remove .depend.* regardless of WITH_FAST_DEPEND in case of changing which is used. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Feb 16 19:00:22 2016 (r295665) +++ head/share/mk/bsd.dep.mk Tue Feb 16 19:02:04 2016 (r295666) @@ -59,7 +59,7 @@ DEPENDFILE?= .depend .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} .endif -DEPENDFILES= ${DEPENDFILE} +DEPENDFILES= ${DEPENDFILE} ${DEPENDFILE}.* # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -156,7 +156,6 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$/ .if ${MK_FAST_DEPEND} == "yes" && \ (${.MAKE.MODE:Mmeta} == "" || ${.MAKE.MODE:Mnofilemon} != "") -DEPENDFILES+= ${DEPENDFILE}.* DEPEND_MP?= -MP # Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to # avoid collisions. From owner-svn-src-head@freebsd.org Tue Feb 16 19:11:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C28E7AAA96F; Tue, 16 Feb 2016 19:11:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74D2F1E79; Tue, 16 Feb 2016 19:11:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GJBHMl009859; Tue, 16 Feb 2016 19:11:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GJBHDf009858; Tue, 16 Feb 2016 19:11:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602161911.u1GJBHDf009858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 19:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295667 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 19:11:18 -0000 Author: bdrewery Date: Tue Feb 16 19:11:17 2016 New Revision: 295667 URL: https://svnweb.freebsd.org/changeset/base/295667 Log: Add CLEANDEPEND[FILES|DIRS] and simplify the tags cleanup to use it. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Feb 16 19:02:04 2016 (r295666) +++ head/share/mk/bsd.dep.mk Tue Feb 16 19:11:17 2016 (r295667) @@ -5,6 +5,11 @@ # # +++ variables +++ # +# CLEANDEPENDDIRS Additional directories to remove for the cleandepend +# target. +# +# CLEANDEPENDFILES Additional files to remove for the cleandepend target. +# # CTAGS A tags file generation program [gtags] # # CTAGSFLAGS Options for ctags(1) [not set] @@ -27,7 +32,8 @@ # +++ targets +++ # # cleandepend: -# Remove depend and tags file +# remove ${CLEANDEPENDFILES}; remove ${CLEANDEPENDDIRS} and all +# contents. # # depend: # Make the dependencies for the source files, and store @@ -59,7 +65,7 @@ DEPENDFILE?= .depend .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} .endif -DEPENDFILES= ${DEPENDFILE} ${DEPENDFILE}.* +CLEANDEPENDFILES= ${DEPENDFILE} ${DEPENDFILE}.* # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -252,16 +258,20 @@ afterdepend: .endif .endif -.if !target(cleandepend) -cleandepend: -.if defined(SRCS) .if ${CTAGS:T} == "gtags" - rm -f ${DEPENDFILES} GPATH GRTAGS GSYMS GTAGS +CLEANDEPENDFILES+= GPATH GRTAGS GSYMS GTAGS .if defined(HTML) - rm -rf HTML +CLEANDEPENDDIRS+= HTML .endif .else - rm -f ${DEPENDFILES} tags +CLEANDEPENDFILES+= tags +.endif +.if !target(cleandepend) +cleandepend: +.if defined(SRCS) + rm -f ${CLEANDEPENDFILES} +.if !empty(CLEANDEPENDDIRS) + rm -rf ${CLEANDEPENDDIRS} .endif .endif .endif From owner-svn-src-head@freebsd.org Tue Feb 16 19:36:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B45BAAB485; Tue, 16 Feb 2016 19:36:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D0B71240; Tue, 16 Feb 2016 19:36:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GJaQni018595; Tue, 16 Feb 2016 19:36:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GJaPf2018590; Tue, 16 Feb 2016 19:36:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602161936.u1GJaPf2018590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Feb 2016 19:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295668 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 19:36:27 -0000 Author: tuexen Date: Tue Feb 16 19:36:25 2016 New Revision: 295668 URL: https://svnweb.freebsd.org/changeset/base/295668 Log: Improve the teardown of the SCTP stack. Obtained from: bz@ MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue Feb 16 19:11:17 2016 (r295667) +++ head/sys/netinet/sctp_asconf.c Tue Feb 16 19:36:25 2016 (r295668) @@ -3248,6 +3248,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * } else { struct sctp_asconf_iterator *asc; struct sctp_laddr *wi; + int ret; SCTP_MALLOC(asc, struct sctp_asconf_iterator *, sizeof(struct sctp_asconf_iterator), @@ -3269,7 +3270,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * wi->action = type; atomic_add_int(&ifa->refcount, 1); LIST_INSERT_HEAD(&asc->list_of_work, wi, sctp_nxt_addr); - (void)sctp_initiate_iterator(sctp_asconf_iterator_ep, + ret = sctp_initiate_iterator(sctp_asconf_iterator_ep, sctp_asconf_iterator_stcb, sctp_asconf_iterator_ep_end, SCTP_PCB_ANY_FLAGS, @@ -3277,6 +3278,12 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * SCTP_ASOC_ANY_STATE, (void *)asc, 0, sctp_asconf_iterator_end, inp, 0); + if (ret) { + SCTP_PRINTF("Failed to initiate iterator for addr_mgmt_ep_sa\n"); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EFAULT); + sctp_asconf_iterator_end(asc, 0); + return (EFAULT); + } } return (0); } else { Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Tue Feb 16 19:11:17 2016 (r295667) +++ head/sys/netinet/sctp_bsd_addr.c Tue Feb 16 19:36:25 2016 (r295668) @@ -293,6 +293,10 @@ sctp_addr_change(struct ifaddr *ifa, int { uint32_t ifa_flags = 0; + if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { + return; + } + /* * BSD only has one VRF, if this changes we will need to hook in the * right things here to get the id to pass to the address managment Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Feb 16 19:11:17 2016 (r295667) +++ head/sys/netinet/sctp_pcb.c Tue Feb 16 19:36:25 2016 (r295668) @@ -2781,8 +2781,45 @@ sctp_move_pcb_and_assoc(struct sctp_inpc SCTP_INP_WUNLOCK(old_inp); } +/* + * insert an laddr entry with the given ifa for the desired list + */ +static int +sctp_insert_laddr(struct sctpladdr *list, struct sctp_ifa *ifa, uint32_t act) +{ + struct sctp_laddr *laddr; + laddr = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr); + if (laddr == NULL) { + /* out of memory? */ + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); + return (EINVAL); + } + SCTP_INCR_LADDR_COUNT(); + bzero(laddr, sizeof(*laddr)); + (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); + laddr->ifa = ifa; + laddr->action = act; + atomic_add_int(&ifa->refcount, 1); + /* insert it */ + LIST_INSERT_HEAD(list, laddr, sctp_nxt_addr); + return (0); +} + +/* + * Remove an laddr entry from the local address list (on an assoc) + */ +static void +sctp_remove_laddr(struct sctp_laddr *laddr) +{ + + /* remove from the list */ + LIST_REMOVE(laddr, sctp_nxt_addr); + sctp_free_ifa(laddr->ifa); + SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), laddr); + SCTP_DECR_LADDR_COUNT(); +} /* sctp_ifap is used to bypass normal local address validation checks */ int @@ -5509,46 +5546,6 @@ sctp_add_local_addr_restricted(struct sc } /* - * insert an laddr entry with the given ifa for the desired list - */ -int -sctp_insert_laddr(struct sctpladdr *list, struct sctp_ifa *ifa, uint32_t act) -{ - struct sctp_laddr *laddr; - - laddr = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr); - if (laddr == NULL) { - /* out of memory? */ - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); - } - SCTP_INCR_LADDR_COUNT(); - bzero(laddr, sizeof(*laddr)); - (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); - laddr->ifa = ifa; - laddr->action = act; - atomic_add_int(&ifa->refcount, 1); - /* insert it */ - LIST_INSERT_HEAD(list, laddr, sctp_nxt_addr); - - return (0); -} - -/* - * Remove an laddr entry from the local address list (on an assoc) - */ -void -sctp_remove_laddr(struct sctp_laddr *laddr) -{ - - /* remove from the list */ - LIST_REMOVE(laddr, sctp_nxt_addr); - sctp_free_ifa(laddr->ifa); - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), laddr); - SCTP_DECR_LADDR_COUNT(); -} - -/* * Remove a local address from the TCB local address restricted list */ void @@ -5918,12 +5915,33 @@ sctp_pcb_finish(void) int i; struct sctp_iterator *it, *nit; + if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { + SCTP_PRINTF("%s: race condition on teardown.\n", __func__); + return; + } + SCTP_BASE_VAR(sctp_pcb_initialized) = 0; + /* * In FreeBSD the iterator thread never exits but we do clean up. * The only way FreeBSD reaches here is if we have VRF's but we * still add the ifdef to make it compile on old versions. */ +retry: SCTP_IPI_ITERATOR_WQ_LOCK(); + /* + * sctp_iterator_worker() might be working on an it entry without + * holding the lock. We won't find it on the list either and + * continue and free/destroy it. While holding the lock, spin, to + * avoid the race condition as sctp_iterator_worker() will have to + * wait to re-aquire the lock. + */ + if (sctp_it_ctl.iterator_running != 0 || sctp_it_ctl.cur_it != NULL) { + SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_PRINTF("%s: Iterator running while we held the lock. Retry. " + "cur_it=%p\n", __func__, sctp_it_ctl.cur_it); + DELAY(10); + goto retry; + } TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { if (it->vn != curvnet) { continue; @@ -5941,7 +5959,7 @@ sctp_pcb_finish(void) sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; } SCTP_ITERATOR_UNLOCK(); - SCTP_OS_TIMER_STOP(&SCTP_BASE_INFO(addr_wq_timer.timer)); + SCTP_OS_TIMER_STOP_DRAIN(&SCTP_BASE_INFO(addr_wq_timer.timer)); SCTP_WQ_ADDR_LOCK(); LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); @@ -6008,6 +6026,14 @@ sctp_pcb_finish(void) SCTP_WQ_ADDR_DESTROY(); + /* Get rid of other stuff too. */ + if (SCTP_BASE_INFO(sctp_asochash) != NULL) + SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_asochash), SCTP_BASE_INFO(hashasocmark)); + if (SCTP_BASE_INFO(sctp_ephash) != NULL) + SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_ephash), SCTP_BASE_INFO(hashmark)); + if (SCTP_BASE_INFO(sctp_tcpephash) != NULL) + SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_tcpephash), SCTP_BASE_INFO(hashtcpmark)); + SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_ep)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asoc)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_laddr)); @@ -6017,13 +6043,7 @@ sctp_pcb_finish(void) SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_strmoq)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf_ack)); - /* Get rid of other stuff to */ - if (SCTP_BASE_INFO(sctp_asochash) != NULL) - SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_asochash), SCTP_BASE_INFO(hashasocmark)); - if (SCTP_BASE_INFO(sctp_ephash) != NULL) - SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_ephash), SCTP_BASE_INFO(hashmark)); - if (SCTP_BASE_INFO(sctp_tcpephash) != NULL) - SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_tcpephash), SCTP_BASE_INFO(hashtcpmark)); + #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE); #endif @@ -6987,6 +7007,11 @@ sctp_initiate_iterator(inp_func inpf, if (af == NULL) { return (-1); } + if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { + SCTP_PRINTF("%s: abort on initialize being %d\n", __func__, + SCTP_BASE_VAR(sctp_pcb_initialized)); + return (-1); + } SCTP_MALLOC(it, struct sctp_iterator *, sizeof(struct sctp_iterator), SCTP_M_ITER); if (it == NULL) { @@ -7025,6 +7050,13 @@ sctp_initiate_iterator(inp_func inpf, } SCTP_IPI_ITERATOR_WQ_LOCK(); + if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { + SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_PRINTF("%s: rollback on initialize being %d it=%p\n", __func__, + SCTP_BASE_VAR(sctp_pcb_initialized), it); + SCTP_FREE(it, SCTP_M_ITER); + return (-1); + } TAILQ_INSERT_TAIL(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); if (sctp_it_ctl.iterator_running == 0) { Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Tue Feb 16 19:11:17 2016 (r295667) +++ head/sys/netinet/sctp_pcb.h Tue Feb 16 19:36:25 2016 (r295668) @@ -598,10 +598,6 @@ void void sctp_add_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *, uint32_t); -int sctp_insert_laddr(struct sctpladdr *, struct sctp_ifa *, uint32_t); - -void sctp_remove_laddr(struct sctp_laddr *); - void sctp_del_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *); int sctp_add_remote_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets **, int, int); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Feb 16 19:11:17 2016 (r295667) +++ head/sys/netinet/sctputil.c Tue Feb 16 19:36:25 2016 (r295668) @@ -1470,7 +1470,9 @@ sctp_handle_addr_wq(void) if (asc->cnt == 0) { SCTP_FREE(asc, SCTP_M_ASC_IT); } else { - (void)sctp_initiate_iterator(sctp_asconf_iterator_ep, + int ret; + + ret = sctp_initiate_iterator(sctp_asconf_iterator_ep, sctp_asconf_iterator_stcb, NULL, /* No ep end for boundall */ SCTP_PCB_FLAGS_BOUNDALL, @@ -1478,6 +1480,20 @@ sctp_handle_addr_wq(void) SCTP_ASOC_ANY_STATE, (void *)asc, 0, sctp_asconf_iterator_end, NULL, 0); + if (ret) { + SCTP_PRINTF("Failed to initiate iterator for handle_addr_wq\n"); + /* Freeing if we are stopping or put back on the addr_wq. */ + if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { + sctp_asconf_iterator_end(asc, 0); + } else { + SCTP_WQ_ADDR_LOCK(); + LIST_FOREACH(wi, &asc->list_of_work, sctp_nxt_addr) { + LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); + } + SCTP_WQ_ADDR_UNLOCK(); + SCTP_FREE(asc, SCTP_M_ASC_IT); + } + } } } From owner-svn-src-head@freebsd.org Tue Feb 16 20:33:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 905D7AAA9FA; Tue, 16 Feb 2016 20:33:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6917D1E80; Tue, 16 Feb 2016 20:33:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GKXJ99036248; Tue, 16 Feb 2016 20:33:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GKXJhS036244; Tue, 16 Feb 2016 20:33:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602162033.u1GKXJhS036244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Feb 2016 20:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295670 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 20:33:20 -0000 Author: tuexen Date: Tue Feb 16 20:33:18 2016 New Revision: 295670 URL: https://svnweb.freebsd.org/changeset/base/295670 Log: Whitespace changes. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue Feb 16 20:11:00 2016 (r295669) +++ head/sys/netinet/sctp_asconf.c Tue Feb 16 20:33:18 2016 (r295670) @@ -3278,7 +3278,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * SCTP_ASOC_ANY_STATE, (void *)asc, 0, sctp_asconf_iterator_end, inp, 0); - if (ret) { + if (ret) { SCTP_PRINTF("Failed to initiate iterator for addr_mgmt_ep_sa\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EFAULT); sctp_asconf_iterator_end(asc, 0); Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Tue Feb 16 20:11:00 2016 (r295669) +++ head/sys/netinet/sctp_bsd_addr.c Tue Feb 16 20:33:18 2016 (r295670) @@ -296,7 +296,6 @@ sctp_addr_change(struct ifaddr *ifa, int if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { return; } - /* * BSD only has one VRF, if this changes we will need to hook in the * right things here to get the id to pass to the address managment Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Feb 16 20:11:00 2016 (r295669) +++ head/sys/netinet/sctp_pcb.c Tue Feb 16 20:33:18 2016 (r295670) @@ -2821,6 +2821,8 @@ sctp_remove_laddr(struct sctp_laddr *lad SCTP_DECR_LADDR_COUNT(); } + + /* sctp_ifap is used to bypass normal local address validation checks */ int sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, @@ -5920,7 +5922,6 @@ sctp_pcb_finish(void) return; } SCTP_BASE_VAR(sctp_pcb_initialized) = 0; - /* * In FreeBSD the iterator thread never exits but we do clean up. * The only way FreeBSD reaches here is if we have VRF's but we @@ -6043,7 +6044,6 @@ retry: SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_strmoq)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf)); SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf_ack)); - #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE); #endif @@ -7057,7 +7057,6 @@ sctp_initiate_iterator(inp_func inpf, SCTP_FREE(it, SCTP_M_ITER); return (-1); } - TAILQ_INSERT_TAIL(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); if (sctp_it_ctl.iterator_running == 0) { sctp_wakeup_iterator(); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Feb 16 20:11:00 2016 (r295669) +++ head/sys/netinet/sctputil.c Tue Feb 16 20:33:18 2016 (r295670) @@ -1482,7 +1482,10 @@ sctp_handle_addr_wq(void) sctp_asconf_iterator_end, NULL, 0); if (ret) { SCTP_PRINTF("Failed to initiate iterator for handle_addr_wq\n"); - /* Freeing if we are stopping or put back on the addr_wq. */ + /* + * Freeing if we are stopping or put back on the + * addr_wq. + */ if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { sctp_asconf_iterator_end(asc, 0); } else { From owner-svn-src-head@freebsd.org Tue Feb 16 20:59:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6FCAAB690; Tue, 16 Feb 2016 20:59:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6F01DAF; Tue, 16 Feb 2016 20:59:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GKxnMw042416; Tue, 16 Feb 2016 20:59:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GKxnZS042415; Tue, 16 Feb 2016 20:59:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602162059.u1GKxnZS042415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Feb 2016 20:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295671 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 20:59:50 -0000 Author: pfg Date: Tue Feb 16 20:59:49 2016 New Revision: 295671 URL: https://svnweb.freebsd.org/changeset/base/295671 Log: cron: use (char *)NULL instead of (char *)0 in execle. Obtained from: OpenBSD (CVS Rev 1.25) Modified: head/usr.sbin/cron/cron/do_command.c Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Tue Feb 16 20:33:18 2016 (r295670) +++ head/usr.sbin/cron/cron/do_command.c Tue Feb 16 20:59:49 2016 (r295671) @@ -337,8 +337,9 @@ child_process(e, u) _exit(OK_EXIT); } # endif /*DEBUGGING*/ - execle(shell, shell, "-c", e->cmd, (char *)0, e->envp); - warn("execl: couldn't exec `%s'", shell); + execle(shell, shell, "-c", e->cmd, (char *)NULL, + e->envp); + warn("execle: couldn't exec `%s'", shell); _exit(ERROR_EXIT); } break; From owner-svn-src-head@freebsd.org Tue Feb 16 21:19:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DC3AAABCDD; Tue, 16 Feb 2016 21:19:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1250D95A; Tue, 16 Feb 2016 21:19:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GLJeBd048021; Tue, 16 Feb 2016 21:19:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GLJe9i048020; Tue, 16 Feb 2016 21:19:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602162119.u1GLJe9i048020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Feb 2016 21:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295672 - head/usr.sbin/cron/crontab X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 21:19:41 -0000 Author: pfg Date: Tue Feb 16 21:19:39 2016 New Revision: 295672 URL: https://svnweb.freebsd.org/changeset/base/295672 Log: crontab: ftruncate() with ftello() instead of ftell(). Obtained from: OpenBSD (CVS rev. 1.47) Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Tue Feb 16 20:59:49 2016 (r295671) +++ head/usr.sbin/cron/crontab/crontab.c Tue Feb 16 21:19:39 2016 (r295672) @@ -532,7 +532,7 @@ replace_cmd() { Set_LineNum(1) while (EOF != (ch = get_char(NewCrontab))) putc(ch, tmp); - ftruncate(fileno(tmp), ftell(tmp)); + ftruncate(fileno(tmp), ftello(tmp)); fflush(tmp); rewind(tmp); if (ferror(tmp)) { From owner-svn-src-head@freebsd.org Tue Feb 16 21:30:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B95BAAA9242; Tue, 16 Feb 2016 21:30:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75BFF1070; Tue, 16 Feb 2016 21:30:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GLUtoa051021; Tue, 16 Feb 2016 21:30:55 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GLUtqB051020; Tue, 16 Feb 2016 21:30:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602162130.u1GLUtqB051020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Feb 2016 21:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295673 - head/sys/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 21:30:56 -0000 Author: jhibbits Date: Tue Feb 16 21:30:55 2016 New Revision: 295673 URL: https://svnweb.freebsd.org/changeset/base/295673 Log: Another conversion u_long -> rman_res_t Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Tue Feb 16 21:19:39 2016 (r295672) +++ head/sys/powerpc/ps3/ps3bus.c Tue Feb 16 21:30:55 2016 (r295673) @@ -58,8 +58,8 @@ static int ps3bus_print_child(device_t d static int ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result); static struct resource *ps3bus_alloc_resource(device_t bus, device_t child, - int type, int *rid, u_long start, u_long end, - u_long count, u_int flags); + int type, int *rid, rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); static int ps3bus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res); static bus_dma_tag_t ps3bus_get_dma_tag(device_t dev, device_t child); @@ -523,14 +523,14 @@ ps3bus_read_ivar(device_t bus, device_t static struct resource * ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ps3bus_devinfo *dinfo; struct ps3bus_softc *sc; int needactivate; struct resource *rv; struct rman *rm; - u_long adjstart, adjend, adjcount; + rman_res_t adjstart, adjend, adjcount; struct resource_list_entry *rle; sc = device_get_softc(bus); @@ -628,7 +628,7 @@ ps3bus_activate_resource(device_t bus, d return (ENOMEM); rman_set_virtual(res, p); rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, (u_long)p); + rman_set_bushandle(res, (rman_res_t)p); } return (rman_activate_resource(res)); From owner-svn-src-head@freebsd.org Tue Feb 16 21:39:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D1FAA9719; Tue, 16 Feb 2016 21:39:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7E58182D; Tue, 16 Feb 2016 21:39:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GLdJbN053992; Tue, 16 Feb 2016 21:39:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GLdJnQ053991; Tue, 16 Feb 2016 21:39:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602162139.u1GLdJnQ053991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Feb 2016 21:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295675 - head/usr.bin/mail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 21:39:21 -0000 Author: pfg Date: Tue Feb 16 21:39:19 2016 New Revision: 295675 URL: https://svnweb.freebsd.org/changeset/base/295675 Log: Fix naive use of ftell(3). Secure coding practices, FIO19-C. Modified: head/usr.bin/mail/def.h Modified: head/usr.bin/mail/def.h ============================================================================== --- head/usr.bin/mail/def.h Tue Feb 16 21:36:48 2016 (r295674) +++ head/usr.bin/mail/def.h Tue Feb 16 21:39:19 2016 (r295675) @@ -270,5 +270,5 @@ struct ignoretab { */ #define trunc(stream) { \ (void)fflush(stream); \ - (void)ftruncate(fileno(stream), (off_t)ftell(stream)); \ + (void)ftruncate(fileno(stream), ftello(stream)); \ } From owner-svn-src-head@freebsd.org Tue Feb 16 21:42:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06BDCAA9ADF; Tue, 16 Feb 2016 21:42:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D30581CE5; Tue, 16 Feb 2016 21:42:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GLgrgU056495; Tue, 16 Feb 2016 21:42:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GLgrQs056493; Tue, 16 Feb 2016 21:42:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602162142.u1GLgrQs056493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Feb 2016 21:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295676 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 21:42:55 -0000 Author: jhb Date: Tue Feb 16 21:42:53 2016 New Revision: 295676 URL: https://svnweb.freebsd.org/changeset/base/295676 Log: The locking annotations for struct sockbuf originally used the key from struct socket. When sockbuf.h was moved out of socketvar.h, the locking key was no longer nearby. Instead, add a new key for sockbuf and use a single item for the socket buffer lock instead of separate entries for receive vs send buffers. Reviewed by: adrian Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4901 Modified: head/sys/sys/sockbuf.h head/sys/sys/socketvar.h Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Tue Feb 16 21:39:19 2016 (r295675) +++ head/sys/sys/sockbuf.h Tue Feb 16 21:42:53 2016 (r295676) @@ -77,33 +77,36 @@ struct xsockbuf { /* * Variables for socket buffering. + * + * Locking key to struct sockbuf: + * (a) locked by SOCKBUF_LOCK(). */ struct sockbuf { struct selinfo sb_sel; /* process selecting read/write */ struct mtx sb_mtx; /* sockbuf lock */ struct sx sb_sx; /* prevent I/O interlacing */ - short sb_state; /* (c/d) socket state on sockbuf */ + short sb_state; /* (a) socket state on sockbuf */ #define sb_startzero sb_mb - struct mbuf *sb_mb; /* (c/d) the mbuf chain */ - struct mbuf *sb_mbtail; /* (c/d) the last mbuf in the chain */ - struct mbuf *sb_lastrecord; /* (c/d) first mbuf of last + struct mbuf *sb_mb; /* (a) the mbuf chain */ + struct mbuf *sb_mbtail; /* (a) the last mbuf in the chain */ + struct mbuf *sb_lastrecord; /* (a) first mbuf of last * record in socket buffer */ - struct mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */ - struct mbuf *sb_fnrdy; /* (c/d) pointer to first not ready buffer */ - u_int sb_sndptroff; /* (c/d) byte offset of ptr into chain */ - u_int sb_acc; /* (c/d) available chars in buffer */ - u_int sb_ccc; /* (c/d) claimed chars in buffer */ - u_int sb_hiwat; /* (c/d) max actual char count */ - u_int sb_mbcnt; /* (c/d) chars of mbufs used */ - u_int sb_mcnt; /* (c/d) number of mbufs in buffer */ - u_int sb_ccnt; /* (c/d) number of clusters in buffer */ - u_int sb_mbmax; /* (c/d) max chars of mbufs to use */ - u_int sb_ctl; /* (c/d) non-data chars in buffer */ - int sb_lowat; /* (c/d) low water mark */ - sbintime_t sb_timeo; /* (c/d) timeout for read/write */ - short sb_flags; /* (c/d) flags, see below */ - int (*sb_upcall)(struct socket *, void *, int); /* (c/d) */ - void *sb_upcallarg; /* (c/d) */ + struct mbuf *sb_sndptr; /* (a) pointer into mbuf chain */ + struct mbuf *sb_fnrdy; /* (a) pointer to first not ready buffer */ + u_int sb_sndptroff; /* (a) byte offset of ptr into chain */ + u_int sb_acc; /* (a) available chars in buffer */ + u_int sb_ccc; /* (a) claimed chars in buffer */ + u_int sb_hiwat; /* (a) max actual char count */ + u_int sb_mbcnt; /* (a) chars of mbufs used */ + u_int sb_mcnt; /* (a) number of mbufs in buffer */ + u_int sb_ccnt; /* (a) number of clusters in buffer */ + u_int sb_mbmax; /* (a) max chars of mbufs to use */ + u_int sb_ctl; /* (a) non-data chars in buffer */ + int sb_lowat; /* (a) low water mark */ + sbintime_t sb_timeo; /* (a) timeout for read/write */ + short sb_flags; /* (a) flags, see below */ + int (*sb_upcall)(struct socket *, void *, int); /* (a) */ + void *sb_upcallarg; /* (a) */ }; #ifdef _KERNEL Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Tue Feb 16 21:39:19 2016 (r295675) +++ head/sys/sys/socketvar.h Tue Feb 16 21:42:53 2016 (r295676) @@ -64,7 +64,6 @@ struct socket; * (a) constant after allocation, no locking required. * (b) locked by SOCK_LOCK(so). * (c) locked by SOCKBUF_LOCK(&so->so_rcv). - * (d) locked by SOCKBUF_LOCK(&so->so_snd). * (e) locked by ACCEPT_LOCK(). * (f) not locked since integer reads/writes are atomic. * (g) used only as a sleep/wakeup address, no value. From owner-svn-src-head@freebsd.org Tue Feb 16 22:00:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88FB9AAA0DC; Tue, 16 Feb 2016 22:00:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9116DC; Tue, 16 Feb 2016 22:00:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GM020A059699; Tue, 16 Feb 2016 22:00:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GM02xI059696; Tue, 16 Feb 2016 22:00:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602162200.u1GM02xI059696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Feb 2016 22:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295677 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 22:00:03 -0000 Author: jhb Date: Tue Feb 16 22:00:01 2016 New Revision: 295677 URL: https://svnweb.freebsd.org/changeset/base/295677 Log: Fetch the current thread and it's syscall state from the trussinfo object instead of passing some of that state as arguments to print_syscall() and print_syscallret(). This just makes the calls of these functions shorter and easier to read. Modified: head/usr.bin/truss/setup.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Feb 16 21:42:53 2016 (r295676) +++ head/usr.bin/truss/setup.c Tue Feb 16 22:00:01 2016 (r295677) @@ -422,8 +422,7 @@ exit_syscall(struct trussinfo *info, str } } - print_syscall_ret(info, t->cs.name, t->cs.nargs, t->cs.s_args, - errorp, retval, sc); + print_syscall_ret(info, errorp, retval); free_syscall(t); /* Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Tue Feb 16 21:42:53 2016 (r295676) +++ head/usr.bin/truss/syscall.h Tue Feb 16 22:00:01 2016 (r295677) @@ -118,7 +118,6 @@ struct linux_socketcall_args { }; void init_syscalls(void); -void print_syscall(struct trussinfo *, const char *, int, char **); -void print_syscall_ret(struct trussinfo *, const char *, int, char **, int, - long *, struct syscall *); +void print_syscall(struct trussinfo *); +void print_syscall_ret(struct trussinfo *, int, long *); void print_summary(struct trussinfo *trussinfo); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Feb 16 21:42:53 2016 (r295676) +++ head/usr.bin/truss/syscalls.c Tue Feb 16 22:00:01 2016 (r295677) @@ -2000,37 +2000,39 @@ print_arg(struct syscall_args *sc, unsig } /* - * Print (to outfile) the system call and its arguments. Note that - * nargs is the number of arguments (not the number of words; this is - * potentially confusing, I know). + * Print (to outfile) the system call and its arguments. */ void -print_syscall(struct trussinfo *trussinfo, const char *name, int nargs, - char **s_args) +print_syscall(struct trussinfo *trussinfo) { struct timespec timediff; - int i, len; + struct threadinfo *t; + const char *name; + char **s_args; + int i, len, nargs; len = 0; + t = trussinfo->curthread; if (trussinfo->flags & FOLLOWFORKS) len += fprintf(trussinfo->outfile, "%5d: ", - trussinfo->curthread->proc->pid); + t->proc->pid); + name = t->cs.name; + nargs = t->cs.nargs; + s_args = t->cs.s_args; if (name != NULL && (strcmp(name, "execve") == 0 || strcmp(name, "exit") == 0)) { - clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); + clock_gettime(CLOCK_REALTIME, &t->after); } if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, - &trussinfo->start_time, &timediff); + timespecsubt(&t->after, &trussinfo->start_time, &timediff); len += fprintf(trussinfo->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, - &trussinfo->curthread->before, &timediff); + timespecsubt(&t->after, &t->before, &timediff); len += fprintf(trussinfo->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, timediff.tv_nsec); } @@ -2038,7 +2040,7 @@ print_syscall(struct trussinfo *trussinf len += fprintf(trussinfo->outfile, "%s(", name); for (i = 0; i < nargs; i++) { - if (s_args[i]) + if (s_args[i] != NULL) len += fprintf(trussinfo->outfile, "%s", s_args[i]); else len += fprintf(trussinfo->outfile, @@ -2052,15 +2054,18 @@ print_syscall(struct trussinfo *trussinf } void -print_syscall_ret(struct trussinfo *trussinfo, const char *name, int nargs, - char **s_args, int errorp, long *retval, struct syscall *sc) +print_syscall_ret(struct trussinfo *trussinfo, int errorp, long *retval) { struct timespec timediff; + struct threadinfo *t; + struct syscall *sc; + int error; + t = trussinfo->curthread; + sc = t->cs.sc; if (trussinfo->flags & COUNTONLY) { - clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); - timespecsubt(&trussinfo->curthread->after, - &trussinfo->curthread->before, &timediff); + clock_gettime(CLOCK_REALTIME, &t->after); + timespecsubt(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; if (errorp) @@ -2068,7 +2073,7 @@ print_syscall_ret(struct trussinfo *trus return; } - print_syscall(trussinfo, name, nargs, s_args); + print_syscall(trussinfo); fflush(trussinfo->outfile); if (errorp) fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0], From owner-svn-src-head@freebsd.org Tue Feb 16 22:13:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4145EAAA5F6; Tue, 16 Feb 2016 22:13:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14490D40; Tue, 16 Feb 2016 22:13:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GMDQZo065316; Tue, 16 Feb 2016 22:13:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GMDQ1p065315; Tue, 16 Feb 2016 22:13:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602162213.u1GMDQ1p065315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Feb 2016 22:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295678 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 22:13:27 -0000 Author: jhb Date: Tue Feb 16 22:13:25 2016 New Revision: 295678 URL: https://svnweb.freebsd.org/changeset/base/295678 Log: Remove an unused variable that snuck into the previous revision. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Feb 16 22:00:01 2016 (r295677) +++ head/usr.bin/truss/syscalls.c Tue Feb 16 22:13:25 2016 (r295678) @@ -2059,7 +2059,6 @@ print_syscall_ret(struct trussinfo *trus struct timespec timediff; struct threadinfo *t; struct syscall *sc; - int error; t = trussinfo->curthread; sc = t->cs.sc; From owner-svn-src-head@freebsd.org Tue Feb 16 23:11:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FC42AABB54; Tue, 16 Feb 2016 23:11:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18D2F178C; Tue, 16 Feb 2016 23:11:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GNBCxR082186; Tue, 16 Feb 2016 23:11:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GNB9um082160; Tue, 16 Feb 2016 23:11:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602162311.u1GNB9um082160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Feb 2016 23:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295681 - in head: lib/clang/libllvmdebuginfodwarf lib/clang/libllvmdebuginfopdb lib/clang/libllvmlibdriver lib/clang/libllvmlto lib/clang/libllvmmirparser lib/clang/libllvmorcjit lib/c... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 23:11:13 -0000 Author: bdrewery Date: Tue Feb 16 23:11:09 2016 New Revision: 295681 URL: https://svnweb.freebsd.org/changeset/base/295681 Log: DIRDEPS_BUILD: Hookup CLANG_EXTRAS. Sponsored by: EMC / Isilon Storage Division Added: head/lib/clang/libllvmdebuginfodwarf/Makefile.depend (contents, props changed) head/lib/clang/libllvmdebuginfopdb/Makefile.depend (contents, props changed) head/lib/clang/libllvmlibdriver/Makefile.depend (contents, props changed) head/lib/clang/libllvmlto/Makefile.depend (contents, props changed) head/lib/clang/libllvmmirparser/Makefile.depend (contents, props changed) head/lib/clang/libllvmorcjit/Makefile.depend (contents, props changed) head/lib/clang/libllvmpasses/Makefile.depend (contents, props changed) head/usr.bin/clang/bugpoint/Makefile.depend (contents, props changed) head/usr.bin/clang/llc/Makefile.depend (contents, props changed) head/usr.bin/clang/lli/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-ar/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-as/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-cov/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-cxxdump/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-diff/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-dis/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-dwarfdump/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-extract/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-link/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-lto/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-mc/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-nm/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-objdump/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-pdbdump/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-profdata/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-rtdyld/Makefile.depend (contents, props changed) head/usr.bin/clang/llvm-symbolizer/Makefile.depend (contents, props changed) head/usr.bin/clang/macho-dump/Makefile.depend (contents, props changed) head/usr.bin/clang/opt/Makefile.depend (contents, props changed) Modified: head/targets/pseudo/clang/Makefile.depend Added: head/lib/clang/libllvmdebuginfodwarf/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmdebuginfodwarf/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/clang/libllvmdebuginfopdb/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmdebuginfopdb/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/clang/libllvmlibdriver/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmlibdriver/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +LibDriver.o: Options.inc.h +LibDriver.po: Options.inc.h +.endif Added: head/lib/clang/libllvmlto/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmlto/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +LTOCodeGenerator.o: Intrinsics.inc.h +LTOCodeGenerator.po: Intrinsics.inc.h +.endif Added: head/lib/clang/libllvmmirparser/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmirparser/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/clang/libllvmorcjit/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmorcjit/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/clang/libllvmpasses/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmpasses/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +PassBuilder.o: Intrinsics.inc.h +PassBuilder.po: Intrinsics.inc.h +.endif Modified: head/targets/pseudo/clang/Makefile.depend ============================================================================== --- head/targets/pseudo/clang/Makefile.depend Tue Feb 16 23:01:19 2016 (r295680) +++ head/targets/pseudo/clang/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -18,4 +18,32 @@ DIRDEPS+= \ usr.bin/clang/lldb .endif +.if ${MK_CLANG_EXTRAS} == "yes" +DIRDEPS+= \ + usr.bin/clang/bugpoint \ + usr.bin/clang/llc \ + usr.bin/clang/lli \ + usr.bin/clang/llvm-ar \ + usr.bin/clang/llvm-as \ + usr.bin/clang/llvm-bcanalyzer \ + usr.bin/clang/llvm-cov \ + usr.bin/clang/llvm-cxxdump \ + usr.bin/clang/llvm-diff \ + usr.bin/clang/llvm-dis \ + usr.bin/clang/llvm-dwarfdump \ + usr.bin/clang/llvm-extract \ + usr.bin/clang/llvm-link \ + usr.bin/clang/llvm-lto \ + usr.bin/clang/llvm-mc \ + usr.bin/clang/llvm-nm \ + usr.bin/clang/llvm-objdump \ + usr.bin/clang/llvm-pdbdump \ + usr.bin/clang/llvm-profdata \ + usr.bin/clang/llvm-rtdyld \ + usr.bin/clang/llvm-symbolizer \ + usr.bin/clang/macho-dump \ + usr.bin/clang/opt \ + +.endif + .include Added: head/usr.bin/clang/bugpoint/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,47 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmbitwriter \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmipo \ + lib/clang/libllvmirreader \ + lib/clang/libllvmlinker \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmobjcarcopts \ + lib/clang/libllvmobject \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmvectorize \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +bugpoint.o: Intrinsics.inc.h +bugpoint.po: Intrinsics.inc.h +.endif Added: head/usr.bin/clang/llc/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,85 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmirreader \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmmirparser \ + lib/clang/libllvmobject \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +llc.o: Intrinsics.inc.h +llc.po: Intrinsics.inc.h +.endif Added: head/usr.bin/clang/lli/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/lli/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,55 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvmexecutionengine \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvminterpreter \ + lib/clang/libllvmipa \ + lib/clang/libllvmirreader \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcjit \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmobject \ + lib/clang/libllvmorcjit \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmruntimedyld \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-ar/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-ar/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-as/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-as/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,26 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmbitwriter \ + lib/clang/libllvmcore \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-bcanalyzer/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-bcanalyzer/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,25 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcore \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-cov/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-cov/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,29 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcore \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmobject \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-cxxdump/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-cxxdump/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,79 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmobject \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-diff/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-diff/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,27 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcore \ + lib/clang/libllvmirreader \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-dis/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-dis/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,29 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcore \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +llvm-dis.o: Intrinsics.inc.h +llvm-dis.po: Intrinsics.inc.h +.endif Added: head/usr.bin/clang/llvm-dwarfdump/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-dwarfdump/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,30 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcore \ + lib/clang/libllvmdebuginfodwarf \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmobject \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-extract/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-extract/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,39 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmbitwriter \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvmipa \ + lib/clang/libllvmipo \ + lib/clang/libllvmirreader \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmobject \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmvectorize \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-link/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-link/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,32 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmasmparser \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmbitwriter \ + lib/clang/libllvmcore \ + lib/clang/libllvmipa \ + lib/clang/libllvmirreader \ + lib/clang/libllvmlinker \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtransformutils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-lto/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-lto/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,88 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmbitwriter \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmipo \ + lib/clang/libllvmlinker \ + lib/clang/libllvmlto \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmobjcarcopts \ + lib/clang/libllvmobject \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmvectorize \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +llvm-lto.o: Intrinsics.inc.h +llvm-lto.po: Intrinsics.inc.h +.endif Added: head/usr.bin/clang/llvm-mc/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-mc/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,79 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmobject \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-nm/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-nm/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,79 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmobject \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/clang/llvm-objdump/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-objdump/Makefile.depend Tue Feb 16 23:11:09 2016 (r295681) @@ -0,0 +1,80 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 16 23:47:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE061AAA824; Tue, 16 Feb 2016 23:47:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06F119E5; Tue, 16 Feb 2016 23:47:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GNlqiP091967; Tue, 16 Feb 2016 23:47:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1GNlqxP091966; Tue, 16 Feb 2016 23:47:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602162347.u1GNlqxP091966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Feb 2016 23:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295682 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Feb 2016 23:47:54 -0000 Author: jhibbits Date: Tue Feb 16 23:47:52 2016 New Revision: 295682 URL: https://svnweb.freebsd.org/changeset/base/295682 Log: Bump __FreeBSD_Version for u_long -> rman_res_t change (r294883). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Feb 16 23:11:09 2016 (r295681) +++ head/sys/sys/param.h Tue Feb 16 23:47:52 2016 (r295682) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100097 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100098 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Feb 17 00:30:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B84DAABB0A; Wed, 17 Feb 2016 00:30:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6A5D90; Wed, 17 Feb 2016 00:30:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1H0US29003954; Wed, 17 Feb 2016 00:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1H0USqt003953; Wed, 17 Feb 2016 00:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602170030.u1H0USqt003953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Feb 2016 00:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295683 - head/libexec/rtld-elf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 00:30:29 -0000 Author: bdrewery Date: Wed Feb 17 00:30:28 2016 New Revision: 295683 URL: https://svnweb.freebsd.org/changeset/base/295683 Log: Fix build race after r295643. Sponsored by: EMC / Isilon Storage Division Modified: head/libexec/rtld-elf/tests/Makefile Modified: head/libexec/rtld-elf/tests/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/Makefile Tue Feb 16 23:47:52 2016 (r295682) +++ head/libexec/rtld-elf/tests/Makefile Wed Feb 17 00:30:28 2016 (r295683) @@ -4,6 +4,7 @@ SUBDIR+= libpythagoras target +SUBDIR_DEPEND_target= libpythagoras ATF_TESTS_C= ld_library_pathfds .include From owner-svn-src-head@freebsd.org Wed Feb 17 00:33:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34708AABD93; Wed, 17 Feb 2016 00:33:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 264CE136C; Wed, 17 Feb 2016 00:33:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 7BA651A26; Wed, 17 Feb 2016 00:33:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 17 Feb 2016 00:33:16 +0000 From: Glen Barber To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295683 - head/libexec/rtld-elf/tests Message-ID: <20160217003315.GE34186@FreeBSD.org> References: <201602170030.u1H0USqt003953@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WK3l2KTTmXPVedZ6" Content-Disposition: inline In-Reply-To: <201602170030.u1H0USqt003953@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 00:33:18 -0000 --WK3l2KTTmXPVedZ6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 17, 2016 at 12:30:28AM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Feb 17 00:30:28 2016 > New Revision: 295683 > URL: https://svnweb.freebsd.org/changeset/base/295683 >=20 > Log: > Fix build race after r295643. > =20 Thank you. Glen --WK3l2KTTmXPVedZ6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWw7/LAAoJEAMUWKVHj+KTWdQP/3UZOc1f2QVE5zFpPyT4Yu4M NnhZL4qNdX3Iks3nZua5I90cYK+fiEiB09G2wP6JTnACJbDMqhCN7+0H0uTa0+H8 2hsVbH3IQ0cc2WMiebDpo7DSNgVuMuxCDlY65d4OpaByJ6Qk4cdzV5795kim7kqO tWoZ8bMPVqmJoz7ukxaaQ2bgxTzWsquOreBx+xvqhVUZkDfsmjNRTmpxI/kT6/JN Yiif3ROd9iOTTotWFxxFxy3qUuGoIOm3CRRnYnBqUjcciot3zvsV+eyskjHVItGx lncg1GSVz//EYaCDTO0ThNP5a4FPYtQc/hoA10rZoJje6En00vis8g2KeHSZQlMS qyDXcWiYl+Q/FX58vtT1WqQ6ThjvFg8EtjY8AdxaaYHWbohHb7p5DqL37XtbmgHw Cq1KTCA+8Um4mG8Agb58pwv//PYtByk+2mXE+11qO0kFPL9AxK0fQGyNDeeF4Ku6 ZHirm4MZ2qGXl0p+0SXf1wzfsQqJ4OCLi8A7+Zv6UfWoxL7C4sEf6zcZ2Ed2aWuO BGKm6JV6RfabsHcbk6PlNd1LIgGVARFny9LuWW+Nn4AZ93eqj0DEsTBnfHsD4YY2 Wu12hgqG+ujnx1Uhw6wLZCY406s8fJO0CVYrumB1bV/QPHCi/bnlltvBqe6YCSKC VL7fUQp3ubdQZQqNlhR5 =M3se -----END PGP SIGNATURE----- --WK3l2KTTmXPVedZ6-- From owner-svn-src-head@freebsd.org Wed Feb 17 12:31:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4354AAA5F2; Wed, 17 Feb 2016 12:31:00 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A76CCC6A; Wed, 17 Feb 2016 12:31:00 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HCUxfV015971; Wed, 17 Feb 2016 12:30:59 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HCUxtt015970; Wed, 17 Feb 2016 12:30:59 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602171230.u1HCUxtt015970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 17 Feb 2016 12:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295693 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 12:31:00 -0000 Author: skra Date: Wed Feb 17 12:30:59 2016 New Revision: 295693 URL: https://svnweb.freebsd.org/changeset/base/295693 Log: Evaluate also VM_PROT_EXECUTE protection in pmap_preboot_map_attr(). Before this change all mappings done by this function were executable as pte entries have NOT EXECUTABLE bit. The function is used only for static device mappings at present. Thus this is also a fix as DEVICE memory should not be mapped as executable. Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Feb 17 11:40:03 2016 (r295692) +++ head/sys/arm/arm/pmap-v6.c Wed Feb 17 12:30:59 2016 (r295693) @@ -1022,6 +1022,7 @@ pmap_preboot_map_attr(vm_paddr_t pa, vm_ pt2_entry_t *pte2p; l2_prot = prot & VM_PROT_WRITE ? PTE2_AP_KRW : PTE2_AP_KR; + l2_prot |= (prot & VM_PROT_EXECUTE) ? PTE2_X : PTE2_NX; l2_attr = vm_memattr_to_pte2(attr); l1_prot = ATTR_TO_L1(l2_prot); l1_attr = ATTR_TO_L1(l2_attr); From owner-svn-src-head@freebsd.org Wed Feb 17 12:36:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44CC9AAA90E; Wed, 17 Feb 2016 12:36:27 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA8F100E; Wed, 17 Feb 2016 12:36:26 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HCaQG8016214; Wed, 17 Feb 2016 12:36:26 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HCaOfj016198; Wed, 17 Feb 2016 12:36:24 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602171236.u1HCaOfj016198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 17 Feb 2016 12:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295694 - in head/sys: arm/arm arm/at91 arm/cavium/cns11xx arm/freescale/imx arm/include arm/mv arm/mv/orion arm/versatile arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 12:36:27 -0000 Author: skra Date: Wed Feb 17 12:36:24 2016 New Revision: 295694 URL: https://svnweb.freebsd.org/changeset/base/295694 Log: Remove pd_prot and pd_cache members from struct arm_devmap_entry. The struct is used for definition of static device mappings which should always have same protection and attributes. Modified: head/sys/arm/arm/bus_space_generic.c head/sys/arm/arm/devmap.c head/sys/arm/at91/at91_machdep.c head/sys/arm/cavium/cns11xx/econa_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/include/devmap.h head/sys/arm/include/pmap-v6.h head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c head/sys/arm64/include/devmap.h Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/arm/bus_space_generic.c Wed Feb 17 12:36:24 2016 (r295694) @@ -71,8 +71,8 @@ generic_bs_map(bus_space_tag_t t, bus_ad /* * We don't even examine the passed-in flags. For ARM, the CACHEABLE - * flag doesn't make sense (we create PTE_DEVICE mappings), and the - * LINEAR flag is just implied because we use kva_alloc(size). + * flag doesn't make sense (we create VM_MEMATTR_DEVICE mappings), and + * the LINEAR flag is just implied because we use kva_alloc(size). */ if ((va = pmap_mapdev(bpa, size)) == NULL) return (ENOMEM); Modified: head/sys/arm/arm/devmap.c ============================================================================== --- head/sys/arm/arm/devmap.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/arm/devmap.c Wed Feb 17 12:36:24 2016 (r295694) @@ -52,7 +52,6 @@ static boolean_t devmap_bootstrap_done = #if defined(__aarch64__) #define MAX_VADDR VM_MAX_KERNEL_ADDRESS -#define PTE_DEVICE VM_MEMATTR_DEVICE #elif defined(__arm__) #define MAX_VADDR ARM_VECTORS_HIGH #endif @@ -165,8 +164,6 @@ arm_devmap_add_entry(vm_paddr_t pa, vm_s m->pd_va = akva_devmap_vaddr; m->pd_pa = pa; m->pd_size = sz; - m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - m->pd_cache = PTE_DEVICE; } /* @@ -209,10 +206,10 @@ arm_devmap_bootstrap(vm_offset_t l1pt, c #if defined(__arm__) #if __ARM_ARCH >= 6 pmap_preboot_map_attr(pd->pd_pa, pd->pd_va, pd->pd_size, - pd->pd_prot, pd->pd_cache); + VM_PROT_READ | VM_PROT_WRITE, VM_MEMATTR_DEVICE); #else pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, - pd->pd_prot, pd->pd_cache); + VM_PROT_READ | VM_PROT_WRITE, PTE_DEVICE); #endif #elif defined(__aarch64__) pmap_kenter_device(pd->pd_va, pd->pd_size, pd->pd_pa); @@ -270,7 +267,8 @@ arm_devmap_vtop(void * vpva, vm_size_t s * range, otherwise it allocates kva space and maps the physical pages into it. * * This routine is intended to be used for mapping device memory, NOT real - * memory; the mapping type is inherently PTE_DEVICE in pmap_kenter_device(). + * memory; the mapping type is inherently VM_MEMATTR_DEVICE in + * pmap_kenter_device(). */ void * pmap_mapdev(vm_offset_t pa, vm_size_t size) Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/at91/at91_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -128,8 +128,6 @@ const struct arm_devmap_entry at91_devma 0xdff00000, 0xfff00000, 0x00100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, /* There's a notion that we should do the rest of these lazily. */ /* @@ -152,16 +150,12 @@ const struct arm_devmap_entry at91_devma AT91RM92_OHCI_VA_BASE, AT91RM92_OHCI_BASE, 0x00100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { /* CompactFlash controller. Portion of EBI CS4 1MB */ AT91RM92_CF_VA_BASE, AT91RM92_CF_BASE, 0x00100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, /* * The next two should be good for the 9260, 9261 and 9G20 since @@ -172,16 +166,12 @@ const struct arm_devmap_entry at91_devma AT91SAM9G20_OHCI_VA_BASE, AT91SAM9G20_OHCI_BASE, 0x00100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { /* EBI CS3 256MB */ AT91SAM9G20_NAND_VA_BASE, AT91SAM9G20_NAND_BASE, AT91SAM9G20_NAND_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, /* * The next should be good for the 9G45. @@ -191,10 +181,8 @@ const struct arm_devmap_entry at91_devma AT91SAM9G45_OHCI_VA_BASE, AT91SAM9G45_OHCI_BASE, 0x00100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, - { 0, 0, 0, 0, 0, } + { 0, 0, 0, } }; #ifdef LINUX_BOOT_ABI Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -113,8 +113,6 @@ static const struct arm_devmap_entry eco ECONA_SDRAM_BASE, /*virtual*/ ECONA_SDRAM_BASE, /*physical*/ ECONA_SDRAM_SIZE, /*size*/ - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, /* * Map the on-board devices VA == PA so that we can access them @@ -128,8 +126,6 @@ static const struct arm_devmap_entry eco ECONA_IO_BASE, /*virtual*/ ECONA_IO_BASE, /*physical*/ ECONA_IO_SIZE, /*size*/ - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { /* @@ -138,8 +134,6 @@ static const struct arm_devmap_entry eco ECONA_OHCI_VBASE, /*virtual*/ ECONA_OHCI_PBASE, /*physical*/ ECONA_USB_SIZE, /*size*/ - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { /* @@ -148,15 +142,11 @@ static const struct arm_devmap_entry eco ECONA_CFI_VBASE, /*virtual*/ ECONA_CFI_PBASE, /*physical*/ ECONA_CFI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { 0, 0, 0, - 0, - 0, } }; Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/freescale/imx/imx6_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -136,7 +136,7 @@ imx6_late_init(platform_t plat) * Notably not mapped right now are HDMI, GPU, and other devices below ARMMP in * the memory map. When we get support for graphics it might make sense to * static map some of that area. Be careful with other things in that area such - * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. + * as OCRAM that probably shouldn't be mapped as VM_MEMATTR_DEVICE memory. */ static int imx6_devmap_init(platform_t plat) Modified: head/sys/arm/include/devmap.h ============================================================================== --- head/sys/arm/include/devmap.h Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/include/devmap.h Wed Feb 17 12:36:24 2016 (r295694) @@ -37,8 +37,6 @@ struct arm_devmap_entry { vm_offset_t pd_va; /* virtual address */ vm_paddr_t pd_pa; /* physical address */ vm_size_t pd_size; /* size of region */ - vm_prot_t pd_prot; /* protection code */ - int pd_cache; /* cache attributes */ }; /* Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/include/pmap-v6.h Wed Feb 17 12:36:24 2016 (r295694) @@ -250,8 +250,6 @@ void pmap_preboot_map_attr(vm_paddr_t, v */ void vector_page_setprot(int); -#define PTE_DEVICE VM_MEMATTR_DEVICE - #endif /* _KERNEL */ // ----------------------------------------------------------------------------- Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/mv/mv_localbus.c Wed Feb 17 12:36:24 2016 (r295694) @@ -477,8 +477,6 @@ fdt_localbus_devmap(phandle_t dt_node, s fdt_devmap[j].pd_va = localbus_virtmap[va_index].va; fdt_devmap[j].pd_pa = offset; fdt_devmap[j].pd_size = size; - fdt_devmap[j].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[j].pd_cache = PTE_DEVICE; /* Copy data to structure used by localbus driver */ localbus_banks[bank].va = fdt_devmap[j].pd_va; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/mv/mv_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -271,7 +271,7 @@ platform_late_init(void) #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } + { 0, 0, 0, } }; static int @@ -302,8 +302,6 @@ moveon: map->pd_va = MV_CESA_SRAM_BASE; /* XXX */ map->pd_pa = base; map->pd_size = size; - map->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - map->pd_cache = PTE_DEVICE; return (0); out: @@ -368,8 +366,6 @@ platform_devmap_init(void) fdt_devmap[i].pd_va = fdt_immr_va; fdt_devmap[i].pd_pa = fdt_immr_pa; fdt_devmap[i].pd_size = fdt_immr_size; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; i++; /* Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/mv/mv_pci.c Wed Feb 17 12:36:24 2016 (r295694) @@ -233,15 +233,11 @@ mv_pci_devmap(phandle_t node, struct arm devmap->pd_va = (io_va ? io_va : io_space.base_parent); devmap->pd_pa = io_space.base_parent; devmap->pd_size = io_space.len; - devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_DEVICE; devmap++; devmap->pd_va = (mem_va ? mem_va : mem_space.base_parent); devmap->pd_pa = mem_space.base_parent; devmap->pd_size = mem_space.len; - devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_DEVICE; return (0); } Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/mv/orion/db88f5xxx.c Wed Feb 17 12:36:24 2016 (r295694) @@ -82,45 +82,33 @@ const struct arm_devmap_entry db88f5xxx_ MV_BASE, MV_PHYS_BASE, MV_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, { /* PCIE I/O */ MV_PCIE_IO_BASE, MV_PCIE_IO_PHYS_BASE, MV_PCIE_IO_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, { /* PCIE Memory */ MV_PCIE_MEM_BASE, MV_PCIE_MEM_PHYS_BASE, MV_PCIE_MEM_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, { /* PCI I/O */ MV_PCI_IO_BASE, MV_PCI_IO_PHYS_BASE, MV_PCI_IO_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, { /* PCI Memory */ MV_PCI_MEM_BASE, MV_PCI_MEM_PHYS_BASE, MV_PCI_MEM_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, { /* 7-seg LED */ MV_DEV_CS0_BASE, MV_DEV_CS0_PHYS_BASE, MV_DEV_CS0_SIZE, - VM_PROT_READ | VM_PROT_WRITE, - PTE_DEVICE, }, - { 0, 0, 0, 0, 0, } + { 0, 0, 0, } }; /* Modified: head/sys/arm/versatile/versatile_machdep.c ============================================================================== --- head/sys/arm/versatile/versatile_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/versatile/versatile_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -82,8 +82,8 @@ platform_late_init(void) #define FDT_DEVMAP_MAX (2) /* FIXME */ static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, }, - { 0, 0, 0, 0, 0, } + { 0, 0, 0, }, + { 0, 0, 0, } }; @@ -97,8 +97,6 @@ platform_devmap_init(void) fdt_devmap[i].pd_va = 0xf0100000; fdt_devmap[i].pd_pa = 0x10100000; fdt_devmap[i].pd_size = 0x01000000; /* 1 MB */ - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; arm_devmap_register_table(&fdt_devmap[0]); return (0); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -125,8 +125,6 @@ static const struct arm_devmap_entry iq8 IOP34X_VADDR, IOP34X_HWADDR, IOP34X_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { /* @@ -136,22 +134,16 @@ static const struct arm_devmap_entry iq8 IOP34X_PCIX_OIOBAR_VADDR &~ (0x100000 - 1), IOP34X_PCIX_OIOBAR &~ (0x100000 - 1), 0x100000, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { IOP34X_PCE1_VADDR, IOP34X_PCE1, IOP34X_PCE1_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, { 0, 0, 0, - 0, - 0, } }; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -119,32 +119,26 @@ struct pv_addr minidataclean; /* Static device mappings. */ static const struct arm_devmap_entry ixp425_devmap[] = { /* Physical/Virtual address for I/O space */ - { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, }, /* Expansion Bus */ - { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + IXP425_EXP_BUS_CS0_SIZE, }, /* IXP425 PCI Configuration */ - { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, }, /* SDRAM Controller */ - { IXP425_MCU_VBASE, IXP425_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_MCU_VBASE, IXP425_MCU_HWBASE, IXP425_MCU_SIZE, }, /* PCI Memory Space */ - { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, }, /* Q-Mgr Memory Space */ - { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, }, { 0 }, }; @@ -152,46 +146,36 @@ static const struct arm_devmap_entry ixp /* Static device mappings. */ static const struct arm_devmap_entry ixp435_devmap[] = { /* Physical/Virtual address for I/O space */ - { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, }, - { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, }, /* IXP425 PCI Configuration */ - { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, }, /* DDRII Controller NB: mapped same place as IXP425 */ - { IXP425_MCU_VBASE, IXP435_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_MCU_VBASE, IXP435_MCU_HWBASE, IXP425_MCU_SIZE, }, /* PCI Memory Space */ - { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, }, /* Q-Mgr Memory Space */ - { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + IXP425_EXP_BUS_CS0_SIZE, }, /* USB1 Memory Space */ - { IXP435_USB1_VBASE, IXP435_USB1_HWBASE, IXP435_USB1_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP435_USB1_VBASE, IXP435_USB1_HWBASE, IXP435_USB1_SIZE, }, /* USB2 Memory Space */ - { IXP435_USB2_VBASE, IXP435_USB2_HWBASE, IXP435_USB2_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { IXP435_USB2_VBASE, IXP435_USB2_HWBASE, IXP435_USB2_SIZE, }, /* GPS Memory Space */ - { CAMBRIA_GPS_VBASE, CAMBRIA_GPS_HWBASE, CAMBRIA_GPS_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { CAMBRIA_GPS_VBASE, CAMBRIA_GPS_HWBASE, CAMBRIA_GPS_SIZE, }, /* RS485 Memory Space */ - { CAMBRIA_RS485_VBASE, CAMBRIA_RS485_HWBASE, CAMBRIA_RS485_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, + { CAMBRIA_RS485_VBASE, CAMBRIA_RS485_HWBASE, CAMBRIA_RS485_SIZE, }, { 0 } }; Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Wed Feb 17 12:36:24 2016 (r295694) @@ -129,10 +129,8 @@ static const struct arm_devmap_entry pxa PXA2X0_PERIPH_START + PXA2X0_PERIPH_OFFSET, PXA2X0_PERIPH_START, PXA250_PERIPH_END - PXA2X0_PERIPH_START, - VM_PROT_READ|VM_PROT_WRITE, - PTE_DEVICE, }, - { 0, 0, 0, 0, 0, } + { 0, 0, 0, } }; #define SDRAM_START 0xa0000000 Modified: head/sys/arm64/include/devmap.h ============================================================================== --- head/sys/arm64/include/devmap.h Wed Feb 17 12:30:59 2016 (r295693) +++ head/sys/arm64/include/devmap.h Wed Feb 17 12:36:24 2016 (r295694) @@ -37,8 +37,6 @@ struct arm_devmap_entry { vm_offset_t pd_va; /* virtual address */ vm_paddr_t pd_pa; /* physical address */ vm_size_t pd_size; /* size of region */ - vm_prot_t pd_prot; /* protection code */ - int pd_cache; /* cache attributes */ }; /* @@ -70,7 +68,7 @@ void arm_devmap_register_table(const str * custom initarm() routines in older code. If the table pointer is NULL, this * will use the table installed previously by arm_devmap_register_table(). */ -void arm_devmap_bootstrap(vm_offset_t _l1pt, +void arm_devmap_bootstrap(vm_offset_t _l1pt, const struct arm_devmap_entry *_table); /* From owner-svn-src-head@freebsd.org Wed Feb 17 12:57:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 294B9AAB166; Wed, 17 Feb 2016 12:57:07 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAD4618EC; Wed, 17 Feb 2016 12:57:06 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HCv52j021969; Wed, 17 Feb 2016 12:57:05 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HCv57j021966; Wed, 17 Feb 2016 12:57:05 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602171257.u1HCv57j021966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 17 Feb 2016 12:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295695 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 12:57:07 -0000 Author: skra Date: Wed Feb 17 12:57:05 2016 New Revision: 295695 URL: https://svnweb.freebsd.org/changeset/base/295695 Log: Include pte-v6.h only where needed. Modified: head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap_var.h head/sys/arm/include/vm.h Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Feb 17 12:36:24 2016 (r295694) +++ head/sys/arm/include/pmap-v6.h Wed Feb 17 12:57:05 2016 (r295695) @@ -222,8 +222,6 @@ void pmap_preboot_map_attr(vm_paddr_t, v #endif /* _KERNEL */ // ----------------- TO BE DELETED --------------------------------------------- -#include - #ifdef _KERNEL /* Modified: head/sys/arm/include/pmap_var.h ============================================================================== --- head/sys/arm/include/pmap_var.h Wed Feb 17 12:36:24 2016 (r295694) +++ head/sys/arm/include/pmap_var.h Wed Feb 17 12:57:05 2016 (r295695) @@ -31,6 +31,7 @@ #define _MACHINE_PMAP_VAR_H_ #include +#include /* * Various PMAP defines, exports, and inline functions * definitions also usable in other MD code. Modified: head/sys/arm/include/vm.h ============================================================================== --- head/sys/arm/include/vm.h Wed Feb 17 12:36:24 2016 (r295694) +++ head/sys/arm/include/vm.h Wed Feb 17 12:57:05 2016 (r295695) @@ -32,8 +32,6 @@ #include #if __ARM_ARCH >= 6 -#include - #define VM_MEMATTR_WB_WA ((vm_memattr_t)0) #define VM_MEMATTR_NOCACHE ((vm_memattr_t)1) #define VM_MEMATTR_DEVICE ((vm_memattr_t)2) From owner-svn-src-head@freebsd.org Wed Feb 17 13:29:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89762AAA15B; Wed, 17 Feb 2016 13:29:19 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42CB51AF6; Wed, 17 Feb 2016 13:29:19 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HDTIF1030872; Wed, 17 Feb 2016 13:29:18 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HDTIUq030869; Wed, 17 Feb 2016 13:29:18 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602171329.u1HDTIUq030869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 17 Feb 2016 13:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295696 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 13:29:19 -0000 Author: skra Date: Wed Feb 17 13:29:17 2016 New Revision: 295696 URL: https://svnweb.freebsd.org/changeset/base/295696 Log: Remove unneeded vector_page_setprot() for __ARM_ARCH >= 6. A vector page is always mapped in KVA space and so it's always writeable. Modified: head/sys/arm/arm/fiq.c head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/arm/fiq.c ============================================================================== --- head/sys/arm/arm/fiq.c Wed Feb 17 12:57:05 2016 (r295695) +++ head/sys/arm/arm/fiq.c Wed Feb 17 13:29:17 2016 (r295696) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -73,13 +74,13 @@ fiq_installhandler(void *func, size_t si { const uint32_t fiqvector = 7 * sizeof(uint32_t); -#if !defined(__ARM_FIQ_INDIRECT) +#if __ARM_ARCH < 6 && !defined(__ARM_FIQ_INDIRECT) vector_page_setprot(VM_PROT_READ|VM_PROT_WRITE); #endif memcpy((void *)(vector_page + fiqvector), func, size); -#if !defined(__ARM_FIQ_INDIRECT) +#if __ARM_ARCH < 6 && !defined(__ARM_FIQ_INDIRECT) vector_page_setprot(VM_PROT_READ); #endif icache_sync((vm_offset_t) fiqvector, size); Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Feb 17 12:57:05 2016 (r295695) +++ head/sys/arm/arm/pmap-v6.c Wed Feb 17 13:29:17 2016 (r295696) @@ -6314,11 +6314,6 @@ pte1_setrw: return (KERN_FAILURE); } -/* !!!! REMOVE !!!! */ -void vector_page_setprot(int p) -{ -} - #if defined(PMAP_DEBUG) /* * Reusing of KVA used in pmap_zero_page function !!! Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Feb 17 12:57:05 2016 (r295695) +++ head/sys/arm/include/pmap-v6.h Wed Feb 17 13:29:17 2016 (r295696) @@ -243,11 +243,6 @@ void pmap_preboot_map_attr(vm_paddr_t, v */ #define PMAP_DOMAIN_KERNEL 0 /* The kernel uses domain #0 */ -/* - * sys/arm/arm/cpufunc.c - */ -void vector_page_setprot(int); - #endif /* _KERNEL */ // ----------------------------------------------------------------------------- From owner-svn-src-head@freebsd.org Wed Feb 17 13:43:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6592AAAA95; Wed, 17 Feb 2016 13:43:44 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 687621952; Wed, 17 Feb 2016 13:43:44 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HDhhmT036529; Wed, 17 Feb 2016 13:43:43 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HDhhom036527; Wed, 17 Feb 2016 13:43:43 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171343.u1HDhhom036527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 13:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295697 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 13:43:44 -0000 Author: br Date: Wed Feb 17 13:43:43 2016 New Revision: 295697 URL: https://svnweb.freebsd.org/changeset/base/295697 Log: Use callee-saved registers to pass args through fork_trampoline(). Modified: head/sys/riscv/riscv/swtch.S head/sys/riscv/riscv/vm_machdep.c Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Wed Feb 17 13:29:17 2016 (r295696) +++ head/sys/riscv/riscv/swtch.S Wed Feb 17 13:43:43 2016 (r295697) @@ -109,14 +109,10 @@ ENTRY(cpu_switch) /* Save the old context. */ ld x13, TD_PCB(a0) - /* Store the callee-saved registers */ + /* Store ra, sp and the callee-saved registers */ sd ra, (PCB_RA)(x13) sd sp, (PCB_SP)(x13) - /* We use these in fork_trampoline */ - sd t0, (PCB_T + 0 * 8)(x13) - sd t1, (PCB_T + 1 * 8)(x13) - /* s[0-11] */ sd s0, (PCB_S + 0 * 8)(x13) sd s1, (PCB_S + 1 * 8)(x13) @@ -167,10 +163,6 @@ ENTRY(cpu_switch) ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) - /* We use these in fork_trampoline */ - ld t0, (PCB_T + 0 * 8)(x13) - ld t1, (PCB_T + 1 * 8)(x13) - /* s[0-11] */ ld s0, (PCB_S + 0 * 8)(x13) ld s1, (PCB_S + 1 * 8)(x13) @@ -195,8 +187,8 @@ END(cpu_switch) */ ENTRY(fork_trampoline) - mv a0, x5 - mv a1, x6 + mv a0, s0 + mv a1, s1 mv a2, sp call _C_LABEL(fork_exit) Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Wed Feb 17 13:29:17 2016 (r295696) +++ head/sys/riscv/riscv/vm_machdep.c Wed Feb 17 13:43:43 2016 (r295697) @@ -97,8 +97,8 @@ cpu_fork(struct thread *td1, struct proc td2->td_frame = tf; /* Set the return value registers for fork() */ - td2->td_pcb->pcb_t[0] = (uintptr_t)fork_return; - td2->td_pcb->pcb_t[1] = (uintptr_t)td2; + td2->td_pcb->pcb_s[0] = (uintptr_t)fork_return; + td2->td_pcb->pcb_s[1] = (uintptr_t)td2; td2->td_pcb->pcb_ra = (uintptr_t)fork_trampoline; td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; @@ -165,8 +165,8 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); - td->td_pcb->pcb_t[0] = (uintptr_t)fork_return; - td->td_pcb->pcb_t[1] = (uintptr_t)td; + td->td_pcb->pcb_s[0] = (uintptr_t)fork_return; + td->td_pcb->pcb_s[1] = (uintptr_t)td; td->td_pcb->pcb_ra = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; @@ -240,8 +240,8 @@ void cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) { - td->td_pcb->pcb_t[0] = (uintptr_t)func; - td->td_pcb->pcb_t[1] = (uintptr_t)arg; + td->td_pcb->pcb_s[0] = (uintptr_t)func; + td->td_pcb->pcb_s[1] = (uintptr_t)arg; td->td_pcb->pcb_ra = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; } From owner-svn-src-head@freebsd.org Wed Feb 17 13:49:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E54BAAAD6D; Wed, 17 Feb 2016 13:49:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFCD71C93; Wed, 17 Feb 2016 13:49:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HDncXp036776; Wed, 17 Feb 2016 13:49:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HDncPV036775; Wed, 17 Feb 2016 13:49:38 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171349.u1HDncPV036775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 13:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295698 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 13:49:40 -0000 Author: br Date: Wed Feb 17 13:49:38 2016 New Revision: 295698 URL: https://svnweb.freebsd.org/changeset/base/295698 Log: Add the implementation of savectx(). Modified: head/sys/riscv/riscv/swtch.S Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Wed Feb 17 13:43:43 2016 (r295697) +++ head/sys/riscv/riscv/swtch.S Wed Feb 17 13:49:38 2016 (r295698) @@ -256,8 +256,27 @@ ENTRY(fork_trampoline) END(fork_trampoline) ENTRY(savectx) - la a0, .Lsavectx_panic_str - call panic -.Lsavectx_panic_str: - .asciz "savectx_panic: %p\0" + /* Store ra, sp and the callee-saved registers */ + sd ra, (PCB_RA)(a0) + sd sp, (PCB_SP)(a0) + + /* s[0-11] */ + sd s0, (PCB_S + 0 * 8)(a0) + sd s1, (PCB_S + 1 * 8)(a0) + sd s2, (PCB_S + 2 * 8)(a0) + sd s3, (PCB_S + 3 * 8)(a0) + sd s4, (PCB_S + 4 * 8)(a0) + sd s5, (PCB_S + 5 * 8)(a0) + sd s6, (PCB_S + 6 * 8)(a0) + sd s7, (PCB_S + 7 * 8)(a0) + sd s8, (PCB_S + 8 * 8)(a0) + sd s9, (PCB_S + 9 * 8)(a0) + sd s10, (PCB_S + 10 * 8)(a0) + sd s11, (PCB_S + 11 * 8)(a0) + + /* Store the VFP registers */ +#ifdef VFP + /* TODO */ +#endif + ret END(savectx) From owner-svn-src-head@freebsd.org Wed Feb 17 14:13:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B765BAAB803; Wed, 17 Feb 2016 14:13:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88A441D91; Wed, 17 Feb 2016 14:13:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HEDPf5045487; Wed, 17 Feb 2016 14:13:25 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HEDPpo045486; Wed, 17 Feb 2016 14:13:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171413.u1HEDPpo045486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 14:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295699 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 14:13:26 -0000 Author: br Date: Wed Feb 17 14:13:25 2016 New Revision: 295699 URL: https://svnweb.freebsd.org/changeset/base/295699 Log: There is no need to pre save tp in cpu_fork(). Discussed with: jhb Modified: head/sys/riscv/riscv/vm_machdep.c Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Wed Feb 17 13:49:38 2016 (r295698) +++ head/sys/riscv/riscv/vm_machdep.c Wed Feb 17 14:13:25 2016 (r295699) @@ -64,16 +64,10 @@ cpu_fork(struct thread *td1, struct proc { struct pcb *pcb2; struct trapframe *tf; - uint64_t val; if ((flags & RFPROC) == 0) return; - if (td1 == curthread) { - __asm __volatile("mv %0, tp" : "=&r"(val)); - td1->td_pcb->pcb_tp = val; - } - pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; From owner-svn-src-head@freebsd.org Wed Feb 17 14:24:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B793AABE16; Wed, 17 Feb 2016 14:24:27 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1965415BC; Wed, 17 Feb 2016 14:24:27 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HEOQqn048707; Wed, 17 Feb 2016 14:24:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HEOQ3g048706; Wed, 17 Feb 2016 14:24:26 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171424.u1HEOQ3g048706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 14:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295700 - head/sys/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 14:24:27 -0000 Author: br Date: Wed Feb 17 14:24:25 2016 New Revision: 295700 URL: https://svnweb.freebsd.org/changeset/base/295700 Log: Use better form representing 32 x 128-bit floating-point registers. Suggested by: kib Modified: head/sys/riscv/include/ucontext.h Modified: head/sys/riscv/include/ucontext.h ============================================================================== --- head/sys/riscv/include/ucontext.h Wed Feb 17 14:13:25 2016 (r295699) +++ head/sys/riscv/include/ucontext.h Wed Feb 17 14:24:25 2016 (r295700) @@ -50,7 +50,7 @@ struct gpregs { }; struct fpregs { - __uint64_t fp_x[64] __aligned(16); + __uint64_t fp_x[32][2]; __uint64_t fp_fcsr; int fp_flags; int pad; From owner-svn-src-head@freebsd.org Wed Feb 17 14:32:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C814AAA3CE; Wed, 17 Feb 2016 14:32:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E51110B4; Wed, 17 Feb 2016 14:32:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HEW3ML049663; Wed, 17 Feb 2016 14:32:03 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HEW33j049662; Wed, 17 Feb 2016 14:32:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171432.u1HEW33j049662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 14:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295701 - head/sys/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 14:32:04 -0000 Author: br Date: Wed Feb 17 14:32:03 2016 New Revision: 295701 URL: https://svnweb.freebsd.org/changeset/base/295701 Log: Add the implementation of atomic_swap_32(). Modified: head/sys/riscv/include/atomic.h Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Wed Feb 17 14:24:25 2016 (r295700) +++ head/sys/riscv/include/atomic.h Wed Feb 17 14:32:03 2016 (r295701) @@ -310,6 +310,19 @@ atomic_readandclear_64(volatile uint64_t return (ret); } +static __inline uint32_t +atomic_swap_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t old; + + __asm __volatile("amoswap.w %0, %2, %1" + : "=&r"(old), "+A" (*p) + : "r" (val) + : "memory"); + + return (old); +} + static __inline uint64_t atomic_swap_64(volatile uint64_t *p, uint64_t val) { From owner-svn-src-head@freebsd.org Wed Feb 17 14:34:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13FD9AAA497; Wed, 17 Feb 2016 14:34:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9523126E; Wed, 17 Feb 2016 14:34:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HEY1DN051610; Wed, 17 Feb 2016 14:34:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HEY1cf051609; Wed, 17 Feb 2016 14:34:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602171434.u1HEY1cf051609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Feb 2016 14:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295702 - head/gnu/usr.bin/rcs/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 14:34:03 -0000 Author: emaste Date: Wed Feb 17 14:34:01 2016 New Revision: 295702 URL: https://svnweb.freebsd.org/changeset/base/295702 Log: Hardcode date in RCS paper for reproducibility The 1995/06/01 date is taken from the $Id$ entry in rcs.ms from RCS 5.7, the last version we imported, and is more meaningful than the OS build date. Reviewed by: eadler Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5299 Modified: head/gnu/usr.bin/rcs/doc/rcs.ms Modified: head/gnu/usr.bin/rcs/doc/rcs.ms ============================================================================== --- head/gnu/usr.bin/rcs/doc/rcs.ms Wed Feb 17 14:32:03 2016 (r295701) +++ head/gnu/usr.bin/rcs/doc/rcs.ms Wed Feb 17 14:34:01 2016 (r295702) @@ -16,7 +16,7 @@ .R .. .de Id -.ND \\$4 +.ND 1 June 1995 .. .Id $FreeBSD$ .RP From owner-svn-src-head@freebsd.org Wed Feb 17 14:39:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9593AAA6D3; Wed, 17 Feb 2016 14:39:30 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 705201517; Wed, 17 Feb 2016 14:39:30 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HEdTj5051831; Wed, 17 Feb 2016 14:39:29 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HEdT5E051828; Wed, 17 Feb 2016 14:39:29 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602171439.u1HEdT5E051828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 17 Feb 2016 14:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295703 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 14:39:30 -0000 Author: skra Date: Wed Feb 17 14:39:29 2016 New Revision: 295703 URL: https://svnweb.freebsd.org/changeset/base/295703 Log: Do not use PMAP_DOMAIN_KERNEL definition for __ARM_ARCH >= 6 as domains are not utilized there. Only domain #0 is used and there is no reference to it in the whole pmap-v6.c. Thus initialize domain access register in locore-v6.c without reference too. Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/locore-v6.S head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Wed Feb 17 14:34:01 2016 (r295702) +++ head/sys/arm/arm/genassym.c Wed Feb 17 14:39:29 2016 (r295703) @@ -129,7 +129,9 @@ ASSYM(PC_CURPMAP, offsetof(struct pcpu, #endif ASSYM(PAGE_SIZE, PAGE_SIZE); +#if __ARM_ARCH < 6 ASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL); +#endif #ifdef PMAP_INCLUDE_PTE_SYNC ASSYM(PMAP_INCLUDE_PTE_SYNC, 1); #endif Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Wed Feb 17 14:34:01 2016 (r295702) +++ head/sys/arm/arm/locore-v6.S Wed Feb 17 14:39:29 2016 (r295703) @@ -280,7 +280,7 @@ ASENTRY_NP(init_mmu) mcr CP15_CONTEXTIDR(r0) /* Set ASID to 0 */ /* Set the Domain Access register */ - mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) + mov r0, #DOMAIN_CLIENT /* Only domain #0 is used */ mcr CP15_DACR(r0) /* Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Feb 17 14:34:01 2016 (r295702) +++ head/sys/arm/include/pmap-v6.h Wed Feb 17 14:39:29 2016 (r295703) @@ -220,30 +220,4 @@ void pmap_preboot_map_attr(vm_paddr_t, v vm_memattr_t); #endif /* _KERNEL */ - -// ----------------- TO BE DELETED --------------------------------------------- -#ifdef _KERNEL - -/* - * sys/arm/arm/elf_trampoline.c - * sys/arm/arm/genassym.c - * sys/arm/arm/machdep.c - * sys/arm/arm/mp_machdep.c - * sys/arm/arm/locore.S - * sys/arm/arm/pmap.c - * sys/arm/arm/swtch.S - * sys/arm/at91/at91_machdep.c - * sys/arm/cavium/cns11xx/econa_machdep.c - * sys/arm/s3c2xx0/s3c24x0_machdep.c - * sys/arm/xscale/ixp425/avila_machdep.c - * sys/arm/xscale/i8134x/crb_machdep.c - * sys/arm/xscale/i80321/ep80219_machdep.c - * sys/arm/xscale/i80321/iq31244_machdep.c - * sys/arm/xscale/pxa/pxa_machdep.c - */ -#define PMAP_DOMAIN_KERNEL 0 /* The kernel uses domain #0 */ - -#endif /* _KERNEL */ -// ----------------------------------------------------------------------------- - #endif /* !_MACHINE_PMAP_H_ */ From owner-svn-src-head@freebsd.org Wed Feb 17 17:16:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4D15AAB002; Wed, 17 Feb 2016 17:16:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849C11D4C; Wed, 17 Feb 2016 17:16:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HHG3mv098326; Wed, 17 Feb 2016 17:16:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HHG2c2098316; Wed, 17 Feb 2016 17:16:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602171716.u1HHG2c2098316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 17 Feb 2016 17:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 17:16:04 -0000 Author: imp Date: Wed Feb 17 17:16:02 2016 New Revision: 295707 URL: https://svnweb.freebsd.org/changeset/base/295707 Log: Create an API to reset a struct bio (g_reset_bio). This is mandatory for all struct bio you get back from g_{new,alloc}_bio. Temporary bios that you create on the stack or elsewhere should use this before first use of the bio, and between uses of the bio. At the moment, it is nothing more than a wrapper around bzero, but that may change in the future. The wrapper also removes one place where we encode the size of struct bio in the KBI. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/dev/mmc/mmcsd.c head/sys/dev/virtio/block/virtio_blk.c head/sys/geom/geom.h head/sys/geom/geom_io.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/raid/g_raid.c head/sys/geom/raid3/g_raid3.c head/sys/kern/kern_physio.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 Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Feb 17 17:16:02 2016 (r295707) @@ -314,7 +314,7 @@ vdev_geom_io(struct g_consumer *cp, int error = 0; for (; off < offset; off += maxio, p += maxio, size -= maxio) { - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); bp->bio_cmd = cmd; bp->bio_done = NULL; bp->bio_offset = off; Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/dev/mmc/mmcsd.c Wed Feb 17 17:16:02 2016 (r295707) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -487,7 +488,7 @@ mmcsd_dump(void *arg, void *virtual, vm_ if (!length) return (0); - bzero(&bp, sizeof(struct bio)); + g_reset_bio(&bp); bp.bio_disk = disk; bp.bio_pblkno = offset / disk->d_sectorsize; bp.bio_bcount = length; Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/dev/virtio/block/virtio_blk.c Wed Feb 17 17:16:02 2016 (r295707) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -1146,7 +1147,7 @@ vtblk_ident(struct vtblk_softc *sc) req->vbr_hdr.sector = 0; req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); + g_reset_bio(&buf); buf.bio_cmd = BIO_READ; buf.bio_data = dp->d_ident; @@ -1278,7 +1279,7 @@ vtblk_dump_write(struct vtblk_softc *sc, req->vbr_hdr.sector = offset / 512; req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); + g_reset_bio(&buf); buf.bio_cmd = BIO_WRITE; buf.bio_data = virtual; @@ -1300,7 +1301,7 @@ vtblk_dump_flush(struct vtblk_softc *sc) req->vbr_hdr.sector = 0; req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); + g_reset_bio(&buf); buf.bio_cmd = BIO_FLUSH; Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/geom.h Wed Feb 17 17:16:02 2016 (r295707) @@ -324,6 +324,7 @@ void g_unregister_classifier(struct g_cl void g_io_request(struct bio *bp, struct g_consumer *cp); struct bio *g_new_bio(void); struct bio *g_alloc_bio(void); +void g_reset_bio(struct bio *); void * g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error); int g_write_data(struct g_consumer *cp, off_t offset, void *ptr, off_t length); int g_delete_data(struct g_consumer *cp, off_t offset, off_t length); Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/geom_io.c Wed Feb 17 17:16:02 2016 (r295707) @@ -265,6 +265,13 @@ g_duplicate_bio(struct bio *bp) } void +g_reset_bio(struct bio *bp) +{ + + bzero(bp, sizeof(bp)); +} + +void g_io_init() { Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/journal/g_journal.c Wed Feb 17 17:16:02 2016 (r295707) @@ -1296,7 +1296,7 @@ g_journal_flush(struct g_journal_softc * data = bp->bio_data; if (sc->sc_flags & GJF_DEVICE_CHECKSUM) MD5Update(&ctx, data, ent->je_length); - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); bp->bio_cflags = GJ_BIO_JOURNAL; bp->bio_offset = ent->je_offset; bp->bio_joffset = ent->je_joffset; @@ -1772,7 +1772,7 @@ g_journal_sync_read(struct g_consumer *c { int error; - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); bp->bio_cmd = BIO_READ; bp->bio_done = NULL; bp->bio_offset = offset; Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/mirror/g_mirror.c Wed Feb 17 17:16:02 2016 (r295707) @@ -1372,7 +1372,7 @@ g_mirror_sync_request(struct bio *bp) /* Send next synchronization request. */ data = bp->bio_data; - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); bp->bio_cmd = BIO_READ; bp->bio_offset = sync->ds_offset; bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/raid/g_raid.c Wed Feb 17 17:16:02 2016 (r295707) @@ -1011,7 +1011,7 @@ g_raid_tr_kerneldump_common(struct g_rai vol = tr->tro_volume; sc = vol->v_softc; - bzero(&bp, sizeof(bp)); + g_reset_bio(&bp); bp.bio_cmd = BIO_WRITE; bp.bio_done = g_raid_tr_kerneldump_common_done; bp.bio_attribute = NULL; Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/geom/raid3/g_raid3.c Wed Feb 17 17:16:02 2016 (r295707) @@ -1717,7 +1717,7 @@ g_raid3_sync_request(struct bio *bp) /* Send next synchronization request. */ data = bp->bio_data; - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); bp->bio_cmd = BIO_READ; bp->bio_offset = sync->ds_offset * (sc->sc_ndisks - 1); bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Wed Feb 17 16:13:22 2016 (r295706) +++ head/sys/kern/kern_physio.c Wed Feb 17 17:16:02 2016 (r295707) @@ -110,7 +110,7 @@ physio(struct cdev *dev, struct uio *uio error = 0; for (i = 0; i < uio->uio_iovcnt; i++) { while (uio->uio_iov[i].iov_len) { - bzero(bp, sizeof(*bp)); + g_reset_bio(bp); if (uio->uio_rw == UIO_READ) { bp->bio_cmd = BIO_READ; curthread->td_ru.ru_inblock++; From owner-svn-src-head@freebsd.org Wed Feb 17 17:52:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6681BAAB134; Wed, 17 Feb 2016 17:52:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3454C14A5; Wed, 17 Feb 2016 17:52:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HHqlIH010444; Wed, 17 Feb 2016 17:52:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HHqlVu010443; Wed, 17 Feb 2016 17:52:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602171752.u1HHqlVu010443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Feb 2016 17:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295708 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 17:52:48 -0000 Author: tuexen Date: Wed Feb 17 17:52:46 2016 New Revision: 295708 URL: https://svnweb.freebsd.org/changeset/base/295708 Log: Address a warning reported by D5245 / PVS. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Feb 17 17:16:02 2016 (r295707) +++ head/sys/netinet/sctp_output.c Wed Feb 17 17:52:46 2016 (r295708) @@ -10613,7 +10613,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in * Clear all bits corresponding to TSNs * smaller or equal to the cumulative TSN. */ - tsn_map &= (~0 << (1 - offset)); + tsn_map &= (~0U << (1 - offset)); } selector = &sack_array[tsn_map]; if (mergeable && selector->right_edge) { @@ -10688,7 +10688,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in * TSNs smaller or equal to the * cumulative TSN. */ - tsn_map &= (~0 << (1 - offset)); + tsn_map &= (~0U << (1 - offset)); } selector = &sack_array[tsn_map]; if (mergeable && selector->right_edge) { From owner-svn-src-head@freebsd.org Wed Feb 17 18:04:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70F2DAAB643; Wed, 17 Feb 2016 18:04:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC4E1BD1; Wed, 17 Feb 2016 18:04:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HI4Nuo013530; Wed, 17 Feb 2016 18:04:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HI4Ncv013528; Wed, 17 Feb 2016 18:04:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602171804.u1HI4Ncv013528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Feb 2016 18:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295709 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 18:04:24 -0000 Author: tuexen Date: Wed Feb 17 18:04:22 2016 New Revision: 295709 URL: https://svnweb.freebsd.org/changeset/base/295709 Log: Code cleanup which will silence a warning in PVS / D5245. Modified: head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed Feb 17 17:52:46 2016 (r295708) +++ head/sys/netinet/sctp_timer.c Wed Feb 17 18:04:22 2016 (r295709) @@ -85,7 +85,7 @@ sctp_audit_retranmission_queue(struct sc asoc->sent_queue_cnt); } -int +static int sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint16_t threshold) { @@ -111,9 +111,9 @@ sctp_threshold_management(struct sctp_in net->last_active = sctp_get_tick_count(); sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, - stcb->sctp_ep, stcb, net, + inp, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_1); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } } } Modified: head/sys/netinet/sctp_timer.h ============================================================================== --- head/sys/netinet/sctp_timer.h Wed Feb 17 17:52:46 2016 (r295708) +++ head/sys/netinet/sctp_timer.h Wed Feb 17 18:04:22 2016 (r295709) @@ -46,10 +46,6 @@ sctp_find_alternate_net(struct sctp_tcb struct sctp_nets *, int mode); int -sctp_threshold_management(struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint16_t); - -int sctp_t3rxt_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); int From owner-svn-src-head@freebsd.org Wed Feb 17 18:12:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246BAAAB969; Wed, 17 Feb 2016 18:12:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E6E11F0; Wed, 17 Feb 2016 18:12:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HICcEt016423; Wed, 17 Feb 2016 18:12:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HICc8M016422; Wed, 17 Feb 2016 18:12:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602171812.u1HICc8M016422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Feb 2016 18:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295710 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 18:12:40 -0000 Author: tuexen Date: Wed Feb 17 18:12:38 2016 New Revision: 295710 URL: https://svnweb.freebsd.org/changeset/base/295710 Log: Add protection code for issues reported by PVS / D5245. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Feb 17 18:04:22 2016 (r295709) +++ head/sys/netinet/sctp_input.c Wed Feb 17 18:12:38 2016 (r295710) @@ -909,7 +909,9 @@ sctp_handle_shutdown(struct sctp_shutdow return; } #endif - sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); + if (stcb->sctp_socket) { + sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); + } #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif @@ -4858,7 +4860,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb != stcb) { + if ((locked_tcb != NULL) && (locked_tcb != stcb)) { /* Very unlikely */ SCTP_TCB_UNLOCK(locked_tcb); } From owner-svn-src-head@freebsd.org Wed Feb 17 18:28:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47989AAA06C; Wed, 17 Feb 2016 18:28:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4D3B1D52; Wed, 17 Feb 2016 18:28:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HIS3p3019880; Wed, 17 Feb 2016 18:28:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HIS3ZI019871; Wed, 17 Feb 2016 18:28:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602171828.u1HIS3ZI019871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 17 Feb 2016 18:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295711 - in head/sys: arm/allwinner arm/allwinner/a20 arm/conf boot/fdt/dts/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 18:28:05 -0000 Author: andrew Date: Wed Feb 17 18:28:03 2016 New Revision: 295711 URL: https://svnweb.freebsd.org/changeset/base/295711 Log: Move the Allwinner kernels to use fdt_pinctrl. This will read the pin configuration from the FDT data, then set the pins into the requested state. As part of this the gpio controller now reports the correct number of pins instead of returning the number of bank * 32. To allow for a future consolidated kernel we add the SOC_ALLWINNER_A10 and SOC_ALLWINNER_A20 kernel options. These need to be set as appropriate for the SoC the kernel will boot on. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D5177 Added: head/sys/arm/allwinner/a10_padconf.c (contents, props changed) head/sys/arm/allwinner/a20/a20_padconf.c (contents, props changed) head/sys/arm/allwinner/allwinner_pinctrl.h (contents, props changed) Modified: head/sys/arm/allwinner/a10_ahci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a20/a20_if_dwc.c head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/if_emac.c head/sys/arm/conf/A10 head/sys/arm/conf/A20 head/sys/arm/conf/CUBIEBOARD head/sys/boot/fdt/dts/arm/bananapi.dts head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi head/sys/conf/options.arm Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Wed Feb 17 18:12:38 2016 (r295710) +++ head/sys/arm/allwinner/a10_ahci.c Wed Feb 17 18:28:03 2016 (r295711) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -49,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "gpio_if.h" /* * Allwinner a1x/a2x/a8x SATA attachment. This is just the AHCI register @@ -119,9 +117,6 @@ __FBSDID("$FreeBSD$"); #define AHCI_P0PHYCR 0x0078 #define AHCI_P0PHYSR 0x007C -/* Kludge for CUBIEBOARD (and Banana PI too) */ -#define GPIO_AHCI_PWR 40 - static void inline ahci_set(struct resource *m, bus_size_t off, uint32_t set) { @@ -298,7 +293,6 @@ ahci_a10_probe(device_t dev) static int ahci_a10_attach(device_t dev) { - device_t gpio; int error; struct ahci_controller *ctlr; @@ -316,19 +310,6 @@ ahci_a10_attach(device_t dev) /* Turn on the PLL for SATA */ a10_clk_ahci_activate(); - /* Apply power to the drive, if any */ - gpio = devclass_get_device(devclass_find("gpio"), 0); - if (gpio == NULL) { - device_printf(dev, - "GPIO device not yet present (SATA won't work).\n"); - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, - ctlr->r_mem); - return (ENXIO); - } - GPIO_PIN_SETFLAGS(gpio, GPIO_AHCI_PWR, GPIO_PIN_OUTPUT); - GPIO_PIN_SET(gpio, GPIO_AHCI_PWR, GPIO_PIN_HIGH); - DELAY(10000); - /* Reset controller */ if ((error = ahci_a10_ctlr_reset(dev)) != 0) { bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Feb 17 18:12:38 2016 (r295710) +++ head/sys/arm/allwinner/a10_gpio.c Wed Feb 17 18:28:03 2016 (r295711) @@ -47,12 +47,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include +#include + #include "gpio_if.h" -#include "a10_gpio.h" /* * A10 have 9 banks of gpio. @@ -62,7 +65,6 @@ __FBSDID("$FreeBSD$"); * PG0 - PG9 | PH0 - PH27 | PI0 - PI12 */ -#define A10_GPIO_PINS 288 #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) @@ -73,6 +75,9 @@ __FBSDID("$FreeBSD$"); #define A10_GPIO_INPUT 0 #define A10_GPIO_OUTPUT 1 +#define AW_GPIO_DRV_MASK 0x3 +#define AW_GPIO_PUD_MASK 0x3 + static struct ofw_compat_data compat_data[] = { {"allwinner,sun4i-a10-pinctrl", 1}, {"allwinner,sun7i-a20-pinctrl", 1}, @@ -88,8 +93,19 @@ struct a10_gpio_softc { bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; void * sc_intrhand; + const struct allwinner_padconf * padconf; }; +/* Defined in a10_padconf.c */ +#ifdef SOC_ALLWINNER_A10 +extern const struct allwinner_padconf a10_padconf; +#endif + +/* Defined in a20_padconf.c */ +#ifdef SOC_ALLWINNER_A20 +extern const struct allwinner_padconf a20_padconf; +#endif + #define A10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define A10_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -123,8 +139,10 @@ a10_gpio_get_function(struct a10_gpio_so /* Must be called with lock held. */ A10_GPIO_LOCK_ASSERT(sc); - bank = pin / 32; - pin = pin % 32; + if (pin > sc->padconf->npins) + return (0); + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); @@ -146,8 +164,8 @@ a10_gpio_set_function(struct a10_gpio_so /* Must be called with lock held. */ A10_GPIO_LOCK_ASSERT(sc); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); data = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); @@ -164,8 +182,8 @@ a10_gpio_get_pud(struct a10_gpio_softc * /* Must be called with lock held. */ A10_GPIO_LOCK_ASSERT(sc); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); @@ -187,17 +205,35 @@ a10_gpio_set_pud(struct a10_gpio_softc * /* Must be called with lock held. */ A10_GPIO_LOCK_ASSERT(sc); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); - val &= ~(0x03 << offset); + val &= ~(AW_GPIO_PUD_MASK << offset); val |= (state << offset); A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val); } static void +a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive) +{ + uint32_t bank, offset, val; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; + offset = ((pin & 0x0f) << 1); + + val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + val &= ~(AW_GPIO_DRV_MASK << offset); + val |= (drive << offset); + A10_GPIO_WRITE(sc, A10_GPIO_GP_DRV(bank, pin >> 4), val); +} + +static void a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint32_t pin, uint32_t flags) { @@ -218,7 +254,7 @@ a10_gpio_pin_configure(struct a10_gpio_s a10_gpio_set_pud(sc, pin, A10_GPIO_PULLUP); else a10_gpio_set_pud(sc, pin, A10_GPIO_PULLDOWN); - } else + } else a10_gpio_set_pud(sc, pin, A10_GPIO_NONE); } @@ -235,16 +271,21 @@ a10_gpio_get_bus(device_t dev) static int a10_gpio_pin_max(device_t dev, int *maxpin) { + struct a10_gpio_softc *sc; - *maxpin = A10_GPIO_PINS - 1; + sc = device_get_softc(dev); + + *maxpin = sc->padconf->npins - 1; return (0); } static int a10_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { + struct a10_gpio_softc *sc; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin >= sc->padconf->npins) return (EINVAL); *caps = A10_GPIO_DEFAULT_CAPS; @@ -257,10 +298,10 @@ a10_gpio_pin_getflags(device_t dev, uint { struct a10_gpio_softc *sc; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin >= sc->padconf->npins) return (EINVAL); - sc = device_get_softc(dev); A10_GPIO_LOCK(sc); *flags = a10_gpio_get_function(sc, pin); *flags |= a10_gpio_get_pud(sc, pin); @@ -272,14 +313,14 @@ a10_gpio_pin_getflags(device_t dev, uint static int a10_gpio_pin_getname(device_t dev, uint32_t pin, char *name) { - uint32_t bank; + struct a10_gpio_softc *sc; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin >= sc->padconf->npins) return (EINVAL); - bank = pin / 32; - snprintf(name, GPIOMAXNAME - 1, "pin %d (P%c%d)", - pin, bank + 'A', pin % 32); + snprintf(name, GPIOMAXNAME - 1, "%s", + sc->padconf->pins[pin].name); name[GPIOMAXNAME - 1] = '\0'; return (0); @@ -290,10 +331,10 @@ a10_gpio_pin_setflags(device_t dev, uint { struct a10_gpio_softc *sc; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin > sc->padconf->npins) return (EINVAL); - sc = device_get_softc(dev); A10_GPIO_LOCK(sc); a10_gpio_pin_configure(sc, pin, flags); A10_GPIO_UNLOCK(sc); @@ -307,13 +348,13 @@ a10_gpio_pin_set(device_t dev, uint32_t struct a10_gpio_softc *sc; uint32_t bank, data; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin > sc->padconf->npins) return (EINVAL); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; - sc = device_get_softc(dev); A10_GPIO_LOCK(sc); data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); if (value) @@ -332,13 +373,13 @@ a10_gpio_pin_get(device_t dev, uint32_t struct a10_gpio_softc *sc; uint32_t bank, reg_data; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin > sc->padconf->npins) return (EINVAL); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; - sc = device_get_softc(dev); A10_GPIO_LOCK(sc); reg_data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); A10_GPIO_UNLOCK(sc); @@ -353,13 +394,13 @@ a10_gpio_pin_toggle(device_t dev, uint32 struct a10_gpio_softc *sc; uint32_t bank, data; - if (pin >= A10_GPIO_PINS) + sc = device_get_softc(dev); + if (pin > sc->padconf->npins) return (EINVAL); - bank = pin / 32; - pin = pin % 32; + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; - sc = device_get_softc(dev); A10_GPIO_LOCK(sc); data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); if (data & (1 << pin)) @@ -373,6 +414,92 @@ a10_gpio_pin_toggle(device_t dev, uint32 } static int +aw_find_pinnum_by_name(struct a10_gpio_softc *sc, const char *pinname) +{ + int i; + + for (i = 0; i < sc->padconf->npins; i++) + if (!strcmp(pinname, sc->padconf->pins[i].name)) + return i; + + return (-1); +} + +static int +aw_find_pin_func(struct a10_gpio_softc *sc, int pin, const char *func) +{ + int i; + + for (i = 0; i < AW_MAX_FUNC_BY_PIN; i++) + if (sc->padconf->pins[pin].functions[i] && + !strcmp(func, sc->padconf->pins[pin].functions[i])) + return (i); + + return (-1); +} + +static int +aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) +{ + struct a10_gpio_softc *sc; + phandle_t node; + const char **pinlist = NULL; + char *pin_function = NULL; + uint32_t pin_drive, pin_pull; + int pins_nb, pin_num, pin_func, i, ret; + + sc = device_get_softc(dev); + node = OF_node_from_xref(cfgxref); + ret = 0; + + /* Getting all prop for configuring pins */ + pins_nb = ofw_bus_string_list_to_array(node, "allwinner,pins", &pinlist); + if (pins_nb <= 0) + return (ENOENT); + if (OF_getprop_alloc(node, "allwinner,function", + sizeof(*pin_function), + (void **)&pin_function) == -1) { + ret = ENOENT; + goto out; + } + if (OF_getencprop(node, "allwinner,drive", + &pin_drive, sizeof(pin_drive)) == -1) { + ret = ENOENT; + goto out; + } + if (OF_getencprop(node, "allwinner,pull", + &pin_pull, sizeof(pin_pull)) == -1) { + ret = ENOENT; + goto out; + } + + /* Configure each pin to the correct function, drive and pull */ + for (i = 0; i < pins_nb; i++) { + pin_num = aw_find_pinnum_by_name(sc, pinlist[i]); + if (pin_num == -1) { + ret = ENOENT; + goto out; + } + pin_func = aw_find_pin_func(sc, pin_num, pin_function); + if (pin_func == -1) { + ret = ENOENT; + goto out; + } + + A10_GPIO_LOCK(sc); + a10_gpio_set_function(sc, pin_num, pin_func); + a10_gpio_set_drv(sc, pin_num, pin_drive); + a10_gpio_set_pud(sc, pin_num, pin_pull); + A10_GPIO_UNLOCK(sc); + } + + out: + free(pinlist, M_OFWPROP); + free(pin_function, M_OFWPROP); + return (ret); +} + +static int a10_gpio_probe(device_t dev) { @@ -382,7 +509,7 @@ a10_gpio_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "Allwinner GPIO controller"); + device_set_desc(dev, "Allwinner GPIO/Pinmux controller"); return (BUS_PROBE_DEFAULT); } @@ -428,6 +555,29 @@ a10_gpio_attach(device_t dev) if (sc->sc_busdev == NULL) goto fail; + + /* Use the right pin data for the current SoC */ + switch (allwinner_soc_type()) { +#ifdef SOC_ALLWINNER_A10 + case ALLWINNERSOC_A10: + sc->padconf = &a10_padconf; + break; +#endif +#ifdef SOC_ALLWINNER_A20 + case ALLWINNERSOC_A20: + sc->padconf = &a20_padconf; + break; +#endif + default: + return (ENOENT); + } + + /* + * Register as a pinctrl device + */ + fdt_pinctrl_register(dev, "allwinner,pins"); + fdt_pinctrl_configure_tree(dev); + return (0); fail: @@ -459,9 +609,18 @@ static int a10_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) { + struct a10_gpio_softc *sc; + int i; + + sc = device_get_softc(bus); /* The GPIO pins are mapped as: . */ - *pin = gpios[0] * 32 + gpios[1]; + for (i = 0; i < sc->padconf->npins; i++) + if (sc->padconf->pins[i].port == gpios[0] && + sc->padconf->pins[i].pin == gpios[1]) { + *pin = i; + break; + } *flags = gpios[gcells - 1]; return (0); @@ -488,6 +647,9 @@ static device_method_t a10_gpio_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, a10_gpio_get_node), + /* fdt_pinctrl interface */ + DEVMETHOD(fdt_pinctrl_configure,aw_fdt_configure_pins), + DEVMETHOD_END }; @@ -501,22 +663,3 @@ static driver_t a10_gpio_driver = { EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); - - -int -a10_gpio_ethernet_activate(uint32_t func) -{ - int i; - struct a10_gpio_softc *sc = a10_gpio_sc; - - if (sc == NULL) - return (ENXIO); - - /* Configure pin mux settings for MII. */ - A10_GPIO_LOCK(sc); - for (i = 0; i <= 17; i++) - a10_gpio_set_function(sc, i, func); - A10_GPIO_UNLOCK(sc); - - return (0); -} Added: head/sys/arm/allwinner/a10_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_padconf.c Wed Feb 17 18:28:03 2016 (r295711) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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 + +const static struct allwinner_pins a10_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "emac", "spi1", NULL, NULL, NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB8", 1, 8, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB9", 1, 9, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB11", 1, 11, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB12", 1, 12, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB13", 1, 13, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, NULL, NULL}}, + {"PB14", 1, 14, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB15", 1, 15, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB16", 1, 16, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC23", 2, 23, {"gpio_in", "gpio_out", "spi0", NULL, NULL, NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", "csi1", NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "ts0", "csi0", "sim", NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint", "csi1"}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint", "csi1"}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint", "csi1"}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + + {"PI0", 8, 0, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI1", 8, 1, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI2", 8, 2, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI3", 8, 3, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PI4", 8, 4, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI5", 8, 5, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI6", 8, 6, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, + {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a10_padconf = { + .npins = sizeof(a10_pins) / sizeof(struct allwinner_pins), + .pins = a10_pins, +}; Modified: head/sys/arm/allwinner/a20/a20_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_if_dwc.c Wed Feb 17 18:12:38 2016 (r295710) +++ head/sys/arm/allwinner/a20/a20_if_dwc.c Wed Feb 17 18:28:03 2016 (r295711) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "if_dwc_if.h" @@ -63,8 +62,7 @@ a20_if_dwc_init(device_t dev) { /* Activate GMAC clock and set the pin mux to rgmii. */ - if (a10_clk_gmac_activate(ofw_bus_get_node(dev)) != 0 || - a10_gpio_ethernet_activate(A10_GPIO_FUNC_RGMII)) { + if (a10_clk_gmac_activate(ofw_bus_get_node(dev)) != 0) { device_printf(dev, "could not activate gmac module\n"); return (ENXIO); } Added: head/sys/arm/allwinner/a20/a20_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a20/a20_padconf.c Wed Feb 17 18:28:03 2016 (r295711) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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 + +const static struct allwinner_pins a20_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "emac", "spi1", NULL, "gmac", NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "emac", "spi3", NULL, "gmac", NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "emac", "spi3", NULL, "gmac", NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "emac", "spi3", NULL, "gmac", NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "emac", "spi3", NULL, "gmac", NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "emac", "spi3", NULL, "gmac", "i2c1", NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "emac", NULL, "uart1", "gmac", NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "emac", NULL, "uart1", "gmac", NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", "gmac", NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", "gmac", NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", "gmac", "i2c1", NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", "gmac", "i2c1", NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", NULL, "can", "uart1", "gmac", "i2c1", NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", NULL, "can", "uart1", "gmac", "i2c1", NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, "spdif", NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "ac97", NULL, NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2c0", "ac97", NULL, NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2c0", "ac97", NULL, NULL, NULL, NULL}}, + {"PB8", 1, 8, {"gpio_in", "gpio_out", "i2c0", "ac97", NULL, NULL, NULL, NULL}}, + {"PB9", 1, 9, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB11", 1, 11, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB12", 1, 12, {"gpio_in", "gpio_out", "i2c0", "ac97", "spdif", NULL, NULL, NULL}}, + {"PB13", 1, 13, {"gpio_in", "gpio_out", "spi2", NULL, "spdif", NULL, NULL, NULL}}, + {"PB14", 1, 14, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB15", 1, 15, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB16", 1, 16, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand0", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}}, + {"PC23", 2, 23, {"gpio_in", "gpio_out", NULL, "spi0", NULL, NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", "csi1", NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint", "csi1"}}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint", "csi1"}}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint", "csi1"}}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint", "csi1"}}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "eint", "csi1"}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "eint", "csi1"}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint", "csi1"}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint", "csi1"}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, + + {"PI0", 8, 0, {"gpio_in", "gpio_out", NULL, "i2c3", NULL, NULL, NULL, NULL}}, + {"PI1", 8, 1, {"gpio_in", "gpio_out", NULL, "i2c3", NULL, NULL, NULL, NULL}}, + {"PI2", 8, 2, {"gpio_in", "gpio_out", NULL, "i2c4", NULL, NULL, NULL, NULL}}, + {"PI3", 8, 3, {"gpio_in", "gpio_out", "pwm", "i2c4", NULL, NULL, NULL, NULL}}, + {"PI4", 8, 4, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI5", 8, 5, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI6", 8, 6, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_a", NULL, "eint", NULL}}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_b", NULL, "eint", NULL}}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, + {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a20_padconf = { + .npins = sizeof(a20_pins) / sizeof(struct allwinner_pins), + .pins = a20_pins, +}; Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Wed Feb 17 18:12:38 2016 (r295710) +++ head/sys/arm/allwinner/a20/files.a20 Wed Feb 17 18:28:03 2016 (r295711) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/allwinner/a20/a20_padconf.c standard arm/allwinner/a20/a20_mp.c optional smp arm/allwinner/a20/a20_if_dwc.c optional dwc Added: head/sys/arm/allwinner/allwinner_pinctrl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/allwinner_pinctrl.h Wed Feb 17 18:28:03 2016 (r295711) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 17 18:28:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8620EAAA0F6; Wed, 17 Feb 2016 18:28:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597A11ED5; Wed, 17 Feb 2016 18:28:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HIScqk019939; Wed, 17 Feb 2016 18:28:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HIScrl019938; Wed, 17 Feb 2016 18:28:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602171828.u1HIScrl019938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 17 Feb 2016 18:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295712 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 18:28:39 -0000 Author: imp Date: Wed Feb 17 18:28:38 2016 New Revision: 295712 URL: https://svnweb.freebsd.org/changeset/base/295712 Log: Use the right size for zeroing. Submitted by: rpokala@ Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Feb 17 18:28:03 2016 (r295711) +++ head/sys/geom/geom_io.c Wed Feb 17 18:28:38 2016 (r295712) @@ -268,7 +268,7 @@ void g_reset_bio(struct bio *bp) { - bzero(bp, sizeof(bp)); + bzero(bp, sizeof(*bp)); } void From owner-svn-src-head@freebsd.org Wed Feb 17 18:41:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26EECAAA836; Wed, 17 Feb 2016 18:41:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC9E41766; Wed, 17 Feb 2016 18:41:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HIftgo025547; Wed, 17 Feb 2016 18:41:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HIftPS025546; Wed, 17 Feb 2016 18:41:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602171841.u1HIftPS025546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Feb 2016 18:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295713 - head/lib/libc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 18:41:57 -0000 Author: bdrewery Date: Wed Feb 17 18:41:55 2016 New Revision: 295713 URL: https://svnweb.freebsd.org/changeset/base/295713 Log: Fix build race after r295643. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/Makefile Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Wed Feb 17 18:28:38 2016 (r295712) +++ head/lib/libc/tests/Makefile Wed Feb 17 18:41:55 2016 (r295713) @@ -22,6 +22,8 @@ TESTS_SUBDIRS+= termios TESTS_SUBDIRS+= tls TESTS_SUBDIRS+= ttyio +SUBDIR_DEPEND_tls= tls_dso + .if ${MK_LOCALES} != "no" TESTS_SUBDIRS+= locale .endif From owner-svn-src-head@freebsd.org Wed Feb 17 19:39:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7770BAAC645; Wed, 17 Feb 2016 19:39:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46DB818F8; Wed, 17 Feb 2016 19:39:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HJdvuh040900; Wed, 17 Feb 2016 19:39:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HJdv05040899; Wed, 17 Feb 2016 19:39:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602171939.u1HJdv05040899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Feb 2016 19:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295716 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 19:39:58 -0000 Author: kib Date: Wed Feb 17 19:39:57 2016 New Revision: 295716 URL: https://svnweb.freebsd.org/changeset/base/295716 Log: In bnoreuselist(), check both ends of the specified logical block numbers range. This effectively skips indirect and extdata blocks on the buffer queue. Since their logical block numbers are negative, bnoreuselist() could loop infinitely. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Feb 17 19:11:09 2016 (r295715) +++ head/sys/kern/vfs_subr.c Wed Feb 17 19:39:57 2016 (r295716) @@ -1673,7 +1673,8 @@ bnoreuselist(struct bufv *bufv, struct b for (lblkno = startn;;) { again: bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); - if (bp == NULL || bp->b_lblkno >= endn) + if (bp == NULL || bp->b_lblkno >= endn || + bp->b_lblkno < startn) break; error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0); From owner-svn-src-head@freebsd.org Wed Feb 17 19:43:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80370AAC7F6; Wed, 17 Feb 2016 19:43:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E26A1D05; Wed, 17 Feb 2016 19:43:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HJh3MZ043500; Wed, 17 Feb 2016 19:43:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HJh3or043499; Wed, 17 Feb 2016 19:43:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602171943.u1HJh3or043499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Feb 2016 19:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295717 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 19:43:04 -0000 Author: kib Date: Wed Feb 17 19:43:03 2016 New Revision: 295717 URL: https://svnweb.freebsd.org/changeset/base/295717 Log: After nullfs rmdir operation, reclaim the directory vnode which was unlinked. Otherwise the vnode stays cached, causing leak. This is similar to r292961 for regular files. Reported and tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Wed Feb 17 19:39:57 2016 (r295716) +++ head/sys/fs/nullfs/null_vnops.c Wed Feb 17 19:43:03 2016 (r295717) @@ -619,6 +619,14 @@ null_rename(struct vop_rename_args *ap) return (null_bypass((struct vop_generic_args *)ap)); } +static int +null_rmdir(struct vop_rmdir_args *ap) +{ + + VTONULL(ap->a_vp)->null_flags |= NULLV_DROP; + return (null_bypass(&ap->a_gen)); +} + /* * We need to process our own vnode lock and then clear the * interlock flag as it applies only to our vnode, not the @@ -920,6 +928,7 @@ struct vop_vector null_vnodeops = { .vop_reclaim = null_reclaim, .vop_remove = null_remove, .vop_rename = null_rename, + .vop_rmdir = null_rmdir, .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, From owner-svn-src-head@freebsd.org Wed Feb 17 21:09:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B185EAABD70; Wed, 17 Feb 2016 21:09:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80CFE1A8F; Wed, 17 Feb 2016 21:09:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HL9JS3067131; Wed, 17 Feb 2016 21:09:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HL9JMA067129; Wed, 17 Feb 2016 21:09:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602172109.u1HL9JMA067129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 17 Feb 2016 21:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295718 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 21:09:20 -0000 Author: glebius Date: Wed Feb 17 21:09:19 2016 New Revision: 295718 URL: https://svnweb.freebsd.org/changeset/base/295718 Log: Add missing braces. Found by: PVS-Studio Approved by: so (implicit) Modified: head/sys/dev/random/nehemiah.c Modified: head/sys/dev/random/nehemiah.c ============================================================================== --- head/sys/dev/random/nehemiah.c Wed Feb 17 19:43:03 2016 (r295717) +++ head/sys/dev/random/nehemiah.c Wed Feb 17 21:09:19 2016 (r295718) @@ -131,9 +131,10 @@ nehemiah_modevent(module_t mod, int type break; case MOD_UNLOAD: - if (via_feature_rng & VIA_HAS_RNG) + if (via_feature_rng & VIA_HAS_RNG) { random_nehemiah_deinit(); random_source_deregister(&random_nehemiah); + } break; case MOD_SHUTDOWN: From owner-svn-src-head@freebsd.org Wed Feb 17 21:13:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 963A4AAC036; Wed, 17 Feb 2016 21:13:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6548F1F0B; Wed, 17 Feb 2016 21:13:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HLDXhi069773; Wed, 17 Feb 2016 21:13:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HLDX3v069772; Wed, 17 Feb 2016 21:13:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602172113.u1HLDX3v069772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 17 Feb 2016 21:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295719 - head/sys/dev/ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 21:13:34 -0000 Author: glebius Date: Wed Feb 17 21:13:33 2016 New Revision: 295719 URL: https://svnweb.freebsd.org/changeset/base/295719 Log: Ternary operator has lower priority than OR. Found by: PVS-Studio Modified: head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Wed Feb 17 21:09:19 2016 (r295718) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Wed Feb 17 21:13:33 2016 (r295719) @@ -162,9 +162,8 @@ ata_serverworks_chipinit(device_t dev) } } else { - pci_write_config(dev, 0x5a, - (pci_read_config(dev, 0x5a, 1) & ~0x40) | - (ctlr->chip->cfg1 == SWKS_100) ? 0x03 : 0x02, 1); + pci_write_config(dev, 0x5a, (pci_read_config(dev, 0x5a, 1) & ~0x40) | + ((ctlr->chip->cfg1 == SWKS_100) ? 0x03 : 0x02), 1); } ctlr->setmode = ata_serverworks_setmode; return 0; From owner-svn-src-head@freebsd.org Wed Feb 17 21:17:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC1F9AAC20A; Wed, 17 Feb 2016 21:17:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB2C131E; Wed, 17 Feb 2016 21:17:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HLHEh0069938; Wed, 17 Feb 2016 21:17:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HLHEc7069937; Wed, 17 Feb 2016 21:17:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602172117.u1HLHEc7069937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 17 Feb 2016 21:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295720 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 21:17:15 -0000 Author: glebius Date: Wed Feb 17 21:17:14 2016 New Revision: 295720 URL: https://svnweb.freebsd.org/changeset/base/295720 Log: Ternary operator has lower priority than OR. Found by: PVS-Studio Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Feb 17 21:13:33 2016 (r295719) +++ head/sys/netinet6/in6.c Wed Feb 17 21:17:14 2016 (r295720) @@ -1316,7 +1316,7 @@ in6_purgeaddr(struct ifaddr *ifa) plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { error = rtinit(&(ia->ia_ifa), RTM_DELETE, ia->ia_flags | - (ia->ia_dstaddr.sin6_family == AF_INET6) ? RTF_HOST : 0); + (ia->ia_dstaddr.sin6_family == AF_INET6 ? RTF_HOST : 0)); if (error != 0) log(LOG_INFO, "%s: err=%d, destination address delete " "failed\n", __func__, error); From owner-svn-src-head@freebsd.org Wed Feb 17 21:24:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B8AAAC603; Wed, 17 Feb 2016 21:24:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02A81C25; Wed, 17 Feb 2016 21:24:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HLOQUS072731; Wed, 17 Feb 2016 21:24:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HLOQuQ072730; Wed, 17 Feb 2016 21:24:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602172124.u1HLOQuQ072730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 17 Feb 2016 21:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295721 - head/sys/dev/ae X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 21:24:27 -0000 Author: glebius Date: Wed Feb 17 21:24:26 2016 New Revision: 295721 URL: https://svnweb.freebsd.org/changeset/base/295721 Log: Fix a potentially "forever" loop. Found by: PVS-Studio Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Feb 17 21:17:14 2016 (r295720) +++ head/sys/dev/ae/if_ae.c Wed Feb 17 21:24:26 2016 (r295721) @@ -1660,7 +1660,7 @@ ae_stop_rxmac(ae_softc_t *sc) /* * Wait for IDLE state. */ - for (i = 0; i < AE_IDLE_TIMEOUT; i--) { + for (i = 0; i < AE_IDLE_TIMEOUT; i++) { val = AE_READ_4(sc, AE_IDLE_REG); if ((val & (AE_IDLE_RXMAC | AE_IDLE_DMAWRITE)) == 0) break; From owner-svn-src-head@freebsd.org Wed Feb 17 23:53:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 543C0AAC591; Wed, 17 Feb 2016 23:53:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24FDF181C; Wed, 17 Feb 2016 23:53:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HNrPV5017297; Wed, 17 Feb 2016 23:53:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HNrPY5017296; Wed, 17 Feb 2016 23:53:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602172353.u1HNrPY5017296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Feb 2016 23:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295729 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 23:53:26 -0000 Author: markj Date: Wed Feb 17 23:53:24 2016 New Revision: 295729 URL: https://svnweb.freebsd.org/changeset/base/295729 Log: Remove a prototype for the non-existent prelist_del(). MFC after: 1 week Modified: head/sys/netinet6/nd6.h Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Wed Feb 17 23:36:58 2016 (r295728) +++ head/sys/netinet6/nd6.h Wed Feb 17 23:53:24 2016 (r295729) @@ -441,7 +441,6 @@ void nd6_dad_stop(struct ifaddr *); /* nd6_rtr.c */ void nd6_rs_input(struct mbuf *, int, int); void nd6_ra_input(struct mbuf *, int, int); -void prelist_del(struct nd_prefix *); void defrouter_reset(void); void defrouter_select(void); void defrtrlist_del(struct nd_defrouter *); From owner-svn-src-head@freebsd.org Wed Feb 17 23:55:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E43B0AAC626; Wed, 17 Feb 2016 23:55:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B63E81A0B; Wed, 17 Feb 2016 23:55:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1HNtOXf017425; Wed, 17 Feb 2016 23:55:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HNtOUG017424; Wed, 17 Feb 2016 23:55:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602172355.u1HNtOUG017424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Feb 2016 23:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295730 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 17 Feb 2016 23:55:26 -0000 Author: markj Date: Wed Feb 17 23:55:24 2016 New Revision: 295730 URL: https://svnweb.freebsd.org/changeset/base/295730 Log: Use pfxrtr_del() instead of freeing advertising routers directly. MFC after: 1 week Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Wed Feb 17 23:53:24 2016 (r295729) +++ head/sys/netinet6/nd6_rtr.c Wed Feb 17 23:55:24 2016 (r295730) @@ -936,9 +936,9 @@ prelist_remove(struct nd_prefix *pr) /* unlink ndpr_entry from nd_prefix list */ LIST_REMOVE(pr, ndpr_entry); - /* free list of routers that adversed the prefix */ + /* free list of routers that advertised the prefix */ LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) { - free(pfr, M_IP6NDP); + pfxrtr_del(pfr); } free(pr, M_IP6NDP); From owner-svn-src-head@freebsd.org Thu Feb 18 00:00:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14444AAC9DC; Thu, 18 Feb 2016 00:00:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5D4C1D5D; Thu, 18 Feb 2016 00:00:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I00p1Y017711; Thu, 18 Feb 2016 00:00:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I00pn5017710; Thu, 18 Feb 2016 00:00:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602180000.u1I00pn5017710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Feb 2016 00:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295732 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 00:00:53 -0000 Author: markj Date: Thu Feb 18 00:00:51 2016 New Revision: 295732 URL: https://svnweb.freebsd.org/changeset/base/295732 Log: Release the ref acquired in nd6_dad_find() if DAD is already in progress. MFC after: 1 week Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Feb 18 00:00:36 2016 (r295731) +++ head/sys/netinet6/nd6_nbr.c Thu Feb 18 00:00:51 2016 (r295732) @@ -1262,9 +1262,10 @@ nd6_dad_start(struct ifaddr *ifa, int de } if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* - * DAD already in progress. Let the existing entry - * to finish it. + * DAD is already in progress. Let the existing entry + * finish it. */ + nd6_dad_rele(dp); return; } From owner-svn-src-head@freebsd.org Thu Feb 18 00:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B894AAAB67C; Thu, 18 Feb 2016 00:26:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0971007; Thu, 18 Feb 2016 00:26:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I0QMYi028946; Thu, 18 Feb 2016 00:26:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I0QMEa028942; Thu, 18 Feb 2016 00:26:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602180026.u1I0QMEa028942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 18 Feb 2016 00:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295733 - in head: libexec libexec/makewhatis.local usr.bin/makewhatis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 00:26:23 -0000 Author: bdrewery Date: Thu Feb 18 00:26:21 2016 New Revision: 295733 URL: https://svnweb.freebsd.org/changeset/base/295733 Log: Fix installation of makewhatis.local(1) since r283777. The wrapper script has moved to libexec/makewhatis.local since it is not directlry related to the older makewhatis(1) utility that has been replaced by the usr.bin/mandoc version. Reported by: vangyzen Added: head/libexec/makewhatis.local/ - copied from r295732, head/usr.bin/makewhatis/ Deleted: head/libexec/makewhatis.local/makewhatis.1 head/libexec/makewhatis.local/makewhatis.c Modified: head/libexec/Makefile head/libexec/makewhatis.local/Makefile head/libexec/makewhatis.local/Makefile.depend head/usr.bin/makewhatis/Makefile Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Feb 18 00:00:51 2016 (r295732) +++ head/libexec/Makefile Thu Feb 18 00:26:21 2016 (r295733) @@ -10,6 +10,7 @@ SUBDIR= ${_atf} \ ${_dma} \ getty \ ${_mail.local} \ + ${_makewhatis.local} \ ${_mknetid} \ ${_pppoed} \ revnetgroup \ @@ -88,6 +89,10 @@ _mail.local= mail.local _smrsh= smrsh .endif +.if ${MK_MAN_UTILS} != "no" +_makewhatis.local= makewhatis.local +.endif + .if ${MK_TALK} != "no" SUBDIR+= talkd .endif Modified: head/libexec/makewhatis.local/Makefile ============================================================================== --- head/usr.bin/makewhatis/Makefile Thu Feb 18 00:00:51 2016 (r295732) +++ head/libexec/makewhatis.local/Makefile Thu Feb 18 00:26:21 2016 (r295733) @@ -1,9 +1,7 @@ # $FreeBSD$ -PROG= makewhatis -LIBADD= z SCRIPTS= makewhatis.local.sh -MAN= makewhatis.1 makewhatis.local.8 +MAN= makewhatis.local.8 SCRIPTSDIR= ${LIBEXECDIR} LINKS= ${SCRIPTSDIR}/makewhatis.local ${SCRIPTSDIR}/catman.local MLINKS= makewhatis.local.8 catman.local.8 Modified: head/libexec/makewhatis.local/Makefile.depend ============================================================================== --- head/usr.bin/makewhatis/Makefile.depend Thu Feb 18 00:00:51 2016 (r295732) +++ head/libexec/makewhatis.local/Makefile.depend Thu Feb 18 00:26:21 2016 (r295733) @@ -2,14 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ - gnu/lib/libgcc \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libz \ .include Modified: head/usr.bin/makewhatis/Makefile ============================================================================== --- head/usr.bin/makewhatis/Makefile Thu Feb 18 00:00:51 2016 (r295732) +++ head/usr.bin/makewhatis/Makefile Thu Feb 18 00:26:21 2016 (r295733) @@ -2,10 +2,5 @@ PROG= makewhatis LIBADD= z -SCRIPTS= makewhatis.local.sh -MAN= makewhatis.1 makewhatis.local.8 -SCRIPTSDIR= ${LIBEXECDIR} -LINKS= ${SCRIPTSDIR}/makewhatis.local ${SCRIPTSDIR}/catman.local -MLINKS= makewhatis.local.8 catman.local.8 .include From owner-svn-src-head@freebsd.org Thu Feb 18 01:24:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF37AACE98; Thu, 18 Feb 2016 01:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58326E65; Thu, 18 Feb 2016 01:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I1OB0w046410; Thu, 18 Feb 2016 01:24:11 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I1OAQk046403; Thu, 18 Feb 2016 01:24:10 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201602180124.u1I1OAQk046403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Feb 2016 01:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295735 - in head/sys/dev: age alc ale jme msk stge vte X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 01:24:12 -0000 Author: yongari Date: Thu Feb 18 01:24:10 2016 New Revision: 295735 URL: https://svnweb.freebsd.org/changeset/base/295735 Log: Fix variable assignment. Found by: PVS-Studio Modified: head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/jme/if_jme.c head/sys/dev/msk/if_msk.c head/sys/dev/stge/if_stge.c head/sys/dev/vte/if_vte.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/age/if_age.c Thu Feb 18 01:24:10 2016 (r295735) @@ -588,7 +588,7 @@ age_attach(device_t dev) /* Create device sysctl node. */ age_sysctl_node(sc); - if ((error = age_dma_alloc(sc) != 0)) + if ((error = age_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/alc/if_alc.c Thu Feb 18 01:24:10 2016 (r295735) @@ -1532,7 +1532,7 @@ alc_attach(device_t dev) /* Create device sysctl node. */ alc_sysctl_node(sc); - if ((error = alc_dma_alloc(sc) != 0)) + if ((error = alc_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/ale/if_ale.c Thu Feb 18 01:24:10 2016 (r295735) @@ -603,7 +603,7 @@ ale_attach(device_t dev) /* Create device sysctl node. */ ale_sysctl_node(sc); - if ((error = ale_dma_alloc(sc) != 0)) + if ((error = ale_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/jme/if_jme.c Thu Feb 18 01:24:10 2016 (r295735) @@ -804,7 +804,7 @@ jme_attach(device_t dev) } /* Create coalescing sysctl node. */ jme_sysctl_node(sc); - if ((error = jme_dma_alloc(sc) != 0)) + if ((error = jme_dma_alloc(sc)) != 0) goto fail; ifp = sc->jme_ifp = if_alloc(IFT_ETHER); Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/msk/if_msk.c Thu Feb 18 01:24:10 2016 (r295735) @@ -1623,7 +1623,7 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); msk_sysctl_node(sc_if); - if ((error = msk_txrx_dma_alloc(sc_if) != 0)) + if ((error = msk_txrx_dma_alloc(sc_if)) != 0) goto fail; msk_rx_dma_jalloc(sc_if); Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/stge/if_stge.c Thu Feb 18 01:24:10 2016 (r295735) @@ -508,7 +508,7 @@ stge_attach(device_t dev) } } - if ((error = stge_dma_alloc(sc) != 0)) + if ((error = stge_dma_alloc(sc)) != 0) goto fail; /* Modified: head/sys/dev/vte/if_vte.c ============================================================================== --- head/sys/dev/vte/if_vte.c Thu Feb 18 00:37:58 2016 (r295734) +++ head/sys/dev/vte/if_vte.c Thu Feb 18 01:24:10 2016 (r295735) @@ -428,7 +428,7 @@ vte_attach(device_t dev) /* Reset the ethernet controller. */ vte_reset(sc); - if ((error = vte_dma_alloc(sc) != 0)) + if ((error = vte_dma_alloc(sc)) != 0) goto fail; /* Create device sysctl node. */ From owner-svn-src-head@freebsd.org Thu Feb 18 01:30:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41381AAB058; Thu, 18 Feb 2016 01:30:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06A641083; Thu, 18 Feb 2016 01:30:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I1UnUP046657; Thu, 18 Feb 2016 01:30:49 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I1UnC4046656; Thu, 18 Feb 2016 01:30:49 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201602180130.u1I1UnC4046656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Feb 2016 01:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295736 - head/sys/dev/rl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 01:30:51 -0000 Author: yongari Date: Thu Feb 18 01:30:49 2016 New Revision: 295736 URL: https://svnweb.freebsd.org/changeset/base/295736 Log: Remove duplicated check. Found by: PVS-Studio Modified: head/sys/dev/rl/if_rl.c Modified: head/sys/dev/rl/if_rl.c ============================================================================== --- head/sys/dev/rl/if_rl.c Thu Feb 18 01:24:10 2016 (r295735) +++ head/sys/dev/rl/if_rl.c Thu Feb 18 01:30:49 2016 (r295736) @@ -1938,18 +1938,15 @@ rl_stop(struct rl_softc *sc) */ for (i = 0; i < RL_TX_LIST_CNT; i++) { if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, - sc->rl_cdata.rl_tx_dmamap[i], - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - m_freem(sc->rl_cdata.rl_tx_chain[i]); - sc->rl_cdata.rl_tx_chain[i] = NULL; - } - CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), - 0x0000000); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + m_freem(sc->rl_cdata.rl_tx_chain[i]); + sc->rl_cdata.rl_tx_chain[i] = NULL; } + CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } } From owner-svn-src-head@freebsd.org Thu Feb 18 01:58:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59784AABEE8; Thu, 18 Feb 2016 01:58:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CED71FA5; Thu, 18 Feb 2016 01:58:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I1wQvm055368; Thu, 18 Feb 2016 01:58:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I1wQm6055367; Thu, 18 Feb 2016 01:58:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602180158.u1I1wQm6055367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Feb 2016 01:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295737 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 01:58:27 -0000 Author: markj Date: Thu Feb 18 01:58:26 2016 New Revision: 295737 URL: https://svnweb.freebsd.org/changeset/base/295737 Log: Use the _SAFE loop variant, since the loop body may remove queue entries. PR: 207146 MFC after: 3 days Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Thu Feb 18 01:30:49 2016 (r295736) +++ head/usr.sbin/rtsold/rtsold.c Thu Feb 18 01:58:26 2016 (r295737) @@ -554,7 +554,7 @@ rtsol_check_timer(void) struct timespec now, rtsol_timer; struct ifinfo *ifi; struct rainfo *rai; - struct ra_opt *rao; + struct ra_opt *rao, *raotmp; int flags; clock_gettime(CLOCK_MONOTONIC_FAST, &now); @@ -649,7 +649,8 @@ rtsol_check_timer(void) int expire = 0; TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) { - TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) { + TAILQ_FOREACH_SAFE(rao, &rai->rai_ra_opt, + rao_next, raotmp) { warnmsg(LOG_DEBUG, __func__, "RA expiration timer: " "type=%d, msg=%s, expire=%s", From owner-svn-src-head@freebsd.org Thu Feb 18 03:05:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 893FBAABD09; Thu, 18 Feb 2016 03:05:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF122B9; Thu, 18 Feb 2016 03:05:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I358oV076600; Thu, 18 Feb 2016 03:05:08 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I358hQ076599; Thu, 18 Feb 2016 03:05:08 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201602180305.u1I358hQ076599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Feb 2016 03:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295738 - head/sys/dev/rl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 03:05:09 -0000 Author: yongari Date: Thu Feb 18 03:05:08 2016 New Revision: 295738 URL: https://svnweb.freebsd.org/changeset/base/295738 Log: Fix a bug introduced in r295736 TX descriptor address should be updated for valid chain. Pointed out by: jmallett Modified: head/sys/dev/rl/if_rl.c Modified: head/sys/dev/rl/if_rl.c ============================================================================== --- head/sys/dev/rl/if_rl.c Thu Feb 18 01:58:26 2016 (r295737) +++ head/sys/dev/rl/if_rl.c Thu Feb 18 03:05:08 2016 (r295738) @@ -1945,8 +1945,9 @@ rl_stop(struct rl_softc *sc) sc->rl_cdata.rl_tx_dmamap[i]); m_freem(sc->rl_cdata.rl_tx_chain[i]); sc->rl_cdata.rl_tx_chain[i] = NULL; + CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), + 0x0000000); } - CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } } From owner-svn-src-head@freebsd.org Thu Feb 18 04:58:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A9FAAC80B; Thu, 18 Feb 2016 04:58:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82E21220; Thu, 18 Feb 2016 04:58:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I4wYks012193; Thu, 18 Feb 2016 04:58:34 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I4wYmJ012190; Thu, 18 Feb 2016 04:58:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180458.u1I4wYmJ012190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 04:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295739 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 04:58:36 -0000 Author: sephe Date: Thu Feb 18 04:58:34 2016 New Revision: 295739 URL: https://svnweb.freebsd.org/changeset/base/295739 Log: tcp/lro: Allow drivers to set the TCP ACK/data segment aggregation limit ACK aggregation limit is append count based, while the TCP data segment aggregation limit is length based. Unless the network driver sets these two limits, it's an NO-OP. Reviewed by: adrian, gallatin (previous version), hselasky (previous version) Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5185 Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h head/sys/sys/param.h Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Feb 18 03:05:08 2016 (r295738) +++ head/sys/netinet/tcp_lro.c Thu Feb 18 04:58:34 2016 (r295739) @@ -88,6 +88,8 @@ tcp_lro_init_args(struct lro_ctrl *lc, s lc->lro_mbuf_count = 0; lc->lro_mbuf_max = lro_mbufs; lc->lro_cnt = lro_entries; + lc->lro_ackcnt_lim = TCP_LRO_ACKCNT_MAX; + lc->lro_length_lim = TCP_LRO_LENGTH_MAX; lc->ifp = ifp; SLIST_INIT(&lc->lro_free); SLIST_INIT(&lc->lro_active); @@ -610,7 +612,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m } /* Flush now if appending will result in overflow. */ - if (le->p_len > (65535 - tcp_data_len)) { + if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); tcp_lro_flush(lc, le); break; @@ -648,6 +650,15 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m if (tcp_data_len == 0) { m_freem(m); + /* + * Flush this LRO entry, if this ACK should not + * be further delayed. + */ + if (le->append_cnt >= lc->lro_ackcnt_lim) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, + next); + tcp_lro_flush(lc, le); + } return (0); } @@ -668,7 +679,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * If a possible next full length packet would cause an * overflow, pro-actively flush now. */ - if (le->p_len > (65535 - lc->ifp->if_mtu)) { + if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); tcp_lro_flush(lc, le); } else Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Thu Feb 18 03:05:08 2016 (r295738) +++ head/sys/netinet/tcp_lro.h Thu Feb 18 04:58:34 2016 (r295739) @@ -91,11 +91,16 @@ struct lro_ctrl { unsigned lro_cnt; unsigned lro_mbuf_count; unsigned lro_mbuf_max; + unsigned short lro_ackcnt_lim; /* max # of aggregated ACKs */ + unsigned lro_length_lim; /* max len of aggregated data */ struct lro_head lro_active; struct lro_head lro_free; }; +#define TCP_LRO_LENGTH_MAX 65535 +#define TCP_LRO_ACKCNT_MAX 65535 /* unlimited */ + int tcp_lro_init(struct lro_ctrl *); int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); void tcp_lro_free(struct lro_ctrl *); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Feb 18 03:05:08 2016 (r295738) +++ head/sys/sys/param.h Thu Feb 18 04:58:34 2016 (r295739) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100098 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100099 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Feb 18 04:59:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F75EAAC8F7; Thu, 18 Feb 2016 04:59:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE0821546; Thu, 18 Feb 2016 04:59:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I4xbDT012423; Thu, 18 Feb 2016 04:59:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I4xbkk012421; Thu, 18 Feb 2016 04:59:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180459.u1I4xbkk012421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 04:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295740 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 04:59:39 -0000 Author: sephe Date: Thu Feb 18 04:59:37 2016 New Revision: 295740 URL: https://svnweb.freebsd.org/changeset/base/295740 Log: hyperv/hn: Set the TCP ACK/data segment aggregation limit Set TCP ACK append limit to 1, i.e. aggregate 2 ACKs at most. Aggregating anything more than 2 hurts TCP sending performance in hyperv. This significantly improves the TCP sending performance when the number of concurrent connetion is low (2~8). And it greatly stabilizes the TCP sending performance in other cases. Set TCP data segments aggregation length limit to 37500. Without this limitation, hn(4) could aggregate ~45 TCP data segments for each connection (even at 64 or more connections) before dispatching them to socket code; large aggregation slows down ACK sending and eventually hurts/destabilizes TCP reception performance. This setting stabilizes and improves TCP reception performance for >4 concurrent connections significantly. Make them sysctls so they could be adjusted. Reviewed by: adrian, gallatin (previous version), hselasky (previous version) Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5185 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 04:58:34 2016 (r295739) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 04:59:37 2016 (r295740) @@ -1030,7 +1030,6 @@ typedef struct hn_softc { struct task hn_txeof_task; struct lro_ctrl hn_lro; - int hn_lro_hiwat; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 04:58:34 2016 (r295739) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 04:59:37 2016 (r295740) @@ -176,14 +176,11 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8 (CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) -/* XXX move to netinet/tcp_lro.h */ -#define HN_LRO_HIWAT_MAX 65535 -#define HN_LRO_HIWAT_DEF HN_LRO_HIWAT_MAX +#define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ -#define HN_LRO_HIWAT_MTULIM(ifp) (2 * (ifp)->if_mtu) -#define HN_LRO_HIWAT_ISVALID(sc, hiwat) \ - ((hiwat) >= HN_LRO_HIWAT_MTULIM((sc)->hn_ifp) || \ - (hiwat) <= HN_LRO_HIWAT_MAX) +#define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) + +#define HN_LRO_ACKCNT_DEF 1 /* * Be aware that this sleepable mutex will exhibit WITNESS errors when @@ -253,9 +250,8 @@ static void hn_start(struct ifnet *ifp); static void hn_start_txeof(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); -#ifdef HN_LRO_HIWAT -static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); -#endif +static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS); static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); @@ -265,15 +261,6 @@ static void hn_start_taskfunc(void *xsc, static void hn_txeof_taskfunc(void *xsc, int pending); static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); -static __inline void -hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) -{ - sc->hn_lro_hiwat = hiwat; -#ifdef HN_LRO_HIWAT - sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; -#endif -} - static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -358,7 +345,6 @@ netvsc_attach(device_t dev) bzero(sc, sizeof(hn_softc_t)); sc->hn_unit = unit; sc->hn_dev = dev; - sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; sc->hn_direct_tx_size = hn_direct_tx_size; if (hn_trust_hosttcp) sc->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; @@ -442,9 +428,8 @@ netvsc_attach(device_t dev) /* Driver private LRO settings */ sc->hn_lro.ifp = ifp; #endif -#ifdef HN_LRO_HIWAT - sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; -#endif + sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF; + sc->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; #endif /* INET || INET6 */ #if __FreeBSD_version >= 1100045 @@ -480,11 +465,12 @@ netvsc_attach(device_t dev) CTLFLAG_RW, &sc->hn_lro.lro_flushed, 0, "LRO flushed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "lro_tried", CTLFLAG_RW, &sc->hn_lro_tried, "# of LRO tries"); -#ifdef HN_LRO_HIWAT - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_hiwat", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_hiwat_sysctl, - "I", "LRO high watermark"); -#endif + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", + CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", + "Max # of data bytes to be aggregated by LRO"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", + "Max # of ACKs to be aggregated by LRO"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, hn_trust_hcsum_sysctl, "I", @@ -1410,12 +1396,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; + /* - * Make sure that LRO high watermark is still valid, - * after MTU change (the 2*MTU limit). + * Make sure that LRO aggregation length limit is still + * valid, after the MTU change. */ - if (!HN_LRO_HIWAT_ISVALID(sc, sc->hn_lro_hiwat)) - hn_set_lro_hiwat(sc, HN_LRO_HIWAT_MTULIM(ifp)); + if (sc->hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) + sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_MIN(ifp); do { NV_LOCK(sc); @@ -1722,26 +1709,51 @@ hn_watchdog(struct ifnet *ifp) } #endif -#ifdef HN_LRO_HIWAT static int -hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS) +hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - int hiwat, error; + unsigned int lenlim; + int error; - hiwat = sc->hn_lro_hiwat; - error = sysctl_handle_int(oidp, &hiwat, 0, req); + lenlim = sc->hn_lro.lro_length_lim; + error = sysctl_handle_int(oidp, &lenlim, 0, req); if (error || req->newptr == NULL) return error; - if (!HN_LRO_HIWAT_ISVALID(sc, hiwat)) + if (lenlim < HN_LRO_LENLIM_MIN(sc->hn_ifp) || + lenlim > TCP_LRO_LENGTH_MAX) return EINVAL; - if (sc->hn_lro_hiwat != hiwat) - hn_set_lro_hiwat(sc, hiwat); + sc->hn_lro.lro_length_lim = lenlim; + return 0; +} + +static int +hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ackcnt, error; + + /* + * lro_ackcnt_lim is append count limit, + * +1 to turn it into aggregation limit. + */ + ackcnt = sc->hn_lro.lro_ackcnt_lim + 1; + error = sysctl_handle_int(oidp, &ackcnt, 0, req); + if (error || req->newptr == NULL) + return error; + + if (ackcnt < 2 || ackcnt > (TCP_LRO_ACKCNT_MAX + 1)) + return EINVAL; + + /* + * Convert aggregation limit back to append + * count limit. + */ + sc->hn_lro.lro_ackcnt_lim = ackcnt - 1; return 0; } -#endif /* HN_LRO_HIWAT */ static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS) From owner-svn-src-head@freebsd.org Thu Feb 18 06:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F1EAAB8C3; Thu, 18 Feb 2016 06:55:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42277871; Thu, 18 Feb 2016 06:55:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I6t5qp050095; Thu, 18 Feb 2016 06:55:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I6t58u050094; Thu, 18 Feb 2016 06:55:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180655.u1I6t58u050094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 06:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295741 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 06:55:06 -0000 Author: sephe Date: Thu Feb 18 06:55:05 2016 New Revision: 295741 URL: https://svnweb.freebsd.org/changeset/base/295741 Log: hyperv/hn: Add option to allow sharing TX taskq between hn instances It is off by default. This eases further experimenting on this driver. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5272 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 04:59:37 2016 (r295740) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 06:55:05 2016 (r295741) @@ -238,6 +238,11 @@ TUNABLE_INT("dev.hn.lro_entry_count", &h #endif #endif +static int hn_share_tx_taskq = 0; +TUNABLE_INT("hw.hn.share_tx_taskq", &hn_share_tx_taskq); + +static struct taskqueue *hn_tx_taskq; + /* * Forward declarations */ @@ -353,10 +358,14 @@ netvsc_attach(device_t dev) if (hn_trust_hostip) sc->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; - sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); + if (hn_tx_taskq == NULL) { + sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &sc->hn_tx_taskq); + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); + } else { + sc->hn_tx_taskq = hn_tx_taskq; + } TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); @@ -602,7 +611,8 @@ netvsc_detach(device_t dev) taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); - taskqueue_free(sc->hn_tx_taskq); + if (sc->hn_tx_taskq != hn_tx_taskq) + taskqueue_free(sc->hn_tx_taskq); ifmedia_removeall(&sc->hn_media); #if defined(INET) || defined(INET6) @@ -2039,6 +2049,28 @@ hn_txeof_taskfunc(void *xsc, int pending NV_UNLOCK(sc); } +static void +hn_tx_taskq_create(void *arg __unused) +{ + if (!hn_share_tx_taskq) + return; + + hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &hn_tx_taskq); + taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); +} +SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST, + hn_tx_taskq_create, NULL); + +static void +hn_tx_taskq_destroy(void *arg __unused) +{ + if (hn_tx_taskq != NULL) + taskqueue_free(hn_tx_taskq); +} +SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_FIRST, + hn_tx_taskq_destroy, NULL); + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), From owner-svn-src-head@freebsd.org Thu Feb 18 07:00:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 211EAAABBDC; Thu, 18 Feb 2016 07:00:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2E98C16; Thu, 18 Feb 2016 07:00:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I70lZ4052297; Thu, 18 Feb 2016 07:00:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I70lVI052296; Thu, 18 Feb 2016 07:00:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180700.u1I70lVI052296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295742 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:00:49 -0000 Author: sephe Date: Thu Feb 18 07:00:47 2016 New Revision: 295742 URL: https://svnweb.freebsd.org/changeset/base/295742 Log: hyperv/hn: Always do transmission scheduling. This one gives the best performance so far. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5273 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 06:55:05 2016 (r295741) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:00:47 2016 (r295742) @@ -465,6 +465,13 @@ netvsc_attach(device_t dev) hn_tx_chimney_size < sc->hn_tx_chimney_max) sc->hn_tx_chimney_size = hn_tx_chimney_size; + /* + * Always schedule transmission instead of trying + * to do direct transmission. This one gives the + * best performance so far. + */ + sc->hn_sched_tx = 1; + ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); From owner-svn-src-head@freebsd.org Thu Feb 18 07:06:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4063CAABFBF; Thu, 18 Feb 2016 07:06:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0190210B9; Thu, 18 Feb 2016 07:06:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I76jIB053269; Thu, 18 Feb 2016 07:06:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I76jec053268; Thu, 18 Feb 2016 07:06:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180706.u1I76jec053268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295743 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:06:46 -0000 Author: sephe Date: Thu Feb 18 07:06:44 2016 New Revision: 295743 URL: https://svnweb.freebsd.org/changeset/base/295743 Log: hyperv/hn: Change global tunable prefix to hw.hn And use SYSCTL+CTLFLAG_RDTUN for them. Suggested by: adrian Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5274 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:00:47 2016 (r295742) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:06:44 2016 (r295743) @@ -205,41 +205,57 @@ struct hn_txdesc { int hv_promisc_mode = 0; /* normal mode by default */ +SYSCTL_NODE(_hw, OID_AUTO, hn, CTLFLAG_RD, NULL, "Hyper-V network interface"); + /* Trust tcp segements verification on host side. */ static int hn_trust_hosttcp = 1; -TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosttcp, CTLFLAG_RDTUN, + &hn_trust_hosttcp, 0, + "Trust tcp segement verification on host side, " + "when csum info is missing (global setting)"); /* Trust udp datagrams verification on host side. */ static int hn_trust_hostudp = 1; -TUNABLE_INT("dev.hn.trust_hostudp", &hn_trust_hostudp); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostudp, CTLFLAG_RDTUN, + &hn_trust_hostudp, 0, + "Trust udp datagram verification on host side, " + "when csum info is missing (global setting)"); /* Trust ip packets verification on host side. */ static int hn_trust_hostip = 1; -TUNABLE_INT("dev.hn.trust_hostip", &hn_trust_hostip); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostip, CTLFLAG_RDTUN, + &hn_trust_hostip, 0, + "Trust ip packet verification on host side, " + "when csum info is missing (global setting)"); #if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; -TUNABLE_INT("dev.hn.tso_maxlen", &hn_tso_maxlen); +SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, + &hn_tso_maxlen, 0, "TSO burst limit"); #endif /* Limit chimney send size */ static int hn_tx_chimney_size = 0; -TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size); +SYSCTL_INT(_hw_hn, OID_AUTO, tx_chimney_size, CTLFLAG_RDTUN, + &hn_tx_chimney_size, 0, "Chimney send packet size limit"); /* Limit the size of packet for direct transmission */ static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; -TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size); +SYSCTL_INT(_hw_hn, OID_AUTO, direct_tx_size, CTLFLAG_RDTUN, + &hn_direct_tx_size, 0, "Size of the packet for direct transmission"); #if defined(INET) || defined(INET6) #if __FreeBSD_version >= 1100095 static int hn_lro_entry_count = HN_LROENT_CNT_DEF; -TUNABLE_INT("dev.hn.lro_entry_count", &hn_lro_entry_count); +SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_count, CTLFLAG_RDTUN, + &hn_lro_entry_count, 0, "LRO entry count"); #endif #endif static int hn_share_tx_taskq = 0; -TUNABLE_INT("hw.hn.share_tx_taskq", &hn_share_tx_taskq); +SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, + &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); static struct taskqueue *hn_tx_taskq; @@ -541,48 +557,6 @@ netvsc_attach(device_t dev) "Always schedule transmission " "instead of doing direct transmission"); - if (unit == 0) { - struct sysctl_ctx_list *dc_ctx; - struct sysctl_oid_list *dc_child; - devclass_t dc; - - /* - * Add sysctl nodes for devclass - */ - dc = device_get_devclass(dev); - dc_ctx = devclass_get_sysctl_ctx(dc); - dc_child = SYSCTL_CHILDREN(devclass_get_sysctl_tree(dc)); - - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hosttcp", - CTLFLAG_RD, &hn_trust_hosttcp, 0, - "Trust tcp segement verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostudp", - CTLFLAG_RD, &hn_trust_hostudp, 0, - "Trust udp datagram verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostip", - CTLFLAG_RD, &hn_trust_hostip, 0, - "Trust ip packet verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tx_chimney_size", - CTLFLAG_RD, &hn_tx_chimney_size, 0, - "Chimney send packet size limit"); -#if __FreeBSD_version >= 1100045 - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tso_maxlen", - CTLFLAG_RD, &hn_tso_maxlen, 0, "TSO burst limit"); -#endif - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", - CTLFLAG_RD, &hn_direct_tx_size, 0, - "Size of the packet for direct transmission"); -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "lro_entry_count", - CTLFLAG_RD, &hn_lro_entry_count, 0, "LRO entry count"); -#endif -#endif - } - return (0); failed: hn_destroy_tx_ring(sc); From owner-svn-src-head@freebsd.org Thu Feb 18 07:16:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EB1AAC3BC; Thu, 18 Feb 2016 07:16:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAA6117BE; Thu, 18 Feb 2016 07:16:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I7GW7e056213; Thu, 18 Feb 2016 07:16:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I7GVHh056211; Thu, 18 Feb 2016 07:16:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180716.u1I7GVHh056211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295744 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:16:33 -0000 Author: sephe Date: Thu Feb 18 07:16:31 2016 New Revision: 295744 URL: https://svnweb.freebsd.org/changeset/base/295744 Log: hyperv/hn: Split RX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5275 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:06:44 2016 (r295743) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:16:31 2016 (r295744) @@ -993,6 +993,24 @@ typedef struct { struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); +struct hn_rx_ring { + struct lro_ctrl hn_lro; + + /* Trust csum verification on host side */ + int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + + u_long hn_csum_ip; + u_long hn_csum_tcp; + u_long hn_csum_udp; + u_long hn_csum_trusted; + u_long hn_lro_tried; + u_long hn_small_pkts; +} __aligned(CACHE_LINE_SIZE); + +#define HN_TRUST_HCSUM_IP 0x0001 +#define HN_TRUST_HCSUM_TCP 0x0002 +#define HN_TRUST_HCSUM_UDP 0x0004 + /* * Device-specific softc structure */ @@ -1029,17 +1047,9 @@ typedef struct hn_softc { struct task hn_start_task; struct task hn_txeof_task; - struct lro_ctrl hn_lro; - - /* Trust csum verification on host side */ - int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + int hn_rx_ring_cnt; + struct hn_rx_ring *hn_rx_ring; - u_long hn_csum_ip; - u_long hn_csum_tcp; - u_long hn_csum_udp; - u_long hn_csum_trusted; - u_long hn_lro_tried; - u_long hn_small_pkts; u_long hn_no_txdescs; u_long hn_send_failed; u_long hn_txdma_failed; @@ -1047,10 +1057,6 @@ typedef struct hn_softc { u_long hn_tx_chimney; } hn_softc_t; -#define HN_TRUST_HCSUM_IP 0x0001 -#define HN_TRUST_HCSUM_TCP 0x0002 -#define HN_TRUST_HCSUM_UDP 0x0004 - /* * Externs */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:06:44 2016 (r295743) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:16:31 2016 (r295744) @@ -275,12 +275,16 @@ static int hn_lro_lenlim_sysctl(SYSCTL_H static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS); static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *sc); static void hn_destroy_tx_ring(struct hn_softc *sc); static void hn_start_taskfunc(void *xsc, int pending); static void hn_txeof_taskfunc(void *xsc, int pending); static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); +static void hn_create_rx_data(struct hn_softc *sc); +static void hn_destroy_rx_data(struct hn_softc *sc); static int hn_ifmedia_upd(struct ifnet *ifp __unused) @@ -352,11 +356,6 @@ netvsc_attach(device_t dev) #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - int lroent_cnt; -#endif -#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -367,12 +366,6 @@ netvsc_attach(device_t dev) sc->hn_unit = unit; sc->hn_dev = dev; sc->hn_direct_tx_size = hn_direct_tx_size; - if (hn_trust_hosttcp) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; - if (hn_trust_hostudp) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; - if (hn_trust_hostip) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, @@ -396,6 +389,8 @@ netvsc_attach(device_t dev) ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; + hn_create_rx_data(sc); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_dunit = unit; ifp->if_dname = NETVSC_DEVNAME; @@ -441,22 +436,6 @@ netvsc_attach(device_t dev) sc->hn_carrier = 1; } -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - lroent_cnt = hn_lro_entry_count; - if (lroent_cnt < TCP_LRO_ENTRIES) - lroent_cnt = TCP_LRO_ENTRIES; - tcp_lro_init_args(&sc->hn_lro, ifp, lroent_cnt, 0); - device_printf(dev, "LRO: entry count %d\n", lroent_cnt); -#else - tcp_lro_init(&sc->hn_lro); - /* Driver private LRO settings */ - sc->hn_lro.ifp = ifp; -#endif - sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF; - sc->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; -#endif /* INET || INET6 */ - #if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) @@ -491,44 +470,6 @@ netvsc_attach(device_t dev) ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - SYSCTL_ADD_U64(ctx, child, OID_AUTO, "lro_queued", - CTLFLAG_RW, &sc->hn_lro.lro_queued, 0, "LRO queued"); - SYSCTL_ADD_U64(ctx, child, OID_AUTO, "lro_flushed", - CTLFLAG_RW, &sc->hn_lro.lro_flushed, 0, "LRO flushed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "lro_tried", - CTLFLAG_RW, &sc->hn_lro_tried, "# of LRO tries"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", - "Max # of data bytes to be aggregated by LRO"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", - "Max # of ACKs to be aggregated by LRO"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, - hn_trust_hcsum_sysctl, "I", - "Trust tcp segement verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostudp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_UDP, - hn_trust_hcsum_sysctl, "I", - "Trust udp datagram verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostip", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_IP, - hn_trust_hcsum_sysctl, "I", - "Trust ip packet verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_ip", - CTLFLAG_RW, &sc->hn_csum_ip, "RXCSUM IP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_tcp", - CTLFLAG_RW, &sc->hn_csum_tcp, "RXCSUM TCP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_udp", - CTLFLAG_RW, &sc->hn_csum_udp, "RXCSUM UDP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", - CTLFLAG_RW, &sc->hn_csum_trusted, - "# of packets that we trust host's csum verification"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "small_pkts", - CTLFLAG_RW, &sc->hn_small_pkts, "# of small packets received"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_txdescs", CTLFLAG_RW, &sc->hn_no_txdescs, "# of times short of TX descs"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "send_failed", @@ -596,9 +537,7 @@ netvsc_detach(device_t dev) taskqueue_free(sc->hn_tx_taskq); ifmedia_removeall(&sc->hn_media); -#if defined(INET) || defined(INET6) - tcp_lro_free(&sc->hn_lro); -#endif + hn_destroy_rx_data(sc); hn_destroy_tx_ring(sc); return (0); @@ -746,7 +685,8 @@ netvsc_channel_rollup(struct hv_device * { struct hn_softc *sc = device_get_softc(device_ctx->device); #if defined(INET) || defined(INET6) - struct lro_ctrl *lro = &sc->hn_lro; + struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct lro_ctrl *lro = &rxr->hn_lro; struct lro_entry *queued; while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { @@ -1162,10 +1102,10 @@ int netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info) { - hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device); + struct hn_softc *sc = device_get_softc(device_ctx->device); + struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ struct mbuf *m_new; struct ifnet *ifp; - device_t dev = device_ctx->device; int size, do_lro = 0, do_csum = 1; if (sc == NULL) { @@ -1190,7 +1130,7 @@ netvsc_recv(struct hv_device *device_ctx memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; - sc->hn_small_pkts++; + rxr->hn_small_pkts++; } else { /* * Get an mbuf with a cluster. For packets 2K or less, @@ -1206,7 +1146,7 @@ netvsc_recv(struct hv_device *device_ctx m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - device_printf(dev, "alloc mbuf failed.\n"); + if_printf(ifp, "alloc mbuf failed.\n"); return (0); } @@ -1223,7 +1163,7 @@ netvsc_recv(struct hv_device *device_ctx if (csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); - sc->hn_csum_ip++; + rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ @@ -1233,9 +1173,9 @@ netvsc_recv(struct hv_device *device_ctx (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; if (csum_info->receive.tcp_csum_succeeded) - sc->hn_csum_tcp++; + rxr->hn_csum_tcp++; else - sc->hn_csum_udp++; + rxr->hn_csum_udp++; } if (csum_info->receive.ip_csum_succeeded && @@ -1267,8 +1207,9 @@ netvsc_recv(struct hv_device *device_ctx pr = hn_check_iplen(m_new, hoff); if (pr == IPPROTO_TCP) { if (do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & + HN_TRUST_HCSUM_TCP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); @@ -1278,16 +1219,17 @@ netvsc_recv(struct hv_device *device_ctx do_lro = 1; } else if (pr == IPPROTO_UDP) { if (do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & + HN_TRUST_HCSUM_UDP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } } else if (pr != IPPROTO_DONE && do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); } @@ -1309,10 +1251,10 @@ skip: if ((ifp->if_capenable & IFCAP_LRO) && do_lro) { #if defined(INET) || defined(INET6) - struct lro_ctrl *lro = &sc->hn_lro; + struct lro_ctrl *lro = &rxr->hn_lro; if (lro->lro_cnt) { - sc->hn_lro_tried++; + rxr->hn_lro_tried++; if (tcp_lro_rx(lro, m_new, 0) == 0) { /* DONE! */ return 0; @@ -1392,8 +1334,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * Make sure that LRO aggregation length limit is still * valid, after the MTU change. */ - if (sc->hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) - sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_MIN(ifp); + NV_LOCK(sc); + if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < + HN_LRO_LENLIM_MIN(ifp)) { + int i; + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + sc->hn_rx_ring[i].hn_lro.lro_length_lim = + HN_LRO_LENLIM_MIN(ifp); + } + } + NV_UNLOCK(sc); do { NV_LOCK(sc); @@ -1705,9 +1656,9 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS { struct hn_softc *sc = arg1; unsigned int lenlim; - int error; + int error, i; - lenlim = sc->hn_lro.lro_length_lim; + lenlim = sc->hn_rx_ring[0].hn_lro.lro_length_lim; error = sysctl_handle_int(oidp, &lenlim, 0, req); if (error || req->newptr == NULL) return error; @@ -1716,7 +1667,10 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS lenlim > TCP_LRO_LENGTH_MAX) return EINVAL; - sc->hn_lro.lro_length_lim = lenlim; + NV_LOCK(sc); + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; + NV_UNLOCK(sc); return 0; } @@ -1724,13 +1678,13 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - int ackcnt, error; + int ackcnt, error, i; /* * lro_ackcnt_lim is append count limit, * +1 to turn it into aggregation limit. */ - ackcnt = sc->hn_lro.lro_ackcnt_lim + 1; + ackcnt = sc->hn_rx_ring[0].hn_lro.lro_ackcnt_lim + 1; error = sysctl_handle_int(oidp, &ackcnt, 0, req); if (error || req->newptr == NULL) return error; @@ -1742,7 +1696,11 @@ hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS * Convert aggregation limit back to append * count limit. */ - sc->hn_lro.lro_ackcnt_lim = ackcnt - 1; + --ackcnt; + NV_LOCK(sc); + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_lro.lro_ackcnt_lim = ackcnt; + NV_UNLOCK(sc); return 0; } @@ -1751,10 +1709,10 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG { struct hn_softc *sc = arg1; int hcsum = arg2; - int on, error; + int on, error, i; on = 0; - if (sc->hn_trust_hcsum & hcsum) + if (sc->hn_rx_ring[0].hn_trust_hcsum & hcsum) on = 1; error = sysctl_handle_int(oidp, &on, 0, req); @@ -1762,10 +1720,14 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG return error; NV_LOCK(sc); - if (on) - sc->hn_trust_hcsum |= hcsum; - else - sc->hn_trust_hcsum &= ~hcsum; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; + + if (on) + rxr->hn_trust_hcsum |= hcsum; + else + rxr->hn_trust_hcsum &= ~hcsum; + } NV_UNLOCK(sc); return 0; } @@ -1790,6 +1752,58 @@ hn_tx_chimney_size_sysctl(SYSCTL_HANDLER } static int +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + u_long stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + stat += *((u_long *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_long(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} + +static int +hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + uint64_t stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + stat += *((uint64_t *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_64(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -1876,6 +1890,136 @@ hn_dma_map_paddr(void *arg, bus_dma_segm *paddr = segs->ds_addr; } +static void +hn_create_rx_data(struct hn_softc *sc) +{ + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + device_t dev = sc->hn_dev; +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + int lroent_cnt; +#endif +#endif + int i; + + sc->hn_rx_ring_cnt = 1; /* TODO: vRSS */ + sc->hn_rx_ring = malloc(sizeof(struct hn_rx_ring) * sc->hn_rx_ring_cnt, + M_NETVSC, M_WAITOK | M_ZERO); + +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + lroent_cnt = hn_lro_entry_count; + if (lroent_cnt < TCP_LRO_ENTRIES) + lroent_cnt = TCP_LRO_ENTRIES; + device_printf(dev, "LRO: entry count %d\n", lroent_cnt); +#endif +#endif /* INET || INET6 */ + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; + + if (hn_trust_hosttcp) + rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; + if (hn_trust_hostudp) + rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; + if (hn_trust_hostip) + rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + + /* + * Initialize LRO. + */ +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + tcp_lro_init_args(&rxr->hn_lro, sc->hn_ifp, lroent_cnt, 0); +#else + tcp_lro_init(&rxr->hn_lro); + rxr->hn_lro.ifp = sc->hn_ifp; +#endif + rxr->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF; + rxr->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; +#endif /* INET || INET6 */ + } + + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", + CTLTYPE_U64 | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_lro.lro_queued), + hn_rx_stat_u64_sysctl, "LU", "LRO queued"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", + CTLTYPE_U64 | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), + hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_lro_tried), + hn_rx_stat_ulong_sysctl, "LU", "# of LRO tries"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", + CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", + "Max # of data bytes to be aggregated by LRO"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", + "Max # of ACKs to be aggregated by LRO"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, + hn_trust_hcsum_sysctl, "I", + "Trust tcp segement verification on host side, " + "when csum info is missing"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostudp", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_UDP, + hn_trust_hcsum_sysctl, "I", + "Trust udp datagram verification on host side, " + "when csum info is missing"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostip", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_IP, + hn_trust_hcsum_sysctl, "I", + "Trust ip packet verification on host side, " + "when csum info is missing"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_ip", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_csum_ip), + hn_rx_stat_ulong_sysctl, "LU", "RXCSUM IP"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_tcp", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_csum_tcp), + hn_rx_stat_ulong_sysctl, "LU", "RXCSUM TCP"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_udp", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_csum_udp), + hn_rx_stat_ulong_sysctl, "LU", "RXCSUM UDP"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_trusted", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_csum_trusted), + hn_rx_stat_ulong_sysctl, "LU", + "# of packets that we trust host's csum verification"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "small_pkts", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_rx_ring, hn_small_pkts), + hn_rx_stat_ulong_sysctl, "LU", "# of small packets received"); +} + +static void +hn_destroy_rx_data(struct hn_softc *sc) +{ +#if defined(INET) || defined(INET6) + int i; +#endif + + if (sc->hn_rx_ring_cnt == 0) + return; + +#if defined(INET) || defined(INET6) + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + tcp_lro_free(&sc->hn_rx_ring[i].hn_lro); +#endif + free(sc->hn_rx_ring, M_NETVSC); + sc->hn_rx_ring = NULL; + + sc->hn_rx_ring_cnt = 0; +} + static int hn_create_tx_ring(struct hn_softc *sc) { From owner-svn-src-head@freebsd.org Thu Feb 18 07:23:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE6EAAC768; Thu, 18 Feb 2016 07:23:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB981DE9; Thu, 18 Feb 2016 07:23:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I7N5Un058948; Thu, 18 Feb 2016 07:23:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I7N5gS058947; Thu, 18 Feb 2016 07:23:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180723.u1I7N5gS058947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295745 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:23:06 -0000 Author: sephe Date: Thu Feb 18 07:23:05 2016 New Revision: 295745 URL: https://svnweb.freebsd.org/changeset/base/295745 Log: hyperv/hn: Use taskqueue_enqueue() This also eases experiment on the non-fast taskqueue. Reviewed by: adrian, Jun Su Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5276 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:16:31 2016 (r295744) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:23:05 2016 (r295745) @@ -1549,7 +1549,7 @@ hn_start(struct ifnet *ifp) return; } do_sched: - taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_start_task); + taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_start_task); } static void @@ -1566,10 +1566,8 @@ hn_start_txeof(struct ifnet *ifp) atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); sched = hn_start_locked(ifp, sc->hn_direct_tx_size); NV_UNLOCK(sc); - if (sched) { - taskqueue_enqueue_fast(sc->hn_tx_taskq, - &sc->hn_start_task); - } + if (sched) + taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_start_task); } else { do_sched: /* @@ -1579,7 +1577,7 @@ do_sched: * races. */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_txeof_task); + taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_txeof_task); } } From owner-svn-src-head@freebsd.org Thu Feb 18 07:28:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83688AAC969; Thu, 18 Feb 2016 07:28:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A901BB; Thu, 18 Feb 2016 07:28:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I7Sjew059179; Thu, 18 Feb 2016 07:28:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I7SjPt059178; Thu, 18 Feb 2016 07:28:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180728.u1I7SjPt059178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295746 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:28:46 -0000 Author: sephe Date: Thu Feb 18 07:28:45 2016 New Revision: 295746 URL: https://svnweb.freebsd.org/changeset/base/295746 Log: hyperv/hn: Use non-fast taskqueue for transmission Performance stays same; so no need to use fast taskqueue here. Suggested by: royger Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5282 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:23:05 2016 (r295745) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:28:45 2016 (r295746) @@ -368,7 +368,7 @@ netvsc_attach(device_t dev) sc->hn_direct_tx_size = hn_direct_tx_size; if (hn_tx_taskq == NULL) { - sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", device_get_nameunit(dev)); @@ -2178,7 +2178,7 @@ hn_tx_taskq_create(void *arg __unused) if (!hn_share_tx_taskq) return; - hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &hn_tx_taskq); taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); } From owner-svn-src-head@freebsd.org Thu Feb 18 07:38:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7191DAACDA0; Thu, 18 Feb 2016 07:38:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0B09A1; Thu, 18 Feb 2016 07:38:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I7bxIj062134; Thu, 18 Feb 2016 07:37:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I7bxAl062132; Thu, 18 Feb 2016 07:37:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180737.u1I7bxAl062132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295747 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:38:00 -0000 Author: sephe Date: Thu Feb 18 07:37:59 2016 New Revision: 295747 URL: https://svnweb.freebsd.org/changeset/base/295747 Log: hyperv/hn: Split TX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5283 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:28:45 2016 (r295746) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:37:59 2016 (r295747) @@ -1011,6 +1011,38 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 +struct hn_tx_ring { + struct mtx hn_txlist_spin; + struct hn_txdesc_list hn_txlist; + int hn_txdesc_cnt; + int hn_txdesc_avail; + int hn_txeof; + + int hn_sched_tx; + struct taskqueue *hn_tx_taskq; + struct task hn_start_task; + struct task hn_txeof_task; + + struct mtx hn_tx_lock; + struct hn_softc *hn_sc; + + int hn_direct_tx_size; + int hn_tx_chimney_size; + bus_dma_tag_t hn_tx_data_dtag; + uint64_t hn_csum_assist; + + u_long hn_no_txdescs; + u_long hn_send_failed; + u_long hn_txdma_failed; + u_long hn_tx_collapsed; + u_long hn_tx_chimney; + + /* Rarely used stuffs */ + struct hn_txdesc *hn_txdesc; + bus_dma_tag_t hn_tx_rndis_dtag; + struct sysctl_oid *hn_tx_sysctl_tree; +} __aligned(CACHE_LINE_SIZE); + /* * Device-specific softc structure */ @@ -1028,33 +1060,14 @@ typedef struct hn_softc { struct hv_device *hn_dev_obj; netvsc_dev *net_dev; - struct hn_txdesc *hn_txdesc; - bus_dma_tag_t hn_tx_data_dtag; - bus_dma_tag_t hn_tx_rndis_dtag; - int hn_tx_chimney_size; - int hn_tx_chimney_max; - uint64_t hn_csum_assist; - - struct mtx hn_txlist_spin; - struct hn_txdesc_list hn_txlist; - int hn_txdesc_cnt; - int hn_txdesc_avail; - int hn_txeof; - - int hn_sched_tx; - int hn_direct_tx_size; - struct taskqueue *hn_tx_taskq; - struct task hn_start_task; - struct task hn_txeof_task; - int hn_rx_ring_cnt; struct hn_rx_ring *hn_rx_ring; - u_long hn_no_txdescs; - u_long hn_send_failed; - u_long hn_txdma_failed; - u_long hn_tx_collapsed; - u_long hn_tx_chimney; + int hn_tx_ring_cnt; + struct hn_tx_ring *hn_tx_ring; + int hn_tx_chimney_max; + struct taskqueue *hn_tx_taskq; + struct sysctl_oid *hn_tx_sysctl_tree; } hn_softc_t; /* Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:28:45 2016 (r295746) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:37:59 2016 (r295747) @@ -153,7 +153,7 @@ __FBSDID("$FreeBSD$"); struct hn_txdesc { SLIST_ENTRY(hn_txdesc) link; struct mbuf *m; - struct hn_softc *sc; + struct hn_tx_ring *txr; int refs; uint32_t flags; /* HN_TXD_FLAG_ */ netvsc_packet netvsc_pkt; /* XXX to be removed */ @@ -193,7 +193,6 @@ struct hn_txdesc { #define NV_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) #define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) -#define NV_TRYLOCK(_sc) mtx_trylock(&(_sc)->hn_lock) #define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) #define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) #define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) @@ -266,9 +265,9 @@ static void hn_stop(hn_softc_t *sc); static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static int hn_start_locked(struct ifnet *ifp, int len); +static int hn_start_locked(struct hn_tx_ring *txr, int len); static void hn_start(struct ifnet *ifp); -static void hn_start_txeof(struct ifnet *ifp); +static void hn_start_txeof(struct hn_tx_ring *); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS); @@ -277,14 +276,20 @@ static int hn_trust_hcsum_sysctl(SYSCTL_ static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); -static int hn_create_tx_ring(struct hn_softc *sc); -static void hn_destroy_tx_ring(struct hn_softc *sc); +static int hn_create_tx_ring(struct hn_softc *, int); +static void hn_destroy_tx_ring(struct hn_tx_ring *); +static int hn_create_tx_data(struct hn_softc *); +static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *xsc, int pending); static void hn_txeof_taskfunc(void *xsc, int pending); -static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); +static void hn_stop_tx_tasks(struct hn_softc *); +static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static void hn_create_rx_data(struct hn_softc *sc); static void hn_destroy_rx_data(struct hn_softc *sc); +static void hn_set_tx_chimney_size(struct hn_softc *, int); static int hn_ifmedia_upd(struct ifnet *ifp __unused) @@ -350,8 +355,6 @@ netvsc_attach(device_t dev) hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp = NULL; - struct sysctl_oid_list *child; - struct sysctl_ctx_list *ctx; int error; #if __FreeBSD_version >= 1100045 int tso_maxlen; @@ -365,7 +368,6 @@ netvsc_attach(device_t dev) bzero(sc, sizeof(hn_softc_t)); sc->hn_unit = unit; sc->hn_dev = dev; - sc->hn_direct_tx_size = hn_direct_tx_size; if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, @@ -375,13 +377,6 @@ netvsc_attach(device_t dev) } else { sc->hn_tx_taskq = hn_tx_taskq; } - TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); - TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); - - error = hn_create_tx_ring(sc); - if (error) - goto failed; - NV_LOCK_INIT(sc, "NetVSCLock"); sc->hn_dev_obj = device_ctx; @@ -389,6 +384,10 @@ netvsc_attach(device_t dev) ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; + error = hn_create_tx_data(sc); + if (error) + goto failed; + hn_create_rx_data(sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -421,12 +420,7 @@ netvsc_attach(device_t dev) ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO; - - if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) - sc->hn_csum_assist = HN_CSUM_ASSIST; - else - sc->hn_csum_assist = HN_CSUM_ASSIST_WIN8; - ifp->if_hwassist = sc->hn_csum_assist | CSUM_TSO; + ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; error = hv_rf_on_device_add(device_ctx, &device_info); if (error) @@ -455,52 +449,14 @@ netvsc_attach(device_t dev) #endif sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; + hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); if (hn_tx_chimney_size > 0 && hn_tx_chimney_size < sc->hn_tx_chimney_max) - sc->hn_tx_chimney_size = hn_tx_chimney_size; - - /* - * Always schedule transmission instead of trying - * to do direct transmission. This one gives the - * best performance so far. - */ - sc->hn_sched_tx = 1; - - ctx = device_get_sysctl_ctx(dev); - child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_txdescs", - CTLFLAG_RW, &sc->hn_no_txdescs, "# of times short of TX descs"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "send_failed", - CTLFLAG_RW, &sc->hn_send_failed, "# of hyper-v sending failure"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "txdma_failed", - CTLFLAG_RW, &sc->hn_txdma_failed, "# of TX DMA failure"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_collapsed", - CTLFLAG_RW, &sc->hn_tx_collapsed, "# of TX mbuf collapsed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_chimney", - CTLFLAG_RW, &sc->hn_tx_chimney, "# of chimney send"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", - CTLFLAG_RD, &sc->hn_txdesc_cnt, 0, "# of total TX descs"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", - CTLFLAG_RD, &sc->hn_txdesc_avail, 0, "# of available TX descs"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_chimney_max", - CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, - "Chimney send packet size upper boundary"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, - "I", "Chimney send packet size limit"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", - CTLFLAG_RW, &sc->hn_direct_tx_size, 0, - "Size of the packet for direct transmission"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sched_tx", - CTLFLAG_RW, &sc->hn_sched_tx, 0, - "Always schedule transmission " - "instead of doing direct transmission"); + hn_set_tx_chimney_size(sc, hn_tx_chimney_size); return (0); failed: - hn_destroy_tx_ring(sc); + hn_destroy_tx_data(sc); if (ifp != NULL) if_free(ifp); return (error); @@ -531,14 +487,14 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); - taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); - taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); - if (sc->hn_tx_taskq != hn_tx_taskq) - taskqueue_free(sc->hn_tx_taskq); + hn_stop_tx_tasks(sc); ifmedia_removeall(&sc->hn_media); hn_destroy_rx_data(sc); - hn_destroy_tx_ring(sc); + hn_destroy_tx_data(sc); + + if (sc->hn_tx_taskq != hn_tx_taskq) + taskqueue_free(sc->hn_tx_taskq); return (0); } @@ -553,13 +509,13 @@ netvsc_shutdown(device_t dev) } static __inline int -hn_txdesc_dmamap_load(struct hn_softc *sc, struct hn_txdesc *txd, +hn_txdesc_dmamap_load(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head, bus_dma_segment_t *segs, int *nsegs) { struct mbuf *m = *m_head; int error; - error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, txd->data_dmap, + error = bus_dmamap_load_mbuf_sg(txr->hn_tx_data_dtag, txd->data_dmap, m, segs, nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { struct mbuf *m_new; @@ -569,13 +525,13 @@ hn_txdesc_dmamap_load(struct hn_softc *s return ENOBUFS; else *m_head = m = m_new; - sc->hn_tx_collapsed++; + txr->hn_tx_collapsed++; - error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, + error = bus_dmamap_load_mbuf_sg(txr->hn_tx_data_dtag, txd->data_dmap, m, segs, nsegs, BUS_DMA_NOWAIT); } if (!error) { - bus_dmamap_sync(sc->hn_tx_data_dtag, txd->data_dmap, + bus_dmamap_sync(txr->hn_tx_data_dtag, txd->data_dmap, BUS_DMASYNC_PREWRITE); txd->flags |= HN_TXD_FLAG_DMAMAP; } @@ -583,20 +539,20 @@ hn_txdesc_dmamap_load(struct hn_softc *s } static __inline void -hn_txdesc_dmamap_unload(struct hn_softc *sc, struct hn_txdesc *txd) +hn_txdesc_dmamap_unload(struct hn_tx_ring *txr, struct hn_txdesc *txd) { if (txd->flags & HN_TXD_FLAG_DMAMAP) { - bus_dmamap_sync(sc->hn_tx_data_dtag, + bus_dmamap_sync(txr->hn_tx_data_dtag, txd->data_dmap, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->hn_tx_data_dtag, + bus_dmamap_unload(txr->hn_tx_data_dtag, txd->data_dmap); txd->flags &= ~HN_TXD_FLAG_DMAMAP; } } static __inline int -hn_txdesc_put(struct hn_softc *sc, struct hn_txdesc *txd) +hn_txdesc_put(struct hn_tx_ring *txr, struct hn_txdesc *txd) { KASSERT((txd->flags & HN_TXD_FLAG_ONLIST) == 0, @@ -606,7 +562,7 @@ hn_txdesc_put(struct hn_softc *sc, struc if (atomic_fetchadd_int(&txd->refs, -1) != 1) return 0; - hn_txdesc_dmamap_unload(sc, txd); + hn_txdesc_dmamap_unload(txr, txd); if (txd->m != NULL) { m_freem(txd->m); txd->m = NULL; @@ -614,31 +570,31 @@ hn_txdesc_put(struct hn_softc *sc, struc txd->flags |= HN_TXD_FLAG_ONLIST; - mtx_lock_spin(&sc->hn_txlist_spin); - KASSERT(sc->hn_txdesc_avail >= 0 && - sc->hn_txdesc_avail < sc->hn_txdesc_cnt, - ("txdesc_put: invalid txd avail %d", sc->hn_txdesc_avail)); - sc->hn_txdesc_avail++; - SLIST_INSERT_HEAD(&sc->hn_txlist, txd, link); - mtx_unlock_spin(&sc->hn_txlist_spin); + mtx_lock_spin(&txr->hn_txlist_spin); + KASSERT(txr->hn_txdesc_avail >= 0 && + txr->hn_txdesc_avail < txr->hn_txdesc_cnt, + ("txdesc_put: invalid txd avail %d", txr->hn_txdesc_avail)); + txr->hn_txdesc_avail++; + SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); + mtx_unlock_spin(&txr->hn_txlist_spin); return 1; } static __inline struct hn_txdesc * -hn_txdesc_get(struct hn_softc *sc) +hn_txdesc_get(struct hn_tx_ring *txr) { struct hn_txdesc *txd; - mtx_lock_spin(&sc->hn_txlist_spin); - txd = SLIST_FIRST(&sc->hn_txlist); + mtx_lock_spin(&txr->hn_txlist_spin); + txd = SLIST_FIRST(&txr->hn_txlist); if (txd != NULL) { - KASSERT(sc->hn_txdesc_avail > 0, - ("txdesc_get: invalid txd avail %d", sc->hn_txdesc_avail)); - sc->hn_txdesc_avail--; - SLIST_REMOVE_HEAD(&sc->hn_txlist, link); + KASSERT(txr->hn_txdesc_avail > 0, + ("txdesc_get: invalid txd avail %d", txr->hn_txdesc_avail)); + txr->hn_txdesc_avail--; + SLIST_REMOVE_HEAD(&txr->hn_txlist, link); } - mtx_unlock_spin(&sc->hn_txlist_spin); + mtx_unlock_spin(&txr->hn_txlist_spin); if (txd != NULL) { KASSERT(txd->m == NULL && txd->refs == 0 && @@ -670,20 +626,21 @@ netvsc_xmit_completion(void *context) { netvsc_packet *packet = context; struct hn_txdesc *txd; - struct hn_softc *sc; + struct hn_tx_ring *txr; txd = (struct hn_txdesc *)(uintptr_t) packet->compl.send.send_completion_tid; - sc = txd->sc; - sc->hn_txeof = 1; - hn_txdesc_put(sc, txd); + txr = txd->txr; + txr->hn_txeof = 1; + hn_txdesc_put(txr, txd); } void netvsc_channel_rollup(struct hv_device *device_ctx) { struct hn_softc *sc = device_get_softc(device_ctx->device); + struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ #if defined(INET) || defined(INET6) struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ struct lro_ctrl *lro = &rxr->hn_lro; @@ -695,11 +652,11 @@ netvsc_channel_rollup(struct hv_device * } #endif - if (!sc->hn_txeof) + if (!txr->hn_txeof) return; - sc->hn_txeof = 0; - hn_start_txeof(sc->hn_ifp); + txr->hn_txeof = 0; + hn_start_txeof(txr); } /* @@ -707,7 +664,7 @@ netvsc_channel_rollup(struct hv_device * * If this function fails, then both txd and m_head0 will be freed. */ static int -hn_encap(struct hn_softc *sc, struct hn_txdesc *txd, struct mbuf **m_head0) +hn_encap(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head0) { bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i; @@ -810,7 +767,7 @@ hn_encap(struct hn_softc *sc, struct hn_ #endif tso_info->lso_v2_xmit.tcp_header_offset = 0; tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; - } else if (m_head->m_pkthdr.csum_flags & sc->hn_csum_assist) { + } else if (m_head->m_pkthdr.csum_flags & txr->hn_csum_assist) { rndis_tcp_ip_csum_info *csum_info; rndis_msg_size += RNDIS_CSUM_PPI_SIZE; @@ -837,8 +794,8 @@ hn_encap(struct hn_softc *sc, struct hn_ /* * Chimney send, if the packet could fit into one chimney buffer. */ - if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { - netvsc_dev *net_dev = sc->net_dev; + if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { + netvsc_dev *net_dev = txr->hn_sc->net_dev; uint32_t send_buf_section_idx; send_buf_section_idx = @@ -857,12 +814,12 @@ hn_encap(struct hn_softc *sc, struct hn_ packet->send_buf_section_size = packet->tot_data_buf_len; packet->page_buf_count = 0; - sc->hn_tx_chimney++; + txr->hn_tx_chimney++; goto done; } } - error = hn_txdesc_dmamap_load(sc, txd, &m_head, segs, &nsegs); + error = hn_txdesc_dmamap_load(txr, txd, &m_head, segs, &nsegs); if (error) { int freed; @@ -872,12 +829,12 @@ hn_encap(struct hn_softc *sc, struct hn_ m_freem(m_head); *m_head0 = NULL; - freed = hn_txdesc_put(sc, txd); + freed = hn_txdesc_put(txr, txd); KASSERT(freed != 0, ("fail to free txd upon txdma error")); - sc->hn_txdma_failed++; - if_inc_counter(sc->hn_ifp, IFCOUNTER_OERRORS, 1); + txr->hn_txdma_failed++; + if_inc_counter(txr->hn_sc->hn_ifp, IFCOUNTER_OERRORS, 1); return error; } *m_head0 = m_head; @@ -920,11 +877,15 @@ done: * Start a transmit of one or more packets */ static int -hn_start_locked(struct ifnet *ifp, int len) +hn_start_locked(struct hn_tx_ring *txr, int len) { - struct hn_softc *sc = ifp->if_softc; + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); + mtx_assert(&txr->hn_tx_lock, MA_OWNED); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return 0; @@ -948,15 +909,15 @@ hn_start_locked(struct ifnet *ifp, int l return 1; } - txd = hn_txdesc_get(sc); + txd = hn_txdesc_get(txr); if (txd == NULL) { - sc->hn_no_txdescs++; + txr->hn_no_txdescs++; IF_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } - error = hn_encap(sc, txd, &m_head); + error = hn_encap(txr, txd, &m_head); if (error) { /* Both txd and m_head are freed */ continue; @@ -971,7 +932,7 @@ again: ETHER_BPF_MTAP(ifp, m_head); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } - hn_txdesc_put(sc, txd); + hn_txdesc_put(txr, txd); if (__predict_false(error)) { int freed; @@ -983,9 +944,9 @@ again: * commands to run? Ask netvsc_channel_rollup() * to kick start later. */ - sc->hn_txeof = 1; + txr->hn_txeof = 1; if (!send_failed) { - sc->hn_send_failed++; + txr->hn_send_failed++; send_failed = 1; /* * Try sending again after set hn_txeof; @@ -1002,11 +963,11 @@ again: * DMA map in hn_txdesc_put(), if it was loaded. */ txd->m = NULL; - freed = hn_txdesc_put(sc, txd); + freed = hn_txdesc_put(txr, txd); KASSERT(freed != 0, ("fail to free txd upon send error")); - sc->hn_send_failed++; + txr->hn_send_failed++; IF_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; @@ -1384,8 +1345,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - if (sc->hn_tx_chimney_size > sc->hn_tx_chimney_max) - sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; + if (sc->hn_tx_ring[0].hn_tx_chimney_size > + sc->hn_tx_chimney_max) + hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); + hn_ifinit_locked(sc); NV_LOCK(sc); @@ -1450,10 +1413,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { ifp->if_capenable ^= IFCAP_TXCSUM; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist |= sc->hn_csum_assist; - else - ifp->if_hwassist &= ~sc->hn_csum_assist; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= + sc->hn_tx_ring[0].hn_csum_assist; + } else { + ifp->if_hwassist &= + ~sc->hn_tx_ring[0].hn_csum_assist; + } } if (mask & IFCAP_RXCSUM) @@ -1536,48 +1502,54 @@ static void hn_start(struct ifnet *ifp) { struct hn_softc *sc = ifp->if_softc; + struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; - if (sc->hn_sched_tx) + if (txr->hn_sched_tx) goto do_sched; - if (NV_TRYLOCK(sc)) { + if (mtx_trylock(&txr->hn_tx_lock)) { int sched; - sched = hn_start_locked(ifp, sc->hn_direct_tx_size); - NV_UNLOCK(sc); + sched = hn_start_locked(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); if (!sched) return; } do_sched: - taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_start_task); + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_start_task); } static void -hn_start_txeof(struct ifnet *ifp) +hn_start_txeof(struct hn_tx_ring *txr) { - struct hn_softc *sc = ifp->if_softc; + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; - if (sc->hn_sched_tx) + KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); + + if (txr->hn_sched_tx) goto do_sched; - if (NV_TRYLOCK(sc)) { + if (mtx_trylock(&txr->hn_tx_lock)) { int sched; atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - sched = hn_start_locked(ifp, sc->hn_direct_tx_size); - NV_UNLOCK(sc); - if (sched) - taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_start_task); + sched = hn_start_locked(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); + if (sched) { + taskqueue_enqueue(txr->hn_tx_taskq, + &txr->hn_start_task); + } } else { do_sched: /* * Release the OACTIVE earlier, with the hope, that * others could catch up. The task will clear the - * flag again with the NV_LOCK to avoid possible + * flag again with the hn_tx_lock to avoid possible * races. */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - taskqueue_enqueue(sc->hn_tx_taskq, &sc->hn_txeof_task); + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_txeof_task); } } @@ -1736,7 +1708,7 @@ hn_tx_chimney_size_sysctl(SYSCTL_HANDLER struct hn_softc *sc = arg1; int chimney_size, error; - chimney_size = sc->hn_tx_chimney_size; + chimney_size = sc->hn_tx_ring[0].hn_tx_chimney_size; error = sysctl_handle_int(oidp, &chimney_size, 0, req); if (error || req->newptr == NULL) return error; @@ -1744,8 +1716,7 @@ hn_tx_chimney_size_sysctl(SYSCTL_HANDLER if (chimney_size > sc->hn_tx_chimney_max || chimney_size <= 0) return EINVAL; - if (sc->hn_tx_chimney_size != chimney_size) - sc->hn_tx_chimney_size = chimney_size; + hn_set_tx_chimney_size(sc, chimney_size); return 0; } @@ -1802,6 +1773,56 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG } static int +hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_tx_ring *txr; + u_long stat; + + stat = 0; + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + txr = &sc->hn_tx_ring[i]; + stat += *((u_long *)((uint8_t *)txr + ofs)); + } + + error = sysctl_handle_long(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + txr = &sc->hn_tx_ring[i]; + *((u_long *)((uint8_t *)txr + ofs)) = 0; + } + return 0; +} + +static int +hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error, conf; + struct hn_tx_ring *txr; + + txr = &sc->hn_tx_ring[0]; + conf = *((int *)((uint8_t *)txr + ofs)); + + error = sysctl_handle_int(oidp, &conf, 0, req); + if (error || req->newptr == NULL) + return error; + + NV_LOCK(sc); + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + txr = &sc->hn_tx_ring[i]; + *((int *)((uint8_t *)txr + ofs)) = conf; + } + NV_UNLOCK(sc); + + return 0; +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -2019,16 +2040,37 @@ hn_destroy_rx_data(struct hn_softc *sc) } static int -hn_create_tx_ring(struct hn_softc *sc) +hn_create_tx_ring(struct hn_softc *sc, int id) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[id]; bus_dma_tag_t parent_dtag; int error, i; - sc->hn_txdesc_cnt = HN_TX_DESC_CNT; - sc->hn_txdesc = malloc(sizeof(struct hn_txdesc) * sc->hn_txdesc_cnt, + txr->hn_sc = sc; + + mtx_init(&txr->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); + mtx_init(&txr->hn_tx_lock, "hn tx", NULL, MTX_DEF); + + txr->hn_txdesc_cnt = HN_TX_DESC_CNT; + txr->hn_txdesc = malloc(sizeof(struct hn_txdesc) * txr->hn_txdesc_cnt, M_NETVSC, M_WAITOK | M_ZERO); - SLIST_INIT(&sc->hn_txlist); - mtx_init(&sc->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); + SLIST_INIT(&txr->hn_txlist); + + txr->hn_tx_taskq = sc->hn_tx_taskq; + TASK_INIT(&txr->hn_start_task, 0, hn_start_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_txeof_taskfunc, txr); + + txr->hn_direct_tx_size = hn_direct_tx_size; + if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) + txr->hn_csum_assist = HN_CSUM_ASSIST; + else + txr->hn_csum_assist = HN_CSUM_ASSIST_WIN8; + + /* + * Always schedule transmission instead of trying to do direct + * transmission. This one gives the best performance so far. + */ + txr->hn_sched_tx = 1; parent_dtag = bus_get_dma_tag(sc->hn_dev); @@ -2045,7 +2087,7 @@ hn_create_tx_ring(struct hn_softc *sc) 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ - &sc->hn_tx_rndis_dtag); + &txr->hn_tx_rndis_dtag); if (error) { device_printf(sc->hn_dev, "failed to create rndis dmatag\n"); return error; @@ -2064,21 +2106,21 @@ hn_create_tx_ring(struct hn_softc *sc) 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ - &sc->hn_tx_data_dtag); + &txr->hn_tx_data_dtag); if (error) { device_printf(sc->hn_dev, "failed to create data dmatag\n"); return error; } - for (i = 0; i < sc->hn_txdesc_cnt; ++i) { - struct hn_txdesc *txd = &sc->hn_txdesc[i]; + for (i = 0; i < txr->hn_txdesc_cnt; ++i) { + struct hn_txdesc *txd = &txr->hn_txdesc[i]; - txd->sc = sc; + txd->txr = txr; /* * Allocate and load RNDIS messages. */ - error = bus_dmamem_alloc(sc->hn_tx_rndis_dtag, + error = bus_dmamem_alloc(txr->hn_tx_rndis_dtag, (void **)&txd->rndis_msg, BUS_DMA_WAITOK | BUS_DMA_COHERENT, &txd->rndis_msg_dmap); @@ -2088,7 +2130,7 @@ hn_create_tx_ring(struct hn_softc *sc) return error; } - error = bus_dmamap_load(sc->hn_tx_rndis_dtag, + error = bus_dmamap_load(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap, txd->rndis_msg, HN_RNDIS_MSG_LEN, hn_dma_map_paddr, &txd->rndis_msg_paddr, @@ -2096,80 +2138,221 @@ hn_create_tx_ring(struct hn_softc *sc) if (error) { device_printf(sc->hn_dev, "failed to load rndis_msg, %d\n", i); - bus_dmamem_free(sc->hn_tx_rndis_dtag, + bus_dmamem_free(txr->hn_tx_rndis_dtag, txd->rndis_msg, txd->rndis_msg_dmap); return error; } /* DMA map for TX data. */ - error = bus_dmamap_create(sc->hn_tx_data_dtag, 0, + error = bus_dmamap_create(txr->hn_tx_data_dtag, 0, &txd->data_dmap); if (error) { device_printf(sc->hn_dev, "failed to allocate tx data dmamap\n"); - bus_dmamap_unload(sc->hn_tx_rndis_dtag, + bus_dmamap_unload(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap); - bus_dmamem_free(sc->hn_tx_rndis_dtag, + bus_dmamem_free(txr->hn_tx_rndis_dtag, txd->rndis_msg, txd->rndis_msg_dmap); return error; } /* All set, put it to list */ txd->flags |= HN_TXD_FLAG_ONLIST; - SLIST_INSERT_HEAD(&sc->hn_txlist, txd, link); + SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); + } + txr->hn_txdesc_avail = txr->hn_txdesc_cnt; + + if (sc->hn_tx_sysctl_tree != NULL) { + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + char name[16]; + + /* + * Create per TX ring sysctl tree: + * dev.hn.UNIT.tx.RINGID + */ + ctx = device_get_sysctl_ctx(sc->hn_dev); + child = SYSCTL_CHILDREN(sc->hn_tx_sysctl_tree); + + snprintf(name, sizeof(name), "%d", id); + txr->hn_tx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, + name, CTLFLAG_RD, 0, ""); + + if (txr->hn_tx_sysctl_tree != NULL) { + child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", + CTLFLAG_RD, &txr->hn_txdesc_avail, 0, + "# of available TX descs"); + } } - sc->hn_txdesc_avail = sc->hn_txdesc_cnt; return 0; } static void -hn_destroy_tx_ring(struct hn_softc *sc) +hn_destroy_tx_ring(struct hn_tx_ring *txr) { struct hn_txdesc *txd; - while ((txd = SLIST_FIRST(&sc->hn_txlist)) != NULL) { + if (txr->hn_txdesc == NULL) + return; + + while ((txd = SLIST_FIRST(&txr->hn_txlist)) != NULL) { KASSERT(txd->m == NULL, ("still has mbuf installed")); KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, ("still dma mapped")); - SLIST_REMOVE_HEAD(&sc->hn_txlist, link); + SLIST_REMOVE_HEAD(&txr->hn_txlist, link); - bus_dmamap_unload(sc->hn_tx_rndis_dtag, + bus_dmamap_unload(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap); - bus_dmamem_free(sc->hn_tx_rndis_dtag, + bus_dmamem_free(txr->hn_tx_rndis_dtag, txd->rndis_msg, txd->rndis_msg_dmap); - bus_dmamap_destroy(sc->hn_tx_data_dtag, txd->data_dmap); + bus_dmamap_destroy(txr->hn_tx_data_dtag, txd->data_dmap); } - if (sc->hn_tx_data_dtag != NULL) - bus_dma_tag_destroy(sc->hn_tx_data_dtag); - if (sc->hn_tx_rndis_dtag != NULL) - bus_dma_tag_destroy(sc->hn_tx_rndis_dtag); - free(sc->hn_txdesc, M_NETVSC); - mtx_destroy(&sc->hn_txlist_spin); + if (txr->hn_tx_data_dtag != NULL) + bus_dma_tag_destroy(txr->hn_tx_data_dtag); + if (txr->hn_tx_rndis_dtag != NULL) + bus_dma_tag_destroy(txr->hn_tx_rndis_dtag); + free(txr->hn_txdesc, M_NETVSC); + txr->hn_txdesc = NULL; + + mtx_destroy(&txr->hn_txlist_spin); + mtx_destroy(&txr->hn_tx_lock); +} + +static int +hn_create_tx_data(struct hn_softc *sc) +{ + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + int i; + + sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ + sc->hn_tx_ring = malloc(sizeof(struct hn_tx_ring) * sc->hn_tx_ring_cnt, + M_NETVSC, M_WAITOK | M_ZERO); + + ctx = device_get_sysctl_ctx(sc->hn_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->hn_dev)); + + /* Create dev.hn.UNIT.tx sysctl tree */ + sc->hn_tx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "tx", + CTLFLAG_RD, 0, ""); + + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + int error; + + error = hn_create_tx_ring(sc, i); + if (error) + return error; + } + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "no_txdescs", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_no_txdescs), + hn_tx_stat_ulong_sysctl, "LU", "# of times short of TX descs"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "send_failed", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_send_failed), + hn_tx_stat_ulong_sysctl, "LU", "# of hyper-v sending failure"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txdma_failed", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_txdma_failed), + hn_tx_stat_ulong_sysctl, "LU", "# of TX DMA failure"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_collapsed", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_tx_collapsed), + hn_tx_stat_ulong_sysctl, "LU", "# of TX mbuf collapsed"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney", + CTLTYPE_ULONG | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_tx_chimney), + hn_tx_stat_ulong_sysctl, "LU", "# of chimney send"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", + CTLFLAG_RD, &sc->hn_tx_ring[0].hn_txdesc_cnt, 0, + "# of total TX descs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_chimney_max", + CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, + "Chimney send packet size upper boundary"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, + "I", "Chimney send packet size limit"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "direct_tx_size", + CTLTYPE_INT | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_direct_tx_size), + hn_tx_conf_int_sysctl, "I", + "Size of the packet for direct transmission"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "sched_tx", + CTLTYPE_INT | CTLFLAG_RW, sc, + __offsetof(struct hn_tx_ring, hn_sched_tx), + hn_tx_conf_int_sysctl, "I", + "Always schedule transmission " + "instead of doing direct transmission"); + + return 0; } static void -hn_start_taskfunc(void *xsc, int pending __unused) +hn_set_tx_chimney_size(struct hn_softc *sc, int chimney_size) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 18 07:44:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 827BAAAB1EE; Thu, 18 Feb 2016 07:44:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD9AD7C; Thu, 18 Feb 2016 07:44:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I7iELr064870; Thu, 18 Feb 2016 07:44:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I7iEhW064867; Thu, 18 Feb 2016 07:44:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602180744.u1I7iEhW064867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Feb 2016 07:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295748 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:44:15 -0000 Author: sephe Date: Thu Feb 18 07:44:14 2016 New Revision: 295748 URL: https://svnweb.freebsd.org/changeset/base/295748 Log: hyperv/hn: Use buf_ring for txdesc list So one spinlock is avoided, which would be potentially dangerous for virtual machine, if the spinlock holder was scheduled out by the host, as noted by royger. Old spinlock based txdesc list is still kept around, so we could have a safe fallback. No performance regression nor improvement is observed. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5290 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:37:59 2016 (r295747) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 18 07:44:14 2016 (r295748) @@ -58,6 +58,8 @@ #include +#define HN_USE_TXDESC_BUFRING + MALLOC_DECLARE(M_NETVSC); #define NVSP_INVALID_PROTOCOL_VERSION (0xFFFFFFFF) @@ -990,8 +992,12 @@ typedef struct { hv_bool_uint8_t link_state; } netvsc_device_info; +#ifndef HN_USE_TXDESC_BUFRING struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); +#else +struct buf_ring; +#endif struct hn_rx_ring { struct lro_ctrl hn_lro; @@ -1012,8 +1018,12 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_UDP 0x0004 struct hn_tx_ring { +#ifndef HN_USE_TXDESC_BUFRING struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; +#else + struct buf_ring *hn_txdesc_br; +#endif int hn_txdesc_cnt; int hn_txdesc_avail; int hn_txeof; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:37:59 2016 (r295747) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 18 07:44:14 2016 (r295748) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -151,7 +152,9 @@ __FBSDID("$FreeBSD$"); #define HN_DIRECT_TX_SIZE_DEF 128 struct hn_txdesc { +#ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; +#endif struct mbuf *m; struct hn_tx_ring *txr; int refs; @@ -258,6 +261,14 @@ SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_ta static struct taskqueue *hn_tx_taskq; +#ifndef HN_USE_TXDESC_BUFRING +static int hn_use_txdesc_bufring = 0; +#else +static int hn_use_txdesc_bufring = 1; +#endif +SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, + &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); + /* * Forward declarations */ @@ -570,6 +581,7 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txd->flags |= HN_TXD_FLAG_ONLIST; +#ifndef HN_USE_TXDESC_BUFRING mtx_lock_spin(&txr->hn_txlist_spin); KASSERT(txr->hn_txdesc_avail >= 0 && txr->hn_txdesc_avail < txr->hn_txdesc_cnt, @@ -577,6 +589,10 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); +#else + atomic_add_int(&txr->hn_txdesc_avail, 1); + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif return 1; } @@ -586,6 +602,7 @@ hn_txdesc_get(struct hn_tx_ring *txr) { struct hn_txdesc *txd; +#ifndef HN_USE_TXDESC_BUFRING mtx_lock_spin(&txr->hn_txlist_spin); txd = SLIST_FIRST(&txr->hn_txlist); if (txd != NULL) { @@ -595,8 +612,14 @@ hn_txdesc_get(struct hn_tx_ring *txr) SLIST_REMOVE_HEAD(&txr->hn_txlist, link); } mtx_unlock_spin(&txr->hn_txlist_spin); +#else + txd = buf_ring_dequeue_sc(txr->hn_txdesc_br); +#endif if (txd != NULL) { +#ifdef HN_USE_TXDESC_BUFRING + atomic_subtract_int(&txr->hn_txdesc_avail, 1); +#endif KASSERT(txd->m == NULL && txd->refs == 0 && (txd->flags & HN_TXD_FLAG_ONLIST), ("invalid txd")); txd->flags &= ~HN_TXD_FLAG_ONLIST; @@ -2048,13 +2071,20 @@ hn_create_tx_ring(struct hn_softc *sc, i txr->hn_sc = sc; +#ifndef HN_USE_TXDESC_BUFRING mtx_init(&txr->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); +#endif mtx_init(&txr->hn_tx_lock, "hn tx", NULL, MTX_DEF); txr->hn_txdesc_cnt = HN_TX_DESC_CNT; txr->hn_txdesc = malloc(sizeof(struct hn_txdesc) * txr->hn_txdesc_cnt, M_NETVSC, M_WAITOK | M_ZERO); +#ifndef HN_USE_TXDESC_BUFRING SLIST_INIT(&txr->hn_txlist); +#else + txr->hn_txdesc_br = buf_ring_alloc(txr->hn_txdesc_cnt, M_NETVSC, + M_WAITOK, &txr->hn_tx_lock); +#endif txr->hn_tx_taskq = sc->hn_tx_taskq; TASK_INIT(&txr->hn_start_task, 0, hn_start_taskfunc, txr); @@ -2158,7 +2188,11 @@ hn_create_tx_ring(struct hn_softc *sc, i /* All set, put it to list */ txd->flags |= HN_TXD_FLAG_ONLIST; +#ifndef HN_USE_TXDESC_BUFRING SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); +#else + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif } txr->hn_txdesc_avail = txr->hn_txdesc_cnt; @@ -2191,6 +2225,20 @@ hn_create_tx_ring(struct hn_softc *sc, i } static void +hn_txdesc_dmamap_destroy(struct hn_txdesc *txd) +{ + struct hn_tx_ring *txr = txd->txr; + + KASSERT(txd->m == NULL, ("still has mbuf installed")); + KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, ("still dma mapped")); + + bus_dmamap_unload(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap); + bus_dmamem_free(txr->hn_tx_rndis_dtag, txd->rndis_msg, + txd->rndis_msg_dmap); + bus_dmamap_destroy(txr->hn_tx_data_dtag, txd->data_dmap); +} + +static void hn_destroy_tx_ring(struct hn_tx_ring *txr) { struct hn_txdesc *txd; @@ -2198,19 +2246,15 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx if (txr->hn_txdesc == NULL) return; +#ifndef HN_USE_TXDESC_BUFRING while ((txd = SLIST_FIRST(&txr->hn_txlist)) != NULL) { - KASSERT(txd->m == NULL, ("still has mbuf installed")); - KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, - ("still dma mapped")); SLIST_REMOVE_HEAD(&txr->hn_txlist, link); - - bus_dmamap_unload(txr->hn_tx_rndis_dtag, - txd->rndis_msg_dmap); - bus_dmamem_free(txr->hn_tx_rndis_dtag, - txd->rndis_msg, txd->rndis_msg_dmap); - - bus_dmamap_destroy(txr->hn_tx_data_dtag, txd->data_dmap); + hn_txdesc_dmamap_destroy(txd); } +#else + while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL) + hn_txdesc_dmamap_destroy(txd); +#endif if (txr->hn_tx_data_dtag != NULL) bus_dma_tag_destroy(txr->hn_tx_data_dtag); @@ -2219,7 +2263,9 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx free(txr->hn_txdesc, M_NETVSC); txr->hn_txdesc = NULL; +#ifndef HN_USE_TXDESC_BUFRING mtx_destroy(&txr->hn_txlist_spin); +#endif mtx_destroy(&txr->hn_tx_lock); } From owner-svn-src-head@freebsd.org Thu Feb 18 07:47:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E886AAB3F8; Thu, 18 Feb 2016 07:47:21 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x232.google.com (mail-vk0-x232.google.com [IPv6:2607:f8b0:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8CF103A; Thu, 18 Feb 2016 07:47:21 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x232.google.com with SMTP id k196so37448269vka.0; Wed, 17 Feb 2016 23:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=f92oppCIZhI1zxNQIMMa4Tr6lU2ak7AUmpa8/2oBL5k=; b=SnQhd/c6+wkzW0MolytDnxuYZfokOLbMrQqmd0/4FQLt4nzLEtWpgBJ2FepdLQDxqE nEPuN8ycC4/SHl+a2xvNfhJMqah4E82SGynb0twDmiIufUYBBrHD+I+wVfgetTzFzhCd iIxbx9BDJkZJ2ybqwwSVpAGAh21v9lp/AJxsYtruZSZ0OjYor5kDATmLxGkxtZ1JZDDr ThWe/aUvvR2lllYrrUfZvt193FVCYVtKdFXAOAkHsTBlAMEpr1wi8LGL/7WmW3GdP6FG zrSqpx3wdVhxRhUgypAMMGn3jtXxBpXprKvKH/6bhuWXhPa0u/GRN5oIekvhmB1AG1ET jTPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=f92oppCIZhI1zxNQIMMa4Tr6lU2ak7AUmpa8/2oBL5k=; b=hd0wb02wCbWYQ/YVxdDKw+HtZX7sidfcKrQhSk3QT+uLf2enAQTDgp4QYTc8xmbrVw K2JN8t7+Sh4etqZTS+R7Dbece/q/hTyrlaGF2Xpyv9vq/EXSOzQZxMsl/qN6EFghhhhM 6TM1dJyfT3XnX3ioUfS9VLaZacqir78PN3vo7HWDeIj1jMri7iMeAQz9PgEFZRPxUlz1 sepvRRGtpsDJ55udMrIViE41cJ1JuxoQUVa9jIabxagTfiJe0RwhA+iHX6u7FL9HoDza e86G/beaFl59kyxG3cb4Ejl30a5gqT060cF2cY39umlaY0tigAaT9GGB5cHyy7/NvSnT iY0A== X-Gm-Message-State: AG10YOQljHpeGHnuBOXO5LT5nzwnkrnp7HC0cXlzeC4cVNQRuh7uQ1X3qJ1Uqn1HqizOjmO5/AR+qL979/gXMw== MIME-Version: 1.0 X-Received: by 10.31.9.72 with SMTP id 69mr4281462vkj.126.1455781640055; Wed, 17 Feb 2016 23:47:20 -0800 (PST) Sender: sepherosa@gmail.com Received: by 10.176.65.104 with HTTP; Wed, 17 Feb 2016 23:47:19 -0800 (PST) In-Reply-To: <201602180458.u1I4wYmJ012190@repo.freebsd.org> References: <201602180458.u1I4wYmJ012190@repo.freebsd.org> Date: Thu, 18 Feb 2016 15:47:19 +0800 X-Google-Sender-Auth: erNH_JYq4fRUZhNHV9lwjrTrLeg Message-ID: Subject: Re: svn commit: r295739 - in head/sys: netinet sys From: Sepherosa Ziehau To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 07:47:21 -0000 Sorry about the MFC note in the commit message. This commit will _not_ be MFCed. Thanks, sephe On Thu, Feb 18, 2016 at 12:58 PM, Sepherosa Ziehau wrote: > Author: sephe > Date: Thu Feb 18 04:58:34 2016 > New Revision: 295739 > URL: https://svnweb.freebsd.org/changeset/base/295739 > > Log: > tcp/lro: Allow drivers to set the TCP ACK/data segment aggregation limit > > ACK aggregation limit is append count based, while the TCP data segment > aggregation limit is length based. Unless the network driver sets these > two limits, it's an NO-OP. > > Reviewed by: adrian, gallatin (previous version), hselasky (previous version) > Approved by: adrian (mentor) > MFC after: 1 week > Sponsored by: Microsoft OSTC > Differential Revision: https://reviews.freebsd.org/D5185 > > Modified: > head/sys/netinet/tcp_lro.c > head/sys/netinet/tcp_lro.h > head/sys/sys/param.h > > Modified: head/sys/netinet/tcp_lro.c > ============================================================================== > --- head/sys/netinet/tcp_lro.c Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/netinet/tcp_lro.c Thu Feb 18 04:58:34 2016 (r295739) > @@ -88,6 +88,8 @@ tcp_lro_init_args(struct lro_ctrl *lc, s > lc->lro_mbuf_count = 0; > lc->lro_mbuf_max = lro_mbufs; > lc->lro_cnt = lro_entries; > + lc->lro_ackcnt_lim = TCP_LRO_ACKCNT_MAX; > + lc->lro_length_lim = TCP_LRO_LENGTH_MAX; > lc->ifp = ifp; > SLIST_INIT(&lc->lro_free); > SLIST_INIT(&lc->lro_active); > @@ -610,7 +612,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > } > > /* Flush now if appending will result in overflow. */ > - if (le->p_len > (65535 - tcp_data_len)) { > + if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { > SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); > tcp_lro_flush(lc, le); > break; > @@ -648,6 +650,15 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > > if (tcp_data_len == 0) { > m_freem(m); > + /* > + * Flush this LRO entry, if this ACK should not > + * be further delayed. > + */ > + if (le->append_cnt >= lc->lro_ackcnt_lim) { > + SLIST_REMOVE(&lc->lro_active, le, lro_entry, > + next); > + tcp_lro_flush(lc, le); > + } > return (0); > } > > @@ -668,7 +679,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > * If a possible next full length packet would cause an > * overflow, pro-actively flush now. > */ > - if (le->p_len > (65535 - lc->ifp->if_mtu)) { > + if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { > SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); > tcp_lro_flush(lc, le); > } else > > Modified: head/sys/netinet/tcp_lro.h > ============================================================================== > --- head/sys/netinet/tcp_lro.h Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/netinet/tcp_lro.h Thu Feb 18 04:58:34 2016 (r295739) > @@ -91,11 +91,16 @@ struct lro_ctrl { > unsigned lro_cnt; > unsigned lro_mbuf_count; > unsigned lro_mbuf_max; > + unsigned short lro_ackcnt_lim; /* max # of aggregated ACKs */ > + unsigned lro_length_lim; /* max len of aggregated data */ > > struct lro_head lro_active; > struct lro_head lro_free; > }; > > +#define TCP_LRO_LENGTH_MAX 65535 > +#define TCP_LRO_ACKCNT_MAX 65535 /* unlimited */ > + > int tcp_lro_init(struct lro_ctrl *); > int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); > void tcp_lro_free(struct lro_ctrl *); > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/sys/param.h Thu Feb 18 04:58:34 2016 (r295739) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100098 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1100099 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Thu Feb 18 08:44:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79745AAC0C7; Thu, 18 Feb 2016 08:44:18 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 355BA1032; Thu, 18 Feb 2016 08:44:18 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I8iH1c082646; Thu, 18 Feb 2016 08:44:17 GMT (envelope-from thomas@FreeBSD.org) Received: (from thomas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I8iGTN082641; Thu, 18 Feb 2016 08:44:16 GMT (envelope-from thomas@FreeBSD.org) Message-Id: <201602180844.u1I8iGTN082641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thomas set sender to thomas@FreeBSD.org using -f From: Thomas Quinot Date: Thu, 18 Feb 2016 08:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295749 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 08:44:18 -0000 Author: thomas Date: Thu Feb 18 08:44:16 2016 New Revision: 295749 URL: https://svnweb.freebsd.org/changeset/base/295749 Log: Reorganize the handling all-zeroes terminal block in sparse mode The intent of the previous code in that case was to force an explicit write, but the implementation was incorrect, and as a result the write was never performed. This new implementation instead uses ftruncate(2) to extend the file with a trailing hole. Also introduce regression tests for these cases. PR: 189284 (original PR whose fix introduced this bug) PR: 207092 Differential Revision: D5248 Reviewed by: sobomax,kib MFC after: 2 weeks Added: head/bin/dd/ref.obs_zeroes (contents, props changed) Modified: head/bin/dd/Makefile head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/gen.c Modified: head/bin/dd/Makefile ============================================================================== --- head/bin/dd/Makefile Thu Feb 18 07:44:14 2016 (r295748) +++ head/bin/dd/Makefile Thu Feb 18 08:44:16 2016 (r295749) @@ -24,7 +24,18 @@ test: ${PROG} gen LC_ALL=en_US.US-ASCII hexdump -C | \ diff -I FreeBSD - ${.CURDIR}/ref.${conv} .endfor - @rm -f gen + @${ECHO} "testing sparse file (obs zeroes)" + @./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null + @hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes + + @${ECHO} "testing spase file (all zeroes)" + @./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null + @./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null + @./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null + @diff 1M_zeroes 1M_zeroes.1 + @diff 1M_zeroes 1M_zeroes.2 + + @rm -f gen 1M_zeroes* obs_zeroes .if ${MK_TESTS} != "no" SUBDIR+= tests Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Thu Feb 18 07:44:14 2016 (r295748) +++ head/bin/dd/dd.c Thu Feb 18 08:44:16 2016 (r295749) @@ -77,7 +77,6 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -static off_t last_sp = 0; /* size of last added sparse block */ u_int ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ @@ -409,6 +408,15 @@ dd_close(void) } if (out.dbcnt || pending) dd_out(1); + + /* + * If the file ends with a hole, ftruncate it to extend its size + * up to the end of the hole (without having to write any data). + */ + if (out.seek_offset > 0 && (out.flags & ISTRUNC)) { + if (ftruncate(out.fd, out.seek_offset) == -1) + err(1, "truncating %s", out.name); + } } void @@ -457,29 +465,27 @@ dd_out(int force) } if (sparse && !force) { pending += cnt; - last_sp = cnt; nw = cnt; } else { if (pending != 0) { - /* If forced to write, and we have no - * data left, we need to write the last - * sparse block explicitly. + /* + * Seek past hole. Note that we need to record the + * reached offset, because we might have no more data + * to write, in which case we'll need to call + * ftruncate to extend the file size. */ - if (force && cnt == 0) { - pending -= last_sp; - assert(outp == out.db); - memset(outp, 0, cnt); - } - if (lseek(out.fd, pending, SEEK_CUR) == - -1) + out.seek_offset = lseek(out.fd, pending, SEEK_CUR); + if (out.seek_offset == -1) err(2, "%s: seek error creating sparse file", out.name); - pending = last_sp = 0; + pending = 0; } - if (cnt) + if (cnt) { nw = write(out.fd, outp, cnt); - else + out.seek_offset = 0; + } else { return; + } } if (nw <= 0) { Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Thu Feb 18 07:44:14 2016 (r295748) +++ head/bin/dd/dd.h Thu Feb 18 08:44:16 2016 (r295749) @@ -54,6 +54,7 @@ typedef struct { const char *name; /* name */ int fd; /* file descriptor */ off_t offset; /* # of blocks to skip */ + off_t seek_offset; /* offset of last seek past output hole */ } IO; typedef struct { Modified: head/bin/dd/gen.c ============================================================================== --- head/bin/dd/gen.c Thu Feb 18 07:44:14 2016 (r295748) +++ head/bin/dd/gen.c Thu Feb 18 08:44:16 2016 (r295749) @@ -5,13 +5,20 @@ */ #include +#include int -main(int argc __unused, char **argv __unused) +main(int argc, char **argv) { int i; - for (i = 0; i < 256; i++) - putchar(i); + if (argc > 1 && !strcmp(argv[1], "189284")) { + fputs("ABCDEFGH", stdout); + for (i = 0; i < 8; i++) + putchar(0); + } else { + for (i = 0; i < 256; i++) + putchar(i); + } return (0); } Added: head/bin/dd/ref.obs_zeroes ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/dd/ref.obs_zeroes Thu Feb 18 08:44:16 2016 (r295749) @@ -0,0 +1,3 @@ +$FreeBSD$ +00000000 41 42 43 44 45 46 47 48 00 00 00 00 00 00 00 00 |ABCDEFGH........| +00000010 From owner-svn-src-head@freebsd.org Thu Feb 18 09:27:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1E4AAB5A9; Thu, 18 Feb 2016 09:27:00 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3678019A; Thu, 18 Feb 2016 09:27:00 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I9QxOC094642; Thu, 18 Feb 2016 09:26:59 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I9QxcR094640; Thu, 18 Feb 2016 09:26:59 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602180926.u1I9QxcR094640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 18 Feb 2016 09:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295750 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 09:27:00 -0000 Author: skra Date: Thu Feb 18 09:26:58 2016 New Revision: 295750 URL: https://svnweb.freebsd.org/changeset/base/295750 Log: Remove unneeded definitions after r291406. Also remove redundant and not used L1_ADDR_BITS definition. Modified: head/sys/arm/include/pte-v6.h head/sys/arm/include/pte.h Modified: head/sys/arm/include/pte-v6.h ============================================================================== --- head/sys/arm/include/pte-v6.h Thu Feb 18 08:44:16 2016 (r295749) +++ head/sys/arm/include/pte-v6.h Thu Feb 18 09:26:58 2016 (r295750) @@ -299,30 +299,8 @@ /* * lib/libkvm/kvm_arm.c */ -#define L1_ADDR_MASK 0xfffffc00 - -/* - * lib/libkvm/kvm_arm.c - */ #define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ -#ifndef LOCORE -/* - * sys/arm/arm/minidump_machdep.c - * sys/arm/arm/pmap.c - * sys/arm/arm/pmap.h (hack for our hack in pmap.h ) - * lib/libkvm/kvm_arm.c - */ -typedef uint32_t pd_entry_t; /* page directory entry */ - -/* - * sys/arm/arm/minidump_machdep.c - * sys/arm/arm/pmap.c - * sys/arm/arm/pmap.h (hack for our hack in pmap.h ) - * sys/arm/include/param.h - */ -typedef uint32_t pt_entry_t; /* page table entry */ -#endif // ----------------------------------------------------------------------------- #endif /* !_MACHINE_PTE_H_ */ Modified: head/sys/arm/include/pte.h ============================================================================== --- head/sys/arm/include/pte.h Thu Feb 18 08:44:16 2016 (r295749) +++ head/sys/arm/include/pte.h Thu Feb 18 09:26:58 2016 (r295750) @@ -73,7 +73,6 @@ typedef pt_entry_t pt2_entry_t; /* comp #define L2_INVAL 0x00 /* L2 invalid type */ /* L1 and L2 address masks */ -#define L1_ADDR_MASK 0xfffffc00 #define L2_ADDR_MASK 0xfffff000 /* @@ -152,7 +151,6 @@ typedef pt_entry_t pt2_entry_t; /* comp * So, we allocate L2 tables 4 at a time, thus yielding a 4K L2 * table. */ -#define L1_ADDR_BITS 0xfff00000 /* L1 PTE address bits */ #define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ #define L1_TABLE_SIZE 0x4000 /* 16K */ From owner-svn-src-head@freebsd.org Thu Feb 18 09:28:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404E1AAB64E; Thu, 18 Feb 2016 09:28:18 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EBB433E; Thu, 18 Feb 2016 09:28:17 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I9SHHf094733; Thu, 18 Feb 2016 09:28:17 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I9SGtp094730; Thu, 18 Feb 2016 09:28:16 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602180928.u1I9SGtp094730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 18 Feb 2016 09:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295751 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 09:28:18 -0000 Author: skra Date: Thu Feb 18 09:28:16 2016 New Revision: 295751 URL: https://svnweb.freebsd.org/changeset/base/295751 Log: Remove redundant L2_ADDR_MASK definition and replace it by primary one. Modified: head/sys/arm/arm/pmap.c head/sys/arm/include/pte.h Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Feb 18 09:26:58 2016 (r295750) +++ head/sys/arm/arm/pmap.c Thu Feb 18 09:28:16 2016 (r295751) @@ -2549,7 +2549,7 @@ pmap_remove_pages(pmap_t pmap) l2b = pmap_get_l2_bucket(pmap, pv->pv_va); KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages")); pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; - m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK); + m = PHYS_TO_VM_PAGE(*pt & L2_S_FRAME); KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); *pt = 0; PTE_SYNC(pt); Modified: head/sys/arm/include/pte.h ============================================================================== --- head/sys/arm/include/pte.h Thu Feb 18 09:26:58 2016 (r295750) +++ head/sys/arm/include/pte.h Thu Feb 18 09:28:16 2016 (r295751) @@ -72,9 +72,6 @@ typedef pt_entry_t pt2_entry_t; /* comp #define L2_MASK 0x03 /* Mask for L2 entry type */ #define L2_INVAL 0x00 /* L2 invalid type */ -/* L1 and L2 address masks */ -#define L2_ADDR_MASK 0xfffff000 - /* * The ARM MMU architecture was introduced with ARM v3 (previous ARM * architecture versions used an optional off-CPU memory controller From owner-svn-src-head@freebsd.org Thu Feb 18 09:30:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFF8AAB73F; Thu, 18 Feb 2016 09:30:06 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7635174F; Thu, 18 Feb 2016 09:30:06 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1I9U5E1094857; Thu, 18 Feb 2016 09:30:05 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1I9U4Vc094852; Thu, 18 Feb 2016 09:30:04 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602180930.u1I9U4Vc094852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 18 Feb 2016 09:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295752 - in head: lib/libkvm sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 09:30:06 -0000 Author: skra Date: Thu Feb 18 09:30:04 2016 New Revision: 295752 URL: https://svnweb.freebsd.org/changeset/base/295752 Log: Remove redundant ARM_L2_ADDR_BITS and L2_ADDR_BITS definitions and replace them by primary ones where needed. Modified: head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_arm.h head/sys/arm/include/pmap.h head/sys/arm/include/pte-v6.h head/sys/arm/include/pte.h Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Thu Feb 18 09:28:16 2016 (r295751) +++ head/lib/libkvm/kvm_arm.c Thu Feb 18 09:30:04 2016 (r295752) @@ -183,7 +183,7 @@ _arm_initvtop(kvm_t *kd) #define l1pte_section_p(pde) (((pde) & ARM_L1_TYPE_MASK) == ARM_L1_TYPE_S) #define l1pte_valid(pde) ((pde) != 0) #define l2pte_valid(pte) ((pte) != 0) -#define l2pte_index(v) (((v) & ARM_L2_ADDR_BITS) >> ARM_L2_S_SHIFT) +#define l2pte_index(v) (((v) & ARM_L1_S_OFFSET) >> ARM_L2_S_SHIFT) static int Modified: head/lib/libkvm/kvm_arm.h ============================================================================== --- head/lib/libkvm/kvm_arm.h Thu Feb 18 09:28:16 2016 (r295751) +++ head/lib/libkvm/kvm_arm.h Thu Feb 18 09:30:04 2016 (r295752) @@ -72,8 +72,6 @@ typedef uint32_t arm_pt_entry_t; #define ARM_L2_TYPE_T 0x03 /* Tiny Page - 1k - not used */ #define ARM_L2_TYPE_MASK 0x03 -#define ARM_L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ - #ifdef __arm__ #include @@ -106,7 +104,6 @@ _Static_assert(L2_TYPE_S == ARM_L2_TYPE_ _Static_assert(L2_TYPE_T == ARM_L2_TYPE_T, "L2_TYPE_T mismatch"); #endif _Static_assert(L2_TYPE_MASK == ARM_L2_TYPE_MASK, "L2_TYPE_MASK mismatch"); -_Static_assert(L2_ADDR_BITS == ARM_L2_ADDR_BITS, "L2_ADDR_BITS mismatch"); #endif int _arm_native(kvm_t *); Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Thu Feb 18 09:28:16 2016 (r295751) +++ head/sys/arm/include/pmap.h Thu Feb 18 09:30:04 2016 (r295752) @@ -489,7 +489,7 @@ void pmap_use_minicache(vm_offset_t, vm_ #define l1pte_page_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_C) #define l1pte_fpage_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_F) -#define l2pte_index(v) (((v) & L2_ADDR_BITS) >> L2_S_SHIFT) +#define l2pte_index(v) (((v) & L1_S_OFFSET) >> L2_S_SHIFT) #define l2pte_valid(pte) ((pte) != 0) #define l2pte_pa(pte) ((pte) & L2_S_FRAME) #define l2pte_minidata(pte) (((pte) & \ Modified: head/sys/arm/include/pte-v6.h ============================================================================== --- head/sys/arm/include/pte-v6.h Thu Feb 18 09:28:16 2016 (r295751) +++ head/sys/arm/include/pte-v6.h Thu Feb 18 09:30:04 2016 (r295752) @@ -296,11 +296,6 @@ */ #define AP_KRW 0x01 /* kernel read/write */ -/* - * lib/libkvm/kvm_arm.c - */ -#define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ - // ----------------------------------------------------------------------------- #endif /* !_MACHINE_PTE_H_ */ Modified: head/sys/arm/include/pte.h ============================================================================== --- head/sys/arm/include/pte.h Thu Feb 18 09:28:16 2016 (r295751) +++ head/sys/arm/include/pte.h Thu Feb 18 09:30:04 2016 (r295752) @@ -148,8 +148,6 @@ typedef pt_entry_t pt2_entry_t; /* comp * So, we allocate L2 tables 4 at a time, thus yielding a 4K L2 * table. */ -#define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ - #define L1_TABLE_SIZE 0x4000 /* 16K */ #define L2_TABLE_SIZE 0x1000 /* 4K */ /* From owner-svn-src-head@freebsd.org Thu Feb 18 11:26:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2449FAACA87; Thu, 18 Feb 2016 11:26:10 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA47B1E92; Thu, 18 Feb 2016 11:26:09 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IBQ89r029915; Thu, 18 Feb 2016 11:26:08 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IBQ8U0029914; Thu, 18 Feb 2016 11:26:08 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602181126.u1IBQ8U0029914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Feb 2016 11:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295753 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 11:26:10 -0000 Author: wma Date: Thu Feb 18 11:26:08 2016 New Revision: 295753 URL: https://svnweb.freebsd.org/changeset/base/295753 Log: Fix ThunderX external PEM bus offset Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5293 Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Thu Feb 18 09:30:04 2016 (r295752) +++ head/sys/arm64/arm64/gic_v3_its.c Thu Feb 18 11:26:08 2016 (r295753) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_reg.h" #include "gic_v3_var.h" -#define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 144 +#define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 88 #include "pic_if.h" From owner-svn-src-head@freebsd.org Thu Feb 18 11:53:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 739FEAAB70F; Thu, 18 Feb 2016 11:53:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40145DDC; Thu, 18 Feb 2016 11:53:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IBrv4X038473; Thu, 18 Feb 2016 11:53:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IBrvDb038472; Thu, 18 Feb 2016 11:53:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602181153.u1IBrvDb038472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 18 Feb 2016 11:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295754 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 11:53:58 -0000 Author: zbb Date: Thu Feb 18 11:53:57 2016 New Revision: 295754 URL: https://svnweb.freebsd.org/changeset/base/295754 Log: Fix bug in ofwbus_release_resource() for non-ofwbus descendants Resource list for devices that are not ofwbus descendants, but got to ofwbus method via bus_generic_release_resource() call chain, cannot be found using BUS_GET_RESOURCE_LIST() used by ofwbus. In that case, changing device's resource list should be avoided (will not contain resource list prepared by ofw or simplebus). Pointy-hat to: zbb Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5304 Modified: head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Thu Feb 18 11:26:08 2016 (r295753) +++ head/sys/dev/ofw/ofwbus.c Thu Feb 18 11:53:57 2016 (r295754) @@ -271,12 +271,17 @@ ofwbus_release_resource(device_t bus, de int rid, struct resource *r) { struct resource_list_entry *rle; + int passthrough; int error; - /* Clean resource list entry */ - rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid); - if (rle != NULL) - rle->res = NULL; + passthrough = (device_get_parent(child) != bus); + if (!passthrough) { + /* Clean resource list entry */ + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), + type, rid); + if (rle != NULL) + rle->res = NULL; + } if ((rman_get_flags(r) & RF_ACTIVE) != 0) { error = bus_deactivate_resource(child, type, rid, r); From owner-svn-src-head@freebsd.org Thu Feb 18 13:00:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA562AAC6A3; Thu, 18 Feb 2016 13:00:06 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B11021D02; Thu, 18 Feb 2016 13:00:06 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ID05pe056347; Thu, 18 Feb 2016 13:00:05 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ID05qW056340; Thu, 18 Feb 2016 13:00:05 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602181300.u1ID05qW056340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 18 Feb 2016 13:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295755 - in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 13:00:07 -0000 Author: zbb Date: Thu Feb 18 13:00:04 2016 New Revision: 295755 URL: https://svnweb.freebsd.org/changeset/base/295755 Log: Introduce bus_get_bus_tag() method Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips nexus and its children in order to return a platform specific default tag. This is required to ensure generic correctness of the bus_space tag. It is especially needed for arches where child bus tag does not match the parent bus tag. This solves the problem with ppc architecture where the PCI bus tag differs from parent bus tag which is big-endian. This commit is a part of the following patch: https://reviews.freebsd.org/D4879 Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879 Modified: head/sys/arm/arm/nexus.c head/sys/arm64/arm64/nexus.c head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/powerpc/powerpc/nexus.c head/sys/sparc64/sparc64/nexus.c head/sys/sys/bus.h Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/arm/arm/nexus.c Thu Feb 18 13:00:04 2016 (r295755) @@ -85,6 +85,7 @@ static struct resource *nexus_alloc_reso rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); #ifdef ARM_INTRNG #ifdef SMP static int nexus_bind_intr(device_t, device_t, struct resource *, int); @@ -124,6 +125,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), #ifdef ARM_INTRNG DEVMETHOD(bus_describe_intr, nexus_describe_intr), #ifdef SMP @@ -260,6 +262,17 @@ nexus_release_resource(device_t bus, dev return (rman_release_resource(res)); } +static bus_space_tag_t +nexus_get_bus_tag(device_t bus __unused, device_t child __unused) +{ + +#ifdef FDT + return(fdtbus_bs_tag); +#else + return((void *)1); +#endif +} + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/arm64/arm64/nexus.c Thu Feb 18 13:00:04 2016 (r295755) @@ -113,6 +113,7 @@ static int nexus_deactivate_resource(dev static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); #ifdef SMP static int nexus_bind_intr(device_t, device_t, struct resource *, int); #endif @@ -134,6 +135,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -307,6 +309,13 @@ nexus_bind_intr(device_t dev, device_t c } #endif +static bus_space_tag_t +nexus_get_bus_tag(device_t bus __unused, device_t child __unused) +{ + + return(&memmap_bus); +} + static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/kern/bus_if.m Thu Feb 18 13:00:04 2016 (r295755) @@ -637,6 +637,17 @@ METHOD bus_dma_tag_t get_dma_tag { } DEFAULT bus_generic_get_dma_tag; /** + * @brief Returns bus_space_tag_t for use w/ devices on the bus. + * + * @param _dev the parent device of @p _child + * @param _child the device to which the tag will belong + */ +METHOD bus_space_tag_t get_bus_tag { + device_t _dev; + device_t _child; +} DEFAULT bus_generic_get_bus_tag; + +/** * @brief Allow the bus to determine the unit number of a device. * * @param _dev the parent device of @p _child Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/kern/subr_bus.c Thu Feb 18 13:00:04 2016 (r295755) @@ -4095,6 +4095,22 @@ bus_generic_get_dma_tag(device_t dev, de } /** + * @brief Helper function for implementing BUS_GET_BUS_TAG(). + * + * This simple implementation of BUS_GET_BUS_TAG() simply calls the + * BUS_GET_BUS_TAG() method of the parent of @p dev. + */ +bus_space_tag_t +bus_generic_get_bus_tag(device_t dev, device_t child) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent != NULL) + return (BUS_GET_BUS_TAG(dev->parent, child)); + return (NULL); +} + +/** * @brief Helper function for implementing BUS_GET_RESOURCE(). * * This implementation of BUS_GET_RESOURCE() uses the @@ -4576,6 +4592,23 @@ bus_get_dma_tag(device_t dev) } /** + * @brief Wrapper function for BUS_GET_BUS_TAG(). + * + * This function simply calls the BUS_GET_BUS_TAG() method of the + * parent of @p dev. + */ +bus_space_tag_t +bus_get_bus_tag(device_t dev) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (NULL); + return (BUS_GET_BUS_TAG(parent, dev)); +} + +/** * @brief Wrapper function for BUS_GET_DOMAIN(). * * This function simply calls the BUS_GET_DOMAIN() method of the Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/powerpc/powerpc/nexus.c Thu Feb 18 13:00:04 2016 (r295755) @@ -66,6 +66,7 @@ static bus_setup_intr_t nexus_setup_intr static bus_teardown_intr_t nexus_teardown_intr; static bus_activate_resource_t nexus_activate_resource; static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); #ifdef SMP static bus_bind_intr_t nexus_bind_intr; #endif @@ -87,6 +88,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), /* ofw_bus interface */ DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), @@ -155,6 +157,13 @@ nexus_teardown_intr(device_t bus __unuse return (powerpc_teardown_intr(ih)); } +static bus_space_tag_t +nexus_get_bus_tag(device_t bus __unused, device_t child __unused) +{ + + return(&bs_be_tag); +} + #ifdef SMP static int nexus_bind_intr(device_t bus __unused, device_t child __unused, Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/sparc64/sparc64/nexus.c Thu Feb 18 13:00:04 2016 (r295755) @@ -98,6 +98,7 @@ static bus_bind_intr_t nexus_bind_intr; #endif static bus_describe_intr_t nexus_describe_intr; static bus_get_dma_tag_t nexus_get_dma_tag; +static bus_get_bus_tag_t nexus_get_bus_tag; static ofw_bus_get_devinfo_t nexus_get_devinfo; static int nexus_inlist(const char *, const char *const *); @@ -135,6 +136,7 @@ static device_method_t nexus_methods[] = #endif DEVMETHOD(bus_describe_intr, nexus_describe_intr), DEVMETHOD(bus_get_dma_tag, nexus_get_dma_tag), + DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), @@ -502,6 +504,13 @@ nexus_get_dma_tag(device_t bus __unused, return (&nexus_dmatag); } +static bus_space_tag_t +nexus_get_bus_tag(device_t bus __unused, device_t child __unused) +{ + + return (&nexus_bustag); +} + static const struct ofw_bus_devinfo * nexus_get_devinfo(device_t bus __unused, device_t child) { Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Thu Feb 18 11:53:57 2016 (r295754) +++ head/sys/sys/bus.h Thu Feb 18 13:00:04 2016 (r295755) @@ -30,6 +30,7 @@ #define _SYS_BUS_H_ #include +#include #include #include @@ -383,6 +384,8 @@ int bus_generic_detach(device_t dev); void bus_generic_driver_added(device_t dev, driver_t *driver); bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child); +bus_space_tag_t + bus_generic_get_bus_tag(device_t dev, device_t child); int bus_generic_get_domain(device_t dev, device_t child, int *domain); struct resource_list * bus_generic_get_resource_list (device_t, device_t); @@ -448,6 +451,7 @@ int bus_activate_resource(device_t dev, int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); bus_dma_tag_t bus_get_dma_tag(device_t dev); +bus_space_tag_t bus_get_bus_tag(device_t dev); int bus_get_domain(device_t dev, int *domain); int bus_release_resource(device_t dev, int type, int rid, struct resource *r); From owner-svn-src-head@freebsd.org Thu Feb 18 13:07:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21ADBAAC9C7; Thu, 18 Feb 2016 13:07:24 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF6D11CC; Thu, 18 Feb 2016 13:07:23 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ID7Nxc059074; Thu, 18 Feb 2016 13:07:23 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ID7MeN059064; Thu, 18 Feb 2016 13:07:22 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602181307.u1ID7MeN059064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 18 Feb 2016 13:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 13:07:24 -0000 Author: zbb Date: Thu Feb 18 13:07:21 2016 New Revision: 295756 URL: https://svnweb.freebsd.org/changeset/base/295756 Log: Extract common code from PowerPC's ofw_pci Import portions of the PowerPC OF PCI implementation into new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofw_pci.h. This creates a new ofw_pci_write_ivar() function and modifies ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures. Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879 Added: head/sys/dev/ofw/ofw_pci.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ofw/ofw_pci.h head/sys/dev/ofw/ofw_subr.c head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h head/sys/powerpc/pseries/rtas_pci.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/conf/files Thu Feb 18 13:07:21 2016 (r295756) @@ -2108,6 +2108,7 @@ dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt +dev/ofw/ofw_pci.c optional fdt pci dev/ow/ow.c optional ow \ dependency "owll_if.h" \ dependency "own_if.h" Added: head/sys/dev/ofw/ofw_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_pci.c Thu Feb 18 13:07:21 2016 (r295756) @@ -0,0 +1,622 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * 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 + +#include +#include + +#include +#include +#include + +#include +#include + +#include "pcib_if.h" + +/* + * If it is necessary to set another value of this for + * some platforms it should be set at fdt.h file + */ +#ifndef PCI_MAP_INTR +#define PCI_MAP_INTR 4 +#endif + +#define PCI_INTR_PINS 4 + +/* + * bus interface. + */ +static struct resource * ofw_pci_alloc_resource(device_t, device_t, + int, int *, u_long, u_long, u_long, u_int); +static int ofw_pci_release_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_activate_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_adjust_resource(device_t, device_t, int, + struct resource *, u_long, u_long); + +/* + * pcib interface + */ +static int ofw_pci_maxslots(device_t); + +/* + * ofw_bus interface + */ +static phandle_t ofw_pci_get_node(device_t, device_t); + +/* + * local methods + */ +static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *); + +/* + * Driver methods. + */ +static device_method_t ofw_pci_methods[] = { + + /* Device interface */ + DEVMETHOD(device_attach, ofw_pci_attach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), + DEVMETHOD(bus_write_ivar, ofw_pci_write_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), + DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), + DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), +#ifdef __powerpc__ + DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), +#endif + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); + +int +ofw_pci_init(device_t dev) +{ + struct ofw_pci_softc *sc; + phandle_t node; + u_int32_t busrange[2]; + struct ofw_pci_range *rp; + int error; + struct ofw_pci_cell_info *cell_info; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + sc->sc_initialized = 1; + sc->sc_range = NULL; + + cell_info = (struct ofw_pci_cell_info *)malloc(sizeof(*cell_info), + M_DEVBUF, M_WAITOK | M_ZERO); + + sc->sc_cell_info = cell_info; + + if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8) + busrange[0] = 0; + + sc->sc_dev = dev; + sc->sc_node = node; + sc->sc_bus = busrange[0]; + + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { + phandle_t c; + int n, i; + + sc->sc_nrange = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_nranges(c, cell_info); + if (n > 0) + sc->sc_nrange += n; + } + if (sc->sc_nrange == 0) { + error = ENXIO; + goto out; + } + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + i = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); + if (n > 0) + i += n; + } + KASSERT(i == sc->sc_nrange, ("range count mismatch")); + } else { + sc->sc_nrange = ofw_pci_nranges(node, cell_info); + if (sc->sc_nrange <= 0) { + device_printf(dev, "could not getranges\n"); + error = ENXIO; + goto out; + } + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + ofw_pci_fill_ranges(node, sc->sc_range); + } + + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; + error = rman_init(&sc->sc_io_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + goto out; + } + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "PCI Memory"; + error = rman_init(&sc->sc_mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + goto out; + } + + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + error = 0; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_CONFIG: + break; + case OFW_PCI_PHYS_HI_SPACE_IO: + error = rman_manage_region(&sc->sc_io_rman, rp->pci, + rp->pci + rp->size - 1); + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + error = rman_manage_region(&sc->sc_mem_rman, rp->pci, + rp->pci + rp->size - 1); + break; + } + + if (error) { + device_printf(dev, + "rman_manage_region(%x, %#jx, %#jx) failed. " + "error = %d\n", rp->pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, + rp->pci + rp->size - 1, error); + goto out; + } + } + + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); + +out: + free(cell_info, M_DEVBUF); + free(sc->sc_range, M_DEVBUF); + rman_fini(&sc->sc_io_rman); + rman_fini(&sc->sc_mem_rman); + + return (error); +} + +int +ofw_pci_attach(device_t dev) +{ + struct ofw_pci_softc *sc; + int error; + + sc = device_get_softc(dev); + if (!sc->sc_initialized) { + error = ofw_pci_init(dev); + if (error) + return (error); + } + + device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +static int +ofw_pci_maxslots(device_t dev) +{ + + return (PCI_SLOTMAX); +} + +int +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct ofw_pci_softc *sc; + struct ofw_pci_register reg; + uint32_t pintr, mintr[PCI_MAP_INTR]; + int intrcells; + phandle_t iparent; + + sc = device_get_softc(bus); + pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent); + if (intrcells != 0) { + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); + return (pintr); + } + + /* + * Maybe it's a real interrupt, not an intpin + */ + if (pin > PCI_INTR_PINS) + return (pin); + + device_printf(bus, "could not route pin %d for device %d.%d\n", + pin, pci_get_slot(dev), pci_get_function(dev)); + return (PCI_INVALID_IRQ); +} + +int +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_DOMAIN: + *result = device_get_unit(dev); + return (0); + case PCIB_IVAR_BUS: + *result = sc->sc_bus; + return (0); + default: + break; + } + + return (ENOENT); +} + +int +ofw_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_BUS: + sc->sc_bus = value; + return (0); + default: + break; + } + + return (ENOENT); +} + +int +ofw_pci_nranges(phandle_t node, struct ofw_pci_cell_info *info) +{ + ssize_t nbase_ranges; + + if (info == NULL) + return (-1); + + info->host_address_cells = 1; + info->size_cells = 2; + info->pci_address_cell = 3; + + OF_getencprop(OF_parent(node), "#address-cells", + &(info->host_address_cells), sizeof(info->host_address_cells)); + OF_getencprop(node, "#address-cells", + &(info->pci_address_cell), sizeof(info->pci_address_cell)); + OF_getencprop(node, "#size-cells", &(info->size_cells), + sizeof(info->size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + + return (nbase_ranges / sizeof(cell_t) / + (info->pci_address_cell + info->host_address_cells + + info->size_cells)); +} + +static struct resource * +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct ofw_pci_softc *sc; + struct resource *rv; + struct rman *rm; + int needactivate; + + needactivate = flags & RF_ACTIVE; + flags &= ~RF_ACTIVE; + + sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + + case SYS_RES_IRQ: + return (bus_alloc_resource(bus, type, rid, start, end, count, + flags)); + + default: + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rv = rman_reserve_resource(rm, start, end, count, flags, child); + if (rv == NULL) { + device_printf(bus, "failed to reserve resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rman_set_rid(rv, *rid); + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv) != 0) { + device_printf(bus, + "failed to activate resource for %s\n", + device_get_nameunit(child)); + rman_release_resource(rv); + return (NULL); + } + } + + return (rv); +} + +static int +ofw_pci_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + if (rman_get_flags(res) & RF_ACTIVE) { + int error = bus_deactivate_resource(child, type, rid, res); + if (error) + return error; + } + + return (rman_release_resource(res)); +} + +static int +ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + struct ofw_pci_softc *sc; + bus_space_handle_t handle; + bus_space_tag_t tag; + int rv; + + sc = device_get_softc(bus); + + if (type == SYS_RES_IRQ) { + return (bus_activate_resource(bus, type, rid, res)); + } + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + struct ofw_pci_range *rp; + vm_offset_t start; + int space; + + start = (vm_offset_t)rman_get_start(res); + + /* + * Map this through the ranges list + */ + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + if (start < rp->pci || start >= rp->pci + rp->size) + continue; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_IO: + space = SYS_RES_IOPORT; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + space = SYS_RES_MEMORY; + break; + default: + space = -1; + } + + if (type == space) { + start += (rp->host - rp->pci); + break; + } + } + + if (bootverbose) + printf("ofw_pci mapdev: start %zx, len %ld\n", start, + rman_get_size(res)); + + tag = BUS_GET_BUS_TAG(child, child); + if (tag == NULL) + return (ENOMEM); + + rman_set_bustag(res, tag); + rv = bus_space_map(tag, start, + rman_get_size(res), 0, &handle); + if (rv != 0) + return (ENOMEM); + + rman_set_bushandle(res, handle); + rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ + } + + return (rman_activate_resource(res)); +} + +#ifdef __powerpc__ +static bus_space_tag_t +ofw_pci_bus_get_bus_tag(device_t bus, device_t child) +{ + + return (&bs_le_tag) +} +#endif + +static int +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* + * If this is a memory resource, unmap it. + */ + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { + u_int32_t psize; + + psize = rman_get_size(res); + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); + } + + return (rman_deactivate_resource(res)); +} + +static int +ofw_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, rman_res_t start, rman_res_t end) +{ + struct rman *rm = NULL; + struct ofw_pci_softc *sc = device_get_softc(bus); + + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + default: + return (ENXIO); + } + + if (!rman_is_region_manager(res, rm)) + return (EINVAL); + + return (rman_adjust_resource(res, start, end)); +} + +static phandle_t +ofw_pci_get_node(device_t bus, device_t dev) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(bus); + /* We only have one child, the PCI bus, which needs our own node. */ + + return (sc->sc_node); +} + +static int +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) +{ + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; + cell_t *base_ranges; + ssize_t nbase_ranges; + int nranges; + int i, j, k; + + OF_getencprop(OF_parent(node), "#address-cells", &host_address_cells, + sizeof(host_address_cells)); + OF_getencprop(node, "#address-cells", &pci_address_cells, + sizeof(pci_address_cells)); + OF_getencprop(node, "#size-cells", &size_cells, sizeof(size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + nranges = nbase_ranges / sizeof(cell_t) / + (pci_address_cells + host_address_cells + size_cells); + + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < nranges; i++) { + ranges[i].pci_hi = base_ranges[j++]; + ranges[i].pci = 0; + for (k = 0; k < pci_address_cells - 1; k++) { + ranges[i].pci <<= 32; + ranges[i].pci |= base_ranges[j++]; + } + ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + ranges[i].host <<= 32; + ranges[i].host |= base_ranges[j++]; + } + ranges[i].size = 0; + for (k = 0; k < size_cells; k++) { + ranges[i].size <<= 32; + ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (nranges); +} Modified: head/sys/dev/ofw/ofw_pci.h ============================================================================== --- head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:07:21 2016 (r295756) @@ -82,14 +82,19 @@ #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 -#define OFW_PCI_PHYS_HI_BUS(hi) \ +#define OFW_PCI_PHYS_HI_BUS(hi) \ (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) /* + * Export class definition for inheritance purposes + */ +DECLARE_CLASS(ofw_pci_driver); + +/* * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. */ struct ofw_pci_register { @@ -100,4 +105,50 @@ struct ofw_pci_register { u_int32_t size_lo; }; +struct ofw_pci_cell_info { + pcell_t host_address_cells; + pcell_t pci_address_cell; + pcell_t size_cells; + }; + +struct ofw_pci_range { + uint32_t pci_hi; + uint64_t pci; + uint64_t host; + uint64_t size; +}; + +/* + * Quirks for some adapters + */ +enum { + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, +}; + +struct ofw_pci_softc { + device_t sc_dev; + phandle_t sc_node; + int sc_bus; + int sc_initialized; + int sc_quirks; + + struct ofw_pci_range *sc_range; + int sc_nrange; + struct ofw_pci_cell_info *sc_cell_info; + + struct rman sc_io_rman; + struct rman sc_mem_rman; + bus_space_tag_t sc_memt; + bus_dma_tag_t sc_dmat; + + struct ofw_bus_iinfo sc_pci_iinfo; +}; + +int ofw_pci_init(device_t); +int ofw_pci_attach(device_t); +int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); +int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); +int ofw_pci_route_interrupt(device_t, device_t, int); +int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); + #endif /* _DEV_OFW_OFW_PCI_H_ */ Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:07:21 2016 (r295756) @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include static void get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:07:21 2016 (r295756) @@ -55,15 +55,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include #include -#include - #include "ofw_bus_if.h" #include "pcib_if.h" Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:07:21 2016 (r295756) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -51,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:07:21 2016 (r295756) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:07:21 2016 (r295756) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:07:21 2016 (r295756) @@ -30,7 +30,6 @@ #include #include -#include struct uninorth_softc { struct ofw_pci_softc pci_sc; Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:00:04 2016 (r295755) +++ head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:07:21 2016 (r295756) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "pcib_if.h" From owner-svn-src-head@freebsd.org Thu Feb 18 14:17:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42253AAC923; Thu, 18 Feb 2016 14:17:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E89EACA; Thu, 18 Feb 2016 14:17:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IEHTxk079622; Thu, 18 Feb 2016 14:17:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IEHSRU079616; Thu, 18 Feb 2016 14:17:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602181417.u1IEHSRU079616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Feb 2016 14:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295757 - in head: lib/libc/tests/gen/posix_spawn lib/libc/tests/sys sys/boot/efi/boot1 sys/boot/i386/boot2 sys/boot/i386/pxeldr sys/boot/i386/zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 14:17:30 -0000 Author: emaste Date: Thu Feb 18 14:17:28 2016 New Revision: 295757 URL: https://svnweb.freebsd.org/changeset/base/295757 Log: Remove dd xfer stats emitted during buildworld They result in gratuitous differences when comparing build log output. Modified: head/lib/libc/tests/gen/posix_spawn/Makefile head/lib/libc/tests/sys/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/lib/libc/tests/gen/posix_spawn/Makefile ============================================================================== --- head/lib/libc/tests/gen/posix_spawn/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/lib/libc/tests/gen/posix_spawn/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -20,7 +20,7 @@ CLEANFILES+= h_nonexec .include "../../Makefile.netbsd-tests" h_zero: - dd if=/dev/zero of=h_zero bs=1k count=2 + dd if=/dev/zero of=h_zero bs=1k count=2 status=none chmod a+x h_zero CLEANFILES+= h_zero Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/lib/libc/tests/sys/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -78,6 +78,6 @@ truncate_test_FILESGRP= wheel CLEANFILES= truncate_test.root_owned truncate_test.root_owned: - dd if=/dev/null bs=1 count=1 of=${.TARGET} + dd if=/dev/null bs=1 count=1 of=${.TARGET} status=none .include Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/sys/boot/efi/boot1/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -113,7 +113,8 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \ + status=none CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/sys/boot/i386/boot2/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -72,14 +72,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 + dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/sys/boot/i386/pxeldr/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync + dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none rm ${.TARGET}.tmp LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Feb 18 13:07:21 2016 (r295756) +++ head/sys/boot/i386/zfsboot/Makefile Thu Feb 18 14:17:28 2016 (r295757) @@ -65,7 +65,7 @@ BOOT2SIZE= 65536 zfsboot2: zfsboot.ld @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync + dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync status=none zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ From owner-svn-src-head@freebsd.org Thu Feb 18 14:38:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E28AFAAD5CC; Thu, 18 Feb 2016 14:38:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9DD1AE2; Thu, 18 Feb 2016 14:38:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IEcbqt085717; Thu, 18 Feb 2016 14:38:37 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IEcb2p085716; Thu, 18 Feb 2016 14:38:37 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602181438.u1IEcb2p085716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Feb 2016 14:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295758 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 14:38:39 -0000 Author: br Date: Thu Feb 18 14:38:37 2016 New Revision: 295758 URL: https://svnweb.freebsd.org/changeset/base/295758 Log: Use medany (Medium/Anywhere) GCC code model for RISC-V. This will allow us to use bigger relocations and all the 64-bit VA space. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Feb 18 14:17:28 2016 (r295757) +++ head/sys/conf/kern.mk Thu Feb 18 14:38:37 2016 (r295758) @@ -105,6 +105,7 @@ CFLAGS += -ffixed-x18 .endif .if ${MACHINE_CPUARCH} == "riscv" +CFLAGS.gcc+= -mcmodel=medany INLINE_LIMIT?= 8000 .endif From owner-svn-src-head@freebsd.org Thu Feb 18 14:55:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E713AAADD01; Thu, 18 Feb 2016 14:55:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8177972; Thu, 18 Feb 2016 14:55:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E0CCDB990; Thu, 18 Feb 2016 09:55:35 -0500 (EST) From: John Baldwin To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295755 - in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sparc64/sparc64 sys Date: Thu, 18 Feb 2016 06:38:41 -0800 Message-ID: <15376407.tuYH0ZQ0Qn@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201602181300.u1ID05qW056340@repo.freebsd.org> References: <201602181300.u1ID05qW056340@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 18 Feb 2016 09:55:36 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 14:55:37 -0000 On Thursday, February 18, 2016 01:00:04 PM Zbigniew Bodek wrote: > Author: zbb > Date: Thu Feb 18 13:00:04 2016 > New Revision: 295755 > URL: https://svnweb.freebsd.org/changeset/base/295755 > > Log: > Introduce bus_get_bus_tag() method > > Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips > nexus and its children in order to return a platform specific default tag. > > This is required to ensure generic correctness of the bus_space tag. > It is especially needed for arches where child bus tag does not match > the parent bus tag. This solves the problem with ppc architecture > where the PCI bus tag differs from parent bus tag which is big-endian. > > This commit is a part of the following patch: > https://reviews.freebsd.org/D4879 > > Submitted by: Marcin Mazurek > Obtained from: Semihalf > Sponsored by: Annapurna Labs > Reviewed by: jhibbits, mmel > Differential Revision: https://reviews.freebsd.org/D4879 It should be noted that this API is temporary. It should probably be marked as such so that no code depends on it long term. Once bus_map_resource is implemented in the parent drivers for this bus this should be removed. I hope to have that in place for 11 so that no release ships with this API. I have a review open on a prototype for bus_map_resource() in D5237. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Feb 18 15:12:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6076DAAC58A; Thu, 18 Feb 2016 15:12:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3168D1996; Thu, 18 Feb 2016 15:12:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IFCqbL000741; Thu, 18 Feb 2016 15:12:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IFCqYq000740; Thu, 18 Feb 2016 15:12:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602181512.u1IFCqYq000740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Feb 2016 15:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295759 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 15:12:53 -0000 Author: imp Date: Thu Feb 18 15:12:52 2016 New Revision: 295759 URL: https://svnweb.freebsd.org/changeset/base/295759 Log: Remove a stray else. It isn't needed (due to the return at the end of the if statement it pairs with). While not an error today, a careless edit in the future could cause problems (though given the nature of this specific code, the problems quite likely would be some variation of "most direct access SCSI storage devices won't attach," which is unlikely to go unnoticed). PVS-Studio: V705 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Feb 18 14:38:37 2016 (r295758) +++ head/sys/cam/scsi/scsi_da.c Thu Feb 18 15:12:52 2016 (r295759) @@ -3228,7 +3228,8 @@ dadone(struct cam_periph *periph, union softc->state = DA_STATE_PROBE_RC; xpt_schedule(periph, priority); return; - } else + } + /* * Attach to anything that claims to be a * direct access or optical disk device, From owner-svn-src-head@freebsd.org Thu Feb 18 15:23:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C8E8AACBBA; Thu, 18 Feb 2016 15:23:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D68B262; Thu, 18 Feb 2016 15:23:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IFNQHF004341; Thu, 18 Feb 2016 15:23:26 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IFNQk8004338; Thu, 18 Feb 2016 15:23:26 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602181523.u1IFNQk8004338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 18 Feb 2016 15:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295760 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 15:23:27 -0000 Author: se Date: Thu Feb 18 15:23:25 2016 New Revision: 295760 URL: https://svnweb.freebsd.org/changeset/base/295760 Log: Make WARNS=6 safe. Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64. Modified: head/usr.sbin/pciconf/Makefile head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/Makefile ============================================================================== --- head/usr.sbin/pciconf/Makefile Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/Makefile Thu Feb 18 15:23:25 2016 (r295760) @@ -5,6 +5,4 @@ PROG= pciconf SRCS= pciconf.c cap.c err.c MAN= pciconf.8 -WARNS?= 3 - .include Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/cap.c Thu Feb 18 15:23:25 2016 (r295760) @@ -120,6 +120,9 @@ static void cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) { + (void)fd; /* UNUSED */ + (void)p; /* UNUSED */ + (void)ptr; /* UNUSED */ printf("VPD"); } @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin } if ((p->pc_hdr & PCIM_HDRTYPE) == 1) return; + max_burst_read = 0; switch (status & PCIXM_STATUS_MAX_READ) { case PCIXM_STATUS_MAX_READ_512: max_burst_read = 512; @@ -186,6 +190,7 @@ cap_pcix(int fd, struct pci_conf *p, uin max_burst_read = 4096; break; } + max_splits = 0; switch (status & PCIXM_STATUS_MAX_SPLITS) { case PCIXM_STATUS_MAX_SPLITS_1: max_splits = 1; @@ -518,6 +523,9 @@ static void cap_sata(int fd, struct pci_conf *p, uint8_t ptr) { + (void)fd; /* UNUSED */ + (void)p; /* UNUSED */ + (void)ptr; /* UNUSED */ printf("SATA Index-Data Pair"); } @@ -759,7 +767,7 @@ ecap_sriov(int fd, struct pci_conf *p, u print_bar(fd, p, "iov bar ", ptr + PCIR_SRIOV_BAR(i)); } -struct { +static struct { uint16_t id; const char *name; } ecap_names[] = { Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016 (r295760) @@ -67,7 +67,7 @@ struct pci_vendor_info char *desc; }; -TAILQ_HEAD(,pci_vendor_info) pci_vendors; +static TAILQ_HEAD(,pci_vendor_info) pci_vendors; static struct pcisel getsel(const char *str); static void list_bridge(int fd, struct pci_conf *p); @@ -896,16 +896,18 @@ getdevice(const char *name) static struct pcisel parsesel(const char *str) { - char *ep = strchr(str, '@'); - char *epbase; + const char *ep; + const char *epbase; + char *eppos; struct pcisel sel; unsigned long selarr[4]; int i; - if (ep == NULL) - ep = (char *)str; - else + ep = strchr(str, '@'); + if (ep != NULL) ep++; + else + ep = str; epbase = ep; @@ -913,7 +915,8 @@ parsesel(const char *str) ep += 3; i = 0; do { - selarr[i++] = strtoul(ep, &ep, 10); + selarr[i++] = strtoul(ep, &eppos, 10); + ep = eppos; } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); if (i > 2) From owner-svn-src-head@freebsd.org Thu Feb 18 15:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB381AACE1E; Thu, 18 Feb 2016 15:28:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0FB7F0; Thu, 18 Feb 2016 15:28:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IFSvln004559; Thu, 18 Feb 2016 15:28:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IFSvft004555; Thu, 18 Feb 2016 15:28:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602181528.u1IFSvft004555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Feb 2016 15:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295761 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 15:28:58 -0000 Author: br Date: Thu Feb 18 15:28:57 2016 New Revision: 295761 URL: https://svnweb.freebsd.org/changeset/base/295761 Log: Increase kernel and user VA space. This allows us to boot with more than 128MB of physical memory. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/include/vmparam.h head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Thu Feb 18 15:23:25 2016 (r295760) +++ head/sys/riscv/include/vmparam.h Thu Feb 18 15:28:57 2016 (r295761) @@ -43,19 +43,19 @@ * Virtual memory related constants, all in bytes */ #ifndef MAXTSIZ -#define MAXTSIZ (32*1024*1024) /* max text size */ +#define MAXTSIZ (1*1024*1024*1024) /* max text size */ #endif #ifndef DFLDSIZ #define DFLDSIZ (128*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (128*1024*1024) /* max data size */ +#define MAXDSIZ (1*1024*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ -#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ +#define DFLSSIZ (128*1024*1024) /* initial stack size limit */ #endif #ifndef MAXSSIZ -#define MAXSSIZ (8*1024*1024) /* max stack size */ +#define MAXSSIZ (1*1024*1024*1024) /* max stack size */ #endif #ifndef SGROWSIZ #define SGROWSIZ (128*1024) /* amount to grow stack */ @@ -128,12 +128,12 @@ * We limit the size of the two spaces to 39 bits each. * * Upper region: 0xffffffffffffffff - * 0xffffffffc0000000 + * 0xffffff8000000000 * - * Hole: 0xffffffffbfffffff - * 0x0000000080000000 + * Hole: 0xffffff7fffffffff + * 0x0000008000000000 * - * Lower region: 0x000000007fffffff + * Lower region: 0x0000007fffffffff * 0x0000000000000000 * * We use the upper region for the kernel, and the lower region for userland. @@ -152,19 +152,20 @@ #define VM_MIN_ADDRESS (0x0000000000000000UL) #define VM_MAX_ADDRESS (0xffffffffffffffffUL) -/* 256 MiB of kernel addresses */ -#define VM_MIN_KERNEL_ADDRESS (0xffffffffc0000000UL) -#define VM_MAX_KERNEL_ADDRESS (0xffffffffcfffffffUL) - -/* Direct Map for 512 MiB of PA: 0x0 - 0x1fffffff */ -#define DMAP_MIN_ADDRESS (0xffffffffd0000000UL) -#define DMAP_MAX_ADDRESS (0xffffffffefffffffUL) +/* 32 GiB of kernel addresses */ +#define VM_MIN_KERNEL_ADDRESS (0xffffff8000000000UL) +#define VM_MAX_KERNEL_ADDRESS (0xffffff8800000000UL) + +/* Direct Map for 128 GiB of PA: 0x0 - 0x1fffffffff */ +#define DMAP_MIN_ADDRESS (0xffffffc000000000UL) +#define DMAP_MAX_ADDRESS (0xffffffdfffffffffUL) #define DMAP_MIN_PHYSADDR (0x0000000000000000UL) #define DMAP_MAX_PHYSADDR (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) /* True if pa is in the dmap range */ -#define PHYS_IN_DMAP(pa) ((pa) <= DMAP_MAX_PHYSADDR) +#define PHYS_IN_DMAP(pa) ((pa) >= DMAP_MIN_PHYSADDR && \ + (pa) <= DMAP_MAX_PHYSADDR) /* True if va is in the dmap range */ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ (va) <= DMAP_MAX_ADDRESS) @@ -186,13 +187,15 @@ }) #define VM_MIN_USER_ADDRESS (0x0000000000000000UL) -#define VM_MAX_USER_ADDRESS (0x0000000080000000UL) +#define VM_MAX_USER_ADDRESS (0x0000008000000000UL) #define VM_MINUSER_ADDRESS (VM_MIN_USER_ADDRESS) #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) -#define USRSTACK (VM_MAX_USER_ADDRESS) +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE + #define KERNENTRY (0x200) /* Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Thu Feb 18 15:23:25 2016 (r295760) +++ head/sys/riscv/riscv/locore.S Thu Feb 18 15:28:57 2016 (r295761) @@ -102,7 +102,6 @@ _start: /* finish building ring */ la t0, hardstack_end - sub t0, t0, s11 csrw mscratch, t0 la t0, mentry Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Feb 18 15:23:25 2016 (r295760) +++ head/sys/riscv/riscv/pmap.c Thu Feb 18 15:28:57 2016 (r295761) @@ -445,31 +445,33 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_ } static void -pmap_bootstrap_dmap(vm_offset_t l2pt) +pmap_bootstrap_dmap(vm_offset_t l1pt, vm_paddr_t kernstart) { vm_offset_t va; vm_paddr_t pa; - pd_entry_t *l2; - u_int l2_slot; + pd_entry_t *l1; + u_int l1_slot; pt_entry_t entry; u_int pn; + pa = kernstart & ~L1_OFFSET; va = DMAP_MIN_ADDRESS; - l2 = (pd_entry_t *)l2pt; - l2_slot = pmap_l2_index(DMAP_MIN_ADDRESS); + l1 = (pd_entry_t *)l1pt; + l1_slot = pmap_l1_index(DMAP_MIN_ADDRESS); - for (pa = 0; va < DMAP_MAX_ADDRESS; pa += L2_SIZE, va += L2_SIZE, l2_slot++) { - KASSERT(l2_slot < Ln_ENTRIES, ("Invalid L2 index")); + for (; va < DMAP_MAX_ADDRESS; + pa += L1_SIZE, va += L1_SIZE, l1_slot++) { + KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index")); /* superpages */ - pn = ((pa >> L2_SHIFT) & Ln_ADDR_MASK); + pn = ((pa >> L1_SHIFT) & Ln_ADDR_MASK); entry = (PTE_VALID | (PTE_TYPE_SRWX << PTE_TYPE_S)); - entry |= (pn << PTE_PPN1_S); + entry |= (pn << PTE_PPN2_S); - pmap_load_store(&l2[l2_slot], entry); + pmap_load_store(&l1[l1_slot], entry); } - cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); + cpu_dcache_wb_range((vm_offset_t)l1, PAGE_SIZE); cpu_tlb_flushID(); } @@ -485,7 +487,6 @@ pmap_bootstrap(vm_offset_t l1pt, vm_padd vm_offset_t va, freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t pa, min_pa; - vm_offset_t l2pt; int i; kern_delta = KERNBASE - kernstart; @@ -520,8 +521,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_padd } /* Create a direct map region early so we can use it for pa -> va */ - l2pt = (l1pt + PAGE_SIZE); - pmap_bootstrap_dmap(l2pt); + pmap_bootstrap_dmap(l1pt, min_pa); va = KERNBASE; pa = KERNBASE - kern_delta; From owner-svn-src-head@freebsd.org Thu Feb 18 15:44:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0358AAAD82C; Thu, 18 Feb 2016 15:44:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4A951558; Thu, 18 Feb 2016 15:44:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IFij8t011109; Thu, 18 Feb 2016 15:44:45 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IFijc5011107; Thu, 18 Feb 2016 15:44:45 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602181544.u1IFijc5011107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 18 Feb 2016 15:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295762 - in head/sys: dev/ofw kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 15:44:47 -0000 Author: zbb Date: Thu Feb 18 15:44:45 2016 New Revision: 295762 URL: https://svnweb.freebsd.org/changeset/base/295762 Log: Fix build for i386 and arm64 after r295755 - Take bus_space_tag_t type into consideration when returning default, zero value. - Include missing rman.h required by ofw_pci.h Modified: head/sys/dev/ofw/ofw_subr.c head/sys/kern/subr_bus.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 15:28:57 2016 (r295761) +++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 15:44:45 2016 (r295762) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Feb 18 15:28:57 2016 (r295761) +++ head/sys/kern/subr_bus.c Thu Feb 18 15:44:45 2016 (r295762) @@ -4107,7 +4107,7 @@ bus_generic_get_bus_tag(device_t dev, de /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_BUS_TAG(dev->parent, child)); - return (NULL); + return ((bus_space_tag_t)0); } /** @@ -4604,7 +4604,7 @@ bus_get_bus_tag(device_t dev) parent = device_get_parent(dev); if (parent == NULL) - return (NULL); + return ((bus_space_tag_t)0); return (BUS_GET_BUS_TAG(parent, dev)); } From owner-svn-src-head@freebsd.org Thu Feb 18 18:07:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BDAAAC47F; Thu, 18 Feb 2016 18:07:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987AB19C; Thu, 18 Feb 2016 18:07:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A602BB918; Thu, 18 Feb 2016 13:07:25 -0500 (EST) From: John Baldwin To: Stefan Esser Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295760 - head/usr.sbin/pciconf Date: Thu, 18 Feb 2016 10:07:21 -0800 Message-ID: <1865104.t06og7Ezta@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201602181523.u1IFNQk8004338@repo.freebsd.org> References: <201602181523.u1IFNQk8004338@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 18 Feb 2016 13:07:25 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 18:07:26 -0000 On Thursday, February 18, 2016 03:23:26 PM Stefan Esser wrote: > Author: se > Date: Thu Feb 18 15:23:25 2016 > New Revision: 295760 > URL: https://svnweb.freebsd.org/changeset/base/295760 > > Log: > Make WARNS=6 safe. > > Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64. Thanks. > Modified: head/usr.sbin/pciconf/cap.c > ============================================================================== > --- head/usr.sbin/pciconf/cap.c Thu Feb 18 15:12:52 2016 (r295759) > +++ head/usr.sbin/pciconf/cap.c Thu Feb 18 15:23:25 2016 (r295760) > @@ -120,6 +120,9 @@ static void > cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) > { > > + (void)fd; /* UNUSED */ > + (void)p; /* UNUSED */ > + (void)ptr; /* UNUSED */ > printf("VPD"); > } I think we prefer __unused in the parameter declaration instead? That is: cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) > @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin > } > if ((p->pc_hdr & PCIM_HDRTYPE) == 1) > return; > + max_burst_read = 0; > switch (status & PCIXM_STATUS_MAX_READ) { > case PCIXM_STATUS_MAX_READ_512: > max_burst_read = 512; Compilers are simply not smart enough. :-P > Modified: head/usr.sbin/pciconf/pciconf.c > ============================================================================== > --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016 (r295759) > +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016 (r295760) > @@ -913,7 +915,8 @@ parsesel(const char *str) > ep += 3; > i = 0; > do { > - selarr[i++] = strtoul(ep, &ep, 10); > + selarr[i++] = strtoul(ep, &eppos, 10); > + ep = eppos; > } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); This is now indented oddly (2 spaces instead of a tab?). -- John Baldwin From owner-svn-src-head@freebsd.org Thu Feb 18 18:41:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3AD1AAD495; Thu, 18 Feb 2016 18:41:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6081A90; Thu, 18 Feb 2016 18:41:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IIfexR065888; Thu, 18 Feb 2016 18:41:40 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IIfe5Q065887; Thu, 18 Feb 2016 18:41:40 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602181841.u1IIfe5Q065887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 18 Feb 2016 18:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295764 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 18:41:41 -0000 Author: sobomax Date: Thu Feb 18 18:41:40 2016 New Revision: 295764 URL: https://svnweb.freebsd.org/changeset/base/295764 Log: Right now, the "virtual hole" API feature of lseek(2) is very vaguely documented and easy to miss. At the same time, it's pretty important for anyone who is trying to use SEEK_HOLE/SEEK_DATA in real app. Try to bridge that gap by making that description more pronounced and also document how it affects failure codes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5162 Modified: head/lib/libc/sys/lseek.2 Modified: head/lib/libc/sys/lseek.2 ============================================================================== --- head/lib/libc/sys/lseek.2 Thu Feb 18 17:09:55 2016 (r295763) +++ head/lib/libc/sys/lseek.2 Thu Feb 18 18:41:40 2016 (r295764) @@ -131,8 +131,14 @@ Applications can use .Dv SEEK_HOLE to optimise their behavior for ranges of zeros, but must not depend on it to find all such ranges in a file. +Each file is presented as having a zero-size virtual hole at the very +end of the file. The existence of a hole at the end of every data region allows for easy -programming and implies that a virtual hole exists at the end of the file. +programming and also provides compatibility to the original imlementation +in Solaris. +It also causes the current file size (i.e. end-of-file offset) to be returned +to indicate that there are no more holes past the supplied +.Fa offset . Applications should use .Fn fpathconf _PC_MIN_HOLE_SIZE or @@ -176,9 +182,11 @@ be negative for a non-character special For .Dv SEEK_DATA , there are no more data regions past the supplied offset. -For -.Dv SEEK_HOLE , -there are no more holes past the supplied offset. +Due to existence of the hole at the end of the file, for +.Dv SEEK_HOLE +this error is only returned when the +.Fa offset +already points to the end-of-file position. .It Bq Er EOVERFLOW The resulting file offset would be a value which cannot be represented correctly in an object of type From owner-svn-src-head@freebsd.org Thu Feb 18 18:50:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983FFAAD855; Thu, 18 Feb 2016 18:50:04 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7631F4; Thu, 18 Feb 2016 18:50:04 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IIo3E4069053; Thu, 18 Feb 2016 18:50:03 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IIo3sm069052; Thu, 18 Feb 2016 18:50:03 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201602181850.u1IIo3sm069052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Thu, 18 Feb 2016 18:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295765 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 18:50:04 -0000 Author: bjk (doc committer) Date: Thu Feb 18 18:50:03 2016 New Revision: 295765 URL: https://svnweb.freebsd.org/changeset/base/295765 Log: Bump .Dd for r295764 Also fix a spelling and grammar nit while here. Modified: head/lib/libc/sys/lseek.2 Modified: head/lib/libc/sys/lseek.2 ============================================================================== --- head/lib/libc/sys/lseek.2 Thu Feb 18 18:41:40 2016 (r295764) +++ head/lib/libc/sys/lseek.2 Thu Feb 18 18:50:03 2016 (r295765) @@ -28,7 +28,7 @@ .\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd May 26, 2012 +.Dd February 18, 2016 .Dt LSEEK 2 .Os .Sh NAME @@ -134,9 +134,9 @@ find all such ranges in a file. Each file is presented as having a zero-size virtual hole at the very end of the file. The existence of a hole at the end of every data region allows for easy -programming and also provides compatibility to the original imlementation +programming and also provides compatibility to the original implementation in Solaris. -It also causes the current file size (i.e. end-of-file offset) to be returned +It also causes the current file size (i.e., end-of-file offset) to be returned to indicate that there are no more holes past the supplied .Fa offset . Applications should use From owner-svn-src-head@freebsd.org Thu Feb 18 19:05:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 133DBAADE74; Thu, 18 Feb 2016 19:05:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8D0AD41; Thu, 18 Feb 2016 19:05:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IJ5UDF074812; Thu, 18 Feb 2016 19:05:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IJ5UwF074811; Thu, 18 Feb 2016 19:05:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602181905.u1IJ5UwF074811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Feb 2016 19:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295766 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 19:05:32 -0000 Author: glebius Date: Thu Feb 18 19:05:30 2016 New Revision: 295766 URL: https://svnweb.freebsd.org/changeset/base/295766 Log: Fix obvious typo, that lead to incorrect sorting. Found by: PVS-Studio Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Feb 18 18:50:03 2016 (r295765) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Feb 18 19:05:30 2016 (r295766) @@ -2890,7 +2890,7 @@ compare_sh(const void *_a, const void *_ if ((uintptr_t)a->handler < (uintptr_t)b->handler) return (-1); - else if ((uintptr_t)b->handler > (uintptr_t)b->handler) + else if ((uintptr_t)a->handler > (uintptr_t)b->handler) return (1); return (0); From owner-svn-src-head@freebsd.org Thu Feb 18 19:37:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B26AACD2D; Thu, 18 Feb 2016 19:37:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 949761E4C; Thu, 18 Feb 2016 19:37:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IJbd4Y083641; Thu, 18 Feb 2016 19:37:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IJbdnZ083640; Thu, 18 Feb 2016 19:37:39 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602181937.u1IJbdnZ083640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Feb 2016 19:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295767 - head/sys/compat/x86bios X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 19:37:40 -0000 Author: jkim Date: Thu Feb 18 19:37:39 2016 New Revision: 295767 URL: https://svnweb.freebsd.org/changeset/base/295767 Log: Silence VPS-Studio errors (V512). These buffer underflows are intentional. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Thu Feb 18 19:05:30 2016 (r295766) +++ head/sys/compat/x86bios/x86bios.c Thu Feb 18 19:37:39 2016 (r295767) @@ -586,7 +586,7 @@ x86bios_call(struct x86regs *regs, uint1 X86BIOS_TRACE(Calling 0x%06x, (seg << 4) + off, regs); mtx_lock(&x86bios_lock); - memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + memcpy((struct x86regs *)&x86bios_emu.x86, regs, sizeof(*regs)); x86bios_fault = 0; spinlock_enter(); x86emu_exec_call(&x86bios_emu, seg, off); @@ -628,7 +628,7 @@ x86bios_intr(struct x86regs *regs, int i X86BIOS_TRACE(Calling INT 0x%02x, intno, regs); mtx_lock(&x86bios_lock); - memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + memcpy((struct x86regs *)&x86bios_emu.x86, regs, sizeof(*regs)); x86bios_fault = 0; spinlock_enter(); x86emu_exec_intr(&x86bios_emu, intno); From owner-svn-src-head@freebsd.org Thu Feb 18 20:08:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 059BCAADB7D; Thu, 18 Feb 2016 20:08:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6665117E; Thu, 18 Feb 2016 20:08:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IK81EF092129; Thu, 18 Feb 2016 20:08:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IK81vg092127; Thu, 18 Feb 2016 20:08:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201602182008.u1IK81vg092127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Feb 2016 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295768 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 20:08:03 -0000 Author: asomers Date: Thu Feb 18 20:08:01 2016 New Revision: 295768 URL: https://svnweb.freebsd.org/changeset/base/295768 Log: Fix compiler warnings in iostat Raise WARNS from 1 to 6 (the default) Fix warnings: * Use C99 designated initializers for structs, and initialize all fields * Mark global variables as static * Mark unused function arguments * Be careful about signed/unsigned comparisons Reviewed by: eadler MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5328 Modified: head/usr.sbin/iostat/Makefile head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/Makefile ============================================================================== --- head/usr.sbin/iostat/Makefile Thu Feb 18 19:37:39 2016 (r295767) +++ head/usr.sbin/iostat/Makefile Thu Feb 18 20:08:01 2016 (r295768) @@ -6,6 +6,4 @@ MAN= iostat.8 LIBADD= devstat kvm m -WARNS?= 1 - .include Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Thu Feb 18 19:37:39 2016 (r295767) +++ head/usr.sbin/iostat/iostat.c Thu Feb 18 20:08:01 2016 (r295768) @@ -117,30 +117,34 @@ #include #include -struct nlist namelist[] = { +static struct nlist namelist[] = { #define X_TTY_NIN 0 - { "_tty_nin" }, + { .n_name = "_tty_nin", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_TTY_NOUT 1 - { "_tty_nout" }, + { .n_name = "_tty_nout", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_BOOTTIME 2 - { "_boottime" }, + { .n_name = "_boottime", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_END 2 - { NULL }, + { .n_name = NULL, + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, }; #define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ -struct statinfo cur, last; -int num_devices; -struct device_selection *dev_select; -int maxshowdevs; -volatile sig_atomic_t headercount; -volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ -volatile sig_atomic_t alarm_rang; -volatile sig_atomic_t return_requested; -unsigned short wrows; /* Current number of tty rows. */ -int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; -int xflag = 0, zflag = 0; +static struct statinfo cur, last; +static int num_devices; +static struct device_selection *dev_select; +static int maxshowdevs; +static volatile sig_atomic_t headercount; +static volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static volatile sig_atomic_t alarm_rang; +static volatile sig_atomic_t return_requested; +static unsigned short wrows; /* Current number of tty rows. */ +static int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; +static int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); @@ -650,7 +654,7 @@ main(int argc, char **argv) * Force a header to be prepended to the next output. */ void -needhdr(int signo) +needhdr(int signo __unused) { headercount = 1; @@ -662,7 +666,7 @@ needhdr(int signo) * prepended to the next output. */ void -needresize(int signo) +needresize(int signo __unused) { wresized = 1; @@ -673,7 +677,7 @@ needresize(int signo) * Record the alarm so the main loop can break its sleep */ void -alarm_clock(int signo) +alarm_clock(int signo __unused) { alarm_rang = 1; } @@ -682,7 +686,7 @@ alarm_clock(int signo) * Request that the main loop exit soon */ void -needreturn(int signo) +needreturn(int signo __unused) { return_requested = 1; } @@ -998,8 +1002,7 @@ readvar(kvm_t *kd, const char *name, int warnx("kvm_read(%s): %s", namelist[nlid].n_name, kvm_geterr(kd)); return (1); - } - if (nbytes != len) { + } else if ((size_t)nbytes != len) { warnx("kvm_read(%s): expected %zu bytes, got %zd bytes", namelist[nlid].n_name, len, nbytes); return (1); From owner-svn-src-head@freebsd.org Thu Feb 18 20:15:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 305DCAADEE2; Thu, 18 Feb 2016 20:15:56 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout07.t-online.de (mailout07.t-online.de [194.25.134.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6B2817A6; Thu, 18 Feb 2016 20:15:55 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd41.aul.t-online.de (fwd41.aul.t-online.de [172.20.27.139]) by mailout07.t-online.de (Postfix) with SMTP id 3A4CD5FB960; Thu, 18 Feb 2016 21:15:47 +0100 (CET) Received: from [192.168.119.22] (ZwsoZaZvrh3baDbPw+aEjq8hbylGK8eGV3HCVC+HzMkqkvPRYrx9eTzuSohREBcwrc@[87.151.212.124]) by fwd41.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1aWUzB-252KuW0; Thu, 18 Feb 2016 21:15:37 +0100 Subject: Re: svn commit: r295760 - head/usr.sbin/pciconf To: John Baldwin , Stefan Esser References: <201602181523.u1IFNQk8004338@repo.freebsd.org> <1865104.t06og7Ezta@ralph.baldwin.cx> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Stefan Esser X-Enigmail-Draft-Status: N1110 Message-ID: <56C6265F.4050101@freebsd.org> Date: Thu, 18 Feb 2016 21:15:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1865104.t06og7Ezta@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-ID: ZwsoZaZvrh3baDbPw+aEjq8hbylGK8eGV3HCVC+HzMkqkvPRYrx9eTzuSohREBcwrc X-TOI-MSGID: aaf13de5-7026-4dc2-b16d-d13db7207141 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 20:15:56 -0000 Am 18.02.2016 um 19:07 schrieb John Baldwin: > On Thursday, February 18, 2016 03:23:26 PM Stefan Esser wrote: >> Author: se >> Date: Thu Feb 18 15:23:25 2016 >> New Revision: 295760 >> URL: https://svnweb.freebsd.org/changeset/base/295760 >> >> Log: >> Make WARNS=6 safe. >> >> Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64. > > Thanks. > >> Modified: head/usr.sbin/pciconf/cap.c >> ============================================================================== >> --- head/usr.sbin/pciconf/cap.c Thu Feb 18 15:12:52 2016 (r295759) >> +++ head/usr.sbin/pciconf/cap.c Thu Feb 18 15:23:25 2016 (r295760) >> @@ -120,6 +120,9 @@ static void >> cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) >> { >> >> + (void)fd; /* UNUSED */ >> + (void)p; /* UNUSED */ >> + (void)ptr; /* UNUSED */ >> printf("VPD"); >> } > > I think we prefer __unused in the parameter declaration instead? That is: Since I was not sure about the best way to silence this warning, I had looked at the mail archive and found a mail thread from July 2012 with subject "(void)foo or __unused foo ?". The cast to void seemed to be the most portable method, but in fact I prefer the __unused modifier myself. > cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) Yes, I'll commit that version in a minute. >> @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin >> } >> if ((p->pc_hdr & PCIM_HDRTYPE) == 1) >> return; >> + max_burst_read = 0; >> switch (status & PCIXM_STATUS_MAX_READ) { >> case PCIXM_STATUS_MAX_READ_512: >> max_burst_read = 512; > > Compilers are simply not smart enough. :-P Well, clang-3.7.1 in -CURRENT is ... But both gcc-4.2.1 and gcc-4.8.5 warn about a possibly uninitialized variable. I could have changed the last case selector into "default" to silence the warning without need for an initializer before the switch statement, but that would be too ugly and misleading. >> Modified: head/usr.sbin/pciconf/pciconf.c >> ============================================================================== >> --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016 (r295759) >> +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016 (r295760) >> @@ -913,7 +915,8 @@ parsesel(const char *str) >> ep += 3; >> i = 0; >> do { >> - selarr[i++] = strtoul(ep, &ep, 10); >> + selarr[i++] = strtoul(ep, &eppos, 10); >> + ep = eppos; >> } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); > > This is now indented oddly (2 spaces instead of a tab?). Sorry, the pciconf sources do not comply with "style" and I'm to blame, since I committed the initial version nearly 20 years ago ... But you are correct, I got even the wrong indentation wrong ;-) Thank you for the review and your comments, I'll commit a fixed version now. Best regards, STefan From owner-svn-src-head@freebsd.org Thu Feb 18 20:20:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50293AAC13C; Thu, 18 Feb 2016 20:20:38 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 222CA1C27; Thu, 18 Feb 2016 20:20:38 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IKKbHk095248; Thu, 18 Feb 2016 20:20:37 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IKKbNi095246; Thu, 18 Feb 2016 20:20:37 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602182020.u1IKKbNi095246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 18 Feb 2016 20:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295769 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 20:20:38 -0000 Author: se Date: Thu Feb 18 20:20:36 2016 New Revision: 295769 URL: https://svnweb.freebsd.org/changeset/base/295769 Log: Use __unused instead of casting to void to silence the unused parameter warning. Fix the indentation of 2 lines to conform with the style of this file. Submitted by: jhb Modified: head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Thu Feb 18 20:08:01 2016 (r295768) +++ head/usr.sbin/pciconf/cap.c Thu Feb 18 20:20:36 2016 (r295769) @@ -117,12 +117,9 @@ cap_agp(int fd, struct pci_conf *p, uint } static void -cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) +cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) { - (void)fd; /* UNUSED */ - (void)p; /* UNUSED */ - (void)ptr; /* UNUSED */ printf("VPD"); } @@ -520,12 +517,9 @@ cap_msix(int fd, struct pci_conf *p, uin } static void -cap_sata(int fd, struct pci_conf *p, uint8_t ptr) +cap_sata(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) { - (void)fd; /* UNUSED */ - (void)p; /* UNUSED */ - (void)ptr; /* UNUSED */ printf("SATA Index-Data Pair"); } Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 20:08:01 2016 (r295768) +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 20:20:36 2016 (r295769) @@ -915,8 +915,8 @@ parsesel(const char *str) ep += 3; i = 0; do { - selarr[i++] = strtoul(ep, &eppos, 10); - ep = eppos; + selarr[i++] = strtoul(ep, &eppos, 10); + ep = eppos; } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); if (i > 2) From owner-svn-src-head@freebsd.org Thu Feb 18 21:05:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0718AAD8BC; Thu, 18 Feb 2016 21:05:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB1411868; Thu, 18 Feb 2016 21:05:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IL54W3009729; Thu, 18 Feb 2016 21:05:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IL54o2009728; Thu, 18 Feb 2016 21:05:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602182105.u1IL54o2009728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Feb 2016 21:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295771 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 21:05:06 -0000 Author: tuexen Date: Thu Feb 18 21:05:04 2016 New Revision: 295771 URL: https://svnweb.freebsd.org/changeset/base/295771 Log: Fix reporting of mapped addressed in getpeername() and getsockname() for IPv6 SCTP sockets. This bugs were found because of an issue reported by PVS / D5245. Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Thu Feb 18 20:37:12 2016 (r295770) +++ head/sys/netinet6/sctp6_usrreq.c Thu Feb 18 21:05:04 2016 (r295771) @@ -1008,7 +1008,9 @@ sctp6_getaddr(struct socket *so, struct stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { - goto notConn6; + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); + return (ENOENT); } fnd = 0; sin_a6 = NULL; @@ -1025,7 +1027,9 @@ sctp6_getaddr(struct socket *so, struct } if ((!fnd) || (sin_a6 == NULL)) { /* punt */ - goto notConn6; + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); + return (ENOENT); } vrf_id = inp->def_vrf_id; sctp_ifa = sctp_source_address_selection(inp, stcb, (sctp_route_t *) & net->ro, net, 0, vrf_id); @@ -1034,7 +1038,6 @@ sctp6_getaddr(struct socket *so, struct } } else { /* For the bound all case you get back 0 */ - notConn6: memset(&sin6->sin6_addr, 0, sizeof(sin6->sin6_addr)); } } else { @@ -1135,10 +1138,6 @@ sctp6_peeraddr(struct socket *so, struct static int sctp6_in6getaddr(struct socket *so, struct sockaddr **nam) { -#ifdef INET - struct sockaddr *addr; - -#endif struct in6pcb *inp6 = sotoin6pcb(so); int error; @@ -1150,19 +1149,21 @@ sctp6_in6getaddr(struct socket *so, stru error = sctp6_getaddr(so, nam); #ifdef INET if (error) { + struct sockaddr_in6 *sin6; + /* try v4 next if v6 failed */ error = sctp_ingetaddr(so, nam); if (error) { return (error); } - addr = *nam; - /* if I'm V6ONLY, convert it to v4-mapped */ - if (SCTP_IPV6_V6ONLY(inp6)) { - struct sockaddr_in6 sin6; - - in6_sin_2_v4mapsin6((struct sockaddr_in *)addr, &sin6); - memcpy(addr, &sin6, sizeof(struct sockaddr_in6)); - } + SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) { + SCTP_FREE_SONAME(*nam); + return (ENOMEM); + } + in6_sin_2_v4mapsin6((struct sockaddr_in *)*nam, sin6); + SCTP_FREE_SONAME(*nam); + *nam = (struct sockaddr *)sin6; } #endif return (error); @@ -1172,10 +1173,6 @@ sctp6_in6getaddr(struct socket *so, stru static int sctp6_getpeeraddr(struct socket *so, struct sockaddr **nam) { -#ifdef INET - struct sockaddr *addr; - -#endif struct in6pcb *inp6 = sotoin6pcb(so); int error; @@ -1187,19 +1184,21 @@ sctp6_getpeeraddr(struct socket *so, str error = sctp6_peeraddr(so, nam); #ifdef INET if (error) { + struct sockaddr_in6 *sin6; + /* try v4 next if v6 failed */ error = sctp_peeraddr(so, nam); if (error) { return (error); } - addr = *nam; - /* if I'm V6ONLY, convert it to v4-mapped */ - if (SCTP_IPV6_V6ONLY(inp6)) { - struct sockaddr_in6 sin6; - - in6_sin_2_v4mapsin6((struct sockaddr_in *)addr, &sin6); - memcpy(addr, &sin6, sizeof(struct sockaddr_in6)); - } + SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) { + SCTP_FREE_SONAME(*nam); + return (ENOMEM); + } + in6_sin_2_v4mapsin6((struct sockaddr_in *)*nam, sin6); + SCTP_FREE_SONAME(*nam); + *nam = (struct sockaddr *)sin6; } #endif return (error); From owner-svn-src-head@freebsd.org Thu Feb 18 21:21:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B96EAAC10E; Thu, 18 Feb 2016 21:21:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599566AE; Thu, 18 Feb 2016 21:21:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ILLjHH015613; Thu, 18 Feb 2016 21:21:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ILLjj2015612; Thu, 18 Feb 2016 21:21:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602182121.u1ILLjj2015612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Feb 2016 21:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295772 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 21:21:46 -0000 Author: tuexen Date: Thu Feb 18 21:21:45 2016 New Revision: 295772 URL: https://svnweb.freebsd.org/changeset/base/295772 Log: Add some protection code. CID: 1331893 MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Feb 18 21:05:04 2016 (r295771) +++ head/sys/netinet/sctp_input.c Thu Feb 18 21:21:45 2016 (r295772) @@ -365,8 +365,10 @@ sctp_process_init(struct sctp_init_chunk } SCTP_TCB_SEND_UNLOCK(stcb); asoc->streamoutcnt = asoc->pre_open_streams; - for (i = 0; i < asoc->streamoutcnt; i++) { - asoc->strmout[i].state = SCTP_STREAM_OPEN; + if (asoc->strmout) { + for (i = 0; i < asoc->streamoutcnt; i++) { + asoc->strmout[i].state = SCTP_STREAM_OPEN; + } } /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; From owner-svn-src-head@freebsd.org Thu Feb 18 21:33:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 362C8AAC5BB; Thu, 18 Feb 2016 21:33:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09A03D2C; Thu, 18 Feb 2016 21:33:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ILXBxt018872; Thu, 18 Feb 2016 21:33:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ILXBHb018871; Thu, 18 Feb 2016 21:33:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602182133.u1ILXBHb018871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Feb 2016 21:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295773 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 21:33:12 -0000 Author: tuexen Date: Thu Feb 18 21:33:10 2016 New Revision: 295773 URL: https://svnweb.freebsd.org/changeset/base/295773 Log: Add protection code. MFC after: 3 days CID: 748858 Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Feb 18 21:21:45 2016 (r295772) +++ head/sys/netinet/sctp_output.c Thu Feb 18 21:33:10 2016 (r295773) @@ -3222,12 +3222,14 @@ plan_d: } } #ifdef INET - if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { - stcb->asoc.scope.ipv4_local_scope = 1; - retried = 1; - goto again_with_private_addresses_allowed; - } else if (retried == 1) { - stcb->asoc.scope.ipv4_local_scope = 0; + if (stcb) { + if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { + stcb->asoc.scope.ipv4_local_scope = 1; + retried = 1; + goto again_with_private_addresses_allowed; + } else if (retried == 1) { + stcb->asoc.scope.ipv4_local_scope = 0; + } } #endif out: From owner-svn-src-head@freebsd.org Thu Feb 18 22:40:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB9D2AAC274; Thu, 18 Feb 2016 22:40:25 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD32810EA; Thu, 18 Feb 2016 22:40:25 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IMeOhB036600; Thu, 18 Feb 2016 22:40:24 GMT (envelope-from jgh@FreeBSD.org) Received: (from jgh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IMeODW036598; Thu, 18 Feb 2016 22:40:24 GMT (envelope-from jgh@FreeBSD.org) Message-Id: <201602182240.u1IMeODW036598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jgh set sender to jgh@FreeBSD.org using -f From: Jason Helfman Date: Thu, 18 Feb 2016 22:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295774 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 22:40:26 -0000 Author: jgh (doc,ports committer) Date: Thu Feb 18 22:40:24 2016 New Revision: 295774 URL: https://svnweb.freebsd.org/changeset/base/295774 Log: - add dma(8) to examples in mailer.conf(5) PR: 207026 Submitted by: lifanov@mail.lifanov.com Approved by: wblock (mentor) Differential Revision: https://reviews.freebsd.org/D5259 Modified: head/share/man/man5/mailer.conf.5 Modified: head/share/man/man5/mailer.conf.5 ============================================================================== --- head/share/man/man5/mailer.conf.5 Thu Feb 18 21:33:10 2016 (r295773) +++ head/share/man/man5/mailer.conf.5 Thu Feb 18 22:40:24 2016 (r295774) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2010 +.Dd February 18, 2016 .Dt MAILER.CONF 5 .Os .Sh NAME @@ -139,7 +139,21 @@ Note the use of additional arguments. sendmail /usr/local/bin/mini_sendmail -srelayhost send-mail /usr/local/bin/mini_sendmail -srelayhost .Ed +.Pp +Using +.Xr dma 8 +to replace +.Xr sendmail 8 : +.Bd -literal -offset indent +# Execute dma instead of sendmail +sendmail /usr/libexec/dma +send-mail /usr/libexec/dma +mailq /usr/libexec/dma +newaliases /usr/libexec/dma +rmail /usr/libexec/dma +.Ed .Sh SEE ALSO +.Xr dma 8 , .Xr mail 1 , .Xr mailq 1 , .Xr newaliases 1 , From owner-svn-src-head@freebsd.org Thu Feb 18 23:00:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A191AACDFF; Thu, 18 Feb 2016 23:00:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9AA1CE1; Thu, 18 Feb 2016 23:00:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IN013J042325; Thu, 18 Feb 2016 23:00:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IN01KW042324; Thu, 18 Feb 2016 23:00:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602182300.u1IN01KW042324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Feb 2016 23:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295775 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 23:00:02 -0000 Author: jkim Date: Thu Feb 18 23:00:01 2016 New Revision: 295775 URL: https://svnweb.freebsd.org/changeset/base/295775 Log: Silence VPS-Studio errors (V646). These is no functional change. Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Thu Feb 18 22:40:24 2016 (r295774) +++ head/sys/contrib/x86emu/x86emu.c Thu Feb 18 23:00:01 2016 (r295775) @@ -7003,7 +7003,7 @@ rol_byte(struct x86emu *emu, uint8_t d, CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 6) & 0x2)), F_OF); - } if (s != 0) { + } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); @@ -7029,7 +7029,7 @@ rol_word(struct x86emu *emu, uint16_t d, CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 14) & 0x2)), F_OF); - } if (s != 0) { + } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); @@ -7055,7 +7055,7 @@ rol_long(struct x86emu *emu, uint32_t d, CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 30) & 0x2)), F_OF); - } if (s != 0) { + } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); From owner-svn-src-head@freebsd.org Thu Feb 18 23:03:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 894E1AAD125; Thu, 18 Feb 2016 23:03:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 640F21D9; Thu, 18 Feb 2016 23:03:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IN3b7N045211; Thu, 18 Feb 2016 23:03:37 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IN3bQc045210; Thu, 18 Feb 2016 23:03:37 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602182303.u1IN3bQc045210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Feb 2016 23:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295776 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 23:03:38 -0000 Author: jkim Date: Thu Feb 18 23:03:37 2016 New Revision: 295776 URL: https://svnweb.freebsd.org/changeset/base/295776 Log: Optimize ROL and ROR emulations and fix comments. Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Thu Feb 18 23:00:01 2016 (r295775) +++ head/sys/contrib/x86emu/x86emu.c Thu Feb 18 23:03:37 2016 (r295776) @@ -6995,15 +6995,13 @@ rol_byte(struct x86emu *emu, uint8_t d, mask = (1 << cnt) - 1; res |= (d >> (8 - cnt)) & mask; - /* set the new carry flag, Note that it is the low order bit - * of the result!!! */ - CONDITIONAL_SET_FLAG(res & 0x1, F_CF); /* OVERFLOW is set *IFF* s==1, then it is the xor of CF and * the most significant bit. Blecck. */ CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 6) & 0x2)), F_OF); - } else if (s != 0) { + } + if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); @@ -7025,11 +7023,11 @@ rol_word(struct x86emu *emu, uint16_t d, res = (d << cnt); mask = (1 << cnt) - 1; res |= (d >> (16 - cnt)) & mask; - CONDITIONAL_SET_FLAG(res & 0x1, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 14) & 0x2)), F_OF); - } else if (s != 0) { + } + if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); @@ -7051,11 +7049,11 @@ rol_long(struct x86emu *emu, uint32_t d, res = (d << cnt); mask = (1 << cnt) - 1; res |= (d >> (32 - cnt)) & mask; - CONDITIONAL_SET_FLAG(res & 0x1, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 30) & 0x2)), F_OF); - } else if (s != 0) { + } + if (s != 0) { /* set the new carry flag, Note that it is the low order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); @@ -7093,14 +7091,12 @@ ror_byte(struct x86emu *emu, uint8_t d, mask = (1 << (8 - cnt)) - 1; res |= (d >> (cnt)) & mask; - /* set the new carry flag, Note that it is the low order bit - * of the result!!! */ - CONDITIONAL_SET_FLAG(res & 0x80, F_CF); /* OVERFLOW is set *IFF* s==1, then it is the xor of the two * most significant bits. Blecck. */ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF); - } else if (s != 0) { - /* set the new carry flag, Note that it is the low order bit + } + if (s != 0) { + /* set the new carry flag, Note that it is the high order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80, F_CF); } @@ -7121,10 +7117,10 @@ ror_word(struct x86emu *emu, uint16_t d, res = (d << (16 - cnt)); mask = (1 << (16 - cnt)) - 1; res |= (d >> (cnt)) & mask; - CONDITIONAL_SET_FLAG(res & 0x8000, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF); - } else if (s != 0) { - /* set the new carry flag, Note that it is the low order bit + } + if (s != 0) { + /* set the new carry flag, Note that it is the high order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF); } @@ -7145,10 +7141,10 @@ ror_long(struct x86emu *emu, uint32_t d, res = (d << (32 - cnt)); mask = (1 << (32 - cnt)) - 1; res |= (d >> (cnt)) & mask; - CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF); - } else if (s != 0) { - /* set the new carry flag, Note that it is the low order bit + } + if (s != 0) { + /* set the new carry flag, Note that it is the high order bit * of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF); } From owner-svn-src-head@freebsd.org Thu Feb 18 23:32:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C1BAADD85; Thu, 18 Feb 2016 23:32:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 320E1130B; Thu, 18 Feb 2016 23:32:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1INWCCW054413; Thu, 18 Feb 2016 23:32:12 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1INWCZc054412; Thu, 18 Feb 2016 23:32:12 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602182332.u1INWCZc054412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Feb 2016 23:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295777 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 23:32:13 -0000 Author: jkim Date: Thu Feb 18 23:32:11 2016 New Revision: 295777 URL: https://svnweb.freebsd.org/changeset/base/295777 Log: Remove a bogus bzero() call. Found by: PVS-Studio Modified: head/sys/dev/acpica/acpi_package.c Modified: head/sys/dev/acpica/acpi_package.c ============================================================================== --- head/sys/dev/acpica/acpi_package.c Thu Feb 18 23:03:37 2016 (r295776) +++ head/sys/dev/acpica/acpi_package.c Thu Feb 18 23:32:11 2016 (r295777) @@ -80,7 +80,6 @@ acpi_PkgStr(ACPI_OBJECT *res, int idx, v obj = &res->Package.Elements[idx]; if (obj == NULL) return (EINVAL); - bzero(dst, sizeof(dst)); switch (obj->Type) { case ACPI_TYPE_STRING: From owner-svn-src-head@freebsd.org Thu Feb 18 23:57:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC260AACAAE for ; Thu, 18 Feb 2016 23:57:47 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF76AD for ; Thu, 18 Feb 2016 23:57:47 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x234.google.com with SMTP id g62so52637156wme.1 for ; Thu, 18 Feb 2016 15:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=zWCBF49i/NM8fxpLeReKaPdBt1KbXQorVj88SfFg5rc=; b=H5dRmUGZUd2pgSUU3AnUNeOA7PngcgoAAl8XiX8uLYDqsTQ7dpmxArGWhz2IHGu4dp 45d9wbcpABEu8NXt6zveTLGHG7Rmg+Tdz2xSXhrJshWcjDevOoAH/I2PAi+ySigAZGu2 k+u9URSVI5CzyLguVQ2X/QpONljs2FjkOog00E92gAFThJFuBb8JzAa7HDbfTYIDhV6M GI23TkKJTE9zDP8JaAoeLloJUxOYm0uEiPo7Vaes4s/T1jYW6N69B+kPZwevibR1QYiE ZRJ2cm49BlGPqJZDUYckvDsupwC3iTgqFiNTzHo0nONVTIB8zxJHsNGJs6aDcAfrUQ/5 xhZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:cc:content-type; bh=zWCBF49i/NM8fxpLeReKaPdBt1KbXQorVj88SfFg5rc=; b=lOv8Plxj5HLN9sMB553n0iy+OnM1qT1WQNUFmJmanIFyHcftGSNXGzXylLshxN2u9p R30xzlnsWfFp0Je+KbNUZPAK+ghQQ1QIrNKUq8RTE/y00PmVx1rOOsh3luyPwBPizHx+ fDYF2NcdQS1bjm+BEChP6A986U0XDGlR2bzt+NCFiFLidp0EMVW2K+wtUNHJHf7u0KgR cbd3IN1YTQBOKy9gP3QMA0Bh/4ZmmYKXLIxtatqNLszFeKf4lnxan0Lv4z2dvibx1z8o cQZ16xJdmqgI//7drVdTkSyxmWs19Gmae1WhrrufnPx7oGj4Gl3HqAxpSt3VOo7E5KII ubsA== X-Gm-Message-State: AG10YOTu2GpdTE3R7uikSuotBVlyiz2NirG+gHuAgZeEW88NhcxYnXlB2x9OcAKSjM/SduFHjca5eh27FukfiINh MIME-Version: 1.0 X-Received: by 10.194.111.229 with SMTP id il5mr8319917wjb.82.1455839865837; Thu, 18 Feb 2016 15:57:45 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 15:57:45 -0800 (PST) Date: Thu, 18 Feb 2016 15:57:45 -0800 X-Google-Sender-Auth: dMirU71Plcqh1oDSYDqlyoYqVwQ Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: ray@FreeBSD.org, Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 18 Feb 2016 23:57:47 -0000 Aleksandr, Adrian, I know it's 3 years later, but I really don't know why it's been done this way. Take a GEOM module and associated usr.bin utility, copy it verbatim add few lines of code and re-add that as a new module seems like just laziness and attempt to avoid doing extra work on making unified code. The same goes for the mkulzma, which is almost 1:1 copy of the mkuzip. Now people are merging back and forth and I've just spent few days testing some rather major rework of geom_uzip / mkuzip code not even realizing that there is its evil twin in the tree. :( https://reviews.freebsd.org/D5333 I suggest functionality from both geom_uncompress / mkulzma are folded now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked afterwards. Thanks! > Author: ray > Date: Wed Jan 4 23:39:11 2012 > New Revision: 229537 > URL: http://svn.freebsd.org/changeset/base/229537 > Log: > GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma > images. > Approved by: adrian (mentor) > Added: > head/sys/geom/uncompress/ > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) > head/sys/modules/geom/geom_uncompress/ > head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/options From owner-svn-src-head@freebsd.org Fri Feb 19 00:02:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 632D7AACD83 for ; Fri, 19 Feb 2016 00:02:16 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0B4E615 for ; Fri, 19 Feb 2016 00:02:15 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x229.google.com with SMTP id a4so48529601wme.1 for ; Thu, 18 Feb 2016 16:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=UMYTqcHrYEZ0vulF2k8uBBTLqmrhONgiLQBueOmrLHk=; b=j4xdjd72KxdEI0VqJ9L45t3gARV8/3+WHkLmtEYXtI+FXUbEYw/6tjPO1uoAi0rJdg gYbw7mexrmH03qX1Pq26JVXqxsmHV9X+ALFKPbKDMzHZwMr1iGPgxF9D85CUsXjJjUdT uuhcRxPejZUsS8KB1/jH0Z1E/WF7B1H6UFzOFhTsHUjNCmCiWvBV3qHtlRA6EYN1FxNy 5WROgdmWa84eI2UCcneP9MZJOaKuVN1903Oak6M4kn5wMKPrjObUVMQoXIoxZ7CXBfPX bb3sd2ut04XFZNAzXRsZW8CswifkBjSlTqGaCuO6705T7BSy45m4CWyl/pNi+koIo0kD 9shw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UMYTqcHrYEZ0vulF2k8uBBTLqmrhONgiLQBueOmrLHk=; b=BGlIZkvolRJd2DI1O8Y2EBS2Q1mZLDPVSYLJAz8v+8FUTnqjjVmSYkfHHhPC0OBwea tUM0AB2txtn4CNSnAJXx5imZV9U6McsDH/tCCou8LDvj8Ik4cToViMpgfgTT+vGtYEKW u3YcxUd2Dq10ond/Fe+0++wSaslQ8xJq7U71eKTLU0NdB+GPaxCi3AyPSmQl09FnGWQe OCWHB6U5rRDlT0wRPfKcGBCsAxKT26HHzIaIw6aDYK6y1tUCfLjJSd/9qzQE+2oxqu0y OZJoJEsQU5VT92KNOvNGgGO7pne4T6H5F+Fdwh/xuG1Brx7c6kyz1xNBbgJvGGDYx5bj 2sCg== X-Gm-Message-State: AG10YOSPIhxthZv3WNq5J7J87l0yO1ZAnRcWjC4MA5IItmUbvOr7rLLvpYRxiJj+Vysr4dFAkZ+nzNF8jU+8DjdX MIME-Version: 1.0 X-Received: by 10.28.61.70 with SMTP id k67mr6049702wma.90.1455840134521; Thu, 18 Feb 2016 16:02:14 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 16:02:14 -0800 (PST) In-Reply-To: References: Date: Thu, 18 Feb 2016 16:02:14 -0800 X-Google-Sender-Auth: yFh2b4MI8VMw3a-2El0Q__y56b8 Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: ray@freebsd.org, Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:02:16 -0000 And also geom_uncompress(4) lists myself as a primary historical author of the kernel module code, which I think just plain confusion between my name and name of Max Khon, who is the original creator of geom_uzip(4). It's further reiterates the need to clean this up properly, so only the code with longer history survives. On Thu, Feb 18, 2016 at 3:57 PM, Maxim Sobolev wrote: > Aleksandr, Adrian, > > I know it's 3 years later, but I really don't know why it's been done this > way. Take a GEOM module and associated usr.bin utility, copy it verbatim > add few lines of code and re-add that as a new module seems like just > laziness and attempt to avoid doing extra work on making unified code. The > same goes for the mkulzma, which is almost 1:1 copy of the mkuzip. Now > people are merging back and forth and I've just spent few days testing some > rather major rework of geom_uzip / mkuzip code not even realizing that > there is its evil twin in the tree. :( > > https://reviews.freebsd.org/D5333 > > I suggest functionality from both geom_uncompress / mkulzma are folded now > back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked > afterwards. > > Thanks! > > > >> Author: ray >> Date: Wed Jan 4 23:39:11 2012 >> New Revision: 229537 >> URL: http://svn.freebsd.org/changeset/base/229537 >> Log: >> GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma >> images. >> Approved by: adrian (mentor) >> Added: >> head/sys/geom/uncompress/ >> head/sys/geom/uncompress/g_uncompress.c (contents, props changed) >> head/sys/modules/geom/geom_uncompress/ >> head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed) >> Modified: >> head/sys/conf/files >> head/sys/conf/options > > > From owner-svn-src-head@freebsd.org Fri Feb 19 00:29:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03626AAB79F; Fri, 19 Feb 2016 00:29:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C31E6100E; Fri, 19 Feb 2016 00:29:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J0TGJI069042; Fri, 19 Feb 2016 00:29:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J0TGJx069036; Fri, 19 Feb 2016 00:29:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201602190029.u1J0TGJx069036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 19 Feb 2016 00:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295778 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:29:18 -0000 Author: np Date: Fri Feb 19 00:29:16 2016 New Revision: 295778 URL: https://svnweb.freebsd.org/changeset/base/295778 Log: cxgbe: catch up with the latest hardware-related definitions. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/common/t4_msg.h head/sys/dev/cxgbe/common/t4_regs.h head/sys/dev/cxgbe/common/t4_regs_values.h head/sys/dev/cxgbe/common/t4_tcb.h head/sys/dev/cxgbe/tom/t4_connect.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Feb 18 23:32:11 2016 (r295777) +++ head/sys/dev/cxgbe/adapter.h Fri Feb 19 00:29:16 2016 (r295778) @@ -813,7 +813,7 @@ struct adapter { struct mtx regwin_lock; /* for indirect reads and memory windows */ an_handler_t an_handler __aligned(CACHE_LINE_SIZE); - fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */ + fw_msg_handler_t fw_msg_handler[7]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ #ifdef INVARIANTS Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Feb 18 23:32:11 2016 (r295777) +++ head/sys/dev/cxgbe/common/common.h Fri Feb 19 00:29:16 2016 (r295778) @@ -47,6 +47,7 @@ enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_M enum { MEMWIN0_APERTURE = 2048, MEMWIN0_BASE = 0x1b800, + MEMWIN1_APERTURE = 32768, MEMWIN1_BASE = 0x28000, Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Thu Feb 18 23:32:11 2016 (r295777) +++ head/sys/dev/cxgbe/common/t4_hw.h Fri Feb 19 00:29:16 2016 (r295778) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Chelsio Communications, Inc. + * Copyright (c) 2011, 2016 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -266,6 +266,12 @@ enum { FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS), /* + * We don't support FLASH devices which can't support the full + * standard set of sections which we need for normal operations. + */ + FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE, + + /* * Sectors 32-63 are reserved for FLASH failover. */ }; @@ -273,4 +279,9 @@ enum { #undef FLASH_START #undef FLASH_MAX_SIZE +#define S_SGE_TIMESTAMP 0 +#define M_SGE_TIMESTAMP 0xfffffffffffffffULL +#define V_SGE_TIMESTAMP(x) ((__u64)(x) << S_SGE_TIMESTAMP) +#define G_SGE_TIMESTAMP(x) (((__u64)(x) >> S_SGE_TIMESTAMP) & M_SGE_TIMESTAMP) + #endif /* __T4_HW_H */ Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Thu Feb 18 23:32:11 2016 (r295777) +++ head/sys/dev/cxgbe/common/t4_msg.h Fri Feb 19 00:29:16 2016 (r295778) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Chelsio Communications, Inc. + * Copyright (c) 2011, 2016 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,8 +55,9 @@ enum { CPL_BARRIER = 0x18, CPL_TID_RELEASE = 0x1A, CPL_TAG_READ_REQ = 0x1B, + CPL_SRQ_TABLE_REQ = 0x1C, CPL_TX_PKT_FSO = 0x1E, - CPL_TX_PKT_ISO = 0x1F, + CPL_TX_DATA_ISO = 0x1F, CPL_CLOSE_LISTSRV_RPL = 0x20, CPL_ERROR = 0x21, @@ -97,7 +98,7 @@ enum { CPL_RX_DATA_DDP = 0x42, CPL_SMT_READ_RPL = 0x43, CPL_PASS_ACCEPT_REQ = 0x44, - CPL_RX2TX_PKT = 0x45, + CPL_RX_ISCSI_CMP = 0x45, CPL_RX_FCOE_DDP = 0x46, CPL_FCOE_HDR = 0x47, CPL_T5_TRACE_PKT = 0x48, @@ -124,6 +125,7 @@ enum { CPL_RDMA_ATOMIC_RPL = 0xAB, CPL_RDMA_IMM_DATA = 0xAC, CPL_RDMA_IMM_DATA_SE = 0xAD, + CPL_RX_MPS_PKT = 0xAF, CPL_TRACE_PKT = 0xB0, CPL_RX2TX_DATA = 0xB1, @@ -133,9 +135,11 @@ enum { CPL_FW4_MSG = 0xC0, CPL_FW4_PLD = 0xC1, CPL_FW4_ACK = 0xC3, + CPL_SRQ_TABLE_RPL = 0xCC, CPL_FW6_MSG = 0xE0, CPL_FW6_PLD = 0xE1, + CPL_TX_TNL_LSO = 0xEC, CPL_TX_PKT_LSO = 0xED, CPL_TX_PKT_XT = 0xEE, @@ -145,6 +149,7 @@ enum { enum CPL_error { CPL_ERR_NONE = 0, CPL_ERR_TCAM_PARITY = 1, + CPL_ERR_TCAM_MISS = 2, CPL_ERR_TCAM_FULL = 3, CPL_ERR_BAD_LENGTH = 15, CPL_ERR_BAD_ROUTE = 18, @@ -164,8 +169,24 @@ enum CPL_error { CPL_ERR_WAIT_ARP_RPL = 41, CPL_ERR_ABORT_FAILED = 42, CPL_ERR_IWARP_FLM = 50, + CPL_CONTAINS_READ_RPL = 60, + CPL_CONTAINS_WRITE_RPL = 61, }; +/* + * Some of the error codes above implicitly indicate that there is no TID + * allocated with the result of an ACT_OPEN. We use this predicate to make + * that explicit. + */ +static inline int act_open_has_tid(int status) +{ + return (status != CPL_ERR_TCAM_PARITY && + status != CPL_ERR_TCAM_MISS && + status != CPL_ERR_TCAM_FULL && + status != CPL_ERR_CONN_EXIST_SYNRECV && + status != CPL_ERR_CONN_EXIST); +} + enum { CPL_CONN_POLICY_AUTO = 0, CPL_CONN_POLICY_ASK = 1, @@ -337,6 +358,12 @@ struct rss_header { #define M_QNUM 0xFFFF #define G_QNUM(x) (((x) >> S_QNUM) & M_QNUM) +#if defined(RSS_HDR_VLD) || defined(CHELSIO_FW) +# define RSS_HDR struct rss_header rss_hdr; +#else +# define RSS_HDR +#endif + #ifndef CHELSIO_FW struct work_request_hdr { __be32 wr_hi; @@ -358,11 +385,9 @@ struct work_request_hdr { # define WR_HDR struct work_request_hdr wr # define WR_HDR_SIZE sizeof(struct work_request_hdr) -# define RSS_HDR #else # define WR_HDR # define WR_HDR_SIZE 0 -# define RSS_HDR struct rss_header rss_hdr; #endif /* option 0 fields */ @@ -480,6 +505,11 @@ struct work_request_hdr { #define V_CONN_POLICY(x) ((x) << S_CONN_POLICY) #define G_CONN_POLICY(x) (((x) >> S_CONN_POLICY) & M_CONN_POLICY) +#define S_T5_FILT_INFO 24 +#define M_T5_FILT_INFO 0xffffffffffULL +#define V_T5_FILT_INFO(x) ((x) << S_T5_FILT_INFO) +#define G_T5_FILT_INFO(x) (((x) >> S_T5_FILT_INFO) & M_T5_FILT_INFO) + #define S_FILT_INFO 28 #define M_FILT_INFO 0xfffffffffULL #define V_FILT_INFO(x) ((x) << S_FILT_INFO) @@ -518,6 +548,10 @@ struct work_request_hdr { #define V_CONG_CNTRL_VALID(x) ((x) << S_CONG_CNTRL_VALID) #define F_CONG_CNTRL_VALID V_CONG_CNTRL_VALID(1U) +#define S_T5_ISS 18 +#define V_T5_ISS(x) ((x) << S_T5_ISS) +#define F_T5_ISS V_T5_ISS(1U) + #define S_PACE_VALID 19 #define V_PACE_VALID(x) ((x) << S_PACE_VALID) #define F_PACE_VALID V_PACE_VALID(1U) @@ -617,11 +651,30 @@ struct cpl_pass_establish { #define G_PASS_OPEN_TOS(x) (((x) >> S_PASS_OPEN_TOS) & M_PASS_OPEN_TOS) /* cpl_pass_establish.tcp_opt fields (also applies to act_open_establish) */ -#define G_TCPOPT_WSCALE_OK(x) (((x) >> 5) & 1) -#define G_TCPOPT_SACK(x) (((x) >> 6) & 1) -#define G_TCPOPT_TSTAMP(x) (((x) >> 7) & 1) -#define G_TCPOPT_SND_WSCALE(x) (((x) >> 8) & 0xf) -#define G_TCPOPT_MSS(x) (((x) >> 12) & 0xf) +#define S_TCPOPT_WSCALE_OK 5 +#define M_TCPOPT_WSCALE_OK 0x1 +#define V_TCPOPT_WSCALE_OK(x) ((x) << S_TCPOPT_WSCALE_OK) +#define G_TCPOPT_WSCALE_OK(x) (((x) >> S_TCPOPT_WSCALE_OK) & M_TCPOPT_WSCALE_OK) + +#define S_TCPOPT_SACK 6 +#define M_TCPOPT_SACK 0x1 +#define V_TCPOPT_SACK(x) ((x) << S_TCPOPT_SACK) +#define G_TCPOPT_SACK(x) (((x) >> S_TCPOPT_SACK) & M_TCPOPT_SACK) + +#define S_TCPOPT_TSTAMP 7 +#define M_TCPOPT_TSTAMP 0x1 +#define V_TCPOPT_TSTAMP(x) ((x) << S_TCPOPT_TSTAMP) +#define G_TCPOPT_TSTAMP(x) (((x) >> S_TCPOPT_TSTAMP) & M_TCPOPT_TSTAMP) + +#define S_TCPOPT_SND_WSCALE 8 +#define M_TCPOPT_SND_WSCALE 0xF +#define V_TCPOPT_SND_WSCALE(x) ((x) << S_TCPOPT_SND_WSCALE) +#define G_TCPOPT_SND_WSCALE(x) (((x) >> S_TCPOPT_SND_WSCALE) & M_TCPOPT_SND_WSCALE) + +#define S_TCPOPT_MSS 12 +#define M_TCPOPT_MSS 0xF +#define V_TCPOPT_MSS(x) ((x) << S_TCPOPT_MSS) +#define G_TCPOPT_MSS(x) (((x) >> S_TCPOPT_MSS) & M_TCPOPT_MSS) struct cpl_pass_accept_req { RSS_HDR @@ -646,16 +699,29 @@ struct cpl_pass_accept_req { #define V_TCP_HDR_LEN(x) ((x) << S_TCP_HDR_LEN) #define G_TCP_HDR_LEN(x) (((x) >> S_TCP_HDR_LEN) & M_TCP_HDR_LEN) +#define S_T6_TCP_HDR_LEN 8 +#define V_T6_TCP_HDR_LEN(x) ((x) << S_T6_TCP_HDR_LEN) +#define G_T6_TCP_HDR_LEN(x) (((x) >> S_T6_TCP_HDR_LEN) & M_TCP_HDR_LEN) + #define S_IP_HDR_LEN 16 #define M_IP_HDR_LEN 0x3FF #define V_IP_HDR_LEN(x) ((x) << S_IP_HDR_LEN) #define G_IP_HDR_LEN(x) (((x) >> S_IP_HDR_LEN) & M_IP_HDR_LEN) +#define S_T6_IP_HDR_LEN 14 +#define V_T6_IP_HDR_LEN(x) ((x) << S_T6_IP_HDR_LEN) +#define G_T6_IP_HDR_LEN(x) (((x) >> S_T6_IP_HDR_LEN) & M_IP_HDR_LEN) + #define S_ETH_HDR_LEN 26 #define M_ETH_HDR_LEN 0x3F #define V_ETH_HDR_LEN(x) ((x) << S_ETH_HDR_LEN) #define G_ETH_HDR_LEN(x) (((x) >> S_ETH_HDR_LEN) & M_ETH_HDR_LEN) +#define S_T6_ETH_HDR_LEN 24 +#define M_T6_ETH_HDR_LEN 0xFF +#define V_T6_ETH_HDR_LEN(x) ((x) << S_T6_ETH_HDR_LEN) +#define G_T6_ETH_HDR_LEN(x) (((x) >> S_T6_ETH_HDR_LEN) & M_T6_ETH_HDR_LEN) + /* cpl_pass_accept_req.l2info fields */ #define S_SYN_MAC_IDX 0 #define M_SYN_MAC_IDX 0x1FF @@ -684,7 +750,10 @@ struct cpl_t5_pass_accept_rpl { __be32 opt2; __be64 opt0; __be32 iss; - __be32 rsvd; + union { + __be32 rsvd; /* T5 */ + __be32 opt3; /* T6 */ + } u; }; struct cpl_act_open_req { @@ -716,6 +785,26 @@ struct cpl_t5_act_open_req { __be64 params; }; +struct cpl_t6_act_open_req { + WR_HDR; + union opcode_tid ot; + __be16 local_port; + __be16 peer_port; + __be32 local_ip; + __be32 peer_ip; + __be64 opt0; + __be32 iss; + __be32 opt2; + __be64 params; + __be32 rsvd2; + __be32 opt3; +}; + +/* cpl_{t5,t6}_act_open_req.params field */ +#define S_AOPEN_FCOEMASK 0 +#define V_AOPEN_FCOEMASK(x) ((x) << S_AOPEN_FCOEMASK) +#define F_AOPEN_FCOEMASK V_AOPEN_FCOEMASK(1U) + struct cpl_act_open_req6 { WR_HDR; union opcode_tid ot; @@ -745,6 +834,23 @@ struct cpl_t5_act_open_req6 { __be64 params; }; +struct cpl_t6_act_open_req6 { + WR_HDR; + union opcode_tid ot; + __be16 local_port; + __be16 peer_port; + __be64 local_ip_hi; + __be64 local_ip_lo; + __be64 peer_ip_hi; + __be64 peer_ip_lo; + __be64 opt0; + __be32 iss; + __be32 opt2; + __be64 params; + __be32 rsvd2; + __be32 opt3; +}; + struct cpl_act_open_rpl { RSS_HDR union opcode_tid ot; @@ -887,6 +993,11 @@ struct cpl_abort_req_rss { __u8 status; }; +/* cpl_abort_req status command code in case of T6, + * bit[0] specifies whether to send RST (0) to remote peer or suppress it (1) + * bit[1] indicates ABORT_REQ was sent after a CLOSE_CON_REQ + * bit[2] specifies whether to disable the mmgr (1) or not (0) + */ struct cpl_abort_req { WR_HDR; union opcode_tid ot; @@ -978,10 +1089,14 @@ struct cpl_tx_data { #define G_TX_ULP_SUBMODE(x) (((x) >> S_TX_ULP_SUBMODE) & M_TX_ULP_SUBMODE) #define S_TX_ULP_MODE 10 -#define M_TX_ULP_MODE 0xF +#define M_TX_ULP_MODE 0x7 #define V_TX_ULP_MODE(x) ((x) << S_TX_ULP_MODE) #define G_TX_ULP_MODE(x) (((x) >> S_TX_ULP_MODE) & M_TX_ULP_MODE) +#define S_TX_FORCE 13 +#define V_TX_FORCE(x) ((x) << S_TX_FORCE) +#define F_TX_FORCE V_TX_FORCE(1U) + #define S_TX_SHOVE 14 #define V_TX_SHOVE(x) ((x) << S_TX_SHOVE) #define F_TX_SHOVE V_TX_SHOVE(1U) @@ -1006,6 +1121,10 @@ struct cpl_tx_data { #define V_TX_TNL(x) ((x) << S_TX_TNL) #define F_TX_TNL V_TX_TNL(1U) +#define S_T6_TX_FORCE 20 +#define V_T6_TX_FORCE(x) ((x) << S_T6_TX_FORCE) +#define F_T6_TX_FORCE V_T6_TX_FORCE(1U) + /* additional tx_data_wr.flags fields */ #define S_TX_CPU_IDX 0 #define M_TX_CPU_IDX 0x3F @@ -1142,6 +1261,10 @@ struct cpl_tx_pkt { #define V_TXPKT_IPHDR_LEN(x) ((__u64)(x) << S_TXPKT_IPHDR_LEN) #define G_TXPKT_IPHDR_LEN(x) (((x) >> S_TXPKT_IPHDR_LEN) & M_TXPKT_IPHDR_LEN) +#define M_T6_TXPKT_IPHDR_LEN 0xFFF +#define G_T6_TXPKT_IPHDR_LEN(x) \ + (((x) >> S_TXPKT_IPHDR_LEN) & M_T6_TXPKT_IPHDR_LEN) + #define S_TXPKT_CSUM_LOC 30 #define M_TXPKT_CSUM_LOC 0x3FF #define V_TXPKT_CSUM_LOC(x) ((__u64)(x) << S_TXPKT_CSUM_LOC) @@ -1152,6 +1275,12 @@ struct cpl_tx_pkt { #define V_TXPKT_ETHHDR_LEN(x) ((__u64)(x) << S_TXPKT_ETHHDR_LEN) #define G_TXPKT_ETHHDR_LEN(x) (((x) >> S_TXPKT_ETHHDR_LEN) & M_TXPKT_ETHHDR_LEN) +#define S_T6_TXPKT_ETHHDR_LEN 32 +#define M_T6_TXPKT_ETHHDR_LEN 0xFF +#define V_T6_TXPKT_ETHHDR_LEN(x) ((__u64)(x) << S_T6_TXPKT_ETHHDR_LEN) +#define G_T6_TXPKT_ETHHDR_LEN(x) \ + (((x) >> S_T6_TXPKT_ETHHDR_LEN) & M_T6_TXPKT_ETHHDR_LEN) + #define S_TXPKT_CSUM_TYPE 40 #define M_TXPKT_CSUM_TYPE 0xF #define V_TXPKT_CSUM_TYPE(x) ((__u64)(x) << S_TXPKT_CSUM_TYPE) @@ -1296,38 +1425,83 @@ struct cpl_iscsi_hdr_no_rss { }; struct cpl_tx_data_iso { - WR_HDR; - __be32 iso_ctrl; - __u8 rsvd; + __be32 op_to_scsi; + __u8 reserved1; __u8 ahs_len; - __be16 mss; + __be16 mpdu; __be32 burst_size; __be32 len; + __be32 reserved2_seglen_offset; + __be32 datasn_offset; + __be32 buffer_offset; + __be32 reserved3; + /* encapsulated CPL_TX_DATA follows here */ }; -/* cpl_tx_data_iso.iso_ctrl fields different from cpl_tx_pkt_lso.lso_ctrl */ -#define S_ISO_CPLHDR_LEN 18 -#define M_ISO_CPLHDR_LEN 0xF -#define V_ISO_CPLHDR_LEN(x) ((x) << S_ISO_CPLHDR_LEN) -#define G_ISO_CPLHDR_LEN(x) (((x) >> S_ISO_CPLHDR_LEN) & M_ISO_CPLHDR_LEN) - -#define S_ISO_HDR_CRC 17 -#define V_ISO_HDR_CRC(x) ((x) << S_ISO_HDR_CRC) -#define F_ISO_HDR_CRC V_ISO_HDR_CRC(1U) - -#define S_ISO_DATA_CRC 16 -#define V_ISO_DATA_CRC(x) ((x) << S_ISO_DATA_CRC) -#define F_ISO_DATA_CRC V_ISO_DATA_CRC(1U) - -#define S_ISO_IMD_DATA_EN 15 -#define V_ISO_IMD_DATA_EN(x) ((x) << S_ISO_IMD_DATA_EN) -#define F_ISO_IMD_DATA_EN V_ISO_IMD_DATA_EN(1U) - -#define S_ISO_PDU_TYPE 13 -#define M_ISO_PDU_TYPE 0x3 -#define V_ISO_PDU_TYPE(x) ((x) << S_ISO_PDU_TYPE) -#define G_ISO_PDU_TYPE(x) (((x) >> S_ISO_PDU_TYPE) & M_ISO_PDU_TYPE) +/* cpl_tx_data_iso.op_to_scsi fields */ +#define S_CPL_TX_DATA_ISO_OP 24 +#define M_CPL_TX_DATA_ISO_OP 0xff +#define V_CPL_TX_DATA_ISO_OP(x) ((x) << S_CPL_TX_DATA_ISO_OP) +#define G_CPL_TX_DATA_ISO_OP(x) \ + (((x) >> S_CPL_TX_DATA_ISO_OP) & M_CPL_TX_DATA_ISO_OP) + +#define S_CPL_TX_DATA_ISO_FIRST 23 +#define M_CPL_TX_DATA_ISO_FIRST 0x1 +#define V_CPL_TX_DATA_ISO_FIRST(x) ((x) << S_CPL_TX_DATA_ISO_FIRST) +#define G_CPL_TX_DATA_ISO_FIRST(x) \ + (((x) >> S_CPL_TX_DATA_ISO_FIRST) & M_CPL_TX_DATA_ISO_FIRST) +#define F_CPL_TX_DATA_ISO_FIRST V_CPL_TX_DATA_ISO_FIRST(1U) + +#define S_CPL_TX_DATA_ISO_LAST 22 +#define M_CPL_TX_DATA_ISO_LAST 0x1 +#define V_CPL_TX_DATA_ISO_LAST(x) ((x) << S_CPL_TX_DATA_ISO_LAST) +#define G_CPL_TX_DATA_ISO_LAST(x) \ + (((x) >> S_CPL_TX_DATA_ISO_LAST) & M_CPL_TX_DATA_ISO_LAST) +#define F_CPL_TX_DATA_ISO_LAST V_CPL_TX_DATA_ISO_LAST(1U) + +#define S_CPL_TX_DATA_ISO_CPLHDRLEN 21 +#define M_CPL_TX_DATA_ISO_CPLHDRLEN 0x1 +#define V_CPL_TX_DATA_ISO_CPLHDRLEN(x) ((x) << S_CPL_TX_DATA_ISO_CPLHDRLEN) +#define G_CPL_TX_DATA_ISO_CPLHDRLEN(x) \ + (((x) >> S_CPL_TX_DATA_ISO_CPLHDRLEN) & M_CPL_TX_DATA_ISO_CPLHDRLEN) +#define F_CPL_TX_DATA_ISO_CPLHDRLEN V_CPL_TX_DATA_ISO_CPLHDRLEN(1U) + +#define S_CPL_TX_DATA_ISO_HDRCRC 20 +#define M_CPL_TX_DATA_ISO_HDRCRC 0x1 +#define V_CPL_TX_DATA_ISO_HDRCRC(x) ((x) << S_CPL_TX_DATA_ISO_HDRCRC) +#define G_CPL_TX_DATA_ISO_HDRCRC(x) \ + (((x) >> S_CPL_TX_DATA_ISO_HDRCRC) & M_CPL_TX_DATA_ISO_HDRCRC) +#define F_CPL_TX_DATA_ISO_HDRCRC V_CPL_TX_DATA_ISO_HDRCRC(1U) + +#define S_CPL_TX_DATA_ISO_PLDCRC 19 +#define M_CPL_TX_DATA_ISO_PLDCRC 0x1 +#define V_CPL_TX_DATA_ISO_PLDCRC(x) ((x) << S_CPL_TX_DATA_ISO_PLDCRC) +#define G_CPL_TX_DATA_ISO_PLDCRC(x) \ + (((x) >> S_CPL_TX_DATA_ISO_PLDCRC) & M_CPL_TX_DATA_ISO_PLDCRC) +#define F_CPL_TX_DATA_ISO_PLDCRC V_CPL_TX_DATA_ISO_PLDCRC(1U) + +#define S_CPL_TX_DATA_ISO_IMMEDIATE 18 +#define M_CPL_TX_DATA_ISO_IMMEDIATE 0x1 +#define V_CPL_TX_DATA_ISO_IMMEDIATE(x) ((x) << S_CPL_TX_DATA_ISO_IMMEDIATE) +#define G_CPL_TX_DATA_ISO_IMMEDIATE(x) \ + (((x) >> S_CPL_TX_DATA_ISO_IMMEDIATE) & M_CPL_TX_DATA_ISO_IMMEDIATE) +#define F_CPL_TX_DATA_ISO_IMMEDIATE V_CPL_TX_DATA_ISO_IMMEDIATE(1U) + +#define S_CPL_TX_DATA_ISO_SCSI 16 +#define M_CPL_TX_DATA_ISO_SCSI 0x3 +#define V_CPL_TX_DATA_ISO_SCSI(x) ((x) << S_CPL_TX_DATA_ISO_SCSI) +#define G_CPL_TX_DATA_ISO_SCSI(x) \ + (((x) >> S_CPL_TX_DATA_ISO_SCSI) & M_CPL_TX_DATA_ISO_SCSI) + +/* cpl_tx_data_iso.reserved2_seglen_offset fields */ +#define S_CPL_TX_DATA_ISO_SEGLEN_OFFSET 0 +#define M_CPL_TX_DATA_ISO_SEGLEN_OFFSET 0xffffff +#define V_CPL_TX_DATA_ISO_SEGLEN_OFFSET(x) \ + ((x) << S_CPL_TX_DATA_ISO_SEGLEN_OFFSET) +#define G_CPL_TX_DATA_ISO_SEGLEN_OFFSET(x) \ + (((x) >> S_CPL_TX_DATA_ISO_SEGLEN_OFFSET) & \ + M_CPL_TX_DATA_ISO_SEGLEN_OFFSET) struct cpl_iscsi_hdr { RSS_HDR @@ -1400,6 +1574,19 @@ struct cpl_fcoe_hdr { __be32 param; }; +/* cpl_fcoe_hdr.rctl_fctl fields */ +#define S_FCOE_FCHDR_RCTL 24 +#define M_FCOE_FCHDR_RCTL 0xff +#define V_FCOE_FCHDR_RCTL(x) ((x) << S_FCOE_FCHDR_RCTL) +#define G_FCOE_FCHDR_RCTL(x) \ + (((x) >> S_FCOE_FCHDR_RCTL) & M_FCOE_FCHDR_RCTL) + +#define S_FCOE_FCHDR_FCTL 0 +#define M_FCOE_FCHDR_FCTL 0xffffff +#define V_FCOE_FCHDR_FCTL(x) ((x) << S_FCOE_FCHDR_FCTL) +#define G_FCOE_FCHDR_FCTL(x) \ + (((x) >> S_FCOE_FCHDR_FCTL) & M_FCOE_FCHDR_FCTL) + struct cpl_fcoe_data { RSS_HDR union opcode_tid ot; @@ -1527,6 +1714,19 @@ struct cpl_rx_iscsi_dif { __u8 rsvd1[4]; }; +struct cpl_rx_iscsi_cmp { + RSS_HDR + union opcode_tid ot; + __be16 pdu_len_ddp; + __be16 len; + __be32 seq; + __be16 urg; + __u8 rsvd; + __u8 status; + __be32 ulp_crc; + __be32 ddpvld; +}; + struct cpl_rx_fcoe_dif { RSS_HDR union opcode_tid ot; @@ -1671,6 +1871,9 @@ struct cpl_rx_pkt { #define V_RX_T5_ETHHDR_LEN(x) ((x) << S_RX_T5_ETHHDR_LEN) #define G_RX_T5_ETHHDR_LEN(x) (((x) >> S_RX_T5_ETHHDR_LEN) & M_RX_T5_ETHHDR_LEN) +#define M_RX_T6_ETHHDR_LEN 0xFF +#define G_RX_T6_ETHHDR_LEN(x) (((x) >> S_RX_ETHHDR_LEN) & M_RX_T6_ETHHDR_LEN) + #define S_RX_PKTYPE 5 #define M_RX_PKTYPE 0x7 #define V_RX_PKTYPE(x) ((x) << S_RX_PKTYPE) @@ -1801,6 +2004,65 @@ struct cpl_rx_pkt { #define V_RXERR_PING(x) ((x) << S_RXERR_PING) #define F_RXERR_PING V_RXERR_PING(1U) +/* In T6, rx_pkt.err_vec indicates + * RxError Error vector (16b) or + * Encapsulating header length (8b), + * Outer encapsulation type (2b) and + * compressed error vector (6b) if CRxPktEnc is + * enabled in TP_OUT_CONFIG + */ + +#define S_T6_COMPR_RXERR_VEC 0 +#define M_T6_COMPR_RXERR_VEC 0x3F +#define V_T6_COMPR_RXERR_VEC(x) ((x) << S_T6_COMPR_RXERR_LEN) +#define G_T6_COMPR_RXERR_VEC(x) \ + (((x) >> S_T6_COMPR_RXERR_VEC) & M_T6_COMPR_RXERR_VEC) + +#define S_T6_COMPR_RXERR_MAC 0 +#define V_T6_COMPR_RXERR_MAC(x) ((x) << S_T6_COMPR_RXERR_MAC) +#define F_T6_COMPR_RXERR_MAC V_T6_COMPR_RXERR_MAC(1U) + +/* Logical OR of RX_ERROR_PKT_LEN, RX_ERROR_TCP_HDR_LEN + * RX_ERROR_IP_HDR_LEN, RX_ERROR_ETH_HDR_LEN + */ +#define S_T6_COMPR_RXERR_LEN 1 +#define V_T6_COMPR_RXERR_LEN(x) ((x) << S_COMPR_T6_RXERR_LEN) +#define F_T6_COMPR_RXERR_LEN V_COMPR_T6_RXERR_LEN(1U) + +#define S_T6_COMPR_RXERR_TCP_OPT 2 +#define V_T6_COMPR_RXERR_TCP_OPT(x) ((x) << S_T6_COMPR_RXERR_TCP_OPT) +#define F_T6_COMPR_RXERR_TCP_OPT V_T6_COMPR_RXERR_TCP_OPT(1U) + +#define S_T6_COMPR_RXERR_IPV6_EXT 3 +#define V_T6_COMPR_RXERR_IPV6_EXT(x) ((x) << S_T6_COMPR_RXERR_IPV6_EXT) +#define F_T6_COMPR_RXERR_IPV6_EXT V_T6_COMPR_RXERR_IPV6_EXT(1U) + +/* Logical OR of RX_ERROR_CSUM, RX_ERROR_CSIP */ +#define S_T6_COMPR_RXERR_SUM 4 +#define V_T6_COMPR_RXERR_SUM(x) ((x) << S_T6_COMPR_RXERR_SUM) +#define F_T6_COMPR_RXERR_SUM V_T6_COMPR_RXERR_SUM(1U) + +/* Logical OR of RX_ERROR_FPMA, RX_ERROR_PING_DROP, + * RX_ERROR_ATTACK, RX_ERROR_FRAG,RX_ERROR_IPVERSION + */ +#define S_T6_COMPR_RXERR_MISC 5 +#define V_T6_COMPR_RXERR_MISC(x) ((x) << S_T6_COMPR_RXERR_MISC) +#define F_T6_COMPR_RXERR_MISC V_T6_COMPR_RXERR_MISC(1U) + +#define S_T6_RX_TNL_TYPE 6 +#define M_T6_RX_TNL_TYPE 0x3 +#define V_T6_RX_TNL_TYPE(x) ((x) << S_T6_RX_TNL_TYPE) +#define G_T6_RX_TNL_TYPE(x) (((x) >> S_T6_RX_TNL_TYPE) & M_T6_RX_TNL_TYPE) + +#define RX_PKT_TNL_TYPE_NVGRE 1 +#define RX_PKT_TNL_TYPE_VXLAN 2 +#define RX_PKT_TNL_TYPE_GENEVE 3 + +#define S_T6_RX_TNLHDR_LEN 8 +#define M_T6_RX_TNLHDR_LEN 0xFF +#define V_T6_RX_TNLHDR_LEN(x) ((x) << S_T6_RX_TNLHDR_LEN) +#define G_T6_RX_TNLHDR_LEN(x) (((x) >> S_T6_RX_TNLHDR_LEN) & M_T6_RX_TNLHDR_LEN) + struct cpl_trace_pkt { RSS_HDR __u8 opcode; @@ -1996,6 +2258,51 @@ struct cpl_l2t_read_rpl { __u8 dst_mac[6]; }; +struct cpl_srq_table_req { + WR_HDR; + union opcode_tid ot; + __u8 status; + __u8 rsvd[2]; + __u8 idx; + __be64 rsvd_pdid; + __be32 qlen_qbase; + __be16 cur_msn; + __be16 max_msn; +}; + +struct cpl_srq_table_rpl { + RSS_HDR + union opcode_tid ot; + __u8 status; + __u8 rsvd[2]; + __u8 idx; + __be64 rsvd_pdid; + __be32 qlen_qbase; + __be16 cur_msn; + __be16 max_msn; +}; + +/* cpl_srq_table_{req,rpl}.params fields */ +#define S_SRQT_QLEN 28 +#define M_SRQT_QLEN 0xF +#define V_SRQT_QLEN(x) ((x) << S_SRQT_QLEN) +#define G_SRQT_QLEN(x) (((x) >> S_SRQT_QLEN) & M_SRQT_QLEN) + +#define S_SRQT_QBASE 0 +#define M_SRQT_QBASE 0x3FFFFFF +#define V_SRQT_QBASE(x) ((x) << S_SRQT_QBASE) +#define G_SRQT_QBASE(x) (((x) >> S_SRQT_QBASE) & M_SRQT_QBASE) + +#define S_SRQT_PDID 0 +#define M_SRQT_PDID 0xFF +#define V_SRQT_PDID(x) ((x) << S_SRQT_PDID) +#define G_SRQT_PDID(x) (((x) >> S_SRQT_PDID) & M_SRQT_PDID) + +#define S_SRQT_IDX 0 +#define M_SRQT_IDX 0xF +#define V_SRQT_IDX(x) ((x) << S_SRQT_IDX) +#define G_SRQT_IDX(x) (((x) >> S_SRQT_IDX) & M_SRQT_IDX) + struct cpl_smt_write_req { WR_HDR; union opcode_tid ot; @@ -2006,6 +2313,17 @@ struct cpl_smt_write_req { __u8 src_mac0[6]; }; +struct cpl_t6_smt_write_req { + WR_HDR; + union opcode_tid ot; + __be32 params; + __be64 tag; + __be16 pfvf0; + __u8 src_mac0[6]; + __be32 local_ip; + __be32 rsvd; +}; + struct cpl_smt_write_rpl { RSS_HDR union opcode_tid ot; @@ -2042,6 +2360,9 @@ struct cpl_smt_read_rpl { #define V_SMTW_IDX(x) ((x) << S_SMTW_IDX) #define G_SMTW_IDX(x) (((x) >> S_SMTW_IDX) & M_SMTW_IDX) +#define M_T6_SMTW_IDX 0xFF +#define G_T6_SMTW_IDX(x) (((x) >> S_SMTW_IDX) & M_T6_SMTW_IDX) + #define S_SMTW_NORPL 31 #define V_SMTW_NORPL(x) ((x) << S_SMTW_NORPL) #define F_SMTW_NORPL V_SMTW_NORPL(1U) @@ -2272,6 +2593,11 @@ struct cpl_sge_egr_update { }; /* cpl_sge_egr_update.ot fields */ +#define S_AUTOEQU 22 +#define M_AUTOEQU 0x1 +#define V_AUTOEQU(x) ((x) << S_AUTOEQU) +#define G_AUTOEQU(x) (((x) >> S_AUTOEQU) & M_AUTOEQU) + #define S_EGR_QID 0 #define M_EGR_QID 0x1FFFF #define V_EGR_QID(x) ((x) << S_EGR_QID) @@ -2284,6 +2610,8 @@ enum { FW_TYPE_CQE = 2, FW_TYPE_OFLD_CONNECTION_WR_RPL = 3, FW_TYPE_RSSCPL = 4, + FW_TYPE_WRERR_RPL = 5, + FW_TYPE_PI_ERR = 6, }; struct cpl_fw2_pld { @@ -2359,7 +2687,8 @@ enum { FW6_TYPE_CQE = FW_TYPE_CQE, FW6_TYPE_OFLD_CONNECTION_WR_RPL = FW_TYPE_OFLD_CONNECTION_WR_RPL, FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL, - + FW6_TYPE_WRERR_RPL = FW_TYPE_WRERR_RPL, + FW6_TYPE_PI_ERR = FW_TYPE_PI_ERR, NUM_FW6_TYPES }; @@ -2382,7 +2711,8 @@ enum { ULP_TX_SC_NOOP = 0x80, ULP_TX_SC_IMM = 0x81, ULP_TX_SC_DSGL = 0x82, - ULP_TX_SC_ISGL = 0x83 + ULP_TX_SC_ISGL = 0x83, + ULP_TX_SC_PICTRL = 0x84 }; #define S_ULPTX_CMD 24 @@ -2455,6 +2785,10 @@ struct ulp_mem_io { #define V_T5_ULP_MEMIO_ORDER(x) ((x) << S_T5_ULP_MEMIO_ORDER) #define F_T5_ULP_MEMIO_ORDER V_T5_ULP_MEMIO_ORDER(1U) +#define S_T5_ULP_MEMIO_FID 4 +#define M_T5_ULP_MEMIO_FID 0x7ff +#define V_T5_ULP_MEMIO_FID(x) ((x) << S_T5_ULP_MEMIO_FID) + /* ulp_mem_io.lock_addr fields */ #define S_ULP_MEMIO_ADDR 0 #define M_ULP_MEMIO_ADDR 0x7FFFFFF @@ -2495,4 +2829,219 @@ struct ulp_txpkt { #define V_ULP_TXPKT_RO(x) ((x) << S_ULP_TXPKT_RO) #define F_ULP_TXPKT_RO V_ULP_TXPKT_RO(1U) +enum cpl_tx_tnl_lso_type { + TX_TNL_TYPE_OPAQUE, + TX_TNL_TYPE_NVGRE, + TX_TNL_TYPE_VXLAN, + TX_TNL_TYPE_GENEVE, +}; + +struct cpl_tx_tnl_lso { + __be32 op_to_IpIdSplitOut; + __be16 IpIdOffsetOut; + __be16 UdpLenSetOut_to_TnlHdrLen; + __be64 r1; + __be32 Flow_to_TcpHdrLen; + __be16 IpIdOffset; + __be16 IpIdSplit_to_Mss; + __be32 TCPSeqOffset; + __be32 EthLenOffset_Size; + /* encapsulated CPL (TX_PKT_XT) follows here */ +}; + +#define S_CPL_TX_TNL_LSO_OPCODE 24 +#define M_CPL_TX_TNL_LSO_OPCODE 0xff +#define V_CPL_TX_TNL_LSO_OPCODE(x) ((x) << S_CPL_TX_TNL_LSO_OPCODE) +#define G_CPL_TX_TNL_LSO_OPCODE(x) \ + (((x) >> S_CPL_TX_TNL_LSO_OPCODE) & M_CPL_TX_TNL_LSO_OPCODE) + +#define S_CPL_TX_TNL_LSO_FIRST 23 +#define M_CPL_TX_TNL_LSO_FIRST 0x1 +#define V_CPL_TX_TNL_LSO_FIRST(x) ((x) << S_CPL_TX_TNL_LSO_FIRST) +#define G_CPL_TX_TNL_LSO_FIRST(x) \ + (((x) >> S_CPL_TX_TNL_LSO_FIRST) & M_CPL_TX_TNL_LSO_FIRST) +#define F_CPL_TX_TNL_LSO_FIRST V_CPL_TX_TNL_LSO_FIRST(1U) + +#define S_CPL_TX_TNL_LSO_LAST 22 +#define M_CPL_TX_TNL_LSO_LAST 0x1 +#define V_CPL_TX_TNL_LSO_LAST(x) ((x) << S_CPL_TX_TNL_LSO_LAST) +#define G_CPL_TX_TNL_LSO_LAST(x) \ + (((x) >> S_CPL_TX_TNL_LSO_LAST) & M_CPL_TX_TNL_LSO_LAST) +#define F_CPL_TX_TNL_LSO_LAST V_CPL_TX_TNL_LSO_LAST(1U) + +#define S_CPL_TX_TNL_LSO_ETHHDRLENXOUT 21 +#define M_CPL_TX_TNL_LSO_ETHHDRLENXOUT 0x1 +#define V_CPL_TX_TNL_LSO_ETHHDRLENXOUT(x) \ + ((x) << S_CPL_TX_TNL_LSO_ETHHDRLENXOUT) +#define G_CPL_TX_TNL_LSO_ETHHDRLENXOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLENXOUT) & M_CPL_TX_TNL_LSO_ETHHDRLENXOUT) +#define F_CPL_TX_TNL_LSO_ETHHDRLENXOUT V_CPL_TX_TNL_LSO_ETHHDRLENXOUT(1U) + +#define S_CPL_TX_TNL_LSO_IPV6OUT 20 +#define M_CPL_TX_TNL_LSO_IPV6OUT 0x1 +#define V_CPL_TX_TNL_LSO_IPV6OUT(x) ((x) << S_CPL_TX_TNL_LSO_IPV6OUT) +#define G_CPL_TX_TNL_LSO_IPV6OUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPV6OUT) & M_CPL_TX_TNL_LSO_IPV6OUT) +#define F_CPL_TX_TNL_LSO_IPV6OUT V_CPL_TX_TNL_LSO_IPV6OUT(1U) + +#define S_CPL_TX_TNL_LSO_ETHHDRLENOUT 16 +#define M_CPL_TX_TNL_LSO_ETHHDRLENOUT 0xf +#define V_CPL_TX_TNL_LSO_ETHHDRLENOUT(x) \ + ((x) << S_CPL_TX_TNL_LSO_ETHHDRLENOUT) +#define G_CPL_TX_TNL_LSO_ETHHDRLENOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLENOUT) & M_CPL_TX_TNL_LSO_ETHHDRLENOUT) + +#define S_CPL_TX_TNL_LSO_IPHDRLENOUT 4 +#define M_CPL_TX_TNL_LSO_IPHDRLENOUT 0xfff +#define V_CPL_TX_TNL_LSO_IPHDRLENOUT(x) ((x) << S_CPL_TX_TNL_LSO_IPHDRLENOUT) +#define G_CPL_TX_TNL_LSO_IPHDRLENOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPHDRLENOUT) & M_CPL_TX_TNL_LSO_IPHDRLENOUT) + +#define S_CPL_TX_TNL_LSO_IPHDRCHKOUT 3 +#define M_CPL_TX_TNL_LSO_IPHDRCHKOUT 0x1 +#define V_CPL_TX_TNL_LSO_IPHDRCHKOUT(x) ((x) << S_CPL_TX_TNL_LSO_IPHDRCHKOUT) +#define G_CPL_TX_TNL_LSO_IPHDRCHKOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPHDRCHKOUT) & M_CPL_TX_TNL_LSO_IPHDRCHKOUT) +#define F_CPL_TX_TNL_LSO_IPHDRCHKOUT V_CPL_TX_TNL_LSO_IPHDRCHKOUT(1U) + +#define S_CPL_TX_TNL_LSO_IPLENSETOUT 2 +#define M_CPL_TX_TNL_LSO_IPLENSETOUT 0x1 +#define V_CPL_TX_TNL_LSO_IPLENSETOUT(x) ((x) << S_CPL_TX_TNL_LSO_IPLENSETOUT) +#define G_CPL_TX_TNL_LSO_IPLENSETOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPLENSETOUT) & M_CPL_TX_TNL_LSO_IPLENSETOUT) +#define F_CPL_TX_TNL_LSO_IPLENSETOUT V_CPL_TX_TNL_LSO_IPLENSETOUT(1U) + +#define S_CPL_TX_TNL_LSO_IPIDINCOUT 1 +#define M_CPL_TX_TNL_LSO_IPIDINCOUT 0x1 +#define V_CPL_TX_TNL_LSO_IPIDINCOUT(x) ((x) << S_CPL_TX_TNL_LSO_IPIDINCOUT) +#define G_CPL_TX_TNL_LSO_IPIDINCOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPIDINCOUT) & M_CPL_TX_TNL_LSO_IPIDINCOUT) +#define F_CPL_TX_TNL_LSO_IPIDINCOUT V_CPL_TX_TNL_LSO_IPIDINCOUT(1U) + +#define S_CPL_TX_TNL_LSO_IPIDSPLITOUT 0 +#define M_CPL_TX_TNL_LSO_IPIDSPLITOUT 0x1 +#define V_CPL_TX_TNL_LSO_IPIDSPLITOUT(x) \ + ((x) << S_CPL_TX_TNL_LSO_IPIDSPLITOUT) +#define G_CPL_TX_TNL_LSO_IPIDSPLITOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPIDSPLITOUT) & M_CPL_TX_TNL_LSO_IPIDSPLITOUT) +#define F_CPL_TX_TNL_LSO_IPIDSPLITOUT V_CPL_TX_TNL_LSO_IPIDSPLITOUT(1U) + +#define S_CPL_TX_TNL_LSO_UDPLENSETOUT 15 +#define M_CPL_TX_TNL_LSO_UDPLENSETOUT 0x1 +#define V_CPL_TX_TNL_LSO_UDPLENSETOUT(x) \ + ((x) << S_CPL_TX_TNL_LSO_UDPLENSETOUT) +#define G_CPL_TX_TNL_LSO_UDPLENSETOUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_UDPLENSETOUT) & M_CPL_TX_TNL_LSO_UDPLENSETOUT) +#define F_CPL_TX_TNL_LSO_UDPLENSETOUT V_CPL_TX_TNL_LSO_UDPLENSETOUT(1U) + +#define S_CPL_TX_TNL_LSO_UDPCHKCLROUT 14 +#define M_CPL_TX_TNL_LSO_UDPCHKCLROUT 0x1 +#define V_CPL_TX_TNL_LSO_UDPCHKCLROUT(x) \ + ((x) << S_CPL_TX_TNL_LSO_UDPCHKCLROUT) +#define G_CPL_TX_TNL_LSO_UDPCHKCLROUT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_UDPCHKCLROUT) & M_CPL_TX_TNL_LSO_UDPCHKCLROUT) +#define F_CPL_TX_TNL_LSO_UDPCHKCLROUT V_CPL_TX_TNL_LSO_UDPCHKCLROUT(1U) + +#define S_CPL_TX_TNL_LSO_TNLTYPE 12 +#define M_CPL_TX_TNL_LSO_TNLTYPE 0x3 +#define V_CPL_TX_TNL_LSO_TNLTYPE(x) ((x) << S_CPL_TX_TNL_LSO_TNLTYPE) +#define G_CPL_TX_TNL_LSO_TNLTYPE(x) \ + (((x) >> S_CPL_TX_TNL_LSO_TNLTYPE) & M_CPL_TX_TNL_LSO_TNLTYPE) + +#define S_CPL_TX_TNL_LSO_TNLHDRLEN 0 +#define M_CPL_TX_TNL_LSO_TNLHDRLEN 0xfff +#define V_CPL_TX_TNL_LSO_TNLHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_TNLHDRLEN) +#define G_CPL_TX_TNL_LSO_TNLHDRLEN(x) \ + (((x) >> S_CPL_TX_TNL_LSO_TNLHDRLEN) & M_CPL_TX_TNL_LSO_TNLHDRLEN) + +#define S_CPL_TX_TNL_LSO_FLOW 21 +#define M_CPL_TX_TNL_LSO_FLOW 0x1 +#define V_CPL_TX_TNL_LSO_FLOW(x) ((x) << S_CPL_TX_TNL_LSO_FLOW) +#define G_CPL_TX_TNL_LSO_FLOW(x) \ + (((x) >> S_CPL_TX_TNL_LSO_FLOW) & M_CPL_TX_TNL_LSO_FLOW) +#define F_CPL_TX_TNL_LSO_FLOW V_CPL_TX_TNL_LSO_FLOW(1U) + +#define S_CPL_TX_TNL_LSO_IPV6 20 +#define M_CPL_TX_TNL_LSO_IPV6 0x1 +#define V_CPL_TX_TNL_LSO_IPV6(x) ((x) << S_CPL_TX_TNL_LSO_IPV6) +#define G_CPL_TX_TNL_LSO_IPV6(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPV6) & M_CPL_TX_TNL_LSO_IPV6) +#define F_CPL_TX_TNL_LSO_IPV6 V_CPL_TX_TNL_LSO_IPV6(1U) + +#define S_CPL_TX_TNL_LSO_ETHHDRLEN 16 +#define M_CPL_TX_TNL_LSO_ETHHDRLEN 0xf +#define V_CPL_TX_TNL_LSO_ETHHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_ETHHDRLEN) +#define G_CPL_TX_TNL_LSO_ETHHDRLEN(x) \ + (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLEN) & M_CPL_TX_TNL_LSO_ETHHDRLEN) + +#define S_CPL_TX_TNL_LSO_IPHDRLEN 4 +#define M_CPL_TX_TNL_LSO_IPHDRLEN 0xfff +#define V_CPL_TX_TNL_LSO_IPHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_IPHDRLEN) +#define G_CPL_TX_TNL_LSO_IPHDRLEN(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPHDRLEN) & M_CPL_TX_TNL_LSO_IPHDRLEN) + +#define S_CPL_TX_TNL_LSO_TCPHDRLEN 0 +#define M_CPL_TX_TNL_LSO_TCPHDRLEN 0xf +#define V_CPL_TX_TNL_LSO_TCPHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_TCPHDRLEN) +#define G_CPL_TX_TNL_LSO_TCPHDRLEN(x) \ + (((x) >> S_CPL_TX_TNL_LSO_TCPHDRLEN) & M_CPL_TX_TNL_LSO_TCPHDRLEN) + +#define S_CPL_TX_TNL_LSO_IPIDSPLIT 15 +#define M_CPL_TX_TNL_LSO_IPIDSPLIT 0x1 +#define V_CPL_TX_TNL_LSO_IPIDSPLIT(x) ((x) << S_CPL_TX_TNL_LSO_IPIDSPLIT) +#define G_CPL_TX_TNL_LSO_IPIDSPLIT(x) \ + (((x) >> S_CPL_TX_TNL_LSO_IPIDSPLIT) & M_CPL_TX_TNL_LSO_IPIDSPLIT) +#define F_CPL_TX_TNL_LSO_IPIDSPLIT V_CPL_TX_TNL_LSO_IPIDSPLIT(1U) + +#define S_CPL_TX_TNL_LSO_ETHHDRLENX 14 +#define M_CPL_TX_TNL_LSO_ETHHDRLENX 0x1 +#define V_CPL_TX_TNL_LSO_ETHHDRLENX(x) ((x) << S_CPL_TX_TNL_LSO_ETHHDRLENX) +#define G_CPL_TX_TNL_LSO_ETHHDRLENX(x) \ + (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLENX) & M_CPL_TX_TNL_LSO_ETHHDRLENX) +#define F_CPL_TX_TNL_LSO_ETHHDRLENX V_CPL_TX_TNL_LSO_ETHHDRLENX(1U) + +#define S_CPL_TX_TNL_LSO_MSS 0 +#define M_CPL_TX_TNL_LSO_MSS 0x3fff +#define V_CPL_TX_TNL_LSO_MSS(x) ((x) << S_CPL_TX_TNL_LSO_MSS) +#define G_CPL_TX_TNL_LSO_MSS(x) \ + (((x) >> S_CPL_TX_TNL_LSO_MSS) & M_CPL_TX_TNL_LSO_MSS) + +#define S_CPL_TX_TNL_LSO_ETHLENOFFSET 28 +#define M_CPL_TX_TNL_LSO_ETHLENOFFSET 0xf +#define V_CPL_TX_TNL_LSO_ETHLENOFFSET(x) \ + ((x) << S_CPL_TX_TNL_LSO_ETHLENOFFSET) +#define G_CPL_TX_TNL_LSO_ETHLENOFFSET(x) \ + (((x) >> S_CPL_TX_TNL_LSO_ETHLENOFFSET) & M_CPL_TX_TNL_LSO_ETHLENOFFSET) + +#define S_CPL_TX_TNL_LSO_SIZE 0 +#define M_CPL_TX_TNL_LSO_SIZE 0xfffffff +#define V_CPL_TX_TNL_LSO_SIZE(x) ((x) << S_CPL_TX_TNL_LSO_SIZE) +#define G_CPL_TX_TNL_LSO_SIZE(x) \ + (((x) >> S_CPL_TX_TNL_LSO_SIZE) & M_CPL_TX_TNL_LSO_SIZE) + +struct cpl_rx_mps_pkt { + __be32 op_to_r1_hi; + __be32 r1_lo_length; +}; + +#define S_CPL_RX_MPS_PKT_OP 24 +#define M_CPL_RX_MPS_PKT_OP 0xff +#define V_CPL_RX_MPS_PKT_OP(x) ((x) << S_CPL_RX_MPS_PKT_OP) +#define G_CPL_RX_MPS_PKT_OP(x) \ + (((x) >> S_CPL_RX_MPS_PKT_OP) & M_CPL_RX_MPS_PKT_OP) + +#define S_CPL_RX_MPS_PKT_TYPE 20 +#define M_CPL_RX_MPS_PKT_TYPE 0xf +#define V_CPL_RX_MPS_PKT_TYPE(x) ((x) << S_CPL_RX_MPS_PKT_TYPE) +#define G_CPL_RX_MPS_PKT_TYPE(x) \ + (((x) >> S_CPL_RX_MPS_PKT_TYPE) & M_CPL_RX_MPS_PKT_TYPE) + +/* + * Values for CPL_RX_MPS_PKT_TYPE, a bit-wise orthogonal field. + */ +#define X_CPL_RX_MPS_PKT_TYPE_PAUSE (1 << 0) +#define X_CPL_RX_MPS_PKT_TYPE_PPP (1 << 1) +#define X_CPL_RX_MPS_PKT_TYPE_QFC (1 << 2) +#define X_CPL_RX_MPS_PKT_TYPE_PTP (1 << 3) + #endif /* T4_MSG_H */ Modified: head/sys/dev/cxgbe/common/t4_regs.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_regs.h Thu Feb 18 23:32:11 2016 (r295777) +++ head/sys/dev/cxgbe/common/t4_regs.h Fri Feb 19 00:29:16 2016 (r295778) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Chelsio Communications, Inc. + * Copyright (c) 2013, 2016 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,6 +28,10 @@ */ /* This file is automatically generated --- changes will be lost */ +/* Generation Date : Wed Jan 27 10:57:51 IST 2016 */ +/* Directory name: t4_reg.txt, Changeset: */ +/* Directory name: t5_reg.txt, Changeset: 6936:7f6342b03d61 */ +/* Directory name: t6_reg.txt, Changeset: 4191:ce3ccd95c109 */ #define MYPF_BASE 0x1b000 #define MYPF_REG(reg_addr) (MYPF_BASE + (reg_addr)) @@ -368,9 +372,141 @@ #define EDC_H_ECC_ERR_DATA_REG(reg_addr, idx) ((reg_addr) + (idx) * 4) #define NUM_EDC_H_ECC_ERR_DATA_INSTANCES 16 +#define SGE_DEBUG1_DBP_THREAD(idx) (A_SGE_DEBUG1_DBP_THREAD + (idx) * 4) +#define NUM_SGE_DEBUG1_DBP_THREAD_INSTANCES 4 + +#define SGE_DEBUG0_DBP_THREAD(idx) (A_SGE_DEBUG0_DBP_THREAD + (idx) * 4) +#define NUM_SGE_DEBUG0_DBP_THREAD_INSTANCES 5 + +#define SGE_WC_EGRS_BAR2_OFF_PF(idx) (A_SGE_WC_EGRS_BAR2_OFF_PF + (idx) * 4) +#define NUM_SGE_WC_EGRS_BAR2_OFF_PF_INSTANCES 8 + +#define SGE_WC_EGRS_BAR2_OFF_VF(idx) (A_SGE_WC_EGRS_BAR2_OFF_VF + (idx) * 4) +#define NUM_SGE_WC_EGRS_BAR2_OFF_VF_INSTANCES 8 + +#define PCIE_T6_DMA_REG(reg_addr, idx) ((reg_addr) + (idx) * 16) +#define NUM_PCIE_T6_DMA_INSTANCES 2 + +#define PCIE_T6_CMD_REG(reg_addr, idx) ((reg_addr) + (idx) * 16) +#define NUM_PCIE_T6_CMD_INSTANCES 1 + +#define PCIE_VF_256_INT_REG(reg_addr, idx) ((reg_addr) + (idx) * 4) +#define NUM_PCIE_VF_256_INT_INSTANCES 128 + +#define MPS_CLS_REQUEST_TRACE_MAC_DA_L(idx) (A_MPS_CLS_REQUEST_TRACE_MAC_DA_L + (idx) * 32) +#define NUM_MPS_CLS_REQUEST_TRACE_MAC_DA_L_INSTANCES 8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 19 00:38:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76ED9AABE6E; Fri, 19 Feb 2016 00:38:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5BD3E161C; Fri, 19 Feb 2016 00:38:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 5456C1E4E; Fri, 19 Feb 2016 00:38:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 0D206D30E; Fri, 19 Feb 2016 00:38:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id z4YbRENfH7Pg; Fri, 19 Feb 2016 00:38:33 +0000 (UTC) Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 32E1CD309 To: Maxim Sobolev , ray@FreeBSD.org, Adrian Chadd References: Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 16:38:45 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I9bq3CGk4fSkOR85HrdibXEW1k4UPQNXt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:38:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I9bq3CGk4fSkOR85HrdibXEW1k4UPQNXt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/18/2016 3:57 PM, Maxim Sobolev wrote: > Aleksandr, Adrian, >=20 > I know it's 3 years later, but I really don't know why it's been done > this way. Take a GEOM module and associated usr.bin utility, copy it > verbatim add few lines of code and re-add that as a new module seems > like just laziness and attempt to avoid doing extra work on making > unified code. The same goes for the mkulzma, which is almost 1:1 copy o= f > the mkuzip. Now people are merging back and forth and I've just spent > few days testing some rather major rework of geom_uzip / mkuzip code no= t > even realizing that there is its evil twin in the tree. :( r283104 is an example of one of these problems. It was a catch-up of uzip's r268986 done almost a year before. I did comparisons before using uzip last summer and ran across that one. >=20 > https://reviews.freebsd.org/D5333 >=20 > I suggest functionality from both geom_uncompress / mkulzma are folded > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuke= d > afterwards. >=20 > Thanks! >=20 > =20 >=20 > Author: ray > Date: Wed Jan 4 23:39:11 2012 > New Revision: 229537 > URL: http://svn.freebsd.org/changeset/base/229537 > Log: > GEOM_UNCOMPRESS module, can be used with uzip images and with new > ulzma images. > Approved by: adrian (mentor) > Added: > head/sys/geom/uncompress/ > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) > head/sys/modules/geom/geom_uncompress/ > head/sys/modules/geom/geom_uncompress/Makefile (contents, props cha= nged) > Modified: > head/sys/conf/files > head/sys/conf/options >=20 >=20 --=20 Regards, Bryan Drewery --I9bq3CGk4fSkOR85HrdibXEW1k4UPQNXt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWxmQVAAoJEDXXcbtuRpfPEUQIANj8xQVUQnR2qxXwq499expN 2pS4EDSM4xLOBcNnyGq37Z33T1LuNSUMLeQ660s4RPcfT8YL9gpbRrAXnNELFYa4 R4EFwElr6UEs9w2cgzdQ3RkkCf5OFfIGevA1pm2LUKPUoyR/BsnLEXeoZ8KK+7f2 5SAAz+3C9+77VKzOm0a/x7D9O7m4pTpl24hkNoPpK3+6D974eN1hj8puJHKrtD2W +VRnu/CFVPqNCaasS8o1vQ4xIRS8xXsctOXaactsXmBI7IZC5+XnAO+0Yh21kv35 Cr0zUBjSoPfRNq/DGzn3IeEc1qzUcM1xN1rVW5ELNzppaV5U+5E1ctpau2Sfnas= =h7yM -----END PGP SIGNATURE----- --I9bq3CGk4fSkOR85HrdibXEW1k4UPQNXt-- From owner-svn-src-head@freebsd.org Fri Feb 19 00:41:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2BB0AABFB0; Fri, 19 Feb 2016 00:41:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A273219DD; Fri, 19 Feb 2016 00:41:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J0fOVP072677; Fri, 19 Feb 2016 00:41:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J0fOSX072675; Fri, 19 Feb 2016 00:41:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602190041.u1J0fOSX072675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Feb 2016 00:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295779 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:41:26 -0000 Author: bdrewery Date: Fri Feb 19 00:41:24 2016 New Revision: 295779 URL: https://svnweb.freebsd.org/changeset/base/295779 Log: Avoid reading .depend.* in simple cases where not needed. This will speed up some tree-walks with FAST_DEPEND which otherwise would include length(SRCS) .depend files. This also uses a trick suggested by sjg@ to still read them in when specifying _V_READ_DEPEND=1 in the env/make args. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Feb 19 00:29:16 2016 (r295778) +++ head/share/mk/bsd.dep.mk Fri Feb 19 00:41:24 2016 (r295779) @@ -81,6 +81,16 @@ tags: ${SRCS} .endif .endif +# Skip reading .depend when not needed to speed up tree-walks +# and simple lookups. +.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ + make(install*) +_SKIP_READ_DEPEND= 1 +.if ${MK_DIRDEPS_BUILD} == "no" +.MAKE.DEPENDFILE= /dev/null +.endif +.endif + .if defined(SRCS) CLEANFILES?= @@ -181,7 +191,7 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.c DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} .endif DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} -.if ${.MAKEFLAGS:M-V} == "" +.if !defined(_SKIP_READ_DEPEND) .for __depend_obj in ${DEPENDFILES_OBJS} .sinclude "${__depend_obj}" .endfor Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Feb 19 00:29:16 2016 (r295778) +++ head/sys/conf/kern.post.mk Fri Feb 19 00:41:24 2016 (r295779) @@ -206,6 +206,15 @@ CFILES_OFED=${CFILES:M*/ofed/*} # We have "special" -I include paths for MLX5. CFILES_MLX5=${CFILES:M*/dev/mlx5/*} +# Skip reading .depend when not needed to speed up tree-walks +# and simple lookups. +.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ + make(install*) || make(kernel-obj) || make(kernel-clean*) || \ + make(kernel-install*) +_SKIP_READ_DEPEND= 1 +.MAKE.DEPENDFILE= /dev/null +.endif + kernel-depend: .depend # The argument list can be very long, so use make -V and xargs to # pass it to mkdep. @@ -222,7 +231,7 @@ DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} -.if ${.MAKEFLAGS:M-V} == "" +.if !defined(_SKIP_READ_DEPEND) .for __depend_obj in ${DEPENDFILES_OBJS} .sinclude "${__depend_obj}" .endfor From owner-svn-src-head@freebsd.org Fri Feb 19 00:41:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844B7AAC012; Fri, 19 Feb 2016 00:41:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4600A1BA7; Fri, 19 Feb 2016 00:41:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J0fc67072728; Fri, 19 Feb 2016 00:41:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J0fclb072727; Fri, 19 Feb 2016 00:41:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602190041.u1J0fclb072727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Feb 2016 00:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295780 - head/usr.bin/clang/llvm-ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:41:39 -0000 Author: bdrewery Date: Fri Feb 19 00:41:38 2016 New Revision: 295780 URL: https://svnweb.freebsd.org/changeset/base/295780 Log: DIRDEPS_BUILD: Add dependencies somehow missed in r295681. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/clang/llvm-ar/Makefile.depend Modified: head/usr.bin/clang/llvm-ar/Makefile.depend ============================================================================== --- head/usr.bin/clang/llvm-ar/Makefile.depend Fri Feb 19 00:41:24 2016 (r295779) +++ head/usr.bin/clang/llvm-ar/Makefile.depend Fri Feb 19 00:41:38 2016 (r295780) @@ -2,10 +2,76 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ include \ include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvmaarch64asmparser \ + lib/clang/libllvmaarch64codegen \ + lib/clang/libllvmaarch64desc \ + lib/clang/libllvmaarch64disassembler \ + lib/clang/libllvmaarch64info \ + lib/clang/libllvmaarch64instprinter \ + lib/clang/libllvmaarch64utils \ + lib/clang/libllvmanalysis \ + lib/clang/libllvmarmasmparser \ + lib/clang/libllvmarmcodegen \ + lib/clang/libllvmarmdesc \ + lib/clang/libllvmarmdisassembler \ + lib/clang/libllvmarminfo \ + lib/clang/libllvmarminstprinter \ + lib/clang/libllvmasmprinter \ + lib/clang/libllvmbitreader \ + lib/clang/libllvmcodegen \ + lib/clang/libllvmcore \ + lib/clang/libllvminstcombine \ + lib/clang/libllvminstrumentation \ + lib/clang/libllvmipa \ + lib/clang/libllvmlibdriver \ + lib/clang/libllvmmc \ + lib/clang/libllvmmcdisassembler \ + lib/clang/libllvmmcparser \ + lib/clang/libllvmmipsasmparser \ + lib/clang/libllvmmipscodegen \ + lib/clang/libllvmmipsdesc \ + lib/clang/libllvmmipsdisassembler \ + lib/clang/libllvmmipsinfo \ + lib/clang/libllvmmipsinstprinter \ + lib/clang/libllvmobject \ + lib/clang/libllvmoption \ + lib/clang/libllvmpowerpcasmparser \ + lib/clang/libllvmpowerpccodegen \ + lib/clang/libllvmpowerpcdesc \ + lib/clang/libllvmpowerpcdisassembler \ + lib/clang/libllvmpowerpcinfo \ + lib/clang/libllvmpowerpcinstprinter \ + lib/clang/libllvmprofiledata \ + lib/clang/libllvmscalaropts \ + lib/clang/libllvmselectiondag \ + lib/clang/libllvmsparcasmparser \ + lib/clang/libllvmsparccodegen \ + lib/clang/libllvmsparcdesc \ + lib/clang/libllvmsparcdisassembler \ + lib/clang/libllvmsparcinfo \ + lib/clang/libllvmsparcinstprinter \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtarget \ + lib/clang/libllvmtransformutils \ + lib/clang/libllvmx86asmparser \ + lib/clang/libllvmx86codegen \ + lib/clang/libllvmx86desc \ + lib/clang/libllvmx86disassembler \ + lib/clang/libllvmx86info \ + lib/clang/libllvmx86instprinter \ + lib/clang/libllvmx86utils \ + lib/libc \ lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/libz \ lib/msun \ + lib/ncurses/ncursesw \ .include From owner-svn-src-head@freebsd.org Fri Feb 19 00:41:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A892EAAC054; Fri, 19 Feb 2016 00:41:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 772311BB4; Fri, 19 Feb 2016 00:41:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J0ff1Y072774; Fri, 19 Feb 2016 00:41:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J0ffa5072773; Fri, 19 Feb 2016 00:41:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602190041.u1J0ffa5072773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Feb 2016 00:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295781 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 00:41:42 -0000 Author: bdrewery Date: Fri Feb 19 00:41:41 2016 New Revision: 295781 URL: https://svnweb.freebsd.org/changeset/base/295781 Log: FAST_DEPEND: Apply conditional -MF from r291945 to kernel as well. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Feb 19 00:41:38 2016 (r295780) +++ head/sys/conf/kern.post.mk Fri Feb 19 00:41:41 2016 (r295781) @@ -228,7 +228,14 @@ DEPENDFILES= .depend DEPENDFILES+= .depend.* DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} +.if defined(.PARSEDIR) +# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS +# as those are the only ones we will include. +DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET}) +CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} +.else CFLAGS+= ${DEPEND_CFLAGS} +.endif DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if !defined(_SKIP_READ_DEPEND) From owner-svn-src-head@freebsd.org Fri Feb 19 01:00:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DC5AACAE6; Fri, 19 Feb 2016 01:00:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEAACC2C; Fri, 19 Feb 2016 01:00:49 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J10mVM078267; Fri, 19 Feb 2016 01:00:48 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J10m0G078266; Fri, 19 Feb 2016 01:00:48 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602190100.u1J10m0G078266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 19 Feb 2016 01:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295782 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:00:50 -0000 Author: sobomax Date: Fri Feb 19 01:00:48 2016 New Revision: 295782 URL: https://svnweb.freebsd.org/changeset/base/295782 Log: Clear up confision as to who the original historical authors of code and manual page were. For whatever reason it listed myself as a primary author, which is just not true. Also, majority of the manpage is copied verbatim from the geom_uzip(4), contributed by ceri, with only minor adjustments from loos, so put ceri back into the copyright secrion where he belongs and reflect that in the AUTHORS section. For what it's worth, I think this one should be deleted and LZMA support just folded back into geom_uzip(4) / mkuzip(4) whete it really belongs. MFC after: 1 month Modified: head/share/man/man4/geom_uncompress.4 Modified: head/share/man/man4/geom_uncompress.4 ============================================================================== --- head/share/man/man4/geom_uncompress.4 Fri Feb 19 00:41:41 2016 (r295781) +++ head/share/man/man4/geom_uncompress.4 Fri Feb 19 01:00:48 2016 (r295782) @@ -1,3 +1,4 @@ +.\" Copyright (c) 2006, Ceri Davies .\" Copyright (c) 2014, Luiz Otavio O Souza .\" All rights reserved. .\" @@ -100,8 +101,18 @@ Consumers: The .Nm driver was written by -.An Maxim Sobolev Aq Mt sobomax@FreeBSD.org -and -.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org . +.An Max Khon Aq Mt fjoe@FreeBSD.org +as +.Xr geom_uzip 4 . +.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org +copied it over as +.Nm +and added LZMA functionality . This manual page was written by -.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org . +.An Ceri Davies Aq Mt ceri@FreeBSD.org +for the +.Xr geom_uzip 8 , +and modified by +.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org +to match +.Nm . From owner-svn-src-head@freebsd.org Fri Feb 19 01:06:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C1EAACE3D; Fri, 19 Feb 2016 01:06:47 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B78FF0; Fri, 19 Feb 2016 01:06:46 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J16jvo081055; Fri, 19 Feb 2016 01:06:45 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J16jUg081054; Fri, 19 Feb 2016 01:06:45 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602190106.u1J16jUg081054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 19 Feb 2016 01:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295783 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:06:47 -0000 Author: sobomax Date: Fri Feb 19 01:06:45 2016 New Revision: 295783 URL: https://svnweb.freebsd.org/changeset/base/295783 Log: Fix section number of .Xr geom_uzip in r295782. MFC after: 1 months (together with r295782) Modified: head/share/man/man4/geom_uncompress.4 Modified: head/share/man/man4/geom_uncompress.4 ============================================================================== --- head/share/man/man4/geom_uncompress.4 Fri Feb 19 01:00:48 2016 (r295782) +++ head/share/man/man4/geom_uncompress.4 Fri Feb 19 01:06:45 2016 (r295783) @@ -111,7 +111,7 @@ and added LZMA functionality . This manual page was written by .An Ceri Davies Aq Mt ceri@FreeBSD.org for the -.Xr geom_uzip 8 , +.Xr geom_uzip 4 , and modified by .An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org to match From owner-svn-src-head@freebsd.org Fri Feb 19 01:08:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5504AACF19; Fri, 19 Feb 2016 01:08:04 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE30117E; Fri, 19 Feb 2016 01:08:04 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J1839w081140; Fri, 19 Feb 2016 01:08:03 GMT (envelope-from jgh@FreeBSD.org) Received: (from jgh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J183wU081139; Fri, 19 Feb 2016 01:08:03 GMT (envelope-from jgh@FreeBSD.org) Message-Id: <201602190108.u1J183wU081139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jgh set sender to jgh@FreeBSD.org using -f From: Jason Helfman Date: Fri, 19 Feb 2016 01:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295784 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:08:04 -0000 Author: jgh (doc,ports committer) Date: Fri Feb 19 01:08:03 2016 New Revision: 295784 URL: https://svnweb.freebsd.org/changeset/base/295784 Log: - language tightening - cleanup SEE ALSO section (thanks brueffer@) Approved by: wblock (mentor) Differential Revision: https://reviews.freebsd.org/D5335 Modified: head/share/man/man5/mailer.conf.5 Modified: head/share/man/man5/mailer.conf.5 ============================================================================== --- head/share/man/man5/mailer.conf.5 Fri Feb 19 01:06:45 2016 (r295783) +++ head/share/man/man5/mailer.conf.5 Fri Feb 19 01:08:03 2016 (r295784) @@ -101,9 +101,10 @@ mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail .Ed .Pp -This example shows how to invoke a sendmail-workalike like +Using .Nm Postfix -in place of +(from ports) +to replace .Xr sendmail 8 : .Bd -literal -offset indent # Emulate sendmail using postfix @@ -113,12 +114,10 @@ mailq /usr/local/sbin/sendmail newaliases /usr/local/sbin/sendmail .Ed .Pp -This example shows -how to invoke -a sendmail-workalike with +Using .Nm Exim (from ports) -in place of +to replace .Xr sendmail 8 : .Bd -literal -offset indent # Emulate sendmail using exim @@ -129,11 +128,11 @@ newaliases /usr/bin/true rmail /usr/local/sbin/exim -i -oee .Ed .Pp -This example shows the use of the +Using .Nm mini_sendmail -package from ports in place of -.Xr sendmail 8 . -Note the use of additional arguments. +(from ports) +to replace +.Xr sendmail 8 : .Bd -literal -offset indent # Send outgoing mail to a smart relay using mini_sendmail sendmail /usr/local/bin/mini_sendmail -srelayhost @@ -153,14 +152,16 @@ newaliases /usr/libexec/dma rmail /usr/libexec/dma .Ed .Sh SEE ALSO -.Xr dma 8 , .Xr mail 1 , .Xr mailq 1 , .Xr newaliases 1 , +.Xr dma 8 , .Xr mailwrapper 8 , .Xr sendmail 8 .Pp .Xr postfix 1 Pq Pa ports/mail/postfix , +.Xr dma 8 Pq Pa ports/mail/dma , +.Xr exim 8 Pq Pa ports/mail/exim , .Xr mini_sendmail 8 Pq Pa ports/mail/mini_sendmail .Sh HISTORY .Nm From owner-svn-src-head@freebsd.org Fri Feb 19 01:28:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D587AAD891 for ; Fri, 19 Feb 2016 01:28:56 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9165F1D1F for ; Fri, 19 Feb 2016 01:28:55 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x232.google.com with SMTP id a4so50400132wme.1 for ; Thu, 18 Feb 2016 17:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aj6UyJfoIGffNbaRzAomS+6iNjty+1ydwOwiCdK2b3U=; b=pdiG4ee/rlTR6modco/PNcpG8k/mXtBNnB/w4aRpAXvcP0npMmLUviTR0sTmygzd4N aDpyTlXfx1SLZR/rRKMKWTzxB1LVA9xPcjZxuiYjDIrqtiqPk64C3BFwFut5nDcNvCZI LAxh8Siy0xGCzlZAhaE4ADjIb3+xvKf/qHpiVSGhSRXUnxXDIUhsYBYG4XWKsENheFZ/ ZaH3aAJv3jsgxlnOk4A2DD8vD4Y0tw6GozuM5BnomlFWdae54aGA+f9i4aIxyI7vDaJW PiGy6YIn2bN/rCauFxRJfiACewlMJidKkl1xnG/SMrT5tXFnXbUOXWb61/XJqez5AdI6 9LBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aj6UyJfoIGffNbaRzAomS+6iNjty+1ydwOwiCdK2b3U=; b=dmjghbk032X4pP4BhirkGP1dT+m6ZEQ7OBACQ9vvK77yAAJ3riEdse+HsIhNzg1q1e V3pZirLt6cXLJW7/I00F3Ng7OJ2A+aGvvqXqiE+QrJTEqvgoW5JNCut0+rcP1Qwjv0zP n0kg94Y81pvuDaIOyA4n/4hqtDRRRtf68cT+uUrdC7NsPgCIf+pQSmoCzo6ZaMCXroP6 jLwDoQYIDwtbBs4lA+3dsdX0VCyVtq0cfPIWy30lhn/qwxzz+otQAdrCWMhaZdupOaT1 QQXF+Ln9k7ipjsXDScLzF+Bh3oYc41Rhq/A/TJWNeV188E7xmswULZof+kD2uTrxlS6b btUQ== X-Gm-Message-State: AG10YOQi8w0HGsPGM0HHg1p+tavztIjhU5+9e/Hq0vM3ICWSOhJhCIXgj1MWrl2aGacwLHju3Px0StRs8uUMBNiK MIME-Version: 1.0 X-Received: by 10.28.228.214 with SMTP id b205mr6614953wmh.94.1455845333955; Thu, 18 Feb 2016 17:28:53 -0800 (PST) Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 17:28:53 -0800 (PST) In-Reply-To: <56C66415.7040407@FreeBSD.org> References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 17:28:53 -0800 Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: Bryan Drewery Cc: ray@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:28:56 -0000 Sigh, I don't now how it managed to sleep through usually tight FreeBSD peer-review process. It would be interesting to hear some comments from @ray and @adrian, perhaps there were some reasons for it being done this way, although I cannot see any in a hindsight. I am just in the middle of rather substantial overhaul of both kernel and userland part here: https://reviews.freebsd.org/D5333 And once that committed it will take them apart again. I've also spend quite lot of time testing my change set, which would with very little effort have covered both formats had I started with unified code base. :( I also plan on making further improvement into kernel module, as it is right now both g_uzip and g_uncompress basically piggyback single "g_up" thread, so you cannot use multiple cores even for different instances, let alone one instance being accessed by multiple readers. And it also can delay other unrelated I/O requests by maxing out CPU time slice available for the g_up. On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery wrote: > On 2/18/2016 3:57 PM, Maxim Sobolev wrote: > > Aleksandr, Adrian, > > > > I know it's 3 years later, but I really don't know why it's been done > > this way. Take a GEOM module and associated usr.bin utility, copy it > > verbatim add few lines of code and re-add that as a new module seems > > like just laziness and attempt to avoid doing extra work on making > > unified code. The same goes for the mkulzma, which is almost 1:1 copy of > > the mkuzip. Now people are merging back and forth and I've just spent > > few days testing some rather major rework of geom_uzip / mkuzip code not > > even realizing that there is its evil twin in the tree. :( > > r283104 is an example of one of these problems. It was a catch-up of > uzip's r268986 done almost a year before. I did comparisons before using > uzip last summer and ran across that one. > > > > > https://reviews.freebsd.org/D5333 > > > > I suggest functionality from both geom_uncompress / mkulzma are folded > > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked > > afterwards. > > > > Thanks! > > > > > > > > Author: ray > > Date: Wed Jan 4 23:39:11 2012 > > New Revision: 229537 > > URL: http://svn.freebsd.org/changeset/base/229537 > > Log: > > GEOM_UNCOMPRESS module, can be used with uzip images and with new > > ulzma images. > > Approved by: adrian (mentor) > > Added: > > head/sys/geom/uncompress/ > > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) > > head/sys/modules/geom/geom_uncompress/ > > head/sys/modules/geom/geom_uncompress/Makefile (contents, props > changed) > > Modified: > > head/sys/conf/files > > head/sys/conf/options > > > > > > > -- > Regards, > Bryan Drewery > > -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel (Canada): +1-778-783-0474 Tel (Toll-Free): +1-855-747-7779 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft From owner-svn-src-head@freebsd.org Fri Feb 19 01:35:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34961AADAE0; Fri, 19 Feb 2016 01:35:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07F2118C; Fri, 19 Feb 2016 01:35:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J1Z2vZ089687; Fri, 19 Feb 2016 01:35:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J1Z2WQ089686; Fri, 19 Feb 2016 01:35:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602190135.u1J1Z2WQ089686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Feb 2016 01:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295785 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:35:03 -0000 Author: markj Date: Fri Feb 19 01:35:01 2016 New Revision: 295785 URL: https://svnweb.freebsd.org/changeset/base/295785 Log: Return an error if both EV_ENABLE and EV_DISABLE are specified for a kevent. Currently, this combination results in EV_DISABLE being ignored. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5307 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Feb 19 01:08:03 2016 (r295784) +++ head/sys/kern/kern_event.c Fri Feb 19 01:35:01 2016 (r295785) @@ -1116,6 +1116,9 @@ kqueue_register(struct kqueue *kq, struc int error, filt, event; int haskqglobal, filedesc_unlock; + if ((kev->flags & (EV_ENABLE | EV_DISABLE)) == (EV_ENABLE | EV_DISABLE)) + return (EINVAL); + fp = NULL; kn = NULL; error = 0; From owner-svn-src-head@freebsd.org Fri Feb 19 01:49:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFC3EAAC18B; Fri, 19 Feb 2016 01:49:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A13A61; Fri, 19 Feb 2016 01:49:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J1nXog092753; Fri, 19 Feb 2016 01:49:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J1nXnT092751; Fri, 19 Feb 2016 01:49:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602190149.u1J1nXnT092751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Feb 2016 01:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295786 - in head: sys/kern tests/sys/kqueue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:49:34 -0000 Author: markj Date: Fri Feb 19 01:49:33 2016 New Revision: 295786 URL: https://svnweb.freebsd.org/changeset/base/295786 Log: Ensure that we test the event condition when a disabled kevent is enabled. r274560 modified kqueue_register() to only test the event condition if the corresponding knote is not disabled. However, this check takes place before the EV_ENABLE flag is used to clear the KN_DISABLED flag on the knote, so enabling a previously-disabled kevent would not result in a notification for a triggered event. This change fixes the problem by testing for EV_ENABLED before possibly checking the event condition. This change also updates a kqueue regression test to exercise this case. PR: 206368 Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5307 Modified: head/sys/kern/kern_event.c head/tests/sys/kqueue/read.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Feb 19 01:35:01 2016 (r295785) +++ head/sys/kern/kern_event.c Fri Feb 19 01:49:33 2016 (r295786) @@ -1323,27 +1323,24 @@ findkn: * kn_knlist. */ done_ev_add: - if ((kev->flags & EV_DISABLE) && - ((kn->kn_status & KN_DISABLED) == 0)) { + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) kn->kn_status |= KN_DISABLED; - } if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else event = 0; + KQ_LOCK(kq); if (event) - KNOTE_ACTIVATE(kn, 1); + kn->kn_status |= KN_ACTIVE; + if ((kn->kn_status & (KN_ACTIVE | KN_DISABLED | KN_QUEUED)) == + KN_ACTIVE) + knote_enqueue(kn); kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); - - if ((kev->flags & EV_ENABLE) && (kn->kn_status & KN_DISABLED)) { - kn->kn_status &= ~KN_DISABLED; - if ((kn->kn_status & KN_ACTIVE) && - ((kn->kn_status & KN_QUEUED) == 0)) - knote_enqueue(kn); - } KQ_UNLOCK_FLUX(kq); done: Modified: head/tests/sys/kqueue/read.c ============================================================================== --- head/tests/sys/kqueue/read.c Fri Feb 19 01:35:01 2016 (r295785) +++ head/tests/sys/kqueue/read.c Fri Feb 19 01:49:33 2016 (r295786) @@ -124,15 +124,17 @@ test_kevent_socket_disable_and_enable(vo test_begin(test_id); - /* Add an event, then disable it. */ - EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); - EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DISABLE, 0, 0, &sockfd[0]); + /* + * Write to the socket before adding the event. This way we can verify that + * enabling a triggered kevent causes the event to be returned immediately. + */ + kevent_socket_fill(); + + /* Add a disabled event. */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_DISABLE, 0, 0, &sockfd[0]); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - kevent_socket_fill(); test_no_kevents(); /* Re-enable the knote, then see if an event is generated */ From owner-svn-src-head@freebsd.org Fri Feb 19 01:57:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99F4AAC57F; Fri, 19 Feb 2016 01:57:00 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9B4C101E; Fri, 19 Feb 2016 01:57:00 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J1ux3G095630; Fri, 19 Feb 2016 01:56:59 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J1ux6e095629; Fri, 19 Feb 2016 01:56:59 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201602190156.u1J1ux6e095629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 19 Feb 2016 01:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295787 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:57:01 -0000 Author: kevlo Date: Fri Feb 19 01:56:59 2016 New Revision: 295787 URL: https://svnweb.freebsd.org/changeset/base/295787 Log: Add missing parentheses. Found by: PVS-Studio Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Feb 19 01:49:33 2016 (r295786) +++ head/sys/dev/ixl/if_ixl.c Fri Feb 19 01:56:59 2016 (r295787) @@ -6311,7 +6311,7 @@ ixl_vf_config_promisc_msg(struct ixl_pf return; } - if (!vf->vf_flags & VF_FLAG_PROMISC_CAP) { + if (!(vf->vf_flags & VF_FLAG_PROMISC_CAP)) { i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, I40E_ERR_PARAM); return; From owner-svn-src-head@freebsd.org Fri Feb 19 01:57:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39FC0AAC652; Fri, 19 Feb 2016 01:57:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBEB1194; Fri, 19 Feb 2016 01:57:52 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J1vq8Y095701; Fri, 19 Feb 2016 01:57:52 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J1vqnk095700; Fri, 19 Feb 2016 01:57:52 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201602190157.u1J1vqnk095700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 19 Feb 2016 01:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295788 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 01:57:53 -0000 Author: kevlo Date: Fri Feb 19 01:57:51 2016 New Revision: 295788 URL: https://svnweb.freebsd.org/changeset/base/295788 Log: Remove bogus cast. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Feb 19 01:56:59 2016 (r295787) +++ head/sys/dev/iwn/if_iwn.c Fri Feb 19 01:57:51 2016 (r295788) @@ -417,7 +417,7 @@ iwn_is_3stream_device(struct iwn_softc * static int iwn_attach(device_t dev) { - struct iwn_softc *sc = (struct iwn_softc *)device_get_softc(dev); + struct iwn_softc *sc = device_get_softc(dev); struct ieee80211com *ic; int i, error, rid; From owner-svn-src-head@freebsd.org Fri Feb 19 03:38:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5035AACF72; Fri, 19 Feb 2016 03:38:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75789131E; Fri, 19 Feb 2016 03:38:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J3bx8A025155; Fri, 19 Feb 2016 03:37:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J3bu5G025128; Fri, 19 Feb 2016 03:37:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602190337.u1J3bu5G025128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 19 Feb 2016 03:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295790 - in head/sys: dev/arcmsr dev/cy dev/ed dev/fb dev/fdc dev/hpt27xx dev/hptiop dev/hptmv dev/hptnr dev/hptrr dev/isci dev/ixgb dev/lmc dev/mrsas dev/mxge dev/nvme dev/quicc dev/s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 03:38:00 -0000 Author: jhibbits Date: Fri Feb 19 03:37:56 2016 New Revision: 295790 URL: https://svnweb.freebsd.org/changeset/base/295790 Log: Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/cy/cy_isa.c head/sys/dev/cy/cy_pci.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/fb/s3_pci.c head/sys/dev/fdc/fdc_pccard.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hptiop/hptiop.c head/sys/dev/hptmv/entry.c head/sys/dev/hptnr/hptnr_osm_bsd.c head/sys/dev/hptrr/hptrr_osm_bsd.c head/sys/dev/isci/isci.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/lmc/if_lmc.c head/sys/dev/mrsas/mrsas.c head/sys/dev/mxge/if_mxge.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/quicc/quicc_core.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/hdspe.c head/sys/dev/sound/pci/vibes.c head/sys/dev/twa/tw_osl_freebsd.c head/sys/dev/tws/tws.c head/sys/isa/isa_common.c head/sys/isa/vga_isa.c head/sys/mips/sibyte/ata_zbbus.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/arcmsr/arcmsr.c Fri Feb 19 03:37:56 2016 (r295790) @@ -4323,7 +4323,7 @@ static int arcmsr_attach(device_t dev) } /* After setting up the adapter, map our interrupt */ rid = 0; - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE); + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if(irqres == NULL || #if __FreeBSD_version >= 700025 bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, arcmsr_intr_handler, acb, &acb->ih)) { Modified: head/sys/dev/cy/cy_isa.c ============================================================================== --- head/sys/dev/cy/cy_isa.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/cy/cy_isa.c Fri Feb 19 03:37:56 2016 (r295790) @@ -80,8 +80,8 @@ cy_isa_probe(device_t dev) return (ENXIO); mem_rid = 0; - mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, - 0ul, ~0ul, 0ul, RF_ACTIVE); + mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid, + RF_ACTIVE); if (mem_res == NULL) { device_printf(dev, "ioport resource allocation failed\n"); return (ENXIO); @@ -112,8 +112,8 @@ cy_isa_attach(device_t dev) mem_res = NULL; mem_rid = 0; - mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, - 0ul, ~0ul, 0ul, RF_ACTIVE); + mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid, + RF_ACTIVE); if (mem_res == NULL) { device_printf(dev, "memory resource allocation failed\n"); goto fail; @@ -127,7 +127,7 @@ cy_isa_attach(device_t dev) } irq_rid = 0; - irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul, + irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid, RF_SHAREABLE | RF_ACTIVE); if (irq_res == NULL) { device_printf(dev, "interrupt resource allocation failed\n"); Modified: head/sys/dev/cy/cy_pci.c ============================================================================== --- head/sys/dev/cy/cy_pci.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/cy/cy_pci.c Fri Feb 19 03:37:56 2016 (r295790) @@ -114,8 +114,8 @@ cy_pci_attach(dev) mem_res = NULL; ioport_rid = CY_PCI_BASE_ADDR1; - ioport_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &ioport_rid, - 0ul, ~0ul, 0ul, RF_ACTIVE); + ioport_res = bus_alloc_resource_(dev, SYS_RES_IOPORT, &ioport_rid, + RF_ACTIVE); if (ioport_res == NULL) { device_printf(dev, "ioport resource allocation failed\n"); goto fail; @@ -123,8 +123,8 @@ cy_pci_attach(dev) ioport = rman_get_start(ioport_res); mem_rid = CY_PCI_BASE_ADDR2; - mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, - 0ul, ~0ul, 0ul, RF_ACTIVE); + mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid, + RF_ACTIVE); if (mem_res == NULL) { device_printf(dev, "memory resource allocation failed\n"); goto fail; @@ -138,7 +138,7 @@ cy_pci_attach(dev) } irq_rid = 0; - irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul, + irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid, RF_SHAREABLE | RF_ACTIVE); if (irq_res == NULL) { device_printf(dev, "interrupt resource allocation failed\n"); Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/ed/if_ed_pccard.c Fri Feb 19 03:37:56 2016 (r295790) @@ -509,8 +509,8 @@ ed_pccard_attach(device_t dev) } if (rman_get_size(sc->port_res) == ED_NOVELL_IO_PORTS / 2) { port_rid++; - sc->port_res2 = bus_alloc_resource(dev, SYS_RES_IOPORT, - &port_rid, 0ul, ~0ul, 1, RF_ACTIVE); + sc->port_res2 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &port_rid, RF_ACTIVE); if (sc->port_res2 == NULL || rman_get_size(sc->port_res2) != ED_NOVELL_IO_PORTS / 2) { error = ENXIO; Modified: head/sys/dev/fb/s3_pci.c ============================================================================== --- head/sys/dev/fb/s3_pci.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/fb/s3_pci.c Fri Feb 19 03:37:56 2016 (r295790) @@ -478,8 +478,8 @@ s3pci_attach(device_t dev) /* Allocate resources */ rid = 0; - if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, 0, RF_ACTIVE | RF_SHAREABLE))) { + if (!(sc->port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE))) { printf("%s: port resource allocation failed!\n", __func__); goto error; } @@ -487,8 +487,8 @@ s3pci_attach(device_t dev) sc->sh = rman_get_bushandle(sc->port_res); rid = 1; - if (!(sc->enh_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, 0, RF_ACTIVE | RF_SHAREABLE))) { + if (!(sc->enh_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE))) { printf("%s: enhanced port resource allocation failed!\n", __func__); goto error; Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/fdc/fdc_pccard.c Fri Feb 19 03:37:56 2016 (r295790) @@ -56,8 +56,7 @@ fdc_pccard_alloc_resources(device_t dev, int rid, i; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, 1, - RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "cannot alloc I/O port range\n"); return (ENXIO); Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 19 03:37:56 2016 (r295790) @@ -1260,8 +1260,8 @@ static void hpt_final_init(void *dummy) for (hba = vbus_ext->hba_list; hba; hba = hba->next) { int rid = 0; - if ((hba->irq_res = bus_alloc_resource(hba->pcidev, - SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) + if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { os_printk("can't allocate interrupt"); return ; Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/hptiop/hptiop.c Fri Feb 19 03:37:56 2016 (r295790) @@ -2052,8 +2052,8 @@ static int hptiop_attach(device_t dev) xpt_action((union ccb *)&ccb); rid = 0; - if ((hba->irq_res = bus_alloc_resource(hba->pcidev, SYS_RES_IRQ, - &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "allocate irq failed!\n"); goto free_hba_path; } Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/hptmv/entry.c Fri Feb 19 03:37:56 2016 (r295790) @@ -1990,7 +1990,7 @@ hpt_attach(device_t dev) return rid; rid = 0; - if ((pAdapter->hpt_irq = bus_alloc_resource(pAdapter->hpt_dev, SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) + if ((pAdapter->hpt_irq = bus_alloc_resource_any(pAdapter->hpt_dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { hpt_printk(("can't allocate interrupt\n")); return(ENXIO); Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 19 03:37:56 2016 (r295790) @@ -1445,8 +1445,8 @@ static void hpt_final_init(void *dummy) for (hba = vbus_ext->hba_list; hba; hba = hba->next) { int rid = 0; - if ((hba->irq_res = bus_alloc_resource(hba->pcidev, - SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) + if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { os_printk("can't allocate interrupt"); return ; Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 19 03:37:56 2016 (r295790) @@ -1093,8 +1093,8 @@ static void hpt_final_init(void *dummy) for (hba = vbus_ext->hba_list; hba; hba = hba->next) { int rid = 0; - if ((hba->irq_res = bus_alloc_resource(hba->pcidev, - SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) + if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { os_printk("can't allocate interrupt"); return ; Modified: head/sys/dev/isci/isci.c ============================================================================== --- head/sys/dev/isci/isci.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/isci/isci.c Fri Feb 19 03:37:56 2016 (r295790) @@ -138,8 +138,8 @@ isci_allocate_pci_memory(struct isci_sof struct ISCI_PCI_BAR *pci_bar = &isci->pci_bar[i]; pci_bar->resource_id = PCIR_BAR(i*2); - pci_bar->resource = bus_alloc_resource(isci->device, - SYS_RES_MEMORY, &pci_bar->resource_id, 0, ~0, 1, + pci_bar->resource = bus_alloc_resource_any(isci->device, + SYS_RES_MEMORY, &pci_bar->resource_id, RF_ACTIVE); if(pci_bar->resource == NULL) Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/ixgb/if_ixgb.c Fri Feb 19 03:37:56 2016 (r295790) @@ -1243,8 +1243,8 @@ ixgb_allocate_pci_resources(struct adapt device_t dev = adapter->dev; rid = IXGB_MMBA; - adapter->res_memory = bus_alloc_resource(dev, SYS_RES_MEMORY, - &rid, 0, ~0, 1, + adapter->res_memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); if (!(adapter->res_memory)) { device_printf(dev, "Unable to allocate bus resource: memory\n"); @@ -1257,9 +1257,9 @@ ixgb_allocate_pci_resources(struct adapt adapter->hw.hw_addr = (uint8_t *) & adapter->osdep.mem_bus_space_handle; rid = 0x0; - adapter->res_interrupt = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + adapter->res_interrupt = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, + RF_SHAREABLE | RF_ACTIVE); if (!(adapter->res_interrupt)) { device_printf(dev, "Unable to allocate bus resource: interrupt\n"); Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/lmc/if_lmc.c Fri Feb 19 03:37:56 2016 (r295790) @@ -4510,8 +4510,8 @@ fbsd_attach(device_t dev) sc->csr_res_id = TLP_CBMA; sc->csr_res_type = SYS_RES_MEMORY; # endif - sc->csr_res = bus_alloc_resource(dev, sc->csr_res_type, &sc->csr_res_id, - 0, ~0, 1, RF_ACTIVE); + sc->csr_res = bus_alloc_resource_any(dev, sc->csr_res_type, &sc->csr_res_id, + RF_ACTIVE); if (sc->csr_res == NULL) { printf("%s: bus_alloc_resource(csr) failed.\n", NAME_UNIT); @@ -4522,8 +4522,8 @@ fbsd_attach(device_t dev) /* Allocate PCI interrupt resources for the card. */ sc->irq_res_id = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_res_id, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_res_id, + RF_ACTIVE | RF_SHAREABLE); if (sc->irq_res == NULL) { printf("%s: bus_alloc_resource(irq) failed.\n", NAME_UNIT); Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/mrsas/mrsas.c Fri Feb 19 03:37:56 2016 (r295790) @@ -833,8 +833,8 @@ mrsas_attach(device_t dev) bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ - if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE)) + if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &(sc->reg_res_id), RF_ACTIVE)) == NULL) { device_printf(dev, "Cannot allocate PCI registers\n"); goto attach_fail; Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 19 03:37:56 2016 (r295790) @@ -4661,8 +4661,8 @@ mxge_add_single_irq(mxge_softc_t *sc) rid = 0; sc->legacy_irq = 1; } - sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0, - 1, RF_SHAREABLE | RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(sc->dev, "could not alloc interrupt\n"); return ENXIO; @@ -4813,8 +4813,8 @@ mxge_attach(device_t dev) /* Map the board into the kernel */ rid = PCIR_BARS; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, - ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->mem_res == NULL) { device_printf(dev, "could not map memory\n"); err = ENXIO; Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/nvme/nvme_ctrlr.c Fri Feb 19 03:37:56 2016 (r295790) @@ -52,8 +52,8 @@ nvme_ctrlr_allocate_bar(struct nvme_cont ctrlr->resource_id = PCIR_BAR(0); - ctrlr->resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY, - &ctrlr->resource_id, 0, ~0, 1, RF_ACTIVE); + ctrlr->resource = bus_alloc_resource_any(ctrlr->dev, SYS_RES_MEMORY, + &ctrlr->resource_id, RF_ACTIVE); if(ctrlr->resource == NULL) { nvme_printf(ctrlr, "unable to allocate pci resource\n"); @@ -72,8 +72,8 @@ nvme_ctrlr_allocate_bar(struct nvme_cont * bus_alloc_resource() will just return NULL which is OK. */ ctrlr->bar4_resource_id = PCIR_BAR(4); - ctrlr->bar4_resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY, - &ctrlr->bar4_resource_id, 0, ~0, 1, RF_ACTIVE); + ctrlr->bar4_resource = bus_alloc_resource_any(ctrlr->dev, SYS_RES_MEMORY, + &ctrlr->bar4_resource_id, RF_ACTIVE); return (0); } Modified: head/sys/dev/quicc/quicc_core.c ============================================================================== --- head/sys/dev/quicc/quicc_core.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/quicc/quicc_core.c Fri Feb 19 03:37:56 2016 (r295790) @@ -110,8 +110,8 @@ quicc_bfe_attach(device_t dev) * Re-allocate. We expect that the softc contains the information * collected by quicc_bfe_probe() intact. */ - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid, - 0, ~0, 0, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid, + RF_ACTIVE); if (sc->sc_rres == NULL) return (ENXIO); @@ -228,13 +228,13 @@ quicc_bfe_probe(device_t dev, u_int cloc sc->sc_rrid = 0; sc->sc_rtype = SYS_RES_MEMORY; - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid, - 0, ~0, 0, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid, + RF_ACTIVE); if (sc->sc_rres == NULL) { sc->sc_rrid = 0; sc->sc_rtype = SYS_RES_IOPORT; - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, - &sc->sc_rrid, 0, ~0, 0, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, + &sc->sc_rrid, RF_ACTIVE); if (sc->sc_rres == NULL) return (ENXIO); } Modified: head/sys/dev/sound/pci/envy24.c ============================================================================== --- head/sys/dev/sound/pci/envy24.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/sound/pci/envy24.c Fri Feb 19 03:37:56 2016 (r295790) @@ -2482,17 +2482,17 @@ envy24_alloc_resource(struct sc_info *sc { /* allocate I/O port resource */ sc->csid = PCIR_CCS; - sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->csid, 0, ~0, 1, RF_ACTIVE); + sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->csid, RF_ACTIVE); sc->ddmaid = PCIR_DDMA; - sc->ddma = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->ddmaid, 0, ~0, 1, RF_ACTIVE); + sc->ddma = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->ddmaid, RF_ACTIVE); sc->dsid = PCIR_DS; - sc->ds = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->dsid, 0, ~0, 1, RF_ACTIVE); + sc->ds = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->dsid, RF_ACTIVE); sc->mtid = PCIR_MT; - sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->mtid, 0, ~0, 1, RF_ACTIVE); + sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->mtid, RF_ACTIVE); if (!sc->cs || !sc->ddma || !sc->ds || !sc->mt) { device_printf(sc->dev, "unable to map IO port space\n"); return ENXIO; @@ -2516,8 +2516,8 @@ envy24_alloc_resource(struct sc_info *sc /* allocate interrupt resource */ sc->irqid = 0; - sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24_intr, sc, &sc->ih)) { device_printf(sc->dev, "unable to map interrupt\n"); Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/sound/pci/envy24ht.c Fri Feb 19 03:37:56 2016 (r295790) @@ -2400,11 +2400,11 @@ envy24ht_alloc_resource(struct sc_info * { /* allocate I/O port resource */ sc->csid = PCIR_CCS; - sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->csid, 0, ~0, 1, RF_ACTIVE); + sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->csid, RF_ACTIVE); sc->mtid = ENVY24HT_PCIR_MT; - sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, - &sc->mtid, 0, ~0, 1, RF_ACTIVE); + sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT, + &sc->mtid, RF_ACTIVE); if (!sc->cs || !sc->mt) { device_printf(sc->dev, "unable to map IO port space\n"); return ENXIO; @@ -2422,8 +2422,8 @@ envy24ht_alloc_resource(struct sc_info * /* allocate interrupt resource */ sc->irqid = 0; - sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24ht_intr, sc, &sc->ih)) { device_printf(sc->dev, "unable to map interrupt\n"); Modified: head/sys/dev/sound/pci/hdspe.c ============================================================================== --- head/sys/dev/sound/pci/hdspe.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/sound/pci/hdspe.c Fri Feb 19 03:37:56 2016 (r295790) @@ -128,8 +128,8 @@ hdspe_alloc_resources(struct sc_info *sc /* Allocate resource. */ sc->csid = PCIR_BAR(0); - sc->cs = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, - &sc->csid, 0, ~0, 1, RF_ACTIVE); + sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, + &sc->csid, RF_ACTIVE); if (!sc->cs) { device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n"); @@ -141,8 +141,8 @@ hdspe_alloc_resources(struct sc_info *sc /* Allocate interrupt resource. */ sc->irqid = 0; - sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, Modified: head/sys/dev/sound/pci/vibes.c ============================================================================== --- head/sys/dev/sound/pci/vibes.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/sound/pci/vibes.c Fri Feb 19 03:37:56 2016 (r295790) @@ -759,8 +759,8 @@ sv_attach(device_t dev) { /* Register IRQ handler */ sc->irqid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, sv_intr, sc, &sc->ih)) { device_printf(dev, "sv_attach: Unable to map interrupt\n"); Modified: head/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- head/sys/dev/twa/tw_osl_freebsd.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Feb 19 03:37:56 2016 (r295790) @@ -338,8 +338,8 @@ twa_attach(device_t dev) return(error); } sc->reg_res_id = PCIR_BARS + bar0_offset; - if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE)) + if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &(sc->reg_res_id), RF_ACTIVE)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, @@ -355,8 +355,8 @@ twa_attach(device_t dev) /* Allocate and register our interrupt. */ sc->irq_res_id = 0; - if ((sc->irq_res = bus_alloc_resource(sc->bus_dev, SYS_RES_IRQ, - &(sc->irq_res_id), 0, ~0, 1, + if ((sc->irq_res = bus_alloc_resource_any(sc->bus_dev, SYS_RES_IRQ, + &(sc->irq_res_id), RF_SHAREABLE | RF_ACTIVE)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/dev/tws/tws.c Fri Feb 19 03:37:56 2016 (r295790) @@ -245,8 +245,8 @@ tws_attach(device_t dev) /* allocate MMIO register space */ sc->reg_res_id = TWS_PCI_BAR1; /* BAR1 offset */ - if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE)) + if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &(sc->reg_res_id), RF_ACTIVE)) == NULL) { tws_log(sc, ALLOC_MEMORY_RES); goto attach_fail_1; Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/isa/isa_common.c Fri Feb 19 03:37:56 2016 (r295790) @@ -150,8 +150,8 @@ isa_find_memory(device_t child, struct i start += MAX(align, 1)) { bus_set_resource(child, SYS_RES_MEMORY, i, start, size); - res[i] = bus_alloc_resource(child, - SYS_RES_MEMORY, &i, 0, ~0, 1, + res[i] = bus_alloc_resource_any(child, + SYS_RES_MEMORY, &i, rman_make_alignment_flags(align) /* !RF_ACTIVE */); if (res[i]) { result->ic_mem[i].ir_start = start; @@ -224,8 +224,8 @@ isa_find_port(device_t child, struct isa start += align) { bus_set_resource(child, SYS_RES_IOPORT, i, start, size); - res[i] = bus_alloc_resource(child, - SYS_RES_IOPORT, &i, 0, ~0, 1, + res[i] = bus_alloc_resource_any(child, + SYS_RES_IOPORT, &i, rman_make_alignment_flags(align) /* !RF_ACTIVE */); if (res[i]) { result->ic_port[i].ir_start = start; Modified: head/sys/isa/vga_isa.c ============================================================================== --- head/sys/isa/vga_isa.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/isa/vga_isa.c Fri Feb 19 03:37:56 2016 (r295790) @@ -195,11 +195,11 @@ isavga_attach(device_t dev) sc = device_get_softc(dev); rid = 0; - bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); + bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE); rid = 0; - bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); error = vga_attach_unit(unit, sc, device_get_flags(dev)); if (error) Modified: head/sys/mips/sibyte/ata_zbbus.c ============================================================================== --- head/sys/mips/sibyte/ata_zbbus.c Fri Feb 19 02:03:14 2016 (r295789) +++ head/sys/mips/sibyte/ata_zbbus.c Fri Feb 19 03:37:56 2016 (r295790) @@ -67,7 +67,7 @@ ata_zbbus_attach(device_t dev) ch->attached = 1; rid = 0; - io = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (io == NULL) return (ENXIO); From owner-svn-src-head@freebsd.org Fri Feb 19 04:53:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CD7EAAD3A8; Fri, 19 Feb 2016 04:53:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25F491554; Fri, 19 Feb 2016 04:53:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id g203so98008866iof.2; Thu, 18 Feb 2016 20:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=aCJ9XkfLo6Ktt+mxerRMieEmE/itAhicsdml3vZrfco=; b=xBnV8tPNWCsLUY7vFeifJLKiqEKzy9YL8Cq2DMRMSw++eVMvrw3a/F4OEMT6P6avf+ Ln5YsvS0g2IQVNX52ougMyMnzMdPtY4B2SHCun17ciifaPh4rQG2RpHUUVBcQyXgtIKN 0kR8NxctfrV9FJg6XbV06/D7XYNYyzwksbJ/yFoseCVZissKPcBzzcy3NuW5Q2nI8T1M Kf8pQmtXnoBDNNXGVOD8tm5h0ELsS59C7rmRuFAhQQRkiUNCif+rxglnMk822a1iP5mA LHQmOS4tmxsoD74y3KuEzUKxuIYoLQOhPxvvTucfBNBtWPaSCkDi/hpgKShXBeJaEYdk moNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aCJ9XkfLo6Ktt+mxerRMieEmE/itAhicsdml3vZrfco=; b=SiZ6gMGCIUmjj8E+ky14xxJ7ufte4hjSD0CGk2/gOt2oBoAvu8ck19Ug5Zofr0QYMr z+TLGumIRPuYXg4kWN8MNanCJia3kGtffbIlLlr9ywVxY3ajiZ1Tgq8WxzXm6ciRhsZT wkWAlpv0Z7wlQlD0vdWBTi+ArLSqgC6XlgzFoeJFSboj0LQfl3smRwRWSsdQMnZFfJ05 gA4HVHOfo3DXwF3YP+0VUFECqHdINhthBg1MG1Lu4OxiZirqR2f6GT5AHS171ATyZagZ bdavQ7McJPz+A7Z54PjYLOofVEDnJZC7um1SIFsqH+0+/1Io3Yql7cA3XV+ryJEpdJi7 Uo5w== X-Gm-Message-State: AG10YOT0cuOkySFOQcYsscsOCEbjdaX/y4CGa/2ojyKvvnKGrAN0u/wKkEldQpACjUrMemAlGfMS2ifUQ4FDAw== MIME-Version: 1.0 X-Received: by 10.107.162.144 with SMTP id l138mr12039940ioe.123.1455857600409; Thu, 18 Feb 2016 20:53:20 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Thu, 18 Feb 2016 20:53:20 -0800 (PST) In-Reply-To: References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 20:53:20 -0800 X-Google-Sender-Auth: R08Vv40rBVRj6x7cu7YEVpRbTDc Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Adrian Chadd To: Maxim Sobolev Cc: Bryan Drewery , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 04:53:21 -0000 It passed the "it's working code and it's immediately useful" filter. I'd love to see them both unified somehow. I really would! -a On 18 February 2016 at 17:28, Maxim Sobolev wrote: > Sigh, I don't now how it managed to sleep through usually tight FreeBSD > peer-review process. It would be interesting to hear some comments from @ray > and @adrian, perhaps there were some reasons for it being done this way, > although I cannot see any in a hindsight. > > I am just in the middle of rather substantial overhaul of both kernel and > userland part here: > > https://reviews.freebsd.org/D5333 > > And once that committed it will take them apart again. I've also spend quite > lot of time testing my change set, which would with very little effort have > covered both formats had I started with unified code base. :( > > I also plan on making further improvement into kernel module, as it is right > now both g_uzip and g_uncompress basically piggyback single "g_up" thread, > so you cannot use multiple cores even for different instances, let alone one > instance being accessed by multiple readers. And it also can delay other > unrelated I/O requests by maxing out CPU time slice available for the g_up. > > On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery wrote: >> >> On 2/18/2016 3:57 PM, Maxim Sobolev wrote: >> > Aleksandr, Adrian, >> > >> > I know it's 3 years later, but I really don't know why it's been done >> > this way. Take a GEOM module and associated usr.bin utility, copy it >> > verbatim add few lines of code and re-add that as a new module seems >> > like just laziness and attempt to avoid doing extra work on making >> > unified code. The same goes for the mkulzma, which is almost 1:1 copy of >> > the mkuzip. Now people are merging back and forth and I've just spent >> > few days testing some rather major rework of geom_uzip / mkuzip code not >> > even realizing that there is its evil twin in the tree. :( >> >> r283104 is an example of one of these problems. It was a catch-up of >> uzip's r268986 done almost a year before. I did comparisons before using >> uzip last summer and ran across that one. >> >> > >> > https://reviews.freebsd.org/D5333 >> > >> > I suggest functionality from both geom_uncompress / mkulzma are folded >> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked >> > afterwards. >> > >> > Thanks! >> > >> > >> > >> > Author: ray >> > Date: Wed Jan 4 23:39:11 2012 >> > New Revision: 229537 >> > URL: http://svn.freebsd.org/changeset/base/229537 >> > Log: >> > GEOM_UNCOMPRESS module, can be used with uzip images and with new >> > ulzma images. >> > Approved by: adrian (mentor) >> > Added: >> > head/sys/geom/uncompress/ >> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) >> > head/sys/modules/geom/geom_uncompress/ >> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props >> > changed) >> > Modified: >> > head/sys/conf/files >> > head/sys/conf/options >> > >> > >> >> >> -- >> Regards, >> Bryan Drewery >> > > > > -- > Maksym Sobolyev > Sippy Software, Inc. > Internet Telephony (VoIP) Experts > Tel (Canada): +1-778-783-0474 > Tel (Toll-Free): +1-855-747-7779 > Fax: +1-866-857-6942 > Web: http://www.sippysoft.com > MSN: sales@sippysoft.com > Skype: SippySoft From owner-svn-src-head@freebsd.org Fri Feb 19 05:02:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18266AAD75D; Fri, 19 Feb 2016 05:02:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C51D71AE4; Fri, 19 Feb 2016 05:02:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J52Hc1050293; Fri, 19 Feb 2016 05:02:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J52HaP050292; Fri, 19 Feb 2016 05:02:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602190502.u1J52HaP050292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 19 Feb 2016 05:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295791 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:02:19 -0000 Author: adrian Date: Fri Feb 19 05:02:17 2016 New Revision: 295791 URL: https://svnweb.freebsd.org/changeset/base/295791 Log: document some ACPI related sysctls. Submitted by: Oliver Pinter Sponsored by: HardenedBSD Differential Revision: https://reviews.freebsd.org/D5263 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Feb 19 03:37:56 2016 (r295790) +++ head/sys/dev/acpica/acpi.c Fri Feb 19 05:02:17 2016 (r295791) @@ -558,16 +558,20 @@ acpi_attach(device_t dev) device_get_name(dev), CTLFLAG_RD, 0, ""); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "supported_sleep_state", CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, acpi_supported_sleep_state_sysctl, "A", ""); + 0, 0, acpi_supported_sleep_state_sysctl, "A", + "List supported ACPI sleep states."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "power_button_state", CTLTYPE_STRING | CTLFLAG_RW, - &sc->acpi_power_button_sx, 0, acpi_sleep_state_sysctl, "A", ""); + &sc->acpi_power_button_sx, 0, acpi_sleep_state_sysctl, "A", + "Power button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_button_state", CTLTYPE_STRING | CTLFLAG_RW, - &sc->acpi_sleep_button_sx, 0, acpi_sleep_state_sysctl, "A", ""); + &sc->acpi_sleep_button_sx, 0, acpi_sleep_state_sysctl, "A", + "Sleep button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "lid_switch_state", CTLTYPE_STRING | CTLFLAG_RW, - &sc->acpi_lid_switch_sx, 0, acpi_sleep_state_sysctl, "A", ""); + &sc->acpi_lid_switch_sx, 0, acpi_sleep_state_sysctl, "A", + "Lid ACPI sleep state. Set to S3 if you want to suspend your laptop when close the Lid."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "standby_state", CTLTYPE_STRING | CTLFLAG_RW, &sc->acpi_standby_sx, 0, acpi_sleep_state_sysctl, "A", ""); From owner-svn-src-head@freebsd.org Fri Feb 19 05:03:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A92E1AAD801; Fri, 19 Feb 2016 05:03:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D87B1CD9; Fri, 19 Feb 2016 05:03:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J53Hoh050980; Fri, 19 Feb 2016 05:03:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J53HY2050979; Fri, 19 Feb 2016 05:03:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602190503.u1J53HY2050979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Feb 2016 05:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295792 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:03:18 -0000 Author: sephe Date: Fri Feb 19 05:03:17 2016 New Revision: 295792 URL: https://svnweb.freebsd.org/changeset/base/295792 Log: hyperv/hn: Add option to bind TX taskqueues to the specified CPU It will be used to help tracking host side transmission ring selection issue; and it will be turned on by default, once we have concrete result. Reviewed by: adrian, Jun Su Approved by: adrian (mento) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5316 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:02:17 2016 (r295791) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:03:17 2016 (r295792) @@ -269,6 +269,10 @@ static int hn_use_txdesc_bufring = 1; SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); +static int hn_bind_tx_taskq = -1; +SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, + &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); + /* * Forward declarations */ @@ -383,8 +387,20 @@ netvsc_attach(device_t dev) if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); + if (hn_bind_tx_taskq >= 0) { + int cpu = hn_bind_tx_taskq; + cpuset_t cpu_set; + + if (cpu > mp_ncpus - 1) + cpu = mp_ncpus - 1; + CPU_SETOF(cpu, &cpu_set); + taskqueue_start_threads_cpuset(&sc->hn_tx_taskq, 1, + PI_NET, &cpu_set, "%s tx", + device_get_nameunit(dev)); + } else { + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, + "%s tx", device_get_nameunit(dev)); + } } else { sc->hn_tx_taskq = hn_tx_taskq; } @@ -2409,7 +2425,18 @@ hn_tx_taskq_create(void *arg __unused) hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &hn_tx_taskq); - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); + if (hn_bind_tx_taskq >= 0) { + int cpu = hn_bind_tx_taskq; + cpuset_t cpu_set; + + if (cpu > mp_ncpus - 1) + cpu = mp_ncpus - 1; + CPU_SETOF(cpu, &cpu_set); + taskqueue_start_threads_cpuset(&hn_tx_taskq, 1, PI_NET, + &cpu_set, "hn tx"); + } else { + taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); + } } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST, hn_tx_taskq_create, NULL); From owner-svn-src-head@freebsd.org Fri Feb 19 05:08:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF5ACAADAE3; Fri, 19 Feb 2016 05:08:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C032B1FB3; Fri, 19 Feb 2016 05:08:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J58iB3051192; Fri, 19 Feb 2016 05:08:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J58ivf051191; Fri, 19 Feb 2016 05:08:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602190508.u1J58ivf051191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Feb 2016 05:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295793 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:08:46 -0000 Author: sephe Date: Fri Feb 19 05:08:44 2016 New Revision: 295793 URL: https://svnweb.freebsd.org/changeset/base/295793 Log: hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012) Tested on Windows Server 2012. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5317 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:03:17 2016 (r295792) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:08:44 2016 (r295793) @@ -176,7 +176,7 @@ struct hn_txdesc { * later. UDP checksum offloading doesn't work on earlier * Windows releases. */ -#define HN_CSUM_ASSIST_WIN8 (CSUM_TCP) +#define HN_CSUM_ASSIST_WIN8 (CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) From owner-svn-src-head@freebsd.org Fri Feb 19 05:13:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F78FAADE95; Fri, 19 Feb 2016 05:13:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4318160B; Fri, 19 Feb 2016 05:13:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J5DujA053975; Fri, 19 Feb 2016 05:13:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J5Dups053974; Fri, 19 Feb 2016 05:13:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602190513.u1J5Dups053974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Feb 2016 05:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295794 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:13:58 -0000 Author: sephe Date: Fri Feb 19 05:13:56 2016 New Revision: 295794 URL: https://svnweb.freebsd.org/changeset/base/295794 Log: hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5318 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:08:44 2016 (r295793) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 19 05:13:56 2016 (r295794) @@ -2276,6 +2276,11 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx bus_dma_tag_destroy(txr->hn_tx_data_dtag); if (txr->hn_tx_rndis_dtag != NULL) bus_dma_tag_destroy(txr->hn_tx_rndis_dtag); + +#ifdef HN_USE_TXDESC_BUFRING + buf_ring_free(txr->hn_txdesc_br, M_NETVSC); +#endif + free(txr->hn_txdesc, M_NETVSC); txr->hn_txdesc = NULL; From owner-svn-src-head@freebsd.org Fri Feb 19 05:20:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45418AAD1F4 for ; Fri, 19 Feb 2016 05:20:50 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D213D1BAF for ; Fri, 19 Feb 2016 05:20:49 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x230.google.com with SMTP id a4so54998538wme.1 for ; Thu, 18 Feb 2016 21:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=t5FmtK/MdMEIGqUW5Wq7++shrLQOxc7vGyaFOTgNJ6c=; b=ujJN7q+VmsjRrgBrx7efxePBdjpBTktXLXPWqqObQyz16oaQwVW/mARtMFaqagnwSn 7uzjnFXArsZOxLufMiZ5DrPHtSFwg99s3OUeVqu7DVOYZYCuYYsl33Z+s86PclO33NTz J736tOnoZwnfox+XiNnB0Uq2FCWaxmOrBuYSMH3rWdqJHX/t9M62nBcTsvnod6Ge09z4 fk2DRqQMUCXjv4UzQG7xY9S9M1aTpvnGL0ipbzRgPt85UbpGxFe3ucG/Ac3g3NUfsei1 b5OcraBovoqZ/uxJl9HUAFaYN7C2jYJYSMLwGTmNVg14KPbd8Kh32QswX4odKtvhACIr SAlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=t5FmtK/MdMEIGqUW5Wq7++shrLQOxc7vGyaFOTgNJ6c=; b=MI1JjVdrwET7eT7z/L8ZzcGJSNNBB85jO6gTybpSHEeA1RlN8L8DYn1AFyKqsTHzCx TVHKnP1IKvRQvspyNTF5qNBdAml4nUvPIZ46LCf7nbPclmaCEKVneNjPEKuF5dePtxQ1 +FhuneW14dXgGx15Slb3wSVRL5/8kE1lSQW821eoE0kzMxFPftqhpFsCPpaAtVV1EGHP QlTjO7d06Bab2/dmzOTJoaMMj0pKBJpmfwwVw6qKEMmChyy+d+9mh+V1gPxUDoLdb+Tk Rh36RHP+Go+FiDT4mBtqbM+o3LmYnUCB6V7WjZ9wPbxx7huT9jJR+RtxjqKOyGw0fXrT 6MQw== X-Gm-Message-State: AG10YOQh0ZpDT/ae8TMwxa/8vnwiI7UCH+my56MuxX0uAgwZuIt9bohqWimx1LQNijG4iiP/F96i8cSY7Ps2OUAZ MIME-Version: 1.0 X-Received: by 10.194.111.229 with SMTP id il5mr9529294wjb.82.1455859248346; Thu, 18 Feb 2016 21:20:48 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 21:20:48 -0800 (PST) In-Reply-To: References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 21:20:48 -0800 X-Google-Sender-Auth: BmoL5wVmds78Qv5mVSJMBseeoQg Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: Adrian Chadd Cc: Bryan Drewery , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:20:50 -0000 Well, what about "do it once, do it right" motto and ongoing code maintenance cost? Don't you think there should be a balance between those? Considering how similar the code really is what we've gained in "immediate availability" department we've already lost since in the time people spend doing cross merges between those two since 2011. Not even to mention time wasted by users of the feature dealing with bugs already fixed in the twin implementation and associated frustration. All that would be eliminated had this fork never happened. On Thu, Feb 18, 2016 at 8:53 PM, Adrian Chadd wrote: > It passed the "it's working code and it's immediately useful" filter. > > I'd love to see them both unified somehow. I really would! > > > -a > > > On 18 February 2016 at 17:28, Maxim Sobolev wrote: > > Sigh, I don't now how it managed to sleep through usually tight FreeBSD > > peer-review process. It would be interesting to hear some comments from > @ray > > and @adrian, perhaps there were some reasons for it being done this way, > > although I cannot see any in a hindsight. > > > > I am just in the middle of rather substantial overhaul of both kernel and > > userland part here: > > > > https://reviews.freebsd.org/D5333 > > > > And once that committed it will take them apart again. I've also spend > quite > > lot of time testing my change set, which would with very little effort > have > > covered both formats had I started with unified code base. :( > > > > I also plan on making further improvement into kernel module, as it is > right > > now both g_uzip and g_uncompress basically piggyback single "g_up" > thread, > > so you cannot use multiple cores even for different instances, let alone > one > > instance being accessed by multiple readers. And it also can delay other > > unrelated I/O requests by maxing out CPU time slice available for the > g_up. > > > > On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery > wrote: > >> > >> On 2/18/2016 3:57 PM, Maxim Sobolev wrote: > >> > Aleksandr, Adrian, > >> > > >> > I know it's 3 years later, but I really don't know why it's been done > >> > this way. Take a GEOM module and associated usr.bin utility, copy it > >> > verbatim add few lines of code and re-add that as a new module seems > >> > like just laziness and attempt to avoid doing extra work on making > >> > unified code. The same goes for the mkulzma, which is almost 1:1 copy > of > >> > the mkuzip. Now people are merging back and forth and I've just spent > >> > few days testing some rather major rework of geom_uzip / mkuzip code > not > >> > even realizing that there is its evil twin in the tree. :( > >> > >> r283104 is an example of one of these problems. It was a catch-up of > >> uzip's r268986 done almost a year before. I did comparisons before using > >> uzip last summer and ran across that one. > >> > >> > > >> > https://reviews.freebsd.org/D5333 > >> > > >> > I suggest functionality from both geom_uncompress / mkulzma are folded > >> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are > nuked > >> > afterwards. > >> > > >> > Thanks! > >> > > >> > > >> > > >> > Author: ray > >> > Date: Wed Jan 4 23:39:11 2012 > >> > New Revision: 229537 > >> > URL: http://svn.freebsd.org/changeset/base/229537 > >> > Log: > >> > GEOM_UNCOMPRESS module, can be used with uzip images and with new > >> > ulzma images. > >> > Approved by: adrian (mentor) > >> > Added: > >> > head/sys/geom/uncompress/ > >> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) > >> > head/sys/modules/geom/geom_uncompress/ > >> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props > >> > changed) > >> > Modified: > >> > head/sys/conf/files > >> > head/sys/conf/options > >> > > >> > > >> > >> > >> -- > >> Regards, > >> Bryan Drewery > >> > > > > > > > > -- > > Maksym Sobolyev > > Sippy Software, Inc. > > Internet Telephony (VoIP) Experts > > Tel (Canada): +1-778-783-0474 > > Tel (Toll-Free): +1-855-747-7779 > > Fax: +1-866-857-6942 > > Web: http://www.sippysoft.com > > MSN: sales@sippysoft.com > > Skype: SippySoft > From owner-svn-src-head@freebsd.org Fri Feb 19 05:32:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 242B6AAD86F; Fri, 19 Feb 2016 05:32:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF5E211DF; Fri, 19 Feb 2016 05:32:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id g203so98693833iof.2; Thu, 18 Feb 2016 21:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=IaB4MlWZnBecGMv02+Cl6vnditF9opdmHRrBLVjMDbs=; b=FmI/+TGdQ8LhFtokkSTaYAB8qO7MgVPEPWRNj6fPAQszkIJFbyqEVQF44KDF5yXhGE Ox2hNX2EFLCEjG4kkDmkMrDV7P23Xe8SYIQbiPqUASUqt4ufdPGFg3zLTA+b3kRoyvef 4qt0igv/V7pe49NnNeLD4TbvSdYoI1IoghiaciIv6xYV5RJPiuPlWGSiIfVwf4nGP6pD OSSVLU8HWfWZx6N+OBhq7IbQRtUEK9k33yMtuMjGz3VGjF8/koJRnWW3B79jm3O9xwEC PltJtHuAXqRlaYrrBcVZn7ffHs89N/u7QsRg+lQZwbGJxvar6j0yeE+EFjB0PfrY/HGX e4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IaB4MlWZnBecGMv02+Cl6vnditF9opdmHRrBLVjMDbs=; b=j6VliUB/ElDg6qTgGGUv0vC4hY6N7879oilpe1vdjjnmLrwUZO3JEZ1KAIKJ3gl6S+ f4WDQleAZIGOiHogsgkQ/s49dTVA+qvksBtdiNuwhPrSL3XonrSaI5s/JfXs/sV7Zltq x7yF/SkvE4ltxezPCmHM6FaaeYxr3tTAl6Tv2eYDPDWEWQRRiIOPNaJklA2jLFl5cis7 03BJAq5p5SFitEZSGzUzmN8/ZDQosoiuSFtYCiE9k4/sl8FxC2XMrT+VhOukELbKAOyF 3FTzzKAMExYCPo/Y5V0W21aas0KgfdaTBWye3cvxUJycWCwHJRuL74jgd59ZLH29hZgY qUHg== X-Gm-Message-State: AG10YOSqZ83czIOCWUSksPppwbtRNnAIPa5yYoJP7cfwapUcyATDsd2Xwle3HX4xnTnNSA+PEYs2W0HuaCPwUQ== MIME-Version: 1.0 X-Received: by 10.107.162.144 with SMTP id l138mr12158133ioe.123.1455859924315; Thu, 18 Feb 2016 21:32:04 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Thu, 18 Feb 2016 21:32:04 -0800 (PST) In-Reply-To: References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 21:32:04 -0800 X-Google-Sender-Auth: PGR0uG4hd_BPK_6T5UowtwwADDA Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Adrian Chadd To: Maxim Sobolev Cc: Bryan Drewery , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:32:05 -0000 On 18 February 2016 at 21:20, Maxim Sobolev wrote: > Well, what about "do it once, do it right" motto and ongoing code > maintenance cost? Don't you think there should be a balance between those? > Considering how similar the code really is what we've gained in "immediate > availability" department we've already lost since in the time people spend > doing cross merges between those two since 2011. Not even to mention time > wasted by users of the feature dealing with bugs already fixed in the twin > implementation and associated frustration. All that would be eliminated had > this fork never happened. Sure. But someone has to do that, and I made a decision that it was better to commit /something/ than for everyone involved to run out of time and nothing to be committed. eg - a lot of ARM and MIPS work. So yes, I'd love to see it fixed. I mean, heck, I fix up other stuff and I completely forgot that this was still split. But geom_ulzma / geom_gzip actually got us a whole lot of MIPS (and maybe some ARM) users, so I believe it was worthwhile. Thanks, -adrian From owner-svn-src-head@freebsd.org Fri Feb 19 05:37:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C888DAADB51 for ; Fri, 19 Feb 2016 05:37:08 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76AC715BA for ; Fri, 19 Feb 2016 05:37:08 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x231.google.com with SMTP id b205so53642672wmb.1 for ; Thu, 18 Feb 2016 21:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=Kos7ewz6iG8bCIF30kNGqereIc6v4cKrK8YS6U71Co8=; b=fs1B53GJoJxtjrmdKnRbox1S3sV6YYSLBvcAxRjT9SBCXsVHh+elBdMt0U7F3tPttL qerNLpg/xhdx3g9ex/0ywnxzKOug3L2MfD16UXEgth+KsPQZcZqZKtlmQHckRDms4OaC icPG8jVg9kNUKLFjIfEiFixTRuylCPdJYhQJDUw4eiwtXVeN5bvu7fVN8Bk1O7dqDfSi Xu3Ka6G2q8DyRCW2stH87aEsZ6dDmIGuCg9pQBDBZwRnJ0wLclofcl4qKmMb+ij3CbzD xDWaiUuMK8NVfZuO9JddedWw6EqpYTLr1mSZyVTH2Cu7E2s17Sp02q2ze5UmVnPM4/5Z P0dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Kos7ewz6iG8bCIF30kNGqereIc6v4cKrK8YS6U71Co8=; b=gRgpIVYeroKZNlpy313bc4mN+GkZ+4TrbljzzbLgOcEUWmRwiHIMPgTCyx56figZFE quGLhzhmgsYe4ArZ2DGRq055y+dDPdHm2S1JdVo9ZFhvRTAwVO32XLQX7HsSwBYfr5sn DDnvag72deESpRbgLUVCe/8FmvHEK4XM4EmxpLVSBSSylwyRSdcFK4e2cA5OZn2dXuKJ 07S0OFHaLnB5FLJpYpBiH3cak+xRaPqCLfgo/soeBq3otAQx2V5HkexI6Yb0hungEhcr yen8BOVXWyYv1hxSmfs6w+sVMX/Dla6drEEqOx6z6qEOc9haDyUONnOrk0AvspxAmpfZ 0uRQ== X-Gm-Message-State: AG10YOQlyjdtMQKZZk9zHbeD3/gyPQdUIahNe51cqSVnI0vRZmFqNaULJMYl6PhzF7cTgJCKlsuay76fZXT8+1Cz MIME-Version: 1.0 X-Received: by 10.28.97.135 with SMTP id v129mr7180956wmb.90.1455860226859; Thu, 18 Feb 2016 21:37:06 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 21:37:06 -0800 (PST) In-Reply-To: References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 21:37:06 -0800 X-Google-Sender-Auth: 7cWa-0PwXZCPssRey5QE1BjVhAk Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: Adrian Chadd Cc: Bryan Drewery , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:37:09 -0000 Also in purely technical department, that fork should have been done using svn copy for all code, manpages etc, not svn add, so that we would keep all history associated with the code going back to 2004. This would also make it more prominent that the code is really very similar to anyone just reading svn logs. Right now we have two disjoint histories, so once we merge both into a single entity some of it would unavoidably get lost. Yes, it's all just my rant at this point, but perhaps there are some lessons to be learned from this incident. On Thu, Feb 18, 2016 at 9:20 PM, Maxim Sobolev wrote: > Well, what about "do it once, do it right" motto and ongoing code > maintenance cost? Don't you think there should be a balance between those? > Considering how similar the code really is what we've gained in "immediate > availability" department we've already lost since in the time people spend > doing cross merges between those two since 2011. Not even to mention time > wasted by users of the feature dealing with bugs already fixed in the twin > implementation and associated frustration. All that would be eliminated had > this fork never happened. > > On Thu, Feb 18, 2016 at 8:53 PM, Adrian Chadd wrote: > >> It passed the "it's working code and it's immediately useful" filter. >> >> I'd love to see them both unified somehow. I really would! >> >> >> -a >> >> >> On 18 February 2016 at 17:28, Maxim Sobolev >> wrote: >> > Sigh, I don't now how it managed to sleep through usually tight FreeBSD >> > peer-review process. It would be interesting to hear some comments from >> @ray >> > and @adrian, perhaps there were some reasons for it being done this way, >> > although I cannot see any in a hindsight. >> > >> > I am just in the middle of rather substantial overhaul of both kernel >> and >> > userland part here: >> > >> > https://reviews.freebsd.org/D5333 >> > >> > And once that committed it will take them apart again. I've also spend >> quite >> > lot of time testing my change set, which would with very little effort >> have >> > covered both formats had I started with unified code base. :( >> > >> > I also plan on making further improvement into kernel module, as it is >> right >> > now both g_uzip and g_uncompress basically piggyback single "g_up" >> thread, >> > so you cannot use multiple cores even for different instances, let >> alone one >> > instance being accessed by multiple readers. And it also can delay other >> > unrelated I/O requests by maxing out CPU time slice available for the >> g_up. >> > >> > On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery >> wrote: >> >> >> >> On 2/18/2016 3:57 PM, Maxim Sobolev wrote: >> >> > Aleksandr, Adrian, >> >> > >> >> > I know it's 3 years later, but I really don't know why it's been done >> >> > this way. Take a GEOM module and associated usr.bin utility, copy it >> >> > verbatim add few lines of code and re-add that as a new module seems >> >> > like just laziness and attempt to avoid doing extra work on making >> >> > unified code. The same goes for the mkulzma, which is almost 1:1 >> copy of >> >> > the mkuzip. Now people are merging back and forth and I've just spent >> >> > few days testing some rather major rework of geom_uzip / mkuzip code >> not >> >> > even realizing that there is its evil twin in the tree. :( >> >> >> >> r283104 is an example of one of these problems. It was a catch-up of >> >> uzip's r268986 done almost a year before. I did comparisons before >> using >> >> uzip last summer and ran across that one. >> >> >> >> > >> >> > https://reviews.freebsd.org/D5333 >> >> > >> >> > I suggest functionality from both geom_uncompress / mkulzma are >> folded >> >> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are >> nuked >> >> > afterwards. >> >> > >> >> > Thanks! >> >> > >> >> > >> >> > >> >> > Author: ray >> >> > Date: Wed Jan 4 23:39:11 2012 >> >> > New Revision: 229537 >> >> > URL: http://svn.freebsd.org/changeset/base/229537 >> >> > Log: >> >> > GEOM_UNCOMPRESS module, can be used with uzip images and with new >> >> > ulzma images. >> >> > Approved by: adrian (mentor) >> >> > Added: >> >> > head/sys/geom/uncompress/ >> >> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed) >> >> > head/sys/modules/geom/geom_uncompress/ >> >> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props >> >> > changed) >> >> > Modified: >> >> > head/sys/conf/files >> >> > head/sys/conf/options >> >> > >> >> > >> >> >> >> >> >> -- >> >> Regards, >> >> Bryan Drewery >> >> >> > >> > >> > >> > -- >> > Maksym Sobolyev >> > Sippy Software, Inc. >> > Internet Telephony (VoIP) Experts >> > Tel (Canada): +1-778-783-0474 >> > Tel (Toll-Free): +1-855-747-7779 >> > Fax: +1-866-857-6942 >> > Web: http://www.sippysoft.com >> > MSN: sales@sippysoft.com >> > Skype: SippySoft >> > > From owner-svn-src-head@freebsd.org Fri Feb 19 05:56:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF7D6AAC310 for ; Fri, 19 Feb 2016 05:56:37 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 861CE1E4B for ; Fri, 19 Feb 2016 05:56:37 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x232.google.com with SMTP id c200so59730786wme.0 for ; Thu, 18 Feb 2016 21:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=M+WGN6dqYmP7wcqKGlUroRN027AOz9DvHg7TuABcPdA=; b=Ox6dcdl9INQwG7l4a9Qm6ZmWnIixb0DdcIFWie6FXOlZ6KRChPAU/7rV9Se4rIIJN8 EdY0mtJpFDKGqwduj95YkdZKRc7tCk/I6TIvNYXsRnLZNNSMrEy3/Oeg5TFYQYICi7xI cC4YV7r/gU3Aj4yP0WO7rjzduF/oOHvoGNDFikXwAG3eD2wKlkWu3wzAFI7tnHGmFunX ms2Mr10CV8gsDrCMcRU/5i9/gcbrVQ4E96GooKh227KspCS5OdVDjzBTuvURfl4hMduy jH1bWELiwjK60sU1GeaWBrZxkFi9lYO4XgjbkxLe/h5z7tATC9acZa8HU0L2bm58MYrl 39fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=M+WGN6dqYmP7wcqKGlUroRN027AOz9DvHg7TuABcPdA=; b=kaJLY1tOZLjiIuQaPr0czf5N1ULTG8zCTTvKlsJ/eQ7z5tlNDR65czAWp9TNZlskNK 7jZ6dwB0rD0SuwN9ed8bB/qCHjKyV/ApgoVb4wsQpXKToLI/f8h3T7lrVAow/totMhTu B0QZD3V2i7NSq50Ljrl7Lyxf7+TpRm3wb/allA7cvAyH4shkgDUhDfJ96SXu7aGjNxbv QBRX5QnL6YMyba7UGgMV/CxiuRBOPl/JoRwuiZnYeHlxUMNhCZ5KkFdHx2G2/0bG3kFw zI/2IfkG3NrZA2DUp07ke/kXyWlmRv6dqiXiQU25cKasykUuKt47j4LZ0Kz5MruL3+BY /8RA== X-Gm-Message-State: AG10YORBn3GkNAmboyV7knS45pCmuDXUF6gy+UT4BGTv89MbuBav8I9VaeoE5TqXHBtzvosg99W86Ste0dd50g90 MIME-Version: 1.0 X-Received: by 10.194.60.44 with SMTP id e12mr10892116wjr.137.1455861396016; Thu, 18 Feb 2016 21:56:36 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 21:56:35 -0800 (PST) In-Reply-To: References: <56C66415.7040407@FreeBSD.org> Date: Thu, 18 Feb 2016 21:56:35 -0800 X-Google-Sender-Auth: j_MfNqnU6rZ5tZClUVbqGtUmclI Message-ID: Subject: Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress From: Maxim Sobolev To: Adrian Chadd Cc: Bryan Drewery , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:56:38 -0000 On Thu, Feb 18, 2016 at 9:32 PM, Adrian Chadd wrote: > Sure. But someone has to do that, and I made a decision that it was > better to commit /something/ than for everyone involved to run out of > time and nothing to be committed. > Well, arguably at the time of commit you had somebody who was at least somewhat motivated (i.e. ray@) to do it and you were in good position to request it's to be done before the commit is allowed to go through. None of which is probably true today, so we are stuck in this position with no real plan on how/when it's going to be resolved. > eg - a lot of ARM and MIPS work. > > So yes, I'd love to see it fixed. I mean, heck, I fix up other stuff > and I completely forgot that this was still split. But geom_ulzma / > geom_gzip actually got us a whole lot of MIPS (and maybe some ARM) > users, so I believe it was worthwhile. > That's fine and dandy but on the flip side it also means there are some users now to be distracted and possibly confused once things hopefully get straightened out and one of those goes away. I am pretty sure there are some build scripts that would need to be adjusted and kernel/boot configurations to be corrected by the said users and it's not a good thing. Have few of those myself, no reasons to believe I am unique. Anyway, I'll probably shut up now. From owner-svn-src-head@freebsd.org Fri Feb 19 05:59:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39116AAC46D; Fri, 19 Feb 2016 05:59:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1397A1FD4; Fri, 19 Feb 2016 05:59:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J5xdoG065666; Fri, 19 Feb 2016 05:59:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J5xc2B065659; Fri, 19 Feb 2016 05:59:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602190559.u1J5xc2B065659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 19 Feb 2016 05:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295795 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 05:59:40 -0000 Author: avos Date: Fri Feb 19 05:59:38 2016 New Revision: 295795 URL: https://svnweb.freebsd.org/changeset/base/295795 Log: net80211: add few missing subtype names. - Add definitions for Timing Advertisement and Control Wrapper frames. - Refresh ieee80211_mgt_subtype_name and ieee80211_ctl_subtype_name arrays. - Count Timing Advertisement frames as discarded management frames in all modes. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5331 Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211.h Fri Feb 19 05:59:38 2016 (r295795) @@ -129,6 +129,7 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 #define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 #define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 +#define IEEE80211_FC0_SUBTYPE_TIMING_ADV 0x60 #define IEEE80211_FC0_SUBTYPE_BEACON 0x80 #define IEEE80211_FC0_SUBTYPE_ATIM 0x90 #define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 @@ -137,6 +138,7 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_FC0_SUBTYPE_ACTION 0xd0 #define IEEE80211_FC0_SUBTYPE_ACTION_NOACK 0xe0 /* for TYPE_CTL */ +#define IEEE80211_FC0_SUBTYPE_CONTROL_WRAP 0x70 #define IEEE80211_FC0_SUBTYPE_BAR 0x80 #define IEEE80211_FC0_SUBTYPE_BA 0x90 #define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_adhoc.c Fri Feb 19 05:59:38 2016 (r295795) @@ -899,6 +899,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_ASSOC_RESP: case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_ATIM: case IEEE80211_FC0_SUBTYPE_DISASSOC: case IEEE80211_FC0_SUBTYPE_AUTH: @@ -941,6 +942,7 @@ ahdemo_recv_mgmt(struct ieee80211_node * case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: case IEEE80211_FC0_SUBTYPE_PROBE_REQ: case IEEE80211_FC0_SUBTYPE_PROBE_RESP: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_BEACON: case IEEE80211_FC0_SUBTYPE_ATIM: case IEEE80211_FC0_SUBTYPE_DISASSOC: Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_hostap.c Fri Feb 19 05:59:38 2016 (r295795) @@ -2226,6 +2226,7 @@ hostap_recv_mgmt(struct ieee80211_node * case IEEE80211_FC0_SUBTYPE_ASSOC_RESP: case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_ATIM: IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "not handled"); Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_mesh.c Fri Feb 19 05:59:38 2016 (r295795) @@ -2093,6 +2093,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni case IEEE80211_FC0_SUBTYPE_ASSOC_RESP: case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_ATIM: case IEEE80211_FC0_SUBTYPE_DISASSOC: case IEEE80211_FC0_SUBTYPE_AUTH: Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_proto.c Fri Feb 19 05:59:38 2016 (r295795) @@ -64,14 +64,14 @@ __FBSDID("$FreeBSD$"); const char *ieee80211_mgt_subtype_name[] = { "assoc_req", "assoc_resp", "reassoc_req", "reassoc_resp", - "probe_req", "probe_resp", "reserved#6", "reserved#7", + "probe_req", "probe_resp", "timing_adv", "reserved#7", "beacon", "atim", "disassoc", "auth", "deauth", "action", "action_noack", "reserved#15" }; const char *ieee80211_ctl_subtype_name[] = { "reserved#0", "reserved#1", "reserved#2", "reserved#3", - "reserved#3", "reserved#5", "reserved#6", "reserved#7", - "reserved#8", "reserved#9", "ps_poll", "rts", + "reserved#4", "reserved#5", "reserved#6", "control_wrap", + "bar", "ba", "ps_poll", "rts", "cts", "ack", "cf_end", "cf_end_ack" }; const char *ieee80211_opmode_name[IEEE80211_OPMODE_MAX] = { Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_sta.c Fri Feb 19 05:59:38 2016 (r295795) @@ -1851,6 +1851,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: case IEEE80211_FC0_SUBTYPE_PROBE_REQ: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_ATIM: IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "not handled"); Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Fri Feb 19 05:13:56 2016 (r295794) +++ head/sys/net80211/ieee80211_wds.c Fri Feb 19 05:59:38 2016 (r295795) @@ -782,6 +782,7 @@ wds_recv_mgmt(struct ieee80211_node *ni, case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: case IEEE80211_FC0_SUBTYPE_PROBE_REQ: case IEEE80211_FC0_SUBTYPE_PROBE_RESP: + case IEEE80211_FC0_SUBTYPE_TIMING_ADV: case IEEE80211_FC0_SUBTYPE_BEACON: case IEEE80211_FC0_SUBTYPE_ATIM: case IEEE80211_FC0_SUBTYPE_DISASSOC: From owner-svn-src-head@freebsd.org Fri Feb 19 06:12:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCB9AACB85 for ; Fri, 19 Feb 2016 06:12:57 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3DE317A0 for ; Fri, 19 Feb 2016 06:12:56 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x233.google.com with SMTP id g62so54817287wme.0 for ; Thu, 18 Feb 2016 22:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=m0xwitiG7BzDp40iyuM6B7AhbX2HZngdbWx1vcAGqq4=; b=ZJhIwDa8lecXVR7za67V/0ZbDrvG7bvJQGgkNWLwhNF+dOoSV+BBjY8n/xsK1SgoZ/ m5+1y1t2KeZ+eSTUeLi9t3KhTa9/fTRvddms+Ib7BYI9lJfVgf7ZOR76Mpl/eJ3B5OvM buc5c28NG9DSSQMYHNRx+qPk83yLuPgdrSRKHeLIddCgZm25EKeZFT+xLYkQLrQ22ADH bNyZrF1E0gO2e5ty59vYVYgghuvevxuE7sX+vnop0R4/l89uuFJZbYU68jRaloVp9GSF x0kFahUWi8ZMlfVlCZV1wCX/Ze7h0MiKrrg8dSQd/ufLRIP8Ki711kNutwu/NC5SfANc jyvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=m0xwitiG7BzDp40iyuM6B7AhbX2HZngdbWx1vcAGqq4=; b=aKFH5UyjlNu6zqGZBEc8i6X1PgATn/hVtBxSEaR1tf8RyxvsQu3Pj4zi4xASfac+j+ SeK+52secb9UTTro8qso3DRiy5xBNQOx8EGu7AGdCaozjbT0r62HZEkkSvZ77kuqAegq iiC9G1XVfI39C0VgTzAx8X1UFUEjIokOuraCbvzRavaaujmTj/MwjUUF1s1QHeomJ3z8 jyNppcQQLB4AUJJRgnlPFeA2IXxipXJzEgONMahrxaTqTpAXVu+y/WZMTZGyC8VyT/oo p67Tr1V2WdyzhvPVh4wp4SsxrNKHzkCTe1zPV/CGcaAFZtiL+ewwtb2uwKBpzRelCoEy oH7Q== X-Gm-Message-State: AG10YOR+xSZy6/TuSxF0aK0S387MhLpSFjgDlJBXXQpT48WoLNIHQhUsqW1X2vfCfX8aLWTITDf/VyQb3HZvG9qc MIME-Version: 1.0 X-Received: by 10.28.225.8 with SMTP id y8mr7636444wmg.94.1455862375314; Thu, 18 Feb 2016 22:12:55 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.218.12 with HTTP; Thu, 18 Feb 2016 22:12:55 -0800 (PST) In-Reply-To: <201602180844.u1I8iGTN082641@repo.freebsd.org> References: <201602180844.u1I8iGTN082641@repo.freebsd.org> Date: Thu, 18 Feb 2016 22:12:55 -0800 X-Google-Sender-Auth: E0ydCEq61P9m4kTu26d_3k-IoZc Message-ID: Subject: Re: svn: head/bin/dd From: Maxim Sobolev To: Thomas Quinot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 06:12:57 -0000 Thanks, Thomas. IMHO this is quite serious bug in one of the core utilities, so I suggest it gets faster MFC before 10.3 goes into beta stage on Feb 26. The old code in RELENG_10 is just plain broken anyway now, so it could not make it any worse. Thanks! On Thu, Feb 18, 2016 at 12:44 AM, Thomas Quinot wrote: > Author: thomas > Date: Thu Feb 18 08:44:16 2016 > New Revision: 295749 > URL: https://svnweb.freebsd.org/changeset/base/295749 > > Log: > Reorganize the handling all-zeroes terminal block in sparse mode > > The intent of the previous code in that case was to force > an explicit write, but the implementation was incorrect, and > as a result the write was never performed. This new implementation > instead uses ftruncate(2) to extend the file with a trailing hole. > > Also introduce regression tests for these cases. > > PR: 189284 > (original PR whose fix introduced this bug) > > PR: 207092 > > Differential Revision: D5248 > Reviewed by: sobomax,kib > MFC after: 2 weeks > > Added: > head/bin/dd/ref.obs_zeroes (contents, props changed) > Modified: > head/bin/dd/Makefile > head/bin/dd/dd.c > head/bin/dd/dd.h > head/bin/dd/gen.c > > Modified: head/bin/dd/Makefile > > ============================================================================== > --- head/bin/dd/Makefile Thu Feb 18 07:44:14 2016 (r295748) > +++ head/bin/dd/Makefile Thu Feb 18 08:44:16 2016 (r295749) > @@ -24,7 +24,18 @@ test: ${PROG} gen > LC_ALL=en_US.US-ASCII hexdump -C | \ > diff -I FreeBSD - ${.CURDIR}/ref.${conv} > .endfor > - @rm -f gen > + @${ECHO} "testing sparse file (obs zeroes)" > + @./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> > /dev/null > + @hexdump -C obs_zeroes | diff -I FreeBSD - > ${.CURDIR}/ref.obs_zeroes > + > + @${ECHO} "testing spase file (all zeroes)" > + @./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null > + @./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> > /dev/null > + @./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null > + @diff 1M_zeroes 1M_zeroes.1 > + @diff 1M_zeroes 1M_zeroes.2 > + > + @rm -f gen 1M_zeroes* obs_zeroes > > .if ${MK_TESTS} != "no" > SUBDIR+= tests > > Modified: head/bin/dd/dd.c > > ============================================================================== > --- head/bin/dd/dd.c Thu Feb 18 07:44:14 2016 (r295748) > +++ head/bin/dd/dd.c Thu Feb 18 08:44:16 2016 (r295749) > @@ -77,7 +77,6 @@ STAT st; /* statistics */ > void (*cfunc)(void); /* conversion function */ > uintmax_t cpy_cnt; /* # of blocks to copy */ > static off_t pending = 0; /* pending seek if sparse */ > -static off_t last_sp = 0; /* size of last added sparse block */ > u_int ddflags = 0; /* conversion options */ > size_t cbsz; /* conversion block size */ > uintmax_t files_cnt = 1; /* # of files to copy */ > @@ -409,6 +408,15 @@ dd_close(void) > } > if (out.dbcnt || pending) > dd_out(1); > + > + /* > + * If the file ends with a hole, ftruncate it to extend its size > + * up to the end of the hole (without having to write any data). > + */ > + if (out.seek_offset > 0 && (out.flags & ISTRUNC)) { > + if (ftruncate(out.fd, out.seek_offset) == -1) > + err(1, "truncating %s", out.name); > + } > } > > void > @@ -457,29 +465,27 @@ dd_out(int force) > } > if (sparse && !force) { > pending += cnt; > - last_sp = cnt; > nw = cnt; > } else { > if (pending != 0) { > - /* If forced to write, and we have > no > - * data left, we need to write the > last > - * sparse block explicitly. > + /* > + * Seek past hole. Note that we > need to record the > + * reached offset, because we > might have no more data > + * to write, in which case we'll > need to call > + * ftruncate to extend the file > size. > */ > - if (force && cnt == 0) { > - pending -= last_sp; > - assert(outp == out.db); > - memset(outp, 0, cnt); > - } > - if (lseek(out.fd, pending, > SEEK_CUR) == > - -1) > + out.seek_offset = lseek(out.fd, > pending, SEEK_CUR); > + if (out.seek_offset == -1) > err(2, "%s: seek error > creating sparse file", > out.name); > - pending = last_sp = 0; > + pending = 0; > } > - if (cnt) > + if (cnt) { > nw = write(out.fd, outp, cnt); > - else > + out.seek_offset = 0; > + } else { > return; > + } > } > > if (nw <= 0) { > > Modified: head/bin/dd/dd.h > > ============================================================================== > --- head/bin/dd/dd.h Thu Feb 18 07:44:14 2016 (r295748) > +++ head/bin/dd/dd.h Thu Feb 18 08:44:16 2016 (r295749) > @@ -54,6 +54,7 @@ typedef struct { > const char *name; /* name */ > int fd; /* file descriptor */ > off_t offset; /* # of blocks to skip */ > + off_t seek_offset; /* offset of last seek past output > hole */ > } IO; > > typedef struct { > > Modified: head/bin/dd/gen.c > > ============================================================================== > --- head/bin/dd/gen.c Thu Feb 18 07:44:14 2016 (r295748) > +++ head/bin/dd/gen.c Thu Feb 18 08:44:16 2016 (r295749) > @@ -5,13 +5,20 @@ > */ > > #include > +#include > > int > -main(int argc __unused, char **argv __unused) > +main(int argc, char **argv) > { > int i; > > - for (i = 0; i < 256; i++) > - putchar(i); > + if (argc > 1 && !strcmp(argv[1], "189284")) { > + fputs("ABCDEFGH", stdout); > + for (i = 0; i < 8; i++) > + putchar(0); > + } else { > + for (i = 0; i < 256; i++) > + putchar(i); > + } > return (0); > } > > Added: head/bin/dd/ref.obs_zeroes > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/dd/ref.obs_zeroes Thu Feb 18 08:44:16 2016 (r295749) > @@ -0,0 +1,3 @@ > +$FreeBSD$ > +00000000 41 42 43 44 45 46 47 48 00 00 00 00 00 00 00 00 > |ABCDEFGH........| > +00000010 > > From owner-svn-src-head@freebsd.org Fri Feb 19 06:35:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 741B1AAD61A; Fri, 19 Feb 2016 06:35:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDF310CE; Fri, 19 Feb 2016 06:35:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J6ZrDb077167; Fri, 19 Feb 2016 06:35:53 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J6Zr9S077166; Fri, 19 Feb 2016 06:35:53 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201602190635.u1J6Zr9S077166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 19 Feb 2016 06:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295796 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 06:35:54 -0000 Author: araujo Date: Fri Feb 19 06:35:53 2016 New Revision: 295796 URL: https://svnweb.freebsd.org/changeset/base/295796 Log: Fix regression introduced on 272446r. lagg(4) supports the protocol none, where it disables any traffic without disabling the lagg(4) interface itself. PR: 206921 Submitted by: Pushkar Kothavade Reviewed by: rpokala Approved by: bapt (mentor) MFC after: 3 weeks Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D5076 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Feb 19 05:59:38 2016 (r295795) +++ head/sys/net/if_lagg.c Fri Feb 19 06:35:53 2016 (r295796) @@ -1260,7 +1260,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = priv_check(td, PRIV_NET_LAGG); if (error) break; - if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) { + if (ra->ra_proto >= LAGG_PROTO_MAX) { error = EPROTONOSUPPORT; break; } From owner-svn-src-head@freebsd.org Fri Feb 19 06:50:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A34B2AADDC5; Fri, 19 Feb 2016 06:50:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72DE917A8; Fri, 19 Feb 2016 06:50:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J6o0OZ080372; Fri, 19 Feb 2016 06:50:00 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J6o0Gu080371; Fri, 19 Feb 2016 06:50:00 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201602190650.u1J6o0Gu080371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 19 Feb 2016 06:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295797 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 06:50:01 -0000 Author: kevlo Date: Fri Feb 19 06:50:00 2016 New Revision: 295797 URL: https://svnweb.freebsd.org/changeset/base/295797 Log: Remove sys/types.h Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Fri Feb 19 06:35:53 2016 (r295796) +++ head/lib/libc/gen/directory.3 Fri Feb 19 06:50:00 2016 (r295797) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 6, 2015 +.Dd February 19, 2016 .Dt DIRECTORY 3 .Os .Sh NAME @@ -46,7 +46,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In dirent.h .Ft DIR * .Fn opendir "const char *filename" From owner-svn-src-head@freebsd.org Fri Feb 19 07:03:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F01AAC67F; Fri, 19 Feb 2016 07:03:27 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2B8711FE; Fri, 19 Feb 2016 07:03:27 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id yy13so45426617pab.3; Thu, 18 Feb 2016 23:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=UpJpGhnE4IHZx8Ys261DLi1fV0uyTpfITkCxQmbZ7KY=; b=lh6bxkoXVK2aMdn/f9nM3WEmOOGGxM7N/S7zP6ek17EHLC9nEbpYxzoQSNHheQen2z ijZRZKA2/6k6gGaaoOjiClGQk4kDnngAs4zsXrdKR56w81YnAdA5DvJDwrFTqSRmCu/k ub9UMsRXeS5tSYl8uw9w6Wh6HWCWzGCmwamaPSDXkvh7f4gLrxibe0RNkzngJeTQM2xc LnSKmF5KQ3/3udHWgNJbE2SMwhB7Z+hIOlurEeV6uqGXECQrUZd0BUrJCyG5AKAP8Uyc dmiWcsh9xN166lsXIPzuFk4e9EqSSGzh1cN7ruf5zqHxDCZyqwFM2U1BPzMQAFA/iROz 0FqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=UpJpGhnE4IHZx8Ys261DLi1fV0uyTpfITkCxQmbZ7KY=; b=PBVgO6cp8HdgItdOpZ9HiBVbDQIk9pcNkDJlKZWHmsrWlGb9Wen6D1Ah4TyFcFuIG5 r+FaIj/ONXyQuXjma3T3Kooc+Hla8tb6X+uTFCUs4QTjZjU+IDWUyHftLkdfzNFjyCZX /i7gS+T0dQjxITYDmsFaOZ8V6mk0cqPZxklCAUyYUMdeIy63kKGAVB1hHMhweHd85LPJ yDS6qZdikkY7J+qGts4scyVNAXhKtbk9U5b0tgtHfW2Y6aocb9xtP58dAD9qmcy+R5Kx LuX2SGXpNHt285GUOT27XE4bho0NJ1ILQtgslyQAV7J3/3sofhEDBVC0s8n3dZVquDgE iIow== X-Gm-Message-State: AG10YOSOtYXRx22M14WzNwYbtzRR42Aq7qi7gY7pgGUa4+VCeu7m1MFqyxY4CcM+hids2g== X-Received: by 10.66.142.168 with SMTP id rx8mr16239154pab.14.1455865407245; Thu, 18 Feb 2016 23:03:27 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:59b2:e9e6:6067:a08f? (2001-44b8-31ae-7b01-59b2-e9e6-6067-a08f.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:59b2:e9e6:6067:a08f]) by smtp.gmail.com with ESMTPSA id tn5sm15021680pac.32.2016.02.18.23.03.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Feb 2016 23:03:26 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r295796 - head/sys/net References: <201602190635.u1J6Zr9S077166@repo.freebsd.org> To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <7f58daf2-24a4-d0eb-e66d-2bb7a591510e@FreeBSD.org> Date: Fri, 19 Feb 2016 18:03:15 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201602190635.u1J6Zr9S077166@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 07:03:28 -0000 On 19/02/2016 5:35 PM, Marcelo Araujo wrote: > Author: araujo > Date: Fri Feb 19 06:35:53 2016 > New Revision: 295796 > URL: https://svnweb.freebsd.org/changeset/base/295796 > > Log: > Fix regression introduced on 272446r. > > lagg(4) supports the protocol none, where it disables any traffic without > disabling the lagg(4) interface itself. > > PR: 206921 > Submitted by: Pushkar Kothavade > Reviewed by: rpokala > Approved by: bapt (mentor) > MFC after: 3 weeks > Sponsored by: gandi.net > Differential Revision: https://reviews.freebsd.org/D5076 > 10.3-R candidate? From owner-svn-src-head@freebsd.org Fri Feb 19 07:07:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFC71AAC85E; Fri, 19 Feb 2016 07:07:50 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com [IPv6:2607:f8b0:4003:c01::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94D7613A0; Fri, 19 Feb 2016 07:07:50 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x22f.google.com with SMTP id jq7so99708517obb.0; Thu, 18 Feb 2016 23:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ymHDtKX38aeEAY/TlCra6pK4k/aapZzN6yK90H7UrsQ=; b=ntUpSKhSjTRFfogbFwmyk8J9j/Vppv7M0sxNTP66eenB2TuzPHg6wbInJ030xYn2WT 3HE2TbhOuAhIUjkDIkpT3OOWgJ55MWR5F8JqEqtaB3xxunArfqhF4JYJWH1R9Fh7wl49 ZesgvxnvwgYzngOfiBqvKwKbzZ6Lw9QMsXBoKdldsxaJ+Gq00rWgq4iT1oG8WKCgG8T9 pzGDbta6yeiEuD5Q/yxJZqyQDHx5ZQQ4agfS73kpGkHDbSx5vPIIfcD9mtVl4HR+DnqR ItklkSdFajRgjkx9oxEUxKXXLxJY+RgyXwquQs877N8QX56Tz22Be/4Lbb94vwcwLibT gazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ymHDtKX38aeEAY/TlCra6pK4k/aapZzN6yK90H7UrsQ=; b=PyoVp3HWBDBql+g3pVOwmsXTv09awsdMaYrAWlAWIw5UgMGnLVngaoZxWTFPFviA2e z4viKUQKr4fY766bVNzBAY1yuEscCmP3wp+5HMBiLWvM/GLbQVzWU+QsXyELQ7NgKUxL 7y7f1AFhmW0Jad1oERnA4F1nGdD8KjtkeJnV4Q9of4K3snp8JTrPgSNmtxPdoQq9F8GY AuBUtgs9rUBnRDinP70MUzJmkjnEAvRve5xHBYm3AiP16UhW/rmBvlMAKfc1/DbrXXmJ ixWpPVToMEVxz55rNBmtpkbqcK09QN9Sht0C84cbhLFZteiDbFsRPysuSOq95IQpLjP2 JQWQ== X-Gm-Message-State: AG10YOQubuw4bdc46jh5T7UtBZkjOpRnV6pk4DjZp+mMGI3z45Q8HsC1s8l+3cGkAwazC09wB0jFUA+Wm0PSig== MIME-Version: 1.0 X-Received: by 10.182.108.201 with SMTP id hm9mr10054515obb.16.1455865669919; Thu, 18 Feb 2016 23:07:49 -0800 (PST) Received: by 10.182.5.138 with HTTP; Thu, 18 Feb 2016 23:07:49 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: <7f58daf2-24a4-d0eb-e66d-2bb7a591510e@FreeBSD.org> References: <201602190635.u1J6Zr9S077166@repo.freebsd.org> <7f58daf2-24a4-d0eb-e66d-2bb7a591510e@FreeBSD.org> Date: Fri, 19 Feb 2016 15:07:49 +0800 Message-ID: Subject: Re: svn commit: r295796 - head/sys/net From: Marcelo Araujo To: koobs@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 07:07:51 -0000 2016-02-19 15:03 GMT+08:00 Kubilay Kocak : > On 19/02/2016 5:35 PM, Marcelo Araujo wrote: > > Author: araujo > > Date: Fri Feb 19 06:35:53 2016 > > New Revision: 295796 > > URL: https://svnweb.freebsd.org/changeset/base/295796 > > > > Log: > > Fix regression introduced on 272446r. > > > > lagg(4) supports the protocol none, where it disables any traffic > without > > disabling the lagg(4) interface itself. > > > > PR: 206921 > > Submitted by: Pushkar Kothavade > > Reviewed by: rpokala > > Approved by: bapt (mentor) > > MFC after: 3 weeks > > Sponsored by: gandi.net > > Differential Revision: https://reviews.freebsd.org/D5076 > > > > 10.3-R candidate? > > Yes, it is! But the patch for 10-Stable is different than the one for HEAD, because lagg(4) code change between releases. Patch for 10-Stable here: https://reviews.freebsd.org/D5226 I have contacted re@ already! I will do again. Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Feb 19 08:35:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC62FAAC36E; Fri, 19 Feb 2016 08:35:30 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942C11190; Fri, 19 Feb 2016 08:35:30 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J8ZTtX012403; Fri, 19 Feb 2016 08:35:29 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J8ZTw0012400; Fri, 19 Feb 2016 08:35:29 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602190835.u1J8ZTw0012400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 08:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295798 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 08:35:30 -0000 Author: skra Date: Fri Feb 19 08:35:29 2016 New Revision: 295798 URL: https://svnweb.freebsd.org/changeset/base/295798 Log: Rename pmap.h to pmap-v4.h and remove pmap-v6.h include from it. Create new pmap.h which includes specific header according to __ARM_ARCH. Note that is included from so one common must exist. Added: head/sys/arm/include/pmap-v4.h - copied, changed from r295797, head/sys/arm/include/pmap.h Replaced: head/sys/arm/include/pmap.h (contents, props changed) Modified: head/sys/arm/include/pmap-v6.h Copied and modified: head/sys/arm/include/pmap-v4.h (from r295797, head/sys/arm/include/pmap.h) ============================================================================== --- head/sys/arm/include/pmap.h Fri Feb 19 06:50:00 2016 (r295797, copy source) +++ head/sys/arm/include/pmap-v4.h Fri Feb 19 08:35:29 2016 (r295798) @@ -46,14 +46,9 @@ * * $FreeBSD$ */ - #include -#if __ARM_ARCH >= 6 -#include -#else /* __ARM_ARCH >= 6 */ - -#ifndef _MACHINE_PMAP_H_ -#define _MACHINE_PMAP_H_ +#ifndef _MACHINE_PMAP_V4_H_ +#define _MACHINE_PMAP_V4_H_ #include #include @@ -543,5 +538,4 @@ extern vm_paddr_t dump_avail[]; #endif /* !LOCORE */ -#endif /* !_MACHINE_PMAP_H_ */ -#endif /* __ARM_ARCH >= 6 */ +#endif /* !_MACHINE_PMAP_V4_H_ */ Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Fri Feb 19 06:50:00 2016 (r295797) +++ head/sys/arm/include/pmap-v6.h Fri Feb 19 08:35:29 2016 (r295798) @@ -45,8 +45,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_PMAP_H_ -#define _MACHINE_PMAP_H_ +#ifndef _MACHINE_PMAP_V6_H_ +#define _MACHINE_PMAP_V6_H_ #include #include @@ -220,4 +220,4 @@ void pmap_preboot_map_attr(vm_paddr_t, v vm_memattr_t); #endif /* _KERNEL */ -#endif /* !_MACHINE_PMAP_H_ */ +#endif /* !_MACHINE_PMAP_V6_H_ */ Added: head/sys/arm/include/pmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/pmap.h Fri Feb 19 08:35:29 2016 (r295798) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2016 Svatopluk Kraus + * Copyright (c) 2016 Michal Meloun + * 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$ + */ + +#ifndef _MACHINE_PMAP_H_ +#define _MACHINE_PMAP_H_ + +#include + +#if __ARM_ARCH >= 6 +#include +#else +#include +#endif + +#endif /* !_MACHINE_PMAP_H_ */ From owner-svn-src-head@freebsd.org Fri Feb 19 08:41:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AC7EAAC7C6; Fri, 19 Feb 2016 08:41:49 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C631754; Fri, 19 Feb 2016 08:41:48 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J8fmb5015114; Fri, 19 Feb 2016 08:41:48 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J8fl8M015111; Fri, 19 Feb 2016 08:41:47 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602190841.u1J8fl8M015111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 08:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295799 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 08:41:49 -0000 Author: skra Date: Fri Feb 19 08:41:47 2016 New Revision: 295799 URL: https://svnweb.freebsd.org/changeset/base/295799 Log: Move common definitions from both pmap-v4.h and pmap-v6.h into pmap.h. (1) MI interface needed for vm subsystem. (2) MD interface created for ARM architecture to be used in files shared by armv4 and armv6 platforms. Modified: head/sys/arm/include/pmap-v4.h head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Fri Feb 19 08:35:29 2016 (r295798) +++ head/sys/arm/include/pmap-v4.h Fri Feb 19 08:41:47 2016 (r295799) @@ -80,16 +80,8 @@ enum mem_type { #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ -#ifdef _KERNEL - -#define vtophys(va) pmap_kextract((vm_offset_t)(va)) - -#endif - #define pmap_page_get_memattr(m) ((m)->md.pv_memattr) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); /* * Pmap stuff @@ -163,7 +155,6 @@ extern struct pmap kernel_pmap_store; #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) #endif - /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_list. @@ -208,9 +199,6 @@ boolean_t pmap_get_pde_pte(pmap_t, vm_of */ extern vm_offset_t pmap_curmaxkvaddr; -struct pcb; - -void pmap_set_pcb_pagedir(pmap_t, struct pcb *); /* Virtual address to page table entry */ static __inline pt_entry_t * vtopte(vm_offset_t va) @@ -223,23 +211,13 @@ vtopte(vm_offset_t va) return (ptep); } -extern vm_paddr_t phys_avail[]; -extern vm_offset_t virtual_avail; -extern vm_offset_t virtual_end; - void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt); int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa); -void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); -void pmap_kremove_device(vm_offset_t, vm_size_t); -void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa); -vm_paddr_t pmap_kextract(vm_offset_t va); vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); -void pmap_unmapdev(vm_offset_t, vm_size_t); vm_page_t pmap_use_pt(pmap_t, vm_offset_t); void pmap_debug(int); void pmap_map_section(vm_offset_t, vm_offset_t, vm_offset_t, int, int); @@ -529,11 +507,8 @@ void pmap_kenter_section(vm_offset_t, vm void pmap_kenter_supersection(vm_offset_t, uint64_t, int flags); #endif -extern char *_tmppt; - void pmap_postinit(void); -extern vm_paddr_t dump_avail[]; #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Fri Feb 19 08:35:29 2016 (r295798) +++ head/sys/arm/include/pmap-v6.h Fri Feb 19 08:41:47 2016 (r295799) @@ -89,12 +89,6 @@ typedef uint32_t ttb_entry_t; /* TTB en #define NKPT2PG 32 #endif -extern vm_paddr_t phys_avail[]; -extern vm_paddr_t dump_avail[]; -extern char *_tmppt; /* poor name! */ -extern vm_offset_t virtual_avail; -extern vm_offset_t virtual_end; - /* * Pmap stuff */ @@ -170,11 +164,9 @@ struct pv_chunk { }; #ifdef _KERNEL -struct pcb; extern ttb_entry_t pmap_kern_ttb; /* TTB for kernel pmap */ #define pmap_page_get_memattr(m) ((m)->md.pat_mode) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) /* * Only the following functions or macros may be used before pmap_bootstrap() @@ -183,27 +175,18 @@ extern ttb_entry_t pmap_kern_ttb; /* TT */ void pmap_bootstrap(vm_offset_t ); void pmap_kenter(vm_offset_t , vm_paddr_t ); -void *pmap_kenter_temporary(vm_paddr_t , int ); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); boolean_t pmap_page_is_mapped(vm_page_t ); -void pmap_page_set_memattr(vm_page_t , vm_memattr_t ); -void pmap_unmapdev(vm_offset_t, vm_size_t); -void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); -void pmap_kremove_device(vm_offset_t, vm_size_t); -void pmap_set_pcb_pagedir(pmap_t , struct pcb *); void pmap_tlb_flush(pmap_t , vm_offset_t ); void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t ); void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t ); -vm_paddr_t pmap_kextract(vm_offset_t ); vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *); int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool); -#define vtophys(va) pmap_kextract((vm_offset_t)(va)) void pmap_set_tex(void); void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set); Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Feb 19 08:35:29 2016 (r295798) +++ head/sys/arm/include/pmap.h Fri Feb 19 08:41:47 2016 (r295799) @@ -38,4 +38,31 @@ #include #endif +#ifdef _KERNEL + +extern vm_paddr_t dump_avail[]; +extern vm_paddr_t phys_avail[]; + +extern char *_tmppt; /* poor name! */ + +extern vm_offset_t virtual_avail; +extern vm_offset_t virtual_end; + +void *pmap_kenter_temporary(vm_paddr_t, int); +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +void pmap_page_set_memattr(vm_page_t, vm_memattr_t); + +void *pmap_mapdev(vm_paddr_t, vm_size_t); +void pmap_unmapdev(vm_offset_t, vm_size_t); + +struct pcb; +void pmap_set_pcb_pagedir(pmap_t, struct pcb *); + +void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); +void pmap_kremove_device(vm_offset_t, vm_size_t); + +vm_paddr_t pmap_kextract(vm_offset_t); +#define vtophys(va) pmap_kextract((vm_offset_t)(va)) + +#endif /* _KERNEL */ #endif /* !_MACHINE_PMAP_H_ */ From owner-svn-src-head@freebsd.org Fri Feb 19 08:42:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6655AAC84E; Fri, 19 Feb 2016 08:42:14 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA39F1951; Fri, 19 Feb 2016 08:42:14 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J8gDPH015178; Fri, 19 Feb 2016 08:42:13 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J8gDOc015177; Fri, 19 Feb 2016 08:42:13 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602190842.u1J8gDOc015177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Fri, 19 Feb 2016 08:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295800 - head/usr.bin/cap_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 08:42:14 -0000 Author: se Date: Fri Feb 19 08:42:13 2016 New Revision: 295800 URL: https://svnweb.freebsd.org/changeset/base/295800 Log: Remove O_SYNC from the options passed to dbmopen(). The output file is created as a temporary file that is moved over the existing file after completion. Thus there is no need to immediately flush all created db records to the temporary file. This speeds up creation of the termcap db by a factor of 40 on my ZFS based /etc filesytem (from 25 seconds to 0.6 seconds). I have compared multiple output files created with and without O_SYNC and they came out identical each time. Nonetheless it might be best to MFC this change and the similar one for services_mkdb (r295465) at the same time when the changes to hash.c in review D5186 are merged. MFC: 1 week Modified: head/usr.bin/cap_mkdb/cap_mkdb.c Modified: head/usr.bin/cap_mkdb/cap_mkdb.c ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:41:47 2016 (r295799) +++ head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:42:13 2016 (r295800) @@ -119,7 +119,7 @@ main(int argc, char *argv[]) (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv); if ((capname = strdup(buf)) == NULL) errx(1, "strdup failed"); - if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC, + if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR, DEFFILEMODE, DB_HASH, &openinfo)) == NULL) err(1, "%s", buf); From owner-svn-src-head@freebsd.org Fri Feb 19 08:54:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B026AAAD163; Fri, 19 Feb 2016 08:54:36 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4CB1143; Fri, 19 Feb 2016 08:54:36 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x229.google.com with SMTP id x65so47800931pfb.1; Fri, 19 Feb 2016 00:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=U4AiQTlvbpHdSh9cq1J7M5IlNvbOZLNoflOANAai0zA=; b=mvHrd713LWfhHzpAaU+JoL22kUYvbWMA1pPTzlTLj/u6t773tAyBdAGi+iXGNGfGx4 8QnlVWY1WPII/++O6c1OwdYOKwV/oAG/xI0ZnuMi6PeRefEBmJfV1ZfUng21S8PH79Zc MkaYOSiNyBG2+mQAwj5/5JzLrjFw7in6iEtfibUayw6vzV9gfkFMlhX3tbJb30SDSmpT 05EzI/yJbruz+SIfC4UPB29ATFSCvJ0aYVJpdO4+zR2YxFHk3MblXOi8KNQ9g1kiQf51 xvSRez8ezLNyKSwIMDHCPrRIWZL4nIQAEFnFTjqs+9L/4Lv7nByuyXGjq2AlGUzrWLpk N0IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:cc:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=U4AiQTlvbpHdSh9cq1J7M5IlNvbOZLNoflOANAai0zA=; b=LDkjeRvWzGsGlGJxCGOKM04ck7aqXMTQdJmsqikbRGT3qPqZJQAnb8nuMfKxyCqme/ B7qurJNml8NWdbyP0JdD2wCsnrXg3wtpzxpE6OC4euhTLpioGLukQRLS/+Zj4swSa3XO sa/S6N41yN7KUT4N6Na5YYnY52e5w4MrfTvGADnyGzU133hUHLezindHlQNHHseBUH9T pVLRF38mQy1QScbTICcVrMqtF3SGA7z6boGa1K4v1wzS1k0s+91L7josg6CkgTV2gFNA 36MAf76MkK2K1L4XDOJpQ8j8KxE9IRyQpVAGUA3wdxsxPGsKSclEUDmkyqNkKunJsf2p E9yw== X-Gm-Message-State: AG10YOTiJ5jkHQ7xyMJApidnmitODrMtmV2Z2Wya/wGhv4NjAoUSSGMIW+Bb2V+OFvOpOQ== X-Received: by 10.98.2.197 with SMTP id 188mr16568228pfc.3.1455872076037; Fri, 19 Feb 2016 00:54:36 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:59b2:e9e6:6067:a08f? (2001-44b8-31ae-7b01-59b2-e9e6-6067-a08f.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:59b2:e9e6:6067:a08f]) by smtp.gmail.com with ESMTPSA id y15sm15959391pfi.16.2016.02.19.00.54.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Feb 2016 00:54:35 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r295796 - head/sys/net References: <201602190635.u1J6Zr9S077166@repo.freebsd.org> <7f58daf2-24a4-d0eb-e66d-2bb7a591510e@FreeBSD.org> To: Marcelo Araujo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff From: Kubilay Kocak Message-ID: <3d13be6a-53e6-c224-2fab-304fd34691eb@FreeBSD.org> Date: Fri, 19 Feb 2016 19:54:25 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 08:54:36 -0000 On 19/02/2016 6:07 PM, Marcelo Araujo wrote: > > > 2016-02-19 15:03 GMT+08:00 Kubilay Kocak >: > > On 19/02/2016 5:35 PM, Marcelo Araujo wrote: > > Author: araujo > > Date: Fri Feb 19 06:35:53 2016 > > New Revision: 295796 > > URL: https://svnweb.freebsd.org/changeset/base/295796 > > > > Log: > > Fix regression introduced on 272446r. > > > > lagg(4) supports the protocol none, where it disables any traffic without > > disabling the lagg(4) interface itself. > > > > PR: 206921 > > Submitted by: Pushkar Kothavade > > > Reviewed by: rpokala > > Approved by: bapt (mentor) > > MFC after: 3 weeks > > Sponsored by: gandi.net > > Differential Revision: https://reviews.freebsd.org/D5076 > > > > 10.3-R candidate? > > > Yes, it is! > > But the patch for 10-Stable is different than the one for HEAD, because > lagg(4) code change between releases. > > Patch for 10-Stable here: > https://reviews.freebsd.org/D5226 > > I have contacted re@ already! I will do again. > > > Best, > -- > > -- > Marcelo Araujo (__) > araujo@FreeBSD.org \\\'',) > http://www.FreeBSD.org \/ \ ^ > Power To Server. .\. /_) > Much love, thank you Marcelo! Might help marking these as such in the original head commit to prevent annoying people (me) from pinging about it :) For example, I'm also interested in all the recent PVS fixes, none of which were marked for MFC, but appear to be very good at least stable/10,9 candidates, if not 10.3-R. ./koobs From owner-svn-src-head@freebsd.org Fri Feb 19 09:23:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B38C3AAC260; Fri, 19 Feb 2016 09:23:34 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75F02157B; Fri, 19 Feb 2016 09:23:34 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J9NXRw027534; Fri, 19 Feb 2016 09:23:33 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J9NWma027527; Fri, 19 Feb 2016 09:23:32 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602190923.u1J9NWma027527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 09:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295801 - in head: lib/libkvm sys/arm/arm sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 09:23:34 -0000 Author: skra Date: Fri Feb 19 09:23:32 2016 New Revision: 295801 URL: https://svnweb.freebsd.org/changeset/base/295801 Log: Rename pte.h to pte-v4.h and start including directly either pte-v4.h or pte-v6.h in files which needs it. There are quite internal definitions in pte-v4.h and pte-v6.h headers specific for corresponding pmap implementation. These headers should be included only in very few files and an intention is to not hide for which implementation such files are. Further, sys/arm/arm/elf_trampoline.c is an example of file which uses armv4 like pmap implementation for both armv4 and armv6 platforms. This is another reason why pte.h which includes specific header according to __ARM_ARCH is not created. Added: head/sys/arm/include/pte-v4.h - copied, changed from r295800, head/sys/arm/include/pte.h Deleted: head/sys/arm/include/pte.h Modified: head/lib/libkvm/kvm_arm.h head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/locore-v4.S head/sys/arm/arm/locore-v6.S head/sys/arm/include/pmap-v4.h head/sys/arm/include/pte-v6.h Modified: head/lib/libkvm/kvm_arm.h ============================================================================== --- head/lib/libkvm/kvm_arm.h Fri Feb 19 08:42:13 2016 (r295800) +++ head/lib/libkvm/kvm_arm.h Fri Feb 19 09:23:32 2016 (r295801) @@ -29,10 +29,6 @@ #ifndef __KVM_ARM_H__ #define __KVM_ARM_H__ -#ifdef __arm__ -#include -#endif - typedef uint32_t arm_physaddr_t; typedef uint32_t arm_pd_entry_t; typedef uint32_t arm_pt_entry_t; @@ -75,6 +71,12 @@ typedef uint32_t arm_pt_entry_t; #ifdef __arm__ #include +#if __ARM_ARCH >= 6 +#include +#else +#include +#endif + _Static_assert(PAGE_SHIFT == ARM_PAGE_SHIFT, "PAGE_SHIFT mismatch"); _Static_assert(PAGE_SIZE == ARM_PAGE_SIZE, "PAGE_SIZE mismatch"); _Static_assert(PAGE_MASK == ARM_PAGE_MASK, "PAGE_MASK mismatch"); Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Feb 19 08:42:13 2016 (r295800) +++ head/sys/arm/arm/elf_trampoline.c Fri Feb 19 09:23:32 2016 (r295801) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Fri Feb 19 08:42:13 2016 (r295800) +++ head/sys/arm/arm/locore-v4.S Fri Feb 19 09:23:32 2016 (r295801) @@ -38,7 +38,7 @@ #include #include #include -#include +#include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Fri Feb 19 08:42:13 2016 (r295800) +++ head/sys/arm/arm/locore-v6.S Fri Feb 19 09:23:32 2016 (r295801) @@ -36,7 +36,7 @@ #include #include #include -#include +#include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Fri Feb 19 08:42:13 2016 (r295800) +++ head/sys/arm/include/pmap-v4.h Fri Feb 19 09:23:32 2016 (r295801) @@ -50,7 +50,7 @@ #ifndef _MACHINE_PMAP_V4_H_ #define _MACHINE_PMAP_V4_H_ -#include +#include #include /* * Pte related macros Copied and modified: head/sys/arm/include/pte-v4.h (from r295800, head/sys/arm/include/pte.h) ============================================================================== --- head/sys/arm/include/pte.h Fri Feb 19 08:42:13 2016 (r295800, copy source) +++ head/sys/arm/include/pte-v4.h Fri Feb 19 09:23:32 2016 (r295801) @@ -33,14 +33,9 @@ * * $FreeBSD$ */ -#include -#if __ARM_ARCH >= 6 -#include -#else /* __ARM_ARCH >= 6 */ - -#ifndef _MACHINE_PTE_H_ -#define _MACHINE_PTE_H_ +#ifndef _MACHINE_PTE_V4_H_ +#define _MACHINE_PTE_V4_H_ #ifndef LOCORE typedef uint32_t pd_entry_t; /* page directory entry */ @@ -350,7 +345,6 @@ typedef pt_entry_t pt2_entry_t; /* comp * 1 X 1 1 0 Y Y WT Y Y * 1 X 1 1 1 Y Y WT Y Y */ -#endif /* !_MACHINE_PTE_H_ */ -#endif /* __ARM_ARCH >= 6 */ +#endif /* !_MACHINE_PTE_V4_H_ */ /* End of pte.h */ Modified: head/sys/arm/include/pte-v6.h ============================================================================== --- head/sys/arm/include/pte-v6.h Fri Feb 19 08:42:13 2016 (r295800) +++ head/sys/arm/include/pte-v6.h Fri Feb 19 09:23:32 2016 (r295801) @@ -27,8 +27,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_PTE_H_ -#define _MACHINE_PTE_H_ +#ifndef _MACHINE_PTE_V6_H_ +#define _MACHINE_PTE_V6_H_ /* * Domain Types for the Domain Access Control Register. @@ -298,4 +298,4 @@ // ----------------------------------------------------------------------------- -#endif /* !_MACHINE_PTE_H_ */ +#endif /* !_MACHINE_PTE_V6_H_ */ From owner-svn-src-head@freebsd.org Fri Feb 19 09:52:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FDFAAD12D; Fri, 19 Feb 2016 09:52:12 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9899C124D; Fri, 19 Feb 2016 09:52:12 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J9qBY9036051; Fri, 19 Feb 2016 09:52:11 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J9qBgb036050; Fri, 19 Feb 2016 09:52:11 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602190952.u1J9qBgb036050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 09:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295802 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 09:52:12 -0000 Author: skra Date: Fri Feb 19 09:52:11 2016 New Revision: 295802 URL: https://svnweb.freebsd.org/changeset/base/295802 Log: Remove AP_KRW definition not needed after r295801. Modified: head/sys/arm/include/pte-v6.h Modified: head/sys/arm/include/pte-v6.h ============================================================================== --- head/sys/arm/include/pte-v6.h Fri Feb 19 09:23:32 2016 (r295801) +++ head/sys/arm/include/pte-v6.h Fri Feb 19 09:52:11 2016 (r295802) @@ -288,14 +288,4 @@ #define PTE2_KERN(pa, ap, attr) PTE2(pa, (ap) | PTE2_A | PTE2_G, attr) #define PTE2_KERN_NG(pa, ap, attr) PTE2(pa, (ap) | PTE2_A | PTE2_NG, attr) - -// ----------------- TO BE DELETED --------------------------------------------- - -/* - * sys/arm/arm/elf_trampoline.c - */ -#define AP_KRW 0x01 /* kernel read/write */ - -// ----------------------------------------------------------------------------- - #endif /* !_MACHINE_PTE_V6_H_ */ From owner-svn-src-head@freebsd.org Fri Feb 19 10:32:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04A12AAE4B8; Fri, 19 Feb 2016 10:32:19 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B382118AF; Fri, 19 Feb 2016 10:32:18 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JAWHiH047600; Fri, 19 Feb 2016 10:32:17 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JAWHi5047599; Fri, 19 Feb 2016 10:32:17 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602191032.u1JAWHi5047599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 10:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295803 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 10:32:19 -0000 Author: skra Date: Fri Feb 19 10:32:17 2016 New Revision: 295803 URL: https://svnweb.freebsd.org/changeset/base/295803 Log: Remove not used definitions and fix some style nits. No functional changes. Modified: head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Fri Feb 19 09:52:11 2016 (r295802) +++ head/sys/arm/include/pmap-v6.h Fri Feb 19 10:32:17 2016 (r295803) @@ -88,21 +88,11 @@ typedef uint32_t ttb_entry_t; /* TTB en */ #define NKPT2PG 32 #endif +#endif /* _KERNEL */ /* * Pmap stuff */ - -/* - * This structure is used to hold a virtual<->physical address - * association and is used mostly by bootstrap code - */ -struct pv_addr { - SLIST_ENTRY(pv_addr) pv_list; - vm_offset_t pv_va; - vm_paddr_t pv_pa; -}; -#endif struct pv_entry; struct pv_chunk; @@ -173,20 +163,18 @@ extern ttb_entry_t pmap_kern_ttb; /* TT * is called: pmap_kenter(), pmap_kextract(), pmap_kremove(), vtophys(), and * vtopte2(). */ -void pmap_bootstrap(vm_offset_t ); -void pmap_kenter(vm_offset_t , vm_paddr_t ); +void pmap_bootstrap(vm_offset_t); +void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kremove(vm_offset_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); -boolean_t pmap_page_is_mapped(vm_page_t ); - -void pmap_tlb_flush(pmap_t , vm_offset_t ); -void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t ); +boolean_t pmap_page_is_mapped(vm_page_t); -void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t ); +void pmap_tlb_flush(pmap_t, vm_offset_t); +void pmap_tlb_flush_range(pmap_t, vm_offset_t, vm_size_t); vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *); -int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool); +int pmap_fault(pmap_t, vm_offset_t, uint32_t, int, bool); void pmap_set_tex(void); void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set); @@ -194,11 +182,11 @@ void reinit_mmu(ttb_entry_t ttb, u_int a /* * Pre-bootstrap epoch functions set. */ -void pmap_bootstrap_prepare(vm_paddr_t ); -vm_paddr_t pmap_preboot_get_pages(u_int ); -void pmap_preboot_map_pages(vm_paddr_t , vm_offset_t , u_int ); -vm_offset_t pmap_preboot_reserve_pages(u_int ); -vm_offset_t pmap_preboot_get_vpages(u_int ); +void pmap_bootstrap_prepare(vm_paddr_t); +vm_paddr_t pmap_preboot_get_pages(u_int); +void pmap_preboot_map_pages(vm_paddr_t, vm_offset_t, u_int); +vm_offset_t pmap_preboot_reserve_pages(u_int); +vm_offset_t pmap_preboot_get_vpages(u_int); void pmap_preboot_map_attr(vm_paddr_t, vm_offset_t, vm_size_t, vm_prot_t, vm_memattr_t); From owner-svn-src-head@freebsd.org Fri Feb 19 10:40:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC53AAE6A4; Fri, 19 Feb 2016 10:40:05 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89BE11C4A; Fri, 19 Feb 2016 10:40:05 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JAe4pd047908; Fri, 19 Feb 2016 10:40:04 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JAe4w1047907; Fri, 19 Feb 2016 10:40:04 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602191040.u1JAe4w1047907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 19 Feb 2016 10:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295804 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 10:40:05 -0000 Author: skra Date: Fri Feb 19 10:40:04 2016 New Revision: 295804 URL: https://svnweb.freebsd.org/changeset/base/295804 Log: Remove not used static function pmap_kenter_attr(). Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Feb 19 10:32:17 2016 (r295803) +++ head/sys/arm/arm/pmap-v6.c Fri Feb 19 10:40:04 2016 (r295804) @@ -1267,13 +1267,6 @@ pmap_kenter_prot_attr(vm_offset_t va, vm pte2_store(pte2p, PTE2_KERN(pa, prot, attr)); } -static __inline void -pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) -{ - - pmap_kenter_prot_attr(va, pa, PTE2_AP_KRW, attr); -} - PMAP_INLINE void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { From owner-svn-src-head@freebsd.org Fri Feb 19 11:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D3DAAD866; Fri, 19 Feb 2016 11:25:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C316E1553; Fri, 19 Feb 2016 11:25:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JBPIKQ062332; Fri, 19 Feb 2016 11:25:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JBPIU7062331; Fri, 19 Feb 2016 11:25:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602191125.u1JBPIU7062331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 19 Feb 2016 11:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295805 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 11:25:20 -0000 Author: tuexen Date: Fri Feb 19 11:25:18 2016 New Revision: 295805 URL: https://svnweb.freebsd.org/changeset/base/295805 Log: Use the SCTP level pointer, not the interface level. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Feb 19 10:40:04 2016 (r295804) +++ head/sys/netinet/sctp_pcb.c Fri Feb 19 11:25:18 2016 (r295805) @@ -5432,7 +5432,7 @@ sctp_select_primary_destination(struct s /* - * Delete the address from the endpoint local address list There is nothing + * Delete the address from the endpoint local address list. There is nothing * to be done if we are bound to all addresses */ void @@ -5483,8 +5483,7 @@ sctp_del_local_addr_ep(struct sctp_inpcb * to laddr */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._s_addr && - (net->ro._s_addr->ifa == laddr->ifa)) { + if (net->ro._s_addr == laddr->ifa) { /* Yep, purge src address selected */ sctp_rtentry_t *rt; From owner-svn-src-head@freebsd.org Fri Feb 19 12:24:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9697AADDCF; Fri, 19 Feb 2016 12:24:17 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67F03176A; Fri, 19 Feb 2016 12:24:17 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id g62so73583278wme.1; Fri, 19 Feb 2016 04:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UelDHx+65EArP6GXV4FCTWH/gGuhlUC9YEujELVuOkM=; b=S8Rxi50XZ/Ho143zVVdzCPibpUr31A/sa0NmnhuOcCc6lLIOM30m/xGdg1kzmZNYmr 0yVfizBgBlb5zmdBzNzAN0L/9S+GIuA7Cmb3bZbVvNCL35jjv3BOv62uVNHZuwQJxUHU r77IOZ/NNjpdNKUHlrTiSOGqkhoARVC9gS0T17G67wSaSpch9ZmP55+HgAooTiSkvL9D 4O5VFrZgtPPcR/vcjh8nucB3Xh6iLbA+avchpd2S4nrF7Z2SYUYcnIWAQA5G9o/PsmdC xluMZB/NtXMFTzNVncTv4seOgKkgRIniJl4dU8ziw57/eRU768TntS2lqK/juDZbGQgb xb2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UelDHx+65EArP6GXV4FCTWH/gGuhlUC9YEujELVuOkM=; b=GtmnM72yalnc3ReUNkE+cxCeryq29ttlYeVXvU/iFiDKsM4BUle8zDCURtNa1SzhiZ 9M5XAOIDzQ9TX+CSvjw/CWZCH+Lc/eaBIkoIKJanXsu82fR2/5uAuQgdOCmOBzGXQNaK mvUuyqArKP1GX8/uqn8250vOrk2gRsOu7HU8357Aw6xf+46jUPvDXGHGaCciiWUa7dPX 00PEmoVr1ZuJKMbqVbt36eIZezeU5PjBYUEj2owV1v8zyi64ZaOhAfwhzA87EyZyZG2a l3KmYp+EqY33B5iU7lKW6QyOoLf83aM8EGG/3mTkEypR1Anqt1xUijkjyQQee/scpSqg EVJA== X-Gm-Message-State: AG10YOS4aAA0gPVTxFjlLfaD67zrcl2XoGsFCV40pEQXO0vRfcRetqqAKaWT/8TG+PW6tQIb4ICBGwK6OZfM/g== MIME-Version: 1.0 X-Received: by 10.194.63.202 with SMTP id i10mr12889819wjs.118.1455884655895; Fri, 19 Feb 2016 04:24:15 -0800 (PST) Received: by 10.194.234.130 with HTTP; Fri, 19 Feb 2016 04:24:15 -0800 (PST) In-Reply-To: <201602182008.u1IK81vg092127@repo.freebsd.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> Date: Fri, 19 Feb 2016 15:24:15 +0300 Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Sergey Kandaurov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 12:24:17 -0000 On 18 February 2016 at 23:08, Alan Somers wrote: > Author: asomers > Date: Thu Feb 18 20:08:01 2016 > New Revision: 295768 > URL: https://svnweb.freebsd.org/changeset/base/295768 > > Log: > Fix compiler warnings in iostat > Modified: head/usr.sbin/iostat/iostat.c > ============================================================================== > --- head/usr.sbin/iostat/iostat.c Thu Feb 18 19:37:39 2016 (r295767) > +++ head/usr.sbin/iostat/iostat.c Thu Feb 18 20:08:01 2016 (r295768) > @@ -117,30 +117,34 @@ > #include > #include > > -struct nlist namelist[] = { > +static struct nlist namelist[] = { > #define X_TTY_NIN 0 > - { "_tty_nin" }, > + { .n_name = "_tty_nin", > + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, > [...] You unlikely need this excessive explicit zeroization. In this case it is implicitly prezeroed. Consider these two cases: : #include : : int main(void) { : struct nlist namelist[2] = {{ .n_type = 0x42 }}; : return sizeof(namelist); : } (__TEXT,__text) section _main: 0000000000000000 pushq %rbp 0000000000000001 movq %rsp, %rbp 0000000000000004 leaq -0x30(%rbp), %rdx 0000000000000008 movl $0x0, %eax 000000000000000d movl $0x6, %ecx 0000000000000012 movq %rdx, %rdi 0000000000000015 rep 0000000000000016 stosq 0000000000000018 movb $0x42, -0x28(%rbp) 000000000000001c movl $0x30, %eax 0000000000000021 popq %rbp 0000000000000022 retq rep stosq does zero 48 bytes, that is namelist[]. Or, if it is static. : #include : : int main(void) { : static struct nlist namelist[2] = {{ .n_type = 0x42 }}; : return sizeof(namelist); : } (__DATA,__data) section 0000000000000020 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 0000000000000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000000000000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -- wbr, pluknet From owner-svn-src-head@freebsd.org Fri Feb 19 14:01:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C6DAAE39B; Fri, 19 Feb 2016 14:01:37 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B811C02; Fri, 19 Feb 2016 14:01:37 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JE1aj0007221; Fri, 19 Feb 2016 14:01:36 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JE1acp007220; Fri, 19 Feb 2016 14:01:36 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602191401.u1JE1acp007220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Fri, 19 Feb 2016 14:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295806 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 14:01:37 -0000 Author: se Date: Fri Feb 19 14:01:35 2016 New Revision: 295806 URL: https://svnweb.freebsd.org/changeset/base/295806 Log: Fix possible out-of-bounds access detected by Ulrich Spörleins "scan-build". Some invalid PCI device selectors could cause read access to an initialized variable next to the array (local loop index variable). While here, the parser has been made more strict with regard to the syntax of PCI device selectors as documented in the man-page. E.g. "pci:" used to be interpreted as "pci0:0". MFC after: 3 days Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Fri Feb 19 11:25:18 2016 (r295805) +++ head/usr.sbin/pciconf/pciconf.c Fri Feb 19 14:01:35 2016 (r295806) @@ -897,7 +897,6 @@ static struct pcisel parsesel(const char *str) { const char *ep; - const char *epbase; char *eppos; struct pcisel sel; unsigned long selarr[4]; @@ -909,30 +908,27 @@ parsesel(const char *str) else ep = str; - epbase = ep; - if (strncmp(ep, "pci", 3) == 0) { ep += 3; i = 0; - do { + while (isdigit(*ep) && i < 4) { selarr[i++] = strtoul(ep, &eppos, 10); ep = eppos; - } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); - - if (i > 2) - sel.pc_func = selarr[--i]; - else - sel.pc_func = 0; - sel.pc_dev = selarr[--i]; - sel.pc_bus = selarr[--i]; - if (i > 0) - sel.pc_domain = selarr[--i]; - else - sel.pc_domain = 0; + if (*ep == ':') { + ep++; + if (*ep == '\0') + i = 0; + } + } + if (i > 0 && *ep == '\0') { + sel.pc_func = (i > 2) ? selarr[--i] : 0; + sel.pc_dev = (i > 0) ? selarr[--i] : 0; + sel.pc_bus = (i > 0) ? selarr[--i] : 0; + sel.pc_domain = (i > 0) ? selarr[--i] : 0; + return (sel); + } } - if (*ep != '\x0' || ep == epbase) - errx(1, "cannot parse selector %s", str); - return sel; + errx(1, "cannot parse selector %s", str); } static struct pcisel From owner-svn-src-head@freebsd.org Fri Feb 19 14:05:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB0BAAE488; Fri, 19 Feb 2016 14:05:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 410421EFA; Fri, 19 Feb 2016 14:05:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JE5Sxd009938; Fri, 19 Feb 2016 14:05:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JE5SOX009937; Fri, 19 Feb 2016 14:05:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602191405.u1JE5SOX009937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 19 Feb 2016 14:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295807 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 14:05:29 -0000 Author: andrew Date: Fri Feb 19 14:05:28 2016 New Revision: 295807 URL: https://svnweb.freebsd.org/changeset/base/295807 Log: Include ofw_bus_subr.h before ofw_pci.h for the definition of struct ofw_bus_iinfo. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Fri Feb 19 14:01:35 2016 (r295806) +++ head/sys/arm/mv/mv_pci.c Fri Feb 19 14:05:28 2016 (r295807) @@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Fri Feb 19 14:15:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78D7BAAE832; Fri, 19 Feb 2016 14:15:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3267414B0; Fri, 19 Feb 2016 14:15:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JEFWce012753; Fri, 19 Feb 2016 14:15:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JEFWQv012751; Fri, 19 Feb 2016 14:15:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602191415.u1JEFWQv012751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 19 Feb 2016 14:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295808 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 14:15:33 -0000 Author: andrew Date: Fri Feb 19 14:15:31 2016 New Revision: 295808 URL: https://svnweb.freebsd.org/changeset/base/295808 Log: Add initial support for the Allwinner A31i and A31s. This just adds the FDT platform code to detect when we are booting on one of these SoCs. The driver changes will be added shortly. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D5338 Modified: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Fri Feb 19 14:05:28 2016 (r295807) +++ head/sys/arm/allwinner/allwinner_machdep.c Fri Feb 19 14:15:31 2016 (r295808) @@ -75,6 +75,23 @@ a20_attach(platform_t plat) return (0); } +static int +a31_attach(platform_t plat) +{ + soc_type = ALLWINNERSOC_A31; + soc_family = ALLWINNERSOC_SUN6I; + + return (0); +} + +static int +a31s_attach(platform_t plat) +{ + soc_type = ALLWINNERSOC_A31S; + soc_family = ALLWINNERSOC_SUN6I; + + return (0); +} static vm_offset_t allwinner_lastaddr(platform_t plat) @@ -138,6 +155,22 @@ static platform_method_t a20_methods[] = PLATFORMMETHOD_END, }; +static platform_method_t a31_methods[] = { + PLATFORMMETHOD(platform_attach, a31_attach), + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + + PLATFORMMETHOD_END, +}; + +static platform_method_t a31s_methods[] = { + PLATFORMMETHOD(platform_attach, a31s_attach), + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + + PLATFORMMETHOD_END, +}; + u_int allwinner_soc_type(void) { @@ -152,3 +185,5 @@ allwinner_soc_family(void) FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); +FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31"); +FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s"); Modified: head/sys/arm/allwinner/allwinner_machdep.h ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.h Fri Feb 19 14:05:28 2016 (r295807) +++ head/sys/arm/allwinner/allwinner_machdep.h Fri Feb 19 14:15:31 2016 (r295808) @@ -34,9 +34,12 @@ #define ALLWINNERSOC_A13 0x13000000 #define ALLWINNERSOC_A10S 0x10000001 #define ALLWINNERSOC_A20 0x20000000 +#define ALLWINNERSOC_A31 0x31000000 +#define ALLWINNERSOC_A31S 0x31000001 #define ALLWINNERSOC_SUN4I 0x40000000 #define ALLWINNERSOC_SUN5I 0x50000000 +#define ALLWINNERSOC_SUN6I 0x60000000 #define ALLWINNERSOC_SUN7I 0x70000000 u_int allwinner_soc_type(void); From owner-svn-src-head@freebsd.org Fri Feb 19 15:11:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24EA9AADCCA; Fri, 19 Feb 2016 15:11:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC2EA1805; Fri, 19 Feb 2016 15:11:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JFBtoW031356; Fri, 19 Feb 2016 15:11:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JFBtUP031355; Fri, 19 Feb 2016 15:11:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602191511.u1JFBtUP031355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 19 Feb 2016 15:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295809 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 15:11:56 -0000 Author: emaste Date: Fri Feb 19 15:11:54 2016 New Revision: 295809 URL: https://svnweb.freebsd.org/changeset/base/295809 Log: Remove objcopy in WITHOUT_TOOLCHAIN if it's from elftoolchain Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 19 14:15:31 2016 (r295808) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 19 15:11:54 2016 (r295809) @@ -7946,6 +7946,10 @@ OLD_FILES+=usr/share/man/man1/readelf.1. OLD_FILES+=usr/share/man/man1/size.1.gz OLD_FILES+=usr/share/man/man1/strings.1.gz OLD_FILES+=usr/share/man/man1/strip.1.gz +.if ${MK_ELFCOPY_AS_OBJCOPY} != no +OLD_FILES+=usr/bin/objcopy +OLD_FILES+=usr/share/man/man1/objcopy.1.gz +.endif .endif .if ${MK_TOOLCHAIN} == no || ${MK_ELFCOPY_AS_OBJCOPY} != no OLD_FILES+=usr/bin/elfcopy From owner-svn-src-head@freebsd.org Fri Feb 19 15:35:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B2BAAE616; Fri, 19 Feb 2016 15:35:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8339A14BB; Fri, 19 Feb 2016 15:35:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JFZKwm037168; Fri, 19 Feb 2016 15:35:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JFZKil037167; Fri, 19 Feb 2016 15:35:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602191535.u1JFZKil037167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Feb 2016 15:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295810 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 15:35:21 -0000 Author: pfg Date: Fri Feb 19 15:35:20 2016 New Revision: 295810 URL: https://svnweb.freebsd.org/changeset/base/295810 Log: firewire: fix a mismatch introduced in r230558. Found by: PVS Static Analysis Reviewed by: sbruno MFC after: 1 month Modified: head/sys/dev/firewire/sbp_targ.c Modified: head/sys/dev/firewire/sbp_targ.c ============================================================================== --- head/sys/dev/firewire/sbp_targ.c Fri Feb 19 15:11:54 2016 (r295809) +++ head/sys/dev/firewire/sbp_targ.c Fri Feb 19 15:35:20 2016 (r295810) @@ -1324,7 +1324,7 @@ sbp_targ_action1(struct cam_sim *sim, un | PIT_DISCONNECT | PIT_TERM_IO; cpi->transport = XPORT_SPI; /* FIXME add XPORT_FW type to cam */ - cpi->hba_misc = PIM_NOBUSRESET | PIM_NOBUSRESET; + cpi->hba_misc = PIM_NOBUSRESET | PIM_NO_6_BYTE; cpi->hba_eng_cnt = 0; cpi->max_target = 7; /* XXX */ cpi->max_lun = MAX_LUN - 1; From owner-svn-src-head@freebsd.org Fri Feb 19 15:49:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DB6AAEB5A; Fri, 19 Feb 2016 15:49:44 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22e.google.com (mail-ob0-x22e.google.com [IPv6:2607:f8b0:4003:c01::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA09E1F1B; Fri, 19 Feb 2016 15:49:44 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x22e.google.com with SMTP id jq7so111309829obb.0; Fri, 19 Feb 2016 07:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=p5vA2r9iHZLlJt3fsoICx93EOlwBnH/0V/4oEEYIvE0=; b=hy6CgjfpYXywW+HyJJqZn7ZMr56hxRcNr8xmglCqdLDoFZyQvRMTFiZTdYKuMuIn5c 1mKu9IL1zf1fk5/0hchMTM98oiTTTJmXkNNI1B/l6cAAAPfwY01NYJ3gMjfBz1SqF6By Gxec9cvKOYi2rrin30JKuIWSZhuZB9ex9AWC5JkXUISKaEz5di+d/vG8h2w47DZgZvto Kk1yoGz1vSPUxtkzmQLuAnv26ckJnPLmGN/SuT5xZH7fA83moueXSKRtTGD36YhlT1r9 jcOqSJtQKK3FwRCjTn3Dfe/fSckCJDC9J8Y1aKxBNjzdxiDllBDfDKyrn5n2QJ8pyMKP uopA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=p5vA2r9iHZLlJt3fsoICx93EOlwBnH/0V/4oEEYIvE0=; b=Y25kqRijYVCIlT2Pv0eWcTNh+u7IJktrL4K1JCHViXi2oJzo1diEapdije53GuWwsm 3Y3KXkIkrbnFQmWoYk9aDeH7sEunjxqkBYXniaXln1lRI7xvN/k9cyKwaOiTgOcH3aSR VHbpEefuAyTybgiMaI+e4QxV36qKoBoy+7sMyDaiH/IvaX8Kqgq8pMUzcR5qU7AY4qgO MIVBNKvuDld4rECmSDGzcktf3EOUjymMgDj0qZ+Xdt0TPhMZDsv8XnVFmTj94QY8EvcS MSxlPUv7TjtnE/oqBPcQ3QwhEK2NIDwvnB4TRLRbByxHVNxgX8I/4Stkg8euXiXP2Xcy hpsQ== X-Gm-Message-State: AG10YOS2HHupNabANWsadAHvdkq2MVoVT4c09xkUxa0g2V6WSmN2zvobXmV+nfhfGAsdlxQ3ns/8JRfP4snCEQ== MIME-Version: 1.0 X-Received: by 10.60.67.34 with SMTP id k2mr12225431oet.67.1455896983931; Fri, 19 Feb 2016 07:49:43 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.78.83 with HTTP; Fri, 19 Feb 2016 07:49:43 -0800 (PST) In-Reply-To: References: <201602182008.u1IK81vg092127@repo.freebsd.org> Date: Fri, 19 Feb 2016 08:49:43 -0700 X-Google-Sender-Auth: RYSjAZxAgChiYPbgf6UW6qkZwPc Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Alan Somers To: Sergey Kandaurov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 15:49:45 -0000 On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: > On 18 February 2016 at 23:08, Alan Somers wrote: >> Author: asomers >> Date: Thu Feb 18 20:08:01 2016 >> New Revision: 295768 >> URL: https://svnweb.freebsd.org/changeset/base/295768 >> >> Log: >> Fix compiler warnings in iostat > >> Modified: head/usr.sbin/iostat/iostat.c >> ============================================================================== >> --- head/usr.sbin/iostat/iostat.c Thu Feb 18 19:37:39 2016 (r295767) >> +++ head/usr.sbin/iostat/iostat.c Thu Feb 18 20:08:01 2016 (r295768) >> @@ -117,30 +117,34 @@ >> #include >> #include >> >> -struct nlist namelist[] = { >> +static struct nlist namelist[] = { >> #define X_TTY_NIN 0 >> - { "_tty_nin" }, >> + { .n_name = "_tty_nin", >> + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, >> [...] > > You unlikely need this excessive explicit zeroization. > In this case it is implicitly prezeroed. > > Consider these two cases: > > : #include > : > : int main(void) { > : struct nlist namelist[2] = {{ .n_type = 0x42 }}; > : return sizeof(namelist); > : } > > (__TEXT,__text) section > _main: > 0000000000000000 pushq %rbp > 0000000000000001 movq %rsp, %rbp > 0000000000000004 leaq -0x30(%rbp), %rdx > 0000000000000008 movl $0x0, %eax > 000000000000000d movl $0x6, %ecx > 0000000000000012 movq %rdx, %rdi > 0000000000000015 rep > 0000000000000016 stosq > 0000000000000018 movb $0x42, -0x28(%rbp) > 000000000000001c movl $0x30, %eax > 0000000000000021 popq %rbp > 0000000000000022 retq > > rep stosq does zero 48 bytes, that is namelist[]. > > Or, if it is static. > > : #include > : > : int main(void) { > : static struct nlist namelist[2] = {{ .n_type = 0x42 }}; > : return sizeof(namelist); > : } > > (__DATA,__data) section > 0000000000000020 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 > 0000000000000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 0000000000000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Yeah, it was being implicitly zeroized before. But Clang complained about the structures being only partially initialized. Since the whole point of my commit was to increase the WARNS level, I explicitly zeroed the zero fields to silence Clang. -Alan From owner-svn-src-head@freebsd.org Fri Feb 19 15:53:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 198DEAAEEAB; Fri, 19 Feb 2016 15:53:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE2631576; Fri, 19 Feb 2016 15:53:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JFr8Vl043413; Fri, 19 Feb 2016 15:53:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JFr8s5043412; Fri, 19 Feb 2016 15:53:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602191553.u1JFr8s5043412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Feb 2016 15:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295811 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 15:53:10 -0000 Author: pfg Date: Fri Feb 19 15:53:08 2016 New Revision: 295811 URL: https://svnweb.freebsd.org/changeset/base/295811 Log: Ext2: cleanup setting of ctime/mtime/birthtime. This adopts the same change as r291936 for UFS. Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and copy the value into the inode. This keeps the behaviour cleaner and is consistent with UFS. Reviewed by: bde MFC after: 1 month (only 10) Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 19 15:35:20 2016 (r295810) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 19 15:53:08 2016 (r295811) @@ -464,16 +464,14 @@ ext2_setattr(struct vop_setattr_args *ap ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, td)))) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - ip->i_flag |= IN_ACCESS; - if (vap->va_mtime.tv_sec != VNOVAL) - ip->i_flag |= IN_CHANGE | IN_UPDATE; - ext2_itimes(vp); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; if (vap->va_atime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_ACCESS; ip->i_atime = vap->va_atime.tv_sec; ip->i_atimensec = vap->va_atime.tv_nsec; } if (vap->va_mtime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_UPDATE; ip->i_mtime = vap->va_mtime.tv_sec; ip->i_mtimensec = vap->va_mtime.tv_nsec; } From owner-svn-src-head@freebsd.org Fri Feb 19 16:43:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95AC7AAE31E; Fri, 19 Feb 2016 16:43:04 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6498414DF; Fri, 19 Feb 2016 16:43:04 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JGh3T3058001; Fri, 19 Feb 2016 16:43:03 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JGh3S5058000; Fri, 19 Feb 2016 16:43:03 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602191643.u1JGh3S5058000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Fri, 19 Feb 2016 16:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295813 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 16:43:04 -0000 Author: se Date: Fri Feb 19 16:43:03 2016 New Revision: 295813 URL: https://svnweb.freebsd.org/changeset/base/295813 Log: Remove redundant check for "(dinfo != NULL)", it has already been performed as the first part of this complex loop conditional. Found by: PVS Static Analysis Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Feb 19 16:37:06 2016 (r295812) +++ head/sys/dev/pci/pci_user.c Fri Feb 19 16:43:03 2016 (r295813) @@ -709,9 +709,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, * that match the user's criteria. */ for (cio->num_matches = 0, error = 0, i = 0, - dinfo = STAILQ_FIRST(devlist_head); - (dinfo != NULL) && (cio->num_matches < ionum) - && (error == 0) && (i < pci_numdevs) && (dinfo != NULL); + dinfo = STAILQ_FIRST(devlist_head); + (dinfo != NULL) && (cio->num_matches < ionum) && + (error == 0) && (i < pci_numdevs)); dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { if (i < cio->offset) From owner-svn-src-head@freebsd.org Fri Feb 19 16:53:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06744AAE7A3; Fri, 19 Feb 2016 16:53:23 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC32B1FD6; Fri, 19 Feb 2016 16:53:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JGrLkt061093; Fri, 19 Feb 2016 16:53:21 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JGrLJr061092; Fri, 19 Feb 2016 16:53:21 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602191653.u1JGrLJr061092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Fri, 19 Feb 2016 16:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295816 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 16:53:23 -0000 Author: se Date: Fri Feb 19 16:53:21 2016 New Revision: 295816 URL: https://svnweb.freebsd.org/changeset/base/295816 Log: Fix syntax error introduced in previous commit where I removed one character to few. I should have waited for the kernel compile to finish, even though the change seemed so trivial. Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Feb 19 16:43:37 2016 (r295815) +++ head/sys/dev/pci/pci_user.c Fri Feb 19 16:53:21 2016 (r295816) @@ -711,7 +711,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, for (cio->num_matches = 0, error = 0, i = 0, dinfo = STAILQ_FIRST(devlist_head); (dinfo != NULL) && (cio->num_matches < ionum) && - (error == 0) && (i < pci_numdevs)); + (error == 0) && (i < pci_numdevs); dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { if (i < cio->offset) From owner-svn-src-head@freebsd.org Fri Feb 19 16:56:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061EEAAE893; Fri, 19 Feb 2016 16:56:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C72BB1281; Fri, 19 Feb 2016 16:56:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JGu7DC061325; Fri, 19 Feb 2016 16:56:07 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JGu7u4061322; Fri, 19 Feb 2016 16:56:07 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602191656.u1JGu7u4061322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 19 Feb 2016 16:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295818 - head/bin/sh/tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 16:56:09 -0000 Author: jilles Date: Fri Feb 19 16:56:07 2016 New Revision: 295818 URL: https://svnweb.freebsd.org/changeset/base/295818 Log: sh: Add tests for comments in sh -c. Added: head/bin/sh/tests/parser/comment1.0 (contents, props changed) head/bin/sh/tests/parser/comment2.42 (contents, props changed) Modified: head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Fri Feb 19 16:53:41 2016 (r295817) +++ head/bin/sh/tests/parser/Makefile Fri Feb 19 16:56:07 2016 (r295818) @@ -25,6 +25,8 @@ FILES+= alias15.0 alias15.0.stdout FILES+= and-pipe-not.0 FILES+= case1.0 FILES+= case2.0 +FILES+= comment1.0 +FILES+= comment2.42 FILES+= dollar-quote1.0 FILES+= dollar-quote2.0 FILES+= dollar-quote3.0 Added: head/bin/sh/tests/parser/comment1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/comment1.0 Fri Feb 19 16:56:07 2016 (r295818) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +${SH} -c '#' Added: head/bin/sh/tests/parser/comment2.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/comment2.42 Fri Feb 19 16:56:07 2016 (r295818) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +${SH} -c '# +exit 42' From owner-svn-src-head@freebsd.org Fri Feb 19 18:05:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C98AADFF7; Fri, 19 Feb 2016 18:05:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 235311D0A; Fri, 19 Feb 2016 18:05:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JI53Oa081836; Fri, 19 Feb 2016 18:05:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JI53eu081835; Fri, 19 Feb 2016 18:05:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602191805.u1JI53eu081835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Feb 2016 18:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295822 - head/sys/dev/qlxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 18:05:04 -0000 Author: pfg Date: Fri Feb 19 18:05:02 2016 New Revision: 295822 URL: https://svnweb.freebsd.org/changeset/base/295822 Log: qlxgb: fix mismatch. Found by: PVS Static Analysis Reviewed by: davidcs MFC after: 1 month Modified: head/sys/dev/qlxgb/qla_hw.c Modified: head/sys/dev/qlxgb/qla_hw.c ============================================================================== --- head/sys/dev/qlxgb/qla_hw.c Fri Feb 19 17:34:11 2016 (r295821) +++ head/sys/dev/qlxgb/qla_hw.c Fri Feb 19 18:05:02 2016 (r295822) @@ -797,7 +797,8 @@ qla_tx_tso(qla_host_t *ha, struct mbuf * } if ((*tcp_opt != 0x01) || (*(tcp_opt + 1) != 0x01) || - (*(tcp_opt + 2) != 0x08) || (*(tcp_opt + 2) != 10)) { + (*(tcp_opt + 2) != 0x08) || + (*(tcp_opt + 3) != 10)) { return -1; } } From owner-svn-src-head@freebsd.org Fri Feb 19 19:17:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6ECBAAE3E2; Fri, 19 Feb 2016 19:17:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B847113B8; Fri, 19 Feb 2016 19:17:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B00A2B94A; Fri, 19 Feb 2016 14:17:26 -0500 (EST) From: John Baldwin To: Stefan Esser Cc: Stefan Esser , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r295760 - head/usr.sbin/pciconf Date: Fri, 19 Feb 2016 10:47:13 -0800 Message-ID: <2165203.hVWJOExbtP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <56C6265F.4050101@freebsd.org> References: <201602181523.u1IFNQk8004338@repo.freebsd.org> <1865104.t06og7Ezta@ralph.baldwin.cx> <56C6265F.4050101@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Feb 2016 14:17:26 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 19:17:27 -0000 On Thursday, February 18, 2016 09:15:27 PM Stefan Esser wrote: > Am 18.02.2016 um 19:07 schrieb John Baldwin: > >> @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin > >> } > >> if ((p->pc_hdr & PCIM_HDRTYPE) == 1) > >> return; > >> + max_burst_read = 0; > >> switch (status & PCIXM_STATUS_MAX_READ) { > >> case PCIXM_STATUS_MAX_READ_512: > >> max_burst_read = 512; > > > > Compilers are simply not smart enough. :-P > > Well, clang-3.7.1 in -CURRENT is ... > > But both gcc-4.2.1 and gcc-4.8.5 warn about a possibly uninitialized > variable. > > I could have changed the last case selector into "default" to silence > the warning without need for an initializer before the switch statement, > but that would be too ugly and misleading. No, I think your current version is fine, was just lamenting the compilers. :) > >> Modified: head/usr.sbin/pciconf/pciconf.c > >> ============================================================================== > >> --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016 (r295759) > >> +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016 (r295760) > >> @@ -913,7 +915,8 @@ parsesel(const char *str) > >> ep += 3; > >> i = 0; > >> do { > >> - selarr[i++] = strtoul(ep, &ep, 10); > >> + selarr[i++] = strtoul(ep, &eppos, 10); > >> + ep = eppos; > >> } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); > > > > This is now indented oddly (2 spaces instead of a tab?). > > Sorry, the pciconf sources do not comply with "style" and I'm to blame, > since I committed the initial version nearly 20 years ago ... > > But you are correct, I got even the wrong indentation wrong ;-) > > Thank you for the review and your comments, I'll commit a fixed version > now. Thanks, the indentation is just a minor nit. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Feb 19 21:32:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35D6FAADFAC; Fri, 19 Feb 2016 21:32:51 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ECFC1CEF; Fri, 19 Feb 2016 21:32:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JLWndL044950; Fri, 19 Feb 2016 21:32:49 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JLWnlo044948; Fri, 19 Feb 2016 21:32:49 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201602192132.u1JLWnlo044948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 19 Feb 2016 21:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295823 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 21:32:51 -0000 Author: davidcs Date: Fri Feb 19 21:32:49 2016 New Revision: 295823 URL: https://svnweb.freebsd.org/changeset/base/295823 Log: Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved. The sysctl trigger_grcdump can be used to manually trigger a fwdump. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Feb 19 18:05:02 2016 (r295822) +++ head/sys/dev/bxe/bxe.c Fri Feb 19 21:32:49 2016 (r295823) @@ -738,6 +738,7 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); +static int bxe_grc_dump(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -7934,6 +7935,16 @@ bxe_chk_parity_attn(struct bxe_softc *sc attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); attn.sig[3] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + port*4); + /* + * Since MCP attentions can't be disabled inside the block, we need to + * read AEU registers to see whether they're currently disabled + */ + attn.sig[3] &= ((REG_RD(sc, (!port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0 + : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0)) & + MISC_AEU_ENABLE_MCP_PRTY_BITS) | + ~MISC_AEU_ENABLE_MCP_PRTY_BITS); + + if (!CHIP_IS_E1x(sc)) attn.sig[4] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_5_FUNC_0 + port*4); @@ -16148,6 +16159,30 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int +bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) +{ + struct bxe_softc *sc; + int error, result; + + result = 0; + error = sysctl_handle_int(oidp, &result, 0, req); + + if (error || !req->newptr) { + return (error); + } + + if (result == 1) { + sc = (struct bxe_softc *)arg1; + + BLOGI(sc, "... grcdump start ...\n"); + bxe_grc_dump(sc); + BLOGI(sc, "... grcdump done ...\n"); + } + + return (error); +} + +static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -16279,11 +16314,15 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RW, &sc->debug, "debug logging mode"); - sc->trigger_grcdump = 0; - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", - CTLFLAG_RW, &sc->trigger_grcdump, 0, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", + CTLTYPE_UINT | CTLFLAG_RW, sc, 0, + bxe_sysctl_trigger_grcdump, "IU", "set by driver when a grcdump is needed"); + sc->grcdump_done = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", + CTLFLAG_RW, &sc->grcdump_done, 0, + "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget", @@ -18901,26 +18940,6 @@ bxe_get_preset_regs_len(struct bxe_softc } static int -bxe_get_max_regs_len(struct bxe_softc *sc) -{ - uint32_t preset_idx; - int regdump_len32, len32; - - regdump_len32 = bxe_get_preset_regs_len(sc, 1); - - /* Calculate the total preset regs length */ - for (preset_idx = 2; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { - - len32 = bxe_get_preset_regs_len(sc, preset_idx); - - if (regdump_len32 < len32) - regdump_len32 = len32; - } - - return regdump_len32; -} - -static int bxe_get_total_regs_len32(struct bxe_softc *sc) { uint32_t preset_idx; @@ -19147,18 +19166,21 @@ bxe_get_preset_regs(struct bxe_softc *sc } static int -bxe_grc_dump(struct bxe_softc *sc, bxe_grcdump_t *dump) +bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; uint32_t preset_idx; uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + + if (sc->grcdump_done) + return (rval); ecore_disable_blocks_parity(sc); - buf = dump->grcdump; - d_hdr = dump->grcdump; + buf = sc->grc_dump; + d_hdr = sc->grc_dump; d_hdr->header_size = (sizeof(struct dump_header) >> 2) - 1; d_hdr->version = BNX2X_DUMP_VERSION; @@ -19179,7 +19201,6 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); } - dump->grcdump_dwords = sizeof(struct dump_header) >> 2; buf += sizeof(struct dump_header); for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { @@ -19196,13 +19217,6 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g size = bxe_get_preset_regs_len(sc, preset_idx) * (sizeof (uint32_t)); - rval = copyout(sc->grc_dump, buf, size); - - if (rval) - break; - - dump->grcdump_dwords += (size / (sizeof (uint32_t))); - buf += size; } @@ -19216,11 +19230,12 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g static int bxe_add_cdev(struct bxe_softc *sc) { - int max_preset_size; + int grc_dump_size; - max_preset_size = bxe_get_max_regs_len(sc) * (sizeof (uint32_t)); + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); - sc->grc_dump = malloc(max_preset_size, M_DEVBUF, M_NOWAIT); + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); if (sc->grc_dump == NULL) return (-1); @@ -19288,12 +19303,13 @@ bxe_eioctl(struct cdev *dev, u_long cmd, sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size)) { + (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { rval = EINVAL; break; } - - rval = bxe_grc_dump(sc, dump); + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + sc->grcdump_done = 0; break; Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Fri Feb 19 18:05:02 2016 (r295822) +++ head/sys/dev/bxe/bxe.h Fri Feb 19 21:32:49 2016 (r295823) @@ -1833,7 +1833,6 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; - int trigger_grcdump; int grcdump_done; }; /* struct bxe_softc */ @@ -2301,7 +2300,6 @@ void ecore_storm_memset_struct(struct bx "ERROR: " format, \ ## args); \ } \ - sc->trigger_grcdump |= 0x1; \ } while(0) #ifdef ECORE_STOP_ON_ERROR From owner-svn-src-head@freebsd.org Fri Feb 19 21:53:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA0BAAAEB6F; Fri, 19 Feb 2016 21:53:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6C91BD7; Fri, 19 Feb 2016 21:53:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JLrCvD051166; Fri, 19 Feb 2016 21:53:12 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JLrCnR051163; Fri, 19 Feb 2016 21:53:12 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602192153.u1JLrCnR051163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 19 Feb 2016 21:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295825 - in head/bin/sh: . tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 21:53:14 -0000 Author: jilles Date: Fri Feb 19 21:53:12 2016 New Revision: 295825 URL: https://svnweb.freebsd.org/changeset/base/295825 Log: sh: Rework code to remove '\0' from shell input. This fixes bugs where '\0' was not removed correctly and speeds up the parser. Added: head/bin/sh/tests/parser/nul1.0 (contents, props changed) Modified: head/bin/sh/input.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Fri Feb 19 21:51:27 2016 (r295824) +++ head/bin/sh/input.c Fri Feb 19 21:53:12 2016 (r295825) @@ -195,8 +195,7 @@ retry: int preadbuffer(void) { - char *p, *q; - int more; + char *p, *q, *r, *end; char savec; while (parsefile->strpush) { @@ -224,34 +223,31 @@ again: } } - q = p = parsefile->buf + (parsenextc - parsefile->buf); - - /* delete nul characters */ - for (more = 1; more;) { - switch (*p) { - case '\0': - p++; /* Skip nul */ - goto check; - - case '\n': - parsenleft = q - parsenextc; - more = 0; /* Stop processing here */ - break; - - default: - break; - } - - *q++ = *p++; -check: - if (--parselleft <= 0) { - parsenleft = q - parsenextc - 1; - if (parsenleft < 0) - goto again; - *q = '\0'; - more = 0; + p = parsefile->buf + (parsenextc - parsefile->buf); + end = p + parselleft; + *end = '\0'; + q = strchrnul(p, '\n'); + if (q != end && *q == '\0') { + /* delete nul characters */ + for (r = q; q != end; q++) { + if (*q != '\0') + *r++ = *q; } + parselleft -= end - r; + if (parselleft == 0) + goto again; + end = p + parselleft; + *end = '\0'; + q = strchrnul(p, '\n'); + } + if (q == end) { + parsenleft = parselleft; + parselleft = 0; + } else /* *q == '\n' */ { + parsenleft = q - parsenextc + 1; + parselleft -= parsenleft; } + parsenleft--; savec = *q; *q = '\0'; Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Fri Feb 19 21:51:27 2016 (r295824) +++ head/bin/sh/tests/parser/Makefile Fri Feb 19 21:53:12 2016 (r295825) @@ -73,6 +73,7 @@ FILES+= line-cont10.0 FILES+= line-cont11.0 FILES+= no-space1.0 FILES+= no-space2.0 +FILES+= nul1.0 FILES+= only-redir1.0 FILES+= only-redir2.0 FILES+= only-redir3.0 Added: head/bin/sh/tests/parser/nul1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/nul1.0 Fri Feb 19 21:53:12 2016 (r295825) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# Although POSIX does not specify the effect of NUL bytes in scripts, +# we ignore them. + +{ + printf 'v=%03000d\0%02000d' 7 2 + dd if=/dev/zero bs=1000 count=1 status=none + printf '1 w=%03000d%02000d1\0\n' 7 2 + printf '\0l\0v\0=\0$\0{\0#\0v\0}\n' + printf '\0l\0w\0=\0\0$\0{\0#\0w}\0\0\0\n' + printf '[ "$lv.$lw.$v" = "5001.5001.$w" ]\n' +} | ${SH} From owner-svn-src-head@freebsd.org Fri Feb 19 21:58:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5507EAAEE10; Fri, 19 Feb 2016 21:58:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF29100C; Fri, 19 Feb 2016 21:58:15 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JLwERJ051557; Fri, 19 Feb 2016 21:58:14 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JLwEZg051556; Fri, 19 Feb 2016 21:58:14 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602192158.u1JLwEZg051556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 19 Feb 2016 21:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295826 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 21:58:16 -0000 Author: erj Date: Fri Feb 19 21:58:14 2016 New Revision: 295826 URL: https://svnweb.freebsd.org/changeset/base/295826 Log: ixl(4): Fix two important RSS bugs. - Change tc_mapping field to assign 64 queues instead of 16 to the PF's VSI; add comments to describe how this is done. - Set hash lut size to 512 when setting filter control; the lut size defaults to 128 if this isn't set. Differential Revision: https://reviews.freebsd.org/D5203 Reviewed by: gallatin Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Feb 19 21:53:12 2016 (r295825) +++ head/sys/dev/ixl/if_ixl.c Fri Feb 19 21:58:14 2016 (r295826) @@ -1175,6 +1175,7 @@ ixl_init_locked(struct ixl_pf *pf) #ifdef IXL_FDIR filter.enable_fdir = TRUE; #endif + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; if (i40e_set_filter_control(hw, &filter)) device_printf(dev, "set_filter_control() failed\n"); @@ -2758,8 +2759,17 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) */ ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID; ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG; - ctxt.info.queue_mapping[0] = 0; - ctxt.info.tc_mapping[0] = 0x0800; + /* In contig mode, que_mapping[0] is first queue index used by this VSI */ + ctxt.info.queue_mapping[0] = 0; + /* + * This VSI will only use traffic class 0; start traffic class 0's + * queue allocation at queue 0, and assign it 64 (2^6) queues (though + * the driver may not use all of them). + */ + ctxt.info.tc_mapping[0] = ((0 << I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT) + & I40E_AQ_VSI_TC_QUE_OFFSET_MASK) | + ((6 << I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) + & I40E_AQ_VSI_TC_QUE_NUMBER_MASK); /* Set VLAN receive stripping mode */ ctxt.info.valid_sections |= I40E_AQ_VSI_PROP_VLAN_VALID; From owner-svn-src-head@freebsd.org Fri Feb 19 22:28:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F8BCAADEAA; Fri, 19 Feb 2016 22:28:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52C6610A9; Fri, 19 Feb 2016 22:28:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JMSjDV060639; Fri, 19 Feb 2016 22:28:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JMSje6060638; Fri, 19 Feb 2016 22:28:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602192228.u1JMSje6060638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Feb 2016 22:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295827 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 22:28:46 -0000 Author: bdrewery Date: Fri Feb 19 22:28:45 2016 New Revision: 295827 URL: https://svnweb.freebsd.org/changeset/base/295827 Log: DIRDEPS_BUILD: Enable the post-build footer/stats display. There is no real downside to this and it is useful to have enabled. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Fri Feb 19 21:58:14 2016 (r295826) +++ head/share/mk/local.meta.sys.mk Fri Feb 19 22:28:45 2016 (r295827) @@ -204,6 +204,7 @@ CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}} .if !empty(TIME_STAMP) TRACER= ${TIME_STAMP} ${:U} .endif +WITH_META_STATS= t # toolchains can be a pain - especially bootstrappping them .if ${MACHINE} == "host" From owner-svn-src-head@freebsd.org Fri Feb 19 22:33:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D2FFAA9244; Fri, 19 Feb 2016 22:33:52 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD3F14E8; Fri, 19 Feb 2016 22:33:52 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JMXp3b063416; Fri, 19 Feb 2016 22:33:51 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JMXpUp063415; Fri, 19 Feb 2016 22:33:51 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602192233.u1JMXpUp063415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 19 Feb 2016 22:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295828 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 22:33:52 -0000 Author: erj Date: Fri Feb 19 22:33:50 2016 New Revision: 295828 URL: https://svnweb.freebsd.org/changeset/base/295828 Log: ixl(4): Remove unsupported device IDs. There is no official support for 20G SKUs on FreeBSD, and the KX_A device ID was never used. Differential Revision: https://reviews.freebsd.org/D5204 Reviewed by: sbruno, jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Feb 19 22:28:45 2016 (r295827) +++ head/sys/dev/ixl/if_ixl.c Fri Feb 19 22:33:50 2016 (r295828) @@ -63,7 +63,6 @@ char ixl_driver_version[] = "1.4.3"; static ixl_vendor_info_t ixl_vendor_info_array[] = { {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_A, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, @@ -71,8 +70,6 @@ static ixl_vendor_info_t ixl_vendor_info {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A, 0, 0, 0}, #ifdef X722_SUPPORT {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0}, From owner-svn-src-head@freebsd.org Fri Feb 19 22:45:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B66DAA98C5; Fri, 19 Feb 2016 22:45:10 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9BF1C80; Fri, 19 Feb 2016 22:45:10 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JMj9g8066385; Fri, 19 Feb 2016 22:45:09 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JMj9pT066384; Fri, 19 Feb 2016 22:45:09 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602192245.u1JMj9pT066384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 19 Feb 2016 22:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295829 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 22:45:10 -0000 Author: erj Date: Fri Feb 19 22:45:09 2016 New Revision: 295829 URL: https://svnweb.freebsd.org/changeset/base/295829 Log: ixl(4): Fix errors in queue interrupt setup in MSIX mode. - I40E_PFINT_DYN_CTLN needs to be cleared, and not have a queue index written to it. - The interrupt linked list for each queue is changed to only include the queue's Rx and Tx queues. Differential Revision: https://reviews.freebsd.org/D5206 Reviewed by: sbruno Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Feb 19 22:33:50 2016 (r295828) +++ head/sys/dev/ixl/if_ixl.c Fri Feb 19 22:45:09 2016 (r295829) @@ -2246,7 +2246,8 @@ ixl_configure_msix(struct ixl_pf *pf) /* Next configure the queues */ for (int i = 0; i < vsi->num_queues; i++, vector++) { - wr32(hw, I40E_PFINT_DYN_CTLN(i), i); + wr32(hw, I40E_PFINT_DYN_CTLN(i), 0); + /* First queue type is RX / type 0 */ wr32(hw, I40E_PFINT_LNKLSTN(i), i); reg = I40E_QINT_RQCTL_CAUSE_ENA_MASK | @@ -2259,11 +2260,8 @@ ixl_configure_msix(struct ixl_pf *pf) reg = I40E_QINT_TQCTL_CAUSE_ENA_MASK | (IXL_TX_ITR << I40E_QINT_TQCTL_ITR_INDX_SHIFT) | (vector << I40E_QINT_TQCTL_MSIX_INDX_SHIFT) | - ((i+1) << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) | + (IXL_QUEUE_EOL << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) | (I40E_QUEUE_TYPE_RX << I40E_QINT_TQCTL_NEXTQ_TYPE_SHIFT); - if (i == (vsi->num_queues - 1)) - reg |= (IXL_QUEUE_EOL - << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT); wr32(hw, I40E_QINT_TQCTL(i), reg); } } From owner-svn-src-head@freebsd.org Fri Feb 19 22:46:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1CD8AA99D2; Fri, 19 Feb 2016 22:46:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81EF61E34; Fri, 19 Feb 2016 22:46:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JMkqdh066480; Fri, 19 Feb 2016 22:46:52 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JMkqjp066478; Fri, 19 Feb 2016 22:46:52 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201602192246.u1JMkqjp066478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 19 Feb 2016 22:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295830 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 22:46:54 -0000 Author: davidcs Date: Fri Feb 19 22:46:52 2016 New Revision: 295830 URL: https://svnweb.freebsd.org/changeset/base/295830 Log: Remove dead code. Code Cleanup. Improve clarity in debug messages MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_init.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Feb 19 22:45:09 2016 (r295829) +++ head/sys/dev/bxe/bxe.c Fri Feb 19 22:46:52 2016 (r295830) @@ -124,14 +124,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57712 MF 10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57712_VF, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57712 VF 10GbE" - }, -#endif { BRCM_VENDORID, CHIP_NUM_57800, @@ -144,14 +136,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57800 MF 10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57800_VF, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57800 VF 10GbE" - }, -#endif { BRCM_VENDORID, CHIP_NUM_57810, @@ -164,14 +148,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57810 MF 10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57810_VF, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57810 VF 10GbE" - }, -#endif { BRCM_VENDORID, CHIP_NUM_57811, @@ -184,42 +160,18 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57811 MF 10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57811_VF, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57811 VF 10GbE" - }, -#endif { BRCM_VENDORID, CHIP_NUM_57840_4_10, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 4x10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57840_2_20, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57840 2x20GbE" - }, -#endif { BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 MF 10GbE" }, -#if 0 - { - BRCM_VENDORID, - CHIP_NUM_57840_VF, - PCI_ANY_ID, PCI_ANY_ID, - "QLogic NetXtreme II BCM57840 VF 10GbE" - }, -#endif { 0, 0, 0, 0, NULL } @@ -245,10 +197,6 @@ static device_method_t bxe_methods[] = { DEVMETHOD(device_attach, bxe_attach), DEVMETHOD(device_detach, bxe_detach), DEVMETHOD(device_shutdown, bxe_shutdown), -#if 0 - DEVMETHOD(device_suspend, bxe_suspend), - DEVMETHOD(device_resume, bxe_resume), -#endif /* Bus interface (bus_if.h) */ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), @@ -458,12 +406,6 @@ static const struct { 8, STATS_FLAGS_FUNC, "tpa_aggregated_frames"}, { STATS_OFFSET32(total_tpa_bytes_hi), 8, STATS_FLAGS_FUNC, "tpa_bytes"}, -#if 0 - { STATS_OFFSET32(recoverable_error), - 4, STATS_FLAGS_FUNC, "recoverable_errors" }, - { STATS_OFFSET32(unrecoverable_error), - 4, STATS_FLAGS_FUNC, "unrecoverable_errors" }, -#endif { STATS_OFFSET32(eee_tx_lpi), 4, STATS_FLAGS_PORT, "eee_tx_lpi"}, { STATS_OFFSET32(rx_calls), @@ -516,12 +458,6 @@ static const struct { 4, STATS_FLAGS_FUNC, "tx_window_violation_std"}, { STATS_OFFSET32(tx_window_violation_tso), 4, STATS_FLAGS_FUNC, "tx_window_violation_tso"}, -#if 0 - { STATS_OFFSET32(tx_unsupported_tso_request_ipv6), - 4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_ipv6"}, - { STATS_OFFSET32(tx_unsupported_tso_request_not_tcp), - 4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_not_tcp"}, -#endif { STATS_OFFSET32(tx_chain_lost_mbuf), 4, STATS_FLAGS_FUNC, "tx_chain_lost_mbuf"}, { STATS_OFFSET32(tx_frames_deferred), @@ -633,12 +569,6 @@ static const struct { 4, "tx_window_violation_std"}, { Q_STATS_OFFSET32(tx_window_violation_tso), 4, "tx_window_violation_tso"}, -#if 0 - { Q_STATS_OFFSET32(tx_unsupported_tso_request_ipv6), - 4, "tx_unsupported_tso_request_ipv6"}, - { Q_STATS_OFFSET32(tx_unsupported_tso_request_not_tcp), - 4, "tx_unsupported_tso_request_not_tcp"}, -#endif { Q_STATS_OFFSET32(tx_chain_lost_mbuf), 4, "tx_chain_lost_mbuf"}, { Q_STATS_OFFSET32(tx_frames_deferred), @@ -906,12 +836,6 @@ bxe_dma_map_addr(void *arg, bus_dma_segm } else { dma->paddr = segs->ds_addr; dma->nseg = nseg; -#if 0 - BLOGD(dma->sc, DBG_LOAD, - "DMA alloc '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n", - dma->msg, dma->vaddr, (void *)dma->paddr, - dma->nseg, dma->size); -#endif } } @@ -996,13 +920,6 @@ bxe_dma_free(struct bxe_softc *sc, struct bxe_dma *dma) { if (dma->size > 0) { -#if 0 - BLOGD(sc, DBG_LOAD, - "DMA free '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n", - dma->msg, dma->vaddr, (void *)dma->paddr, - dma->nseg, dma->size); -#endif - DBASSERT(sc, (dma->tag != NULL), ("dma tag is NULL")); bus_dmamap_sync(dma->tag, dma->map, @@ -1043,69 +960,6 @@ bxe_reg_rd_ind(struct bxe_softc *sc, return (val); } -#if 0 -void bxe_dp_dmae(struct bxe_softc *sc, struct dmae_command *dmae, int msglvl) -{ - uint32_t src_type = dmae->opcode & DMAE_COMMAND_SRC; - - switch (dmae->opcode & DMAE_COMMAND_DST) { - case DMAE_CMD_DST_PCI: - if (src_type == DMAE_CMD_SRC_PCI) - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src [%x:%08x], len [%d*4], dst [%x:%08x]\n" - "comp_addr [%x:%08x], comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, - dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, - dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - else - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src [%08x], len [%d*4], dst [%x:%08x]\n" - "comp_addr [%x:%08x], comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_lo >> 2, - dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, - dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - break; - case DMAE_CMD_DST_GRC: - if (src_type == DMAE_CMD_SRC_PCI) - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src [%x:%08x], len [%d*4], dst_addr [%08x]\n" - "comp_addr [%x:%08x], comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, - dmae->len, dmae->dst_addr_lo >> 2, - dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - else - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src [%08x], len [%d*4], dst [%08x]\n" - "comp_addr [%x:%08x], comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_lo >> 2, - dmae->len, dmae->dst_addr_lo >> 2, - dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - break; - default: - if (src_type == DMAE_CMD_SRC_PCI) - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src_addr [%x:%08x] len [%d * 4] dst_addr [none]\n" - "comp_addr [%x:%08x] comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, - dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - else - DP(msglvl, "DMAE: opcode 0x%08x\n" - "src_addr [%08x] len [%d * 4] dst_addr [none]\n" - "comp_addr [%x:%08x] comp_val 0x%08x\n", - dmae->opcode, dmae->src_addr_lo >> 2, - dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo, - dmae->comp_val); - break; - } - -} -#endif - static int bxe_acquire_hw_lock(struct bxe_softc *sc, uint32_t resource) @@ -1118,7 +972,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { - BLOGE(sc, "resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE\n", resource); + BLOGE(sc, "(resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE)" + " resource_bit 0x%x\n", resource, resource_bit); return (-1); } @@ -1132,8 +987,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc /* validate the resource is not already taken */ lock_status = REG_RD(sc, hw_lock_control_reg); if (lock_status & resource_bit) { - BLOGE(sc, "resource in use (status 0x%x bit 0x%x)\n", - lock_status, resource_bit); + BLOGE(sc, "resource (0x%x) in use (status 0x%x bit 0x%x)\n", + resource, lock_status, resource_bit); return (-1); } @@ -1147,7 +1002,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc DELAY(5000); } - BLOGE(sc, "Resource lock timeout!\n"); + BLOGE(sc, "Resource 0x%x resource_bit 0x%x lock timeout!\n", + resource, resource_bit); return (-1); } @@ -1162,7 +1018,8 @@ bxe_release_hw_lock(struct bxe_softc *sc /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { - BLOGE(sc, "resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE\n", resource); + BLOGE(sc, "(resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE)" + " resource_bit 0x%x\n", resource, resource_bit); return (-1); } @@ -1176,8 +1033,8 @@ bxe_release_hw_lock(struct bxe_softc *sc /* validate the resource is currently taken */ lock_status = REG_RD(sc, hw_lock_control_reg); if (!(lock_status & resource_bit)) { - BLOGE(sc, "resource not in use (status 0x%x bit 0x%x)\n", - lock_status, resource_bit); + BLOGE(sc, "resource (0x%x) not in use (status 0x%x bit 0x%x)\n", + resource, lock_status, resource_bit); return (-1); } @@ -1239,7 +1096,9 @@ bxe_acquire_nvram_lock(struct bxe_softc } if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) { - BLOGE(sc, "Cannot get access to nvram interface\n"); + BLOGE(sc, "Cannot get access to nvram interface " + "port %d val 0x%x (MCPR_NVM_SW_ARB_ARB_ARB1 << port)\n", + port, val); return (-1); } @@ -1273,7 +1132,9 @@ bxe_release_nvram_lock(struct bxe_softc } if (val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port)) { - BLOGE(sc, "Cannot free access to nvram interface\n"); + BLOGE(sc, "Cannot free access to nvram interface " + "port %d val 0x%x (MCPR_NVM_SW_ARB_ARB_ARB1 << port)\n", + port, val); return (-1); } @@ -1356,7 +1217,9 @@ bxe_nvram_read_dword(struct bxe_softc *s } if (rc == -1) { - BLOGE(sc, "nvram read timeout expired\n"); + BLOGE(sc, "nvram read timeout expired " + "(offset 0x%x cmd_flags 0x%x val 0x%x)\n", + offset, cmd_flags, val); } return (rc); @@ -1462,7 +1325,9 @@ bxe_nvram_write_dword(struct bxe_softc * } if (rc == -1) { - BLOGE(sc, "nvram write timeout expired\n"); + BLOGE(sc, "nvram write timeout expired " + "(offset 0x%x cmd_flags 0x%x val 0x%x)\n", + offset, cmd_flags, val); } return (rc); @@ -1696,7 +1561,8 @@ bxe_issue_dmae_with_comp(struct bxe_soft if (!timeout || (sc->recovery_state != BXE_RECOVERY_DONE && sc->recovery_state != BXE_RECOVERY_NIC_LOADING)) { - BLOGE(sc, "DMAE timeout!\n"); + BLOGE(sc, "DMAE timeout! *wb_comp 0x%x recovery_state 0x%x\n", + *wb_comp, sc->recovery_state); BXE_DMAE_UNLOCK(sc); return (DMAE_TIMEOUT); } @@ -1706,7 +1572,8 @@ bxe_issue_dmae_with_comp(struct bxe_soft } if (*wb_comp & DMAE_PCI_ERR_FLAG) { - BLOGE(sc, "DMAE PCI error!\n"); + BLOGE(sc, "DMAE PCI error! *wb_comp 0x%x recovery_state 0x%x\n", + *wb_comp, sc->recovery_state); BXE_DMAE_UNLOCK(sc); return (DMAE_PCI_ERROR); } @@ -1941,12 +1808,6 @@ elink_cb_event_log(struct bxe_softc ...) { /* XXX */ -#if 0 - //va_list ap; - va_start(ap, elink_log_id); - _XXX_(sc, lm_log_id, ap); - va_end(ap); -#endif BLOGI(sc, "ELINK EVENT LOG (%d)\n", elink_log_id); } @@ -1959,7 +1820,7 @@ bxe_set_spio(struct bxe_softc *sc, /* Only 2 SPIOs are configurable */ if ((spio != MISC_SPIO_SPIO4) && (spio != MISC_SPIO_SPIO5)) { - BLOGE(sc, "Invalid SPIO 0x%x\n", spio); + BLOGE(sc, "Invalid SPIO 0x%x mode 0x%x\n", spio, mode); return (-1); } @@ -2013,7 +1874,9 @@ bxe_gpio_read(struct bxe_softc *sc, uint32_t gpio_reg; if (gpio_num > MISC_REGISTERS_GPIO_3) { - BLOGE(sc, "Invalid GPIO %d\n", gpio_num); + BLOGE(sc, "Invalid GPIO %d port 0x%x gpio_port %d gpio_shift %d" + " gpio_mask 0x%x\n", gpio_num, port, gpio_port, gpio_shift, + gpio_mask); return (-1); } @@ -2039,7 +1902,9 @@ bxe_gpio_write(struct bxe_softc *sc, uint32_t gpio_reg; if (gpio_num > MISC_REGISTERS_GPIO_3) { - BLOGE(sc, "Invalid GPIO %d\n", gpio_num); + BLOGE(sc, "Invalid GPIO %d mode 0x%x port 0x%x gpio_port %d" + " gpio_shift %d gpio_mask 0x%x\n", + gpio_num, mode, port, gpio_port, gpio_shift, gpio_mask); return (-1); } @@ -2122,7 +1987,8 @@ bxe_gpio_mult_write(struct bxe_softc *sc break; default: - BLOGE(sc, "Invalid GPIO mode assignment %d\n", mode); + BLOGE(sc, "Invalid GPIO mode assignment pins 0x%x mode 0x%x" + " gpio_reg 0x%x\n", pins, mode, gpio_reg); bxe_release_hw_lock(sc, HW_LOCK_RESOURCE_GPIO); return (-1); } @@ -2148,7 +2014,9 @@ bxe_gpio_int_write(struct bxe_softc *sc, uint32_t gpio_reg; if (gpio_num > MISC_REGISTERS_GPIO_3) { - BLOGE(sc, "Invalid GPIO %d\n", gpio_num); + BLOGE(sc, "Invalid GPIO %d mode 0x%x port 0x%x gpio_port %d" + " gpio_shift %d gpio_mask 0x%x\n", + gpio_num, mode, port, gpio_port, gpio_shift, gpio_mask); return (-1); } @@ -2567,29 +2435,6 @@ bxe_sp_post(struct bxe_softc *sc, * @sc: driver hanlde * @p: pointer to rss configuration */ -#if 0 -static void -bxe_debug_print_ind_table(struct bxe_softc *sc, - struct ecore_config_rss_params *p) -{ - int i; - - BLOGD(sc, DBG_LOAD, "Setting indirection table to:\n"); - BLOGD(sc, DBG_LOAD, " 0x0000: "); - for (i = 0; i < T_ETH_INDIRECTION_TABLE_SIZE; i++) { - BLOGD(sc, DBG_LOAD, "0x%02x ", p->ind_table[i]); - - /* Print 4 bytes in a line */ - if ((i + 1 < T_ETH_INDIRECTION_TABLE_SIZE) && - (((i + 1) & 0x3) == 0)) { - BLOGD(sc, DBG_LOAD, "\n"); - BLOGD(sc, DBG_LOAD, "0x%04x: ", i + 1); - } - } - - BLOGD(sc, DBG_LOAD, "\n"); -} -#endif /* * FreeBSD Device probe function. @@ -2764,13 +2609,6 @@ bxe_tx_avail(struct bxe_softc *sc, used = SUB_S16(prod, cons); -#if 0 - KASSERT((used < 0), ("used tx bds < 0")); - KASSERT((used > sc->tx_ring_size), ("used tx bds > tx_ring_size")); - KASSERT(((sc->tx_ring_size - used) > MAX_TX_AVAIL), - ("invalid number of tx bds used")); -#endif - return (int16_t)(sc->tx_ring_size) - used; } @@ -2816,16 +2654,6 @@ bxe_sp_event(struct bxe_softc *sc, BLOGD(sc, DBG_SP, "fp=%d cid=%d got ramrod #%d state is %x type is %d\n", fp->index, cid, command, sc->state, rr_cqe->ramrod_cqe.ramrod_type); -#if 0 - /* - * If cid is within VF range, replace the slowpath object with the - * one corresponding to this VF - */ - if ((cid >= BXE_FIRST_VF_CID) && (cid < BXE_FIRST_VF_CID + BXE_VF_CIDS)) { - bxe_iov_set_queue_sp_obj(sc, cid, &q_obj); - } -#endif - switch (command) { case (RAMROD_CMD_ID_ETH_CLIENT_UPDATE): BLOGD(sc, DBG_SP, "got UPDATE ramrod. CID %d\n", cid); @@ -2877,34 +2705,10 @@ bxe_sp_event(struct bxe_softc *sc, return; } -#if 0 - /* SRIOV: reschedule any 'in_progress' operations */ - bxe_iov_sp_event(sc, cid, TRUE); -#endif - atomic_add_acq_long(&sc->cq_spq_left, 1); BLOGD(sc, DBG_SP, "sc->cq_spq_left 0x%lx\n", atomic_load_acq_long(&sc->cq_spq_left)); - -#if 0 - if ((drv_cmd == ECORE_Q_CMD_UPDATE) && (IS_FCOE_FP(fp)) && - (!!bxe_test_bit(ECORE_AFEX_FCOE_Q_UPDATE_PENDING, &sc->sp_state))) { - /* - * If Queue update ramrod is completed for last Queue in AFEX VIF set - * flow, then ACK MCP at the end. Mark pending ACK to MCP bit to - * prevent case that both bits are cleared. At the end of load/unload - * driver checks that sp_state is cleared and this order prevents - * races. - */ - bxe_set_bit(ECORE_AFEX_PENDING_VIFSET_MCP_ACK, &sc->sp_state); - wmb(); - bxe_clear_bit(ECORE_AFEX_FCOE_Q_UPDATE_PENDING, &sc->sp_state); - - /* schedule the sp task as MCP ack is required */ - bxe_schedule_sp_task(sc); - } -#endif } /* @@ -2945,8 +2749,15 @@ bxe_tpa_start(struct bxe_softc tmp_bd = tpa_info->bd; if (tmp_bd.m == NULL) { - BLOGE(sc, "fp[%02d].tpa[%02d] mbuf not allocated!\n", - fp->index, queue); + uint32_t *tmp; + + tmp = (uint32_t *)cqe; + + BLOGE(sc, "fp[%02d].tpa[%02d] cons[%d] prod[%d]mbuf not allocated!\n", + fp->index, queue, cons, prod); + BLOGE(sc, "cqe [0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x]\n", + *tmp, *(tmp+1), *(tmp+2), *(tmp+3), *(tmp+4), *(tmp+5), *(tmp+6), *(tmp+7)); + /* XXX Error handling? */ return; } @@ -3027,10 +2838,17 @@ bxe_fill_frag_mbuf(struct bxe_softc /* make sure the aggregated frame is not too big to handle */ if (pages > 8 * PAGES_PER_SGE) { + + uint32_t *tmp = (uint32_t *)cqe; + BLOGE(sc, "fp[%02d].sge[0x%04x] has too many pages (%d)! " "pkt_len=%d len_on_bd=%d frag_size=%d\n", fp->index, cqe_idx, pages, le16toh(cqe->pkt_len), tpa_info->len_on_bd, frag_size); + + BLOGE(sc, "cqe [0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x]\n", + *tmp, *(tmp+1), *(tmp+2), *(tmp+3), *(tmp+4), *(tmp+5), *(tmp+6), *(tmp+7)); + bxe_panic(sc, ("sge page count error\n")); return (EINVAL); } @@ -3391,15 +3209,6 @@ bxe_rxeof(struct bxe_softc *sc, uint16_t frag_size, pages; uint8_t queue; -#if 0 - /* sanity check */ - if (!fp->tpa_enable && - (CQE_TYPE_START(cqe_fp_type) || CQE_TYPE_STOP(cqe_fp_type))) { - BLOGE(sc, "START/STOP packet while !tpa_enable type (0x%x)\n", - CQE_TYPE(cqe_fp_type)); - } -#endif - if (CQE_TYPE_START(cqe_fp_type)) { bxe_tpa_start(sc, fp, cqe_fp->queue_index, bd_cons, bd_prod, cqe_fp); @@ -3605,44 +3414,8 @@ bxe_free_tx_pkt(struct bxe_softc *sc, tx_start_bd = &fp->tx_chain[bd_idx].start_bd; nbd = le16toh(tx_start_bd->nbd) - 1; -#if 0 - if ((nbd - 1) > (MAX_MBUF_FRAGS + 2)) { - bxe_panic(sc, ("BAD nbd!\n")); - } -#endif - new_cons = (tx_buf->first_bd + nbd); -#if 0 - struct eth_tx_bd *tx_data_bd; - - /* - * The following code doesn't do anything but is left here - * for clarity on what the new value of new_cons skipped. - */ - - /* get the next bd */ - bd_idx = TX_BD(TX_BD_NEXT(bd_idx)); - - /* skip the parse bd */ - --nbd; - bd_idx = TX_BD(TX_BD_NEXT(bd_idx)); - - /* skip the TSO split header bd since they have no mapping */ - if (tx_buf->flags & BXE_TSO_SPLIT_BD) { - --nbd; - bd_idx = TX_BD(TX_BD_NEXT(bd_idx)); - } - - /* now free frags */ - while (nbd > 0) { - tx_data_bd = &fp->tx_chain[bd_idx].reg_bd; - if (--nbd) { - bd_idx = TX_BD(TX_BD_NEXT(bd_idx)); - } - } -#endif - /* free the mbuf */ if (__predict_true(tx_buf->m != NULL)) { m_freem(tx_buf->m); @@ -3787,7 +3560,8 @@ bxe_del_all_macs(struct bxe_softc rc = mac_obj->delete_all(sc, mac_obj, &vlan_mac_flags, &ramrod_flags); if (rc < 0) { - BLOGE(sc, "Failed to delete MACs (%d)\n", rc); + BLOGE(sc, "Failed to delete MACs (%d) mac_type %d wait_for_comp 0x%x\n", + rc, mac_type, wait_for_comp); } return (rc); @@ -3859,7 +3633,7 @@ bxe_fill_accept_flags(struct bxe_softc * break; default: - BLOGE(sc, "Unknown rx_mode (%d)\n", rx_mode); + BLOGE(sc, "Unknown rx_mode (0x%x)\n", rx_mode); return (-1); } @@ -3907,7 +3681,11 @@ bxe_set_q_rx_mode(struct bxe_softc *sc, rc = ecore_config_rx_mode(sc, &ramrod_param); if (rc < 0) { - BLOGE(sc, "Set rx_mode %d failed\n", sc->rx_mode); + BLOGE(sc, "Set rx_mode %d cli_id 0x%x rx_mode_flags 0x%x " + "rx_accept_flags 0x%x tx_accept_flags 0x%x " + "ramrod_flags 0x%x rc %d failed\n", sc->rx_mode, cl_id, + (uint32_t)rx_mode_flags, (uint32_t)rx_accept_flags, + (uint32_t)tx_accept_flags, (uint32_t)ramrod_flags, rc); return (rc); } @@ -3990,52 +3768,11 @@ bxe_send_unload_req(struct bxe_softc *sc int unload_mode) { uint32_t reset_code = 0; -#if 0 - int port = SC_PORT(sc); - int path = SC_PATH(sc); -#endif /* Select the UNLOAD request mode */ if (unload_mode == UNLOAD_NORMAL) { reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; - } -#if 0 - else if (sc->flags & BXE_NO_WOL_FLAG) { - reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP; - } else if (sc->wol) { - uint32_t emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0; - uint8_t *mac_addr = sc->dev->dev_addr; - uint32_t val; - uint16_t pmc; - - /* - * The mac address is written to entries 1-4 to - * preserve entry 0 which is used by the PMF - */ - uint8_t entry = (SC_VN(sc) + 1)*8; - - val = (mac_addr[0] << 8) | mac_addr[1]; - EMAC_WR(sc, EMAC_REG_EMAC_MAC_MATCH + entry, val); - - val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | - (mac_addr[4] << 8) | mac_addr[5]; - EMAC_WR(sc, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val); - - /* Enable the PME and clear the status */ - pmc = pci_read_config(sc->dev, - (sc->devinfo.pcie_pm_cap_reg + - PCIR_POWER_STATUS), - 2); - pmc |= PCIM_PSTAT_PMEENABLE | PCIM_PSTAT_PME; - pci_write_config(sc->dev, - (sc->devinfo.pcie_pm_cap_reg + - PCIR_POWER_STATUS), - pmc, 4); - - reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN; - } -#endif - else { + } else { reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; } @@ -4210,7 +3947,7 @@ bxe_func_stop(struct bxe_softc *sc) rc = ecore_func_state_change(sc, &func_params); if (rc) { BLOGE(sc, "FUNC_STOP ramrod failed. " - "Running a dry transaction\n"); + "Running a dry transaction (%d)\n", rc); bxe_set_bit(RAMROD_DRV_CLR_ONLY, &func_params.ramrod_flags); return (ecore_func_state_change(sc, &func_params)); } @@ -4321,7 +4058,7 @@ bxe_chip_cleanup(struct bxe_softc *sc, */ rc = bxe_func_wait_started(sc); if (rc) { - BLOGE(sc, "bxe_func_wait_started failed\n"); + BLOGE(sc, "bxe_func_wait_started failed (%d)\n", rc); } /* @@ -4339,14 +4076,14 @@ bxe_chip_cleanup(struct bxe_softc *sc, * very wrong has happen. */ if (!bxe_wait_sp_comp(sc, ~0x0UL)) { - BLOGE(sc, "Common slow path ramrods got stuck!\n"); + BLOGE(sc, "Common slow path ramrods got stuck!(%d)\n", rc); } unload_error: rc = bxe_func_stop(sc); if (rc) { - BLOGE(sc, "Function stop failed!\n"); + BLOGE(sc, "Function stop failed!(%d)\n", rc); } /* disable HW interrupts */ @@ -4358,7 +4095,7 @@ unload_error: /* Reset the chip */ rc = bxe_reset_hw(sc, reset_code); if (rc) { - BLOGE(sc, "Hardware reset failed\n"); + BLOGE(sc, "Hardware reset failed(%d)\n", rc); } /* Report UNLOAD_DONE to MCP */ @@ -4484,7 +4221,8 @@ bxe_nic_unload(struct bxe_softc *sc, mb(); BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); - BLOGE(sc, "Can't unload in closed or error state\n"); + BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" + " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); } @@ -4691,7 +4429,8 @@ bxe_ioctl_nvram(struct bxe_softc *sc, if ((nvdata = (struct bxe_nvram_data *) malloc(len, M_DEVBUF, (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed\n"); + BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " + " len = 0x%x\n", priv_op, len); return (1); } memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); @@ -5387,11 +5126,6 @@ bxe_set_pbd_lso_e2(struct mbuf *m, ETH_TX_PARSE_BD_E2_LSO_MSS); /* XXX test for IPv6 with extension header... */ -#if 0 - struct ip6_hdr *ip6; - if (ip6 && ip6->ip6_nxt == 'some ipv6 extension header') - *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR; -#endif } static void @@ -5652,17 +5386,6 @@ bxe_tx_encap_continue: } else { /* used by FW for packet accounting */ tx_start_bd->vlan_or_ethertype = htole16(fp->tx_pkt_prod); -#if 0 - /* - * If NPAR-SD is active then FW should do the tagging regardless - * of value of priority. Otherwise, if priority indicates this is - * a control packet we need to indicate to FW to avoid tagging. - */ - if (!IS_MF_AFEX(sc) && (mbuf priority == PRIO_CONTROL)) { - SET_FLAG(tx_start_bd->general_data, - ETH_TX_START_BD_FORCE_VLAN_MODE, 1); - } -#endif } } @@ -5702,25 +5425,6 @@ bxe_tx_encap_continue: hlen = bxe_set_pbd_csum_e2(fp, m0, &pbd_e2_parsing_data); } -#if 0 - /* - * Add the MACs to the parsing BD if the module param was - * explicitly set, if this is a vf, or in switch independent - * mode. - */ - if (sc->flags & BXE_TX_SWITCHING || IS_VF(sc) || IS_MF_SI(sc)) { - eh = mtod(m0, struct ether_vlan_header *); - bxe_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi, - &pbd_e2->data.mac_addr.src_mid, - &pbd_e2->data.mac_addr.src_lo, - eh->evl_shost); - bxe_set_fw_mac_addr(&pbd_e2->data.mac_addr.dst_hi, - &pbd_e2->data.mac_addr.dst_mid, - &pbd_e2->data.mac_addr.dst_lo, - eh->evl_dhost); - } -#endif - SET_FLAG(pbd_e2_parsing_data, ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE, mac_type); } else { @@ -6347,13 +6051,6 @@ bxe_free_mem(struct bxe_softc *sc) { int i; -#if 0 - if (!CONFIGURE_NIC_MODE(sc)) { - /* free searcher T2 table */ - bxe_dma_free(sc, &sc->t2); - } -#endif - for (i = 0; i < L2_ILT_LINES(sc); i++) { bxe_dma_free(sc, &sc->context[i].vcxt_dma); sc->context[i].vcxt = NULL; @@ -6364,9 +6061,6 @@ bxe_free_mem(struct bxe_softc *sc) bxe_free_ilt_lines_mem(sc); -#if 0 - bxe_iov_free_mem(sc); -#endif } static int @@ -6376,16 +6070,6 @@ bxe_alloc_mem(struct bxe_softc *sc) int allocated; int i; -#if 0 - if (!CONFIGURE_NIC_MODE(sc)) { - /* allocate searcher T2 table */ - if (bxe_dma_alloc(sc, SRC_T2_SZ, - &sc->t2, "searcher t2 table") != 0) { - return (-1); - } - } -#endif - /* * Allocate memory for CDU context: * This memory is allocated separately and not in the generic ILT @@ -6440,14 +6124,6 @@ bxe_alloc_mem(struct bxe_softc *sc) return (-1); } -#if 0 - if (bxe_iov_alloc_mem(sc)) { - BLOGE(sc, "Failed to allocate memory for SRIOV\n"); - bxe_free_mem(sc); - return (-1); - } -#endif - return (0); } @@ -8325,27 +8001,9 @@ bxe_attn_int_deasserted3(struct bxe_soft if (val & DRV_STATUS_DRV_INFO_REQ) bxe_handle_drv_info_req(sc); -#if 0 - if (val & DRV_STATUS_VF_DISABLED) - bxe_vf_handle_flr_event(sc); -#endif - if ((sc->port.pmf == 0) && (val & DRV_STATUS_PMF)) bxe_pmf_update(sc); -#if 0 - if (sc->port.pmf && - (val & DRV_STATUS_DCBX_NEGOTIATION_RESULTS) && - (sc->dcbx_enabled > 0)) - /* start dcbx state machine */ - bxe_dcbx_set_params(sc, BXE_DCBX_STATE_NEG_RECEIVED); -#endif - -#if 0 - if (val & DRV_STATUS_AFEX_EVENT_MASK) - bxe_handle_afex_cmd(sc, val & DRV_STATUS_AFEX_EVENT_MASK); -#endif - if (val & DRV_STATUS_EEE_NEGOTIATION_RESULTS) bxe_handle_eee_event(sc); @@ -8746,8 +8404,7 @@ bxe_handle_mcast_eqe(struct bxe_softc *s rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT); if (rc < 0) { BLOGD(sc, DBG_SP, - "ERROR: Failed to send pending mcast commands (%d)\n", - rc); + "ERROR: Failed to send pending mcast commands (%d)\n", rc); } } @@ -8807,16 +8464,6 @@ bxe_handle_rx_mode_eqe(struct bxe_softc &sc->sp_state)) { bxe_set_storm_rx_mode(sc); } -#if 0 - else if (bxe_test_and_clear_bit(ECORE_FILTER_ISCSI_ETH_START_SCHED, - &sc->sp_state)) { - bxe_set_iscsi_eth_rx_mode(sc, TRUE); - } - else if (bxe_test_and_clear_bit(ECORE_FILTER_ISCSI_ETH_STOP_SCHED, - &sc->sp_state)) { - bxe_set_iscsi_eth_rx_mode(sc, FALSE); - } -#endif } static void @@ -8868,27 +8515,12 @@ bxe_eq_int(struct bxe_softc *sc) elem = &sc->eq[EQ_DESC(sw_cons)]; -#if 0 - int rc; - rc = bxe_iov_eq_sp_event(sc, elem); - if (!rc) { - BLOGE(sc, "bxe_iov_eq_sp_event returned %d\n", rc); - goto next_spqe; - } -#endif - /* elem CID originates from FW, actually LE */ cid = SW_CID(elem->message.data.cfc_del_event.cid); opcode = elem->message.opcode; /* handle eq element */ switch (opcode) { -#if 0 - case EVENT_RING_OPCODE_VF_PF_CHANNEL: - BLOGD(sc, DBG_SP, "vf/pf channel element on eq\n"); - bxe_vf_mbx(sc, &elem->message.data.vf_pf_event); - continue; -#endif case EVENT_RING_OPCODE_STAT_QUERY: BLOGD(sc, DBG_SP, "got statistics completion event %d\n", @@ -8934,25 +8566,9 @@ bxe_eq_int(struct bxe_softc *sc) else { BLOGD(sc, DBG_SP, "AFEX: ramrod completed FUNCTION_UPDATE\n"); -#if 0 - f_obj->complete_cmd(sc, f_obj, ECORE_F_CMD_AFEX_UPDATE); - /* - * We will perform the queues update from the sp_core_task as - * all queue SP operations should run with CORE_LOCK. - */ - bxe_set_bit(BXE_SP_CORE_AFEX_F_UPDATE, &sc->sp_core_state); - taskqueue_enqueue(sc->sp_tq, &sc->sp_tq_task); -#endif } goto next_spqe; -#if 0 - case EVENT_RING_OPCODE_AFEX_VIF_LISTS: - f_obj->complete_cmd(sc, f_obj, ECORE_F_CMD_AFEX_VIFLISTS); - bxe_after_afex_vif_lists(sc, elem); - goto next_spqe; -#endif - case EVENT_RING_OPCODE_FORWARD_SETUP: q_obj = &bxe_fwd_sp_obj(sc, q_obj); if (q_obj->complete_cmd(sc, q_obj, @@ -9079,14 +8695,6 @@ bxe_handle_sp_tq(void *context, */ // XXX bxe_iov_sp_task(sc); -#if 0 - /* AFEX - poll to check if VIFSET_ACK should be sent to MFW */ - if (bxe_test_and_clear_bit(ECORE_AFEX_PENDING_VIFSET_MCP_ACK, - &sc->sp_state)) { - bxe_link_report(sc); - bxe_fw_command(sc, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0); - } -#endif } static void @@ -9195,13 +8803,6 @@ bxe_intr_legacy(void *xsc) BLOGD(sc, DBG_INTR, "---> BXE INTx <---\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 19 22:48:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDE8AA9AA3; Fri, 19 Feb 2016 22:48:21 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB7A31022; Fri, 19 Feb 2016 22:48:21 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1JMmK0o066569; Fri, 19 Feb 2016 22:48:20 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1JMmK4W066568; Fri, 19 Feb 2016 22:48:20 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602192248.u1JMmK4W066568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 19 Feb 2016 22:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295831 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 22:48:22 -0000 Author: erj Date: Fri Feb 19 22:48:20 2016 New Revision: 295831 URL: https://svnweb.freebsd.org/changeset/base/295831 Log: ixl(4)/ixlv(4): Revert m_collapse() in ixl_xmit() to m_defrag(). The m_collapse() call would fail when transmitting medium-sized packets when the interface mtu was set to 9000, so revert back to m_defrag(), which does not fail. Differential Revision: https://reviews.freebsd.org/D5207 Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Fri Feb 19 22:46:52 2016 (r295830) +++ head/sys/dev/ixl/ixl_txrx.c Fri Feb 19 22:48:20 2016 (r295831) @@ -286,7 +286,7 @@ ixl_xmit(struct ixl_queue *que, struct m if (error == EFBIG) { struct mbuf *m; - m = m_collapse(*m_headp, M_NOWAIT, maxsegs); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { que->mbuf_defrag_failed++; m_freem(*m_headp); From owner-svn-src-head@freebsd.org Fri Feb 19 23:06:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E383AAE5A9; Fri, 19 Feb 2016 23:06:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 392561DE2; Fri, 19 Feb 2016 23:06:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u1JN6CMN014637 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Feb 2016 15:06:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u1JN6CMP014636; Fri, 19 Feb 2016 15:06:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Feb 2016 15:06:12 -0800 From: Gleb Smirnoff To: Alan Somers Cc: Sergey Kandaurov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Message-ID: <20160219230612.GR1945@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:06:14 -0000 On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: A> > On 18 February 2016 at 23:08, Alan Somers wrote: A> >> Author: asomers A> >> Date: Thu Feb 18 20:08:01 2016 A> >> New Revision: 295768 A> >> URL: https://svnweb.freebsd.org/changeset/base/295768 A> >> A> >> Log: A> >> Fix compiler warnings in iostat A> > A> >> Modified: head/usr.sbin/iostat/iostat.c A> >> ============================================================================== A> >> --- head/usr.sbin/iostat/iostat.c Thu Feb 18 19:37:39 2016 (r295767) A> >> +++ head/usr.sbin/iostat/iostat.c Thu Feb 18 20:08:01 2016 (r295768) A> >> @@ -117,30 +117,34 @@ A> >> #include A> >> #include A> >> A> >> -struct nlist namelist[] = { A> >> +static struct nlist namelist[] = { A> >> #define X_TTY_NIN 0 A> >> - { "_tty_nin" }, A> >> + { .n_name = "_tty_nin", A> >> + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, A> >> [...] A> > A> > You unlikely need this excessive explicit zeroization. A> > In this case it is implicitly prezeroed. A> > A> > Consider these two cases: A> > A> > : #include A> > : A> > : int main(void) { A> > : struct nlist namelist[2] = {{ .n_type = 0x42 }}; A> > : return sizeof(namelist); A> > : } A> > A> > (__TEXT,__text) section A> > _main: A> > 0000000000000000 pushq %rbp A> > 0000000000000001 movq %rsp, %rbp A> > 0000000000000004 leaq -0x30(%rbp), %rdx A> > 0000000000000008 movl $0x0, %eax A> > 000000000000000d movl $0x6, %ecx A> > 0000000000000012 movq %rdx, %rdi A> > 0000000000000015 rep A> > 0000000000000016 stosq A> > 0000000000000018 movb $0x42, -0x28(%rbp) A> > 000000000000001c movl $0x30, %eax A> > 0000000000000021 popq %rbp A> > 0000000000000022 retq A> > A> > rep stosq does zero 48 bytes, that is namelist[]. A> > A> > Or, if it is static. A> > A> > : #include A> > : A> > : int main(void) { A> > : static struct nlist namelist[2] = {{ .n_type = 0x42 }}; A> > : return sizeof(namelist); A> > : } A> > A> > (__DATA,__data) section A> > 0000000000000020 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 A> > 0000000000000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A> > 0000000000000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A> A> Yeah, it was being implicitly zeroized before. But Clang complained A> about the structures being only partially initialized. Since the A> whole point of my commit was to increase the WARNS level, I explicitly A> zeroed the zero fields to silence Clang. Isn't zero filling part of the standard? I don't see why lack of explicit zeroing is a warning? Looks a false warning to me. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 19 23:08:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252A1AAE71D; Fri, 19 Feb 2016 23:08:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 129C01009; Fri, 19 Feb 2016 23:08:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u1JN8C9o014672 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Feb 2016 15:08:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u1JN8CtD014671; Fri, 19 Feb 2016 15:08:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Feb 2016 15:08:12 -0800 From: Gleb Smirnoff To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295828 - head/sys/dev/ixl Message-ID: <20160219230812.GS1945@FreeBSD.org> References: <201602192233.u1JMXpUp063415@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602192233.u1JMXpUp063415@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:08:14 -0000 On Fri, Feb 19, 2016 at 10:33:51PM +0000, Eric Joyner wrote: E> Author: erj E> Date: Fri Feb 19 22:33:50 2016 E> New Revision: 295828 E> URL: https://svnweb.freebsd.org/changeset/base/295828 E> E> Log: E> ixl(4): Remove unsupported device IDs. E> E> There is no official support for 20G SKUs on FreeBSD, and the KX_A E> device ID was never used. Did the driver attach but failed to work before? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 19 23:14:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F21AAEA00; Fri, 19 Feb 2016 23:14:48 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F08481447; Fri, 19 Feb 2016 23:14:47 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id g62so91139265wme.0; Fri, 19 Feb 2016 15:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=01V0n2S5Khbtlwb0Qg/aJzITbJ1nW5QrSFzGPpO/Vwo=; b=h5uB2iPujw+jSfgtNFjTfK0M3l7bNRew7HGpot0FLbQ2HurzgDvgARjfYZqw9TCzCU 0cqYfBJjpUGL5nKzZaPA/7w0GCNcf2bEZZA1Jcr3j/RBdombk4kZTzWCiOkXpAdL+nIb afMh3cR4XXK/7iVn5GIiviOb/+8rWVPh+P08rUb6dHkqHJTdmRNGAmGu77+8OMesLUhK oboRu+B7MCCj3p+z7Zx1/O5kAbege7wmgz9/5vWYwFYzwh/tzSmqBk0cACcbKL2Z84ig 7ENJ74/9ckCBBslwpZjEUTgkbq4gSDzINxt6FmznOggtgyAUF0TGTtoySqI6ZO28pRi8 XtFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=01V0n2S5Khbtlwb0Qg/aJzITbJ1nW5QrSFzGPpO/Vwo=; b=XDzn7j07sEZQvpjR5/0HgOLZAoCbw42F+edYApwa8mNVINe2WD8llT2eN4JY+22Qdq K+xjMMWtk3uR4Ti0N3NWhJxfXeVJE8KAqOxAij4JWo53R6EZB6LGLHYadm5kq4gDD0jB EENs0tjU9dgv+tNw4wFw0/pQU7mHObcoBJGFJFdL0rIE3cLmHu+ddTTtlE24vPHZJPcw NB5pykHB5YGqj8aHeUfo4MD1ZCAmcMzDW48PVal9Hztqpnmk5jwyRTyhcJ6ZE7CjEPwI 3vKAuyLq/LmbW/gtPfr9GCjjh0xkinZx+MhiQp+xGZ3sXGUD8HOO2dTFdNWlYDGTr6WV CNgg== X-Gm-Message-State: AG10YORbxBdfXj/UsT+kryHqLa0d37SkEr53TpbDmmj9KTW4V0fMWqBa+oIj2C4ycA13CshNnYh/t9m/YQJrIw== MIME-Version: 1.0 X-Received: by 10.194.84.66 with SMTP id w2mr3574021wjy.6.1455923685009; Fri, 19 Feb 2016 15:14:45 -0800 (PST) Received: by 10.27.170.11 with HTTP; Fri, 19 Feb 2016 15:14:44 -0800 (PST) In-Reply-To: <20160219230612.GR1945@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> Date: Fri, 19 Feb 2016 17:14:44 -0600 Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Benjamin Kaduk To: Gleb Smirnoff Cc: Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:14:48 -0000 On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: > On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: > A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov > wrote: > A> Yeah, it was being implicitly zeroized before. But Clang complained > A> about the structures being only partially initialized. Since the > A> whole point of my commit was to increase the WARNS level, I explicitly > A> zeroed the zero fields to silence Clang. > > Isn't zero filling part of the standard? I don't see why lack of > explicit zeroing is a warning? Looks a false warning to me. > It is not quite as simple as this would make it sound. The elements or members of an aggregate (e.g.) structure type are initialized as if it were an object of static storage duration (i.e., to zero) if the initializer list does not contain enough initializers for all members of the aggregate type, per item 21 of section 6.7.8 of n1256.pdf. However, such initialization does not necessarily need to zero any padding bytes that are present, which may take unspecified values. Personally, I think this particular clang warning can be too aggressive, especially for complex structs, but on the other hand given the indeterminateness of padding, bzero/memset are often a better choice anyway. -Ben From owner-svn-src-head@freebsd.org Fri Feb 19 23:18:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54527AAEB5F; Fri, 19 Feb 2016 23:18:05 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com [209.85.220.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6DB17D6; Fri, 19 Feb 2016 23:18:04 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-qk0-f172.google.com with SMTP id s5so37066693qkd.0; Fri, 19 Feb 2016 15:18:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=bOIsPdE8lWHKZn6Ip02Tp92VXiLrHNPg6jV7UWbe+Po=; b=JtdgmvRWDUUwcmHYK9IR0ifpzCEBw8UFStaSFClNtyb+JI3DxNZmbqpXFUHENaoom4 Y2xYPI8y+lRWYz3Eeg4iEMcnc8DIe8D/XjsI3UGwas80SNl0lY48AKsXONszzPCBKr/1 +y6hd+Emmgu6RtSEA1qAaZFYJdoN3TdyyWzGQjO3bzBhjZB8ingQ8nwMDFIXPkPQHmQl WzILW8auPymkFpRvBaBMdjZdnnouec/eeUXrnQ8TrhYStTR7rVFH1bKOZm9VKZb5SKGO +XL7TZ1wLnVXAZsDqzS6n2Mt5MXAHgtZsGMyDgsWVqteHz3n3W8NeS3gobt8zsEMQ8Tm aMpw== X-Gm-Message-State: AG10YOTaB3sTD94VuFGhyMrVpaVtq6I5fbRQKp1kWrucLpA2RovrKFkSkX3yhsVw1bP3pA== X-Received: by 10.55.81.3 with SMTP id f3mr19740199qkb.35.1455923538923; Fri, 19 Feb 2016 15:12:18 -0800 (PST) Received: from mail-qg0-f47.google.com (mail-qg0-f47.google.com. [209.85.192.47]) by smtp.gmail.com with ESMTPSA id 123sm5563996qhu.22.2016.02.19.15.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 15:12:18 -0800 (PST) Received: by mail-qg0-f47.google.com with SMTP id y9so74653704qgd.3; Fri, 19 Feb 2016 15:12:18 -0800 (PST) X-Received: by 10.140.95.76 with SMTP id h70mr12539707qge.105.1455923538446; Fri, 19 Feb 2016 15:12:18 -0800 (PST) MIME-Version: 1.0 References: <201602192233.u1JMXpUp063415@repo.freebsd.org> <20160219230812.GS1945@FreeBSD.org> In-Reply-To: <20160219230812.GS1945@FreeBSD.org> From: Eric Joyner Date: Fri, 19 Feb 2016 23:12:08 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r295828 - head/sys/dev/ixl To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:18:05 -0000 The driver worked for the most part on the 20G hardware, but it's specific hardware for an OEM that doesn't use FreeBSD. The KX_A device ID never made it into any hardware. On Fri, Feb 19, 2016 at 3:08 PM Gleb Smirnoff wrote: > On Fri, Feb 19, 2016 at 10:33:51PM +0000, Eric Joyner wrote: > E> Author: erj > E> Date: Fri Feb 19 22:33:50 2016 > E> New Revision: 295828 > E> URL: https://svnweb.freebsd.org/changeset/base/295828 > E> > E> Log: > E> ixl(4): Remove unsupported device IDs. > E> > E> There is no official support for 20G SKUs on FreeBSD, and the KX_A > E> device ID was never used. > > Did the driver attach but failed to work before? > > -- > Totus tuus, Glebius. > From owner-svn-src-head@freebsd.org Fri Feb 19 23:23:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC53AAEE31; Fri, 19 Feb 2016 23:23:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B363E1C59; Fri, 19 Feb 2016 23:23:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::f94f:f974:728d:e162] (unknown [IPv6:2001:7b8:3a7:0:f94f:f974:728d:e162]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 83CE8AB5B; Sat, 20 Feb 2016 00:23:49 +0100 (CET) Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Sat, 20 Feb 2016 00:23:40 +0100 Cc: Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:23:53 -0000 --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 19 Feb 2016, at 16:49, Alan Somers wrote: >=20 > On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov = wrote: ... >>> -struct nlist namelist[] =3D { >>> +static struct nlist namelist[] =3D { >>> #define X_TTY_NIN 0 >>> - { "_tty_nin" }, >>> + { .n_name =3D "_tty_nin", >>> + .n_type =3D 0, .n_other =3D 0, .n_desc =3D 0, .n_value =3D = 0 }, >>> [...] >>=20 >> You unlikely need this excessive explicit zeroization. >> In this case it is implicitly prezeroed. ... > Yeah, it was being implicitly zeroized before. But Clang complained > about the structures being only partially initialized. Since the > whole point of my commit was to increase the WARNS level, I explicitly > zeroed the zero fields to silence Clang. You got this warning, most likely: usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' = initializer [-Werror,-Wmissing-field-initializers] { "_tty_nin" }, ^ This warning is only produced when you use -Wall -W, and then initialize structs partially, i.e. you initialize some fields but not others. I think this is a quite reasonable warning for a high warning level. On the other hand, if this kind of construct is used throughout the tree, and it is not seen as a big problem, we can simply silence this particular warning using -Wno-missing-field -initializers. There is already quite a list of warnings which are suppressed by default, even at WARNS=3D6, namely: -Wno-empty-body -Wno-format-y2k -Wno-pointer-sign -Wno-string-plus-int -Wno-unused-const-variable -Wno-unused-parameter -Dimitry --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlbHpAUACgkQsF6jCi4glqMxlQCg/fTaWwEfvIldNSVMJDEjxMbV xD0AoI7Hez0QV3G6p9UhX8FsRzU/eYZJ =fJ6B -----END PGP SIGNATURE----- --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81-- From owner-svn-src-head@freebsd.org Fri Feb 19 23:31:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97C6AAD2A1; Fri, 19 Feb 2016 23:31:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B5EBD1107; Fri, 19 Feb 2016 23:31:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u1JNVZO2014771 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Feb 2016 15:31:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u1JNVZkt014770; Fri, 19 Feb 2016 15:31:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Feb 2016 15:31:35 -0800 From: Gleb Smirnoff To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295828 - head/sys/dev/ixl Message-ID: <20160219233135.GT1945@FreeBSD.org> References: <201602192233.u1JMXpUp063415@repo.freebsd.org> <20160219230812.GS1945@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:31:36 -0000 Eric, do you mean that this specific PCI ID goes to a certain device manufacturer who is known to install only specific software on their devices? Even in that case I don't see any improvement in removing the PCI IDs from the driver. People could use these devices aftermarket, and install what ever they want. Even if that is very very low probability, still having working PCI IDs in the driver doesn't hurt anyone. IMHO, once Intel drops official maintainership for some hw/sw, the code shouldn't be deleted from FreeBSD, since community may willing to take maintainership. As was discussed, we need official support matrix of Intel published, and anything that doesn't fit into the matrix is community supported. On Fri, Feb 19, 2016 at 11:12:08PM +0000, Eric Joyner wrote: E> The driver worked for the most part on the 20G hardware, but it's specific E> hardware for an OEM that doesn't use FreeBSD. E> E> The KX_A device ID never made it into any hardware. E> E> On Fri, Feb 19, 2016 at 3:08 PM Gleb Smirnoff wrote: E> E> > On Fri, Feb 19, 2016 at 10:33:51PM +0000, Eric Joyner wrote: E> > E> Author: erj E> > E> Date: Fri Feb 19 22:33:50 2016 E> > E> New Revision: 295828 E> > E> URL: https://svnweb.freebsd.org/changeset/base/295828 E> > E> E> > E> Log: E> > E> ixl(4): Remove unsupported device IDs. E> > E> E> > E> There is no official support for 20G SKUs on FreeBSD, and the KX_A E> > E> device ID was never used. E> > E> > Did the driver attach but failed to work before? E> > E> > -- E> > Totus tuus, Glebius. E> > -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 19 23:32:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3C3FAAD3DD; Fri, 19 Feb 2016 23:32:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D87612FE; Fri, 19 Feb 2016 23:32:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u1JNWrTJ014787 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Feb 2016 15:32:54 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u1JNWrRN014786; Fri, 19 Feb 2016 15:32:53 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Feb 2016 15:32:53 -0800 From: Gleb Smirnoff To: Dimitry Andric Cc: Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Message-ID: <20160219233253.GU1945@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Feb 2016 23:32:54 -0000 On Sat, Feb 20, 2016 at 12:23:40AM +0100, Dimitry Andric wrote: D> You got this warning, most likely: D> D> usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer [-Werror,-Wmissing-field-initializers] D> { "_tty_nin" }, D> ^ D> D> This warning is only produced when you use -Wall -W, and then initialize D> structs partially, i.e. you initialize some fields but not others. I D> think this is a quite reasonable warning for a high warning level. D> D> On the other hand, if this kind of construct is used throughout the D> tree, and it is not seen as a big problem, we can simply silence this D> particular warning using -Wno-missing-field -initializers. There is D> already quite a list of warnings which are suppressed by default, even D> at WARNS=6, namely: D> D> -Wno-empty-body D> -Wno-format-y2k D> -Wno-pointer-sign D> -Wno-string-plus-int D> -Wno-unused-const-variable D> -Wno-unused-parameter I think we should add -Wno-missing-field-initializers there. We use this feature in the kernel intentionally, since it allows to write code that is less dependant on API changes. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sat Feb 20 00:04:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8F6AAE563; Sat, 20 Feb 2016 00:04:44 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from vps.amdmi3.ru (vps.amdmi3.ru [109.234.38.216]) by mx1.freebsd.org (Postfix) with ESMTP id 715F817C; Sat, 20 Feb 2016 00:04:43 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from hive.panopticon (unknown [78.153.152.119]) by vps.amdmi3.ru (Postfix) with ESMTPS id 10D0AB0615; Sat, 20 Feb 2016 03:04:41 +0300 (MSK) Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 716B3D83; Sat, 20 Feb 2016 03:02:36 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 112191DF; Sat, 20 Feb 2016 03:03:56 +0300 (MSK) Date: Sat, 20 Feb 2016 03:03:56 +0300 From: Dmitry Marakasov To: Stefan Esser Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb Message-ID: <20160220000356.GA10175@hades.panopticon> References: <201602190842.u1J8gDOc015177@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201602190842.u1J8gDOc015177@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 00:04:44 -0000 * Stefan Esser (se@FreeBSD.org) wrote: > Log: > Remove O_SYNC from the options passed to dbmopen(). > > The output file is created as a temporary file that is moved over the > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. How is it guaranteed that the temporary file is completely written to disk before it's moved over the old database? I've run cap_mkdb under ktrace and I don't see fsync call there. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://amdmi3.ru From owner-svn-src-head@freebsd.org Sat Feb 20 00:40:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E21AAE79A; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D204C13DC; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CC32E17B1; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8474718B9C; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id eP8e3Ikb-B_D; Sat, 20 Feb 2016 00:40:34 +0000 (UTC) Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3E6EA18B96 To: Stefan Esser , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602190842.u1J8gDOc015177@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc X-Enigmail-Draft-Status: N1110 Organization: FreeBSD Message-ID: <56C7B60E.8080002@FreeBSD.org> Date: Fri, 19 Feb 2016 16:40:46 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602190842.u1J8gDOc015177@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 00:40:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/19/2016 12:42 AM, Stefan Esser wrote: > Author: se > Date: Fri Feb 19 08:42:13 2016 > New Revision: 295800 > URL: https://svnweb.freebsd.org/changeset/base/295800 >=20 > Log: > Remove O_SYNC from the options passed to dbmopen(). Uh, this is a full revert of r293312's changes to cap_mkdb which were made for good reason. So this seems simply wrong without a better fix. > =20 > The output file is created as a temporary file that is moved over the= > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. This is not right either. Depending on the use of soft updates / journaling the data and metadata (file name / rename) may be written at different times. It is entirely possible to get a renamed file with no or junk content without an fsync. That's exactly what r293312 mentions in its commit message. > =20 > This speeds up creation of the termcap db by a factor of 40 on my > ZFS based /etc filesytem (from 25 seconds to 0.6 seconds). > =20 > I have compared multiple output files created with and without O_SYNC= > and they came out identical each time. Nonetheless it might be best > to MFC this change and the similar one for services_mkdb (r295465) at= > the same time when the changes to hash.c in review D5186 are merged. > =20 > MFC: 1 week >=20 > Modified: > head/usr.bin/cap_mkdb/cap_mkdb.c >=20 > Modified: head/usr.bin/cap_mkdb/cap_mkdb.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/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:41:47 2016 (r295799)= > +++ head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:42:13 2016 (r295800)= > @@ -119,7 +119,7 @@ main(int argc, char *argv[]) > (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);= > if ((capname =3D strdup(buf)) =3D=3D NULL) > errx(1, "strdup failed"); > - if ((capdbp =3D dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC, > + if ((capdbp =3D dbopen(capname, O_CREAT | O_TRUNC | O_RDWR, > DEFFILEMODE, DB_HASH, &openinfo)) =3D=3D NULL) > err(1, "%s", buf); > =20 >=20 --=20 Regards, Bryan Drewery --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWx7YOAAoJEDXXcbtuRpfP0eoIAKJjU/UcXWCvLBsNGRdxbyOM 5uk9H2Aue4TPjEST4SXuFE49mdWsqty5dC36UKxVyQONOUOI+BGRBApxPYqWRYRi K+DPz9FmBNbKgxv/De2FrF2zHabPg/f+PyMxCu/BnwtMui5SWYMmeHSeLV5G3KD6 RBm5/xAga2J4EtZR3NnIL/kIASFOOrExgVdC+7ln46WQFPomA5rkDfeYVGud4w05 V2puH9vnCtY6EaInRp1lAgR0eczsVV5EX0jqw1GOlgXRmUZYWoVi4HmT6UogLTbH v6rVwurm2OumY7OpmBzP6ZJXBQHOM5YZFOKaZQnbvpZLwZb7pUiEzmZEbT/vD+8= =aFoF -----END PGP SIGNATURE----- --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0-- From owner-svn-src-head@freebsd.org Sat Feb 20 00:49:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC37AAEB66; Sat, 20 Feb 2016 00:49:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ED3A199C; Sat, 20 Feb 2016 00:49:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-x235.google.com with SMTP id h129so80621599ywb.1; Fri, 19 Feb 2016 16:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Xj2tHl5EAdyUx/YeBLo//Ark3N4weU0A0VResVEYPDM=; b=xGbEcvo3XyNu3v9eFND+Sziz29h4quVkoavN8zPPtVNISrv42LZX1pIUiL9PZ931sg F495UekwtSdcxVNe/KbNnx+FTMsCa8ZanDI+Y7ShGVAi9shK33RJP8BCR00d+Am78WeE hKq8SxkJ6U4VkeV19rOIpV3OWjiXZ49XovYXd7WiLNBd5fHlP1rlNFIj3f1NUvEEDtkK nO+6BHKw6m5/ZaPhL6Kijy7S/B+VINJafhQKeh0nom4/eulWz9dHKQT+LLxgWgaD54Ik PqD9WcQEtN/0TcshzpadM+y2w7dN+bjtMbLu4Cq2GmKLspFDgVySx32OLog9Iv8ih/F4 Ek0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Xj2tHl5EAdyUx/YeBLo//Ark3N4weU0A0VResVEYPDM=; b=EGPvsN3pg+rsUBkNG3fNUj0BtHP+OFxYODiWciXrP5soVQuKShidNMCn3GXC9Z0SBd yVb2EZW9A9Ok+byUMV1+17hlk5Y7m4ehSTPOhzIdIGZIolhAAvWAePjvQg39rc1/YJmj H7jvzMJZn2+qt5+d1kL2KCtUd/adUB3osqQ5saGP4VuYK2RX1oKQhFpYlKx3v2MK66tk Uld9jDGGKvdx2lEyuqJGj22X4swS+79fhkHYI6UY3mck6N7iVpOKP7M4dg4jwFXD5AVl 7mcF7WvUyh8ZDEdpz0qAoQFTF7WeyS6kF0Eml6RyiWaLZWEWnH3D7OxZq/2KU1X+ha/g NBZA== X-Gm-Message-State: AG10YOSu2OBnp5I091Fx6ahAiyzjl4TJQHGcGJKwSAIAtPNRDxzkJRqzL7Ah/lSrt7KkDjn3xIbwXrZK+McVZA== MIME-Version: 1.0 X-Received: by 10.129.40.78 with SMTP id o75mr9452613ywo.9.1455929375292; Fri, 19 Feb 2016 16:49:35 -0800 (PST) Received: by 10.37.210.9 with HTTP; Fri, 19 Feb 2016 16:49:35 -0800 (PST) In-Reply-To: <20160219230612.GR1945@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> Date: Fri, 19 Feb 2016 16:49:35 -0800 Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Conrad Meyer To: Gleb Smirnoff Cc: Alan Somers , Sergey Kandaurov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 00:49:36 -0000 On Fri, Feb 19, 2016 at 3:06 PM, Gleb Smirnoff wrote: > Isn't zero filling part of the standard? I don't see why lack of > explicit zeroing is a warning? Looks a false warning to me. Yep. This is Clang being too whiney, IMO. I think a good workaround is to add -Wno-missing-field-initializers to warn flags (but otherwise keep high WARNS). Best, Conrad From owner-svn-src-head@freebsd.org Sat Feb 20 01:33:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB510AAE262; Sat, 20 Feb 2016 01:33:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B94F810A7; Sat, 20 Feb 2016 01:33:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1K1X2pu016475; Sat, 20 Feb 2016 01:33:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1K1WwTp016411; Sat, 20 Feb 2016 01:32:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602200132.u1K1WwTp016411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Feb 2016 01:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295832 - in head/sys: arm/at91 arm/cavium/cns11xx arm/mv arm64/arm64 arm64/cavium dev/acpica dev/eisa dev/fdt dev/gpio dev/mca dev/ofw dev/pccard dev/siba dev/vnic kern mips/adm5120 mi... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 01:33:04 -0000 Author: jhibbits Date: Sat Feb 20 01:32:58 2016 New Revision: 295832 URL: https://svnweb.freebsd.org/changeset/base/295832 Log: Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it. This simplifies checking for default resource range for bus_alloc_resource(), and improves readability. This is part of, and related to, the migration of rman_res_t from u_long to uintmax_t. Discussed with: jhb Suggested by: marcel Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_pinctrl.c head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_pci.c head/sys/arm64/arm64/gic_fdt.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/nexus.c head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/dev/acpica/acpi.c head/sys/dev/eisa/eisaconf.c head/sys/dev/fdt/simplebus.c head/sys/dev/gpio/gpiobus.c head/sys/dev/mca/mca_bus.c head/sys/dev/ofw/ofwbus.c head/sys/dev/pccard/pccard.c head/sys/dev/siba/siba.c head/sys/dev/vnic/mrml_bridge.c head/sys/kern/subr_bus.c head/sys/mips/adm5120/obio.c head/sys/mips/alchemy/obio.c head/sys/mips/atheros/apb.c head/sys/mips/beri/beri_simplebus.c head/sys/mips/idt/obio.c head/sys/mips/mips/nexus.c head/sys/mips/nlm/xlp_simplebus.c head/sys/mips/rt305x/obio.c head/sys/mips/sibyte/sb_zbbus.c head/sys/powerpc/mpc85xx/isa.c head/sys/riscv/riscv/nexus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/isa/isa.c head/sys/sparc64/pci/apb.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c head/sys/sys/rman.h head/sys/x86/isa/isa.c head/sys/x86/x86/nexus.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm/at91/at91.c Sat Feb 20 01:32:58 2016 (r295832) @@ -164,7 +164,7 @@ at91_alloc_resource(device_t dev, device return (NULL); if (rle->res) panic("Resource rid %d type %d already in use", *rid, type); - if (start == 0UL && end == ~0UL) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm/at91/at91_pinctrl.c Sat Feb 20 01:32:58 2016 (r295832) @@ -280,7 +280,7 @@ pinctrl_alloc_resource(device_t bus, dev * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm/cavium/cns11xx/econa.c Sat Feb 20 01:32:58 2016 (r295832) @@ -425,7 +425,7 @@ econa_alloc_resource(device_t dev, devic } if (rle->res) panic("Resource rid %d type %d already in use", *rid, type); - if (start == 0UL && end == ~0UL) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm/mv/mv_localbus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -341,7 +341,7 @@ localbus_alloc_resource(device_t bus, de * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm/mv/mv_pci.c Sat Feb 20 01:32:58 2016 (r295832) @@ -844,7 +844,7 @@ mv_pcib_alloc_resource(device_t dev, dev type, rid, start, end, count, flags)); }; - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { start = sc->sc_mem_base; end = sc->sc_mem_base + sc->sc_mem_size - 1; count = sc->sc_mem_size; Modified: head/sys/arm64/arm64/gic_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_fdt.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/arm64/gic_fdt.c Sat Feb 20 01:32:58 2016 (r295832) @@ -211,7 +211,7 @@ arm_gic_fdt_alloc_resource(device_t bus, * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/arm64/gic_v3_fdt.c Sat Feb 20 01:32:58 2016 (r295832) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -180,7 +181,7 @@ gic_v3_ofw_bus_alloc_res(device_t bus, d struct resource_list_entry *rle; int ranges_len; - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); if (type != SYS_RES_MEMORY) Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/arm64/nexus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -223,7 +223,7 @@ nexus_alloc_resource(device_t bus, devic * (ie. they aren't maintained by a child bus), then work out * the start/end values. */ - if ((start == 0UL) && (end == ~0UL) && (count == 1)) { + if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) { if (device_get_parent(child) != bus || ndev == NULL) return(NULL); rle = resource_list_find(&ndev->nx_resources, type, *rid); Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/cavium/thunder_pcie.c Sat Feb 20 01:32:58 2016 (r295832) @@ -292,7 +292,7 @@ thunder_pcie_alloc_resource(device_t dev type, rid, start, end, count, flags)); }; - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { /* Read BAR manually to get resource address and size */ pci_read_bar(child, *rid, &map, &testval, NULL); Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Sat Feb 20 01:32:58 2016 (r295832) @@ -283,7 +283,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t sc = device_get_softc(bus); - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); if (type == SYS_RES_IOPORT) Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Sat Feb 20 01:32:58 2016 (r295832) @@ -435,7 +435,7 @@ thunder_pem_alloc_resource(device_t dev, end, count, flags)); }; - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { device_printf(dev, "Cannot allocate resource with unspecified range\n"); goto fail; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/acpica/acpi.c Sat Feb 20 01:32:58 2016 (r295832) @@ -1334,7 +1334,7 @@ acpi_alloc_resource(device_t bus, device struct resource_list_entry *rle; struct resource_list *rl; struct resource *res; - int isdefault = (start == 0UL && end == ~0UL); + int isdefault = RMAN_IS_DEFAULT_RANGE(start, end); /* * First attempt at allocating the resource. For direct children, Modified: head/sys/dev/eisa/eisaconf.c ============================================================================== --- head/sys/dev/eisa/eisaconf.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/eisa/eisaconf.c Sat Feb 20 01:32:58 2016 (r295832) @@ -359,7 +359,7 @@ eisa_alloc_resource(device_t dev, device struct resource *rv, **rvp = 0; isdefault = (device_get_parent(child) == dev && - start == 0UL && end == ~0UL && count == 1); + RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); switch (type) { case SYS_RES_IRQ: Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/fdt/simplebus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -335,7 +335,7 @@ simplebus_alloc_resource(device_t bus, d * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/gpio/gpiobus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -516,7 +516,7 @@ gpiobus_alloc_resource(device_t bus, dev if (type != SYS_RES_IRQ) return (NULL); - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); rle = NULL; if (isdefault) { rl = BUS_GET_RESOURCE_LIST(bus, child); Modified: head/sys/dev/mca/mca_bus.c ============================================================================== --- head/sys/dev/mca/mca_bus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/mca/mca_bus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -463,7 +463,7 @@ mca_alloc_resource (device_t dev, device int isdefault; int passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != dev); if (!passthrough && !isdefault) { Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/ofw/ofwbus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -186,7 +186,7 @@ ofwbus_alloc_resource(device_t bus, devi struct resource_list_entry *rle; int isdefault, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); sc = device_get_softc(bus); rle = NULL; Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/pccard/pccard.c Sat Feb 20 01:32:58 2016 (r295832) @@ -1137,7 +1137,7 @@ pccard_alloc_resource(device_t dev, devi struct pccard_ivar *dinfo; struct resource_list_entry *rle = 0; int passthrough = (device_get_parent(child) != dev); - int isdefault = (start == 0 && end == ~0UL && count == 1); + int isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); struct resource *r = NULL; /* XXX I'm no longer sure this is right */ Modified: head/sys/dev/siba/siba.c ============================================================================== --- head/sys/dev/siba/siba.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/siba/siba.c Sat Feb 20 01:32:58 2016 (r295832) @@ -383,7 +383,7 @@ siba_alloc_resource(device_t bus, device printf("%s: entry\n", __func__); #endif - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); needactivate = flags & RF_ACTIVE; rl = BUS_GET_RESOURCE_LIST(bus, child); rle = NULL; Modified: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- head/sys/dev/vnic/mrml_bridge.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/dev/vnic/mrml_bridge.c Sat Feb 20 01:32:58 2016 (r295832) @@ -139,7 +139,7 @@ mrmlb_ofw_bus_alloc_res(device_t bus, de struct resource_list_entry *rle; int i; - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); if (type == SYS_RES_IOPORT) Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/kern/subr_bus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -3311,7 +3311,7 @@ resource_list_alloc(struct resource_list { struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); + int isdefault = RMAN_IS_DEFAULT_RANGE(start, end); if (passthrough) { return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, Modified: head/sys/mips/adm5120/obio.c ============================================================================== --- head/sys/mips/adm5120/obio.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/adm5120/obio.c Sat Feb 20 01:32:58 2016 (r295832) @@ -231,7 +231,7 @@ obio_alloc_resource(device_t bus, device struct rman *rm; int isdefault, needactivate, passthrough; - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); rle = NULL; Modified: head/sys/mips/alchemy/obio.c ============================================================================== --- head/sys/mips/alchemy/obio.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/alchemy/obio.c Sat Feb 20 01:32:58 2016 (r295832) @@ -232,7 +232,7 @@ obio_alloc_resource(device_t bus, device struct rman *rm; int isdefault, needactivate, passthrough; - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); rle = NULL; Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/atheros/apb.c Sat Feb 20 01:32:58 2016 (r295832) @@ -170,7 +170,7 @@ apb_alloc_resource(device_t bus, device_ struct rman *rm; int isdefault, needactivate, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end)); needactivate = flags & RF_ACTIVE; /* * Pass memory requests to nexus device Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/beri/beri_simplebus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -260,7 +260,7 @@ simplebus_alloc_resource(device_t bus, d * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); Modified: head/sys/mips/idt/obio.c ============================================================================== --- head/sys/mips/idt/obio.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/idt/obio.c Sat Feb 20 01:32:58 2016 (r295832) @@ -165,7 +165,7 @@ obio_alloc_resource(device_t bus, device struct rman *rm; int isdefault, needactivate, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end)); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); rle = NULL; Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/mips/nexus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -281,7 +281,7 @@ nexus_alloc_resource(device_t bus, devic (void *)(intptr_t)end, count, flags); dprintf("%s: requested rid is %d\n", __func__, *rid); - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); rle = NULL; Modified: head/sys/mips/nlm/xlp_simplebus.c ============================================================================== --- head/sys/mips/nlm/xlp_simplebus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/nlm/xlp_simplebus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -192,7 +192,7 @@ xlp_simplebus_alloc_resource(device_t bu bustag = NULL; if (!passthrough) { - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); if (isdefault) { rle = resource_list_find(&di->rl, type, *rid); if (rle == NULL) Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/rt305x/obio.c Sat Feb 20 01:32:58 2016 (r295832) @@ -287,7 +287,7 @@ obio_alloc_resource(device_t bus, device struct rman *rm; int isdefault, needactivate, passthrough; - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); rle = NULL; Modified: head/sys/mips/sibyte/sb_zbbus.c ============================================================================== --- head/sys/mips/sibyte/sb_zbbus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/mips/sibyte/sb_zbbus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -288,7 +288,7 @@ zbbus_alloc_resource(device_t bus, devic struct resource_list_entry *rle; struct zbbus_devinfo *dinfo; - isdefault = (start == 0UL && end == ~0UL && count == 1); + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); /* * Our direct child is asking for a default resource allocation. Modified: head/sys/powerpc/mpc85xx/isa.c ============================================================================== --- head/sys/powerpc/mpc85xx/isa.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/powerpc/mpc85xx/isa.c Sat Feb 20 01:32:58 2016 (r295832) @@ -52,7 +52,7 @@ isa_alloc_resource(device_t bus, device_ struct resource_list *rl = &idev->id_resources; int isdefault, passthrough, rids; - isdefault = (start == 0UL && end == ~0UL) ? 1 : 0; + isdefault = RMAN_IS_DEFAULT_RANGE(start, end) ? 1 : 0; passthrough = (device_get_parent(child) != bus) ? 1 : 0; if (!passthrough && !isdefault && Modified: head/sys/riscv/riscv/nexus.c ============================================================================== --- head/sys/riscv/riscv/nexus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/riscv/riscv/nexus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -215,7 +215,7 @@ nexus_alloc_resource(device_t bus, devic * (ie. they aren't maintained by a child bus), then work out * the start/end values. */ - if ((start == 0UL) && (end == ~0UL) && (count == 1)) { + if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) { if (device_get_parent(child) != bus || ndev == NULL) return(NULL); rle = resource_list_find(&ndev->nx_resources, type, *rid); Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/central/central.c Sat Feb 20 01:32:58 2016 (r295832) @@ -228,7 +228,7 @@ central_alloc_resource(device_t bus, dev int passthrough; int i; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); res = NULL; rle = NULL; Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/ebus/ebus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -438,7 +438,7 @@ ebus_alloc_resource(device_t bus, device uint64_t cend, cstart, offset; int i, isdefault, passthrough, ridx; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); sc = device_get_softc(bus); rl = BUS_GET_RESOURCE_LIST(bus, child); Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/fhc/fhc.c Sat Feb 20 01:32:58 2016 (r295832) @@ -433,7 +433,7 @@ fhc_alloc_resource(device_t bus, device_ int passthrough; int i; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); res = NULL; rle = NULL; Modified: head/sys/sparc64/isa/isa.c ============================================================================== --- head/sys/sparc64/isa/isa.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/isa/isa.c Sat Feb 20 01:32:58 2016 (r295832) @@ -279,7 +279,7 @@ isa_alloc_resource(device_t bus, device_ * Consider adding a resource definition. */ int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); + int isdefault = RMAN_IS_DEFAULT_RANGE(start, end); struct resource_list *rl; struct resource_list_entry *rle; u_long base, limit; Modified: head/sys/sparc64/pci/apb.c ============================================================================== --- head/sys/sparc64/pci/apb.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/pci/apb.c Sat Feb 20 01:32:58 2016 (r295832) @@ -238,7 +238,7 @@ apb_alloc_resource(device_t dev, device_ * out where it's coming from (we should actually never see these) so * we just have to punt. */ - if (start == 0 && end == ~0) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { device_printf(dev, "can't decode default resource id %d for " "%s, bypassing\n", *rid, device_get_nameunit(child)); goto passup; Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/sbus/sbus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -723,7 +723,7 @@ sbus_alloc_resource(device_t bus, device int i, slot; int isdefault, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); rle = NULL; sc = device_get_softc(bus); Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/sparc64/nexus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -370,7 +370,7 @@ nexus_alloc_resource(device_t bus, devic device_t nexus; int isdefault, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != bus); nexus = bus; while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sparc64/sparc64/upa.c Sat Feb 20 01:32:58 2016 (r295832) @@ -412,7 +412,7 @@ upa_alloc_resource(device_t dev, device_ bus_addr_t cend, cstart; int i, isdefault, passthrough; - isdefault = (start == 0UL && end == ~0UL); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); passthrough = (device_get_parent(child) != dev); sc = device_get_softc(dev); rl = BUS_GET_RESOURCE_LIST(dev, child); Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/sys/rman.h Sat Feb 20 01:32:58 2016 (r295832) @@ -63,6 +63,8 @@ enum rman_type { RMAN_UNINIT = 0, RMAN_G #define RM_MAX_END ((rman_res_t)~0) +#define RMAN_IS_DEFAULT_RANGE(s,e) ((s) == 0 && (e) == RM_MAX_END) + /* * Userspace-exported structures. */ Modified: head/sys/x86/isa/isa.c ============================================================================== --- head/sys/x86/isa/isa.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/x86/isa/isa.c Sat Feb 20 01:32:58 2016 (r295832) @@ -94,7 +94,7 @@ isa_alloc_resource(device_t bus, device_ * Consider adding a resource definition. */ int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); + int isdefault = RMAN_IS_DEFAULT_RANGE(start, end); struct isa_device* idev = DEVTOISA(child); struct resource_list *rl = &idev->id_resources; struct resource_list_entry *rle; Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Fri Feb 19 22:48:20 2016 (r295831) +++ head/sys/x86/x86/nexus.c Sat Feb 20 01:32:58 2016 (r295832) @@ -377,7 +377,7 @@ nexus_alloc_resource(device_t bus, devic * (ie. they aren't maintained by a child bus), then work out * the start/end values. */ - if ((start == 0UL) && (end == ~0UL) && (count == 1)) { + if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) { if (device_get_parent(child) != bus || ndev == NULL) return(NULL); rle = resource_list_find(&ndev->nx_resources, type, *rid); From owner-svn-src-head@freebsd.org Sat Feb 20 01:34:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B649CAAE3DC; Sat, 20 Feb 2016 01:34:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 886B6122C; Sat, 20 Feb 2016 01:34:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1K1YD32016556; Sat, 20 Feb 2016 01:34:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1K1YDOD016555; Sat, 20 Feb 2016 01:34:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602200134.u1K1YDOD016555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Feb 2016 01:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295833 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 01:34:14 -0000 Author: jhibbits Date: Sat Feb 20 01:34:13 2016 New Revision: 295833 URL: https://svnweb.freebsd.org/changeset/base/295833 Log: Fix the definition of RM_MAX_END. Even though casting from signed to unsigned is well-defined in C, it's better to first cast to the larger unsigned type, then negate. Modified: head/sys/sys/rman.h Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Sat Feb 20 01:32:58 2016 (r295832) +++ head/sys/sys/rman.h Sat Feb 20 01:34:13 2016 (r295833) @@ -61,7 +61,7 @@ enum rman_type { RMAN_UNINIT = 0, RMAN_G */ #define RM_TEXTLEN 32 -#define RM_MAX_END ((rman_res_t)~0) +#define RM_MAX_END (~(rman_res_t)0) #define RMAN_IS_DEFAULT_RANGE(s,e) ((s) == 0 && (e) == RM_MAX_END) From owner-svn-src-head@freebsd.org Sat Feb 20 01:51:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D3CAAEC19; Sat, 20 Feb 2016 01:51:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E23351A4C; Sat, 20 Feb 2016 01:51:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f172.google.com with SMTP id h129so81302830ywb.1; Fri, 19 Feb 2016 17:51:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=tJMQB7ePCleKDnZEijcepFW7+kNigL4PZb4FjJwmmoI=; b=A0RMPyl4viU44qIi8ScstXBy6HsX+IJeGWZ1a1b0Gvx7NmiIT2mNP6m5qNbSS215Ep CK9UCJZpoxwkhkoLTZe1Nku76CDF2IgZxwheUZ0hBkXSfmW6h2WdBkOH7lD8kdw2m51R HDD0DAuOd+k3JP7bQYUP3T/OWoJ7iMAgkxY9+0hGvXd3vT9RuGbWvz1c+qkWxIjZHWMl 8qMo7tottSlxN9GsLFTEekCBZwMO5RgUcSC7j41rgDQsHvcInbnm2Kevmph6lkhnzmeF MivQpxAqvg6G/B1KIZw2baQyee8onmLmFtsE3dcH5B56ZyeNuCjnLM9LOnZYUBxPW8GP QpOw== X-Gm-Message-State: AG10YOTMONgwej1ybJ0mGHj2MawIu/euCSQeWpQAG/muaQ0YuJfbupiYHZie7mwrX5n1bg== X-Received: by 10.129.147.2 with SMTP id k2mr9362446ywg.69.1455929440719; Fri, 19 Feb 2016 16:50:40 -0800 (PST) Received: from mail-yw0-f169.google.com (mail-yw0-f169.google.com. [209.85.161.169]) by smtp.gmail.com with ESMTPSA id o23sm10644901ywd.30.2016.02.19.16.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 16:50:40 -0800 (PST) Received: by mail-yw0-f169.google.com with SMTP id e63so80367130ywc.3; Fri, 19 Feb 2016 16:50:40 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.13.212.195 with SMTP id w186mr9479851ywd.247.1455929440113; Fri, 19 Feb 2016 16:50:40 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.210.9 with HTTP; Fri, 19 Feb 2016 16:50:40 -0800 (PST) In-Reply-To: References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> Date: Fri, 19 Feb 2016 16:50:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Conrad Meyer To: Benjamin Kaduk Cc: Gleb Smirnoff , Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 01:51:42 -0000 On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk wrote: > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: >> Isn't zero filling part of the standard? I don't see why lack of >> explicit zeroing is a warning? Looks a false warning to me. > > > It is not quite as simple as this would make it sound. The elements or > members of an aggregate (e.g.) structure type are initialized as if it were > an object of static storage duration (i.e., to zero) if the initializer list > does not contain enough initializers for all members of the aggregate type, > per item 21 of section 6.7.8 of n1256.pdf. However, such initialization > does not necessarily need to zero any padding bytes that are present, which > may take unspecified values. Personally, I think this particular clang > warning can be too aggressive, especially for complex structs, but on the > other hand given the indeterminateness of padding, bzero/memset are often a > better choice anyway. By definition, padding byte contents are unused. There is no reason their values matter one way or another, so why do we care about the distinction between bzero and member zero initialization? Best, Conrad From owner-svn-src-head@freebsd.org Sat Feb 20 02:01:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB377AAEFDF; Sat, 20 Feb 2016 02:01:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 480E81FBA; Sat, 20 Feb 2016 02:01:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2337942820A; Sat, 20 Feb 2016 13:01:28 +1100 (AEDT) Date: Sat, 20 Feb 2016 13:01:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk cc: Gleb Smirnoff , Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Subject: Re: svn commit: r295768 - head/usr.sbin/iostat In-Reply-To: Message-ID: <20160220123404.F1403@besplex.bde.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=VKpU7ulDBB15Tj0QqSkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 02:01:36 -0000 On Fri, 19 Feb 2016, Benjamin Kaduk wrote: > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: > >> On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: >> A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov >> wrote: >> A> Yeah, it was being implicitly zeroized before. But Clang complained >> A> about the structures being only partially initialized. Since the >> A> whole point of my commit was to increase the WARNS level, I explicitly >> A> zeroed the zero fields to silence Clang. >> >> Isn't zero filling part of the standard? I don't see why lack of >> explicit zeroing is a warning? Looks a false warning to me. > > It is not quite as simple as this would make it sound. The elements or > members of an aggregate (e.g.) structure type are initialized as if it were > an object of static storage duration (i.e., to zero) if the initializer > list does not contain enough initializers for all members of the aggregate > type, per item 21 of section 6.7.8 of n1256.pdf. However, such > initialization does not necessarily need to zero any padding bytes that are > present, which may take unspecified values. Perhaps, but then there is even less reason to expect that initializing all the struct members initialzes the padding between them. > Personally, I think this > particular clang warning can be too aggressive, especially for complex > structs, but on the other hand given the indeterminateness of padding, > bzero/memset are often a better choice anyway. It is just a bug in clang. Using auto structs with initialzers, auto structs initialized by memset/ bzero followed by initializing a few fields, are almost equally good pessimizations. Some compilers generate similar code for them (like the code shown by pluknet -- the initializer is optimized to an inlined memset followed by initializing 1 field. But doing this this on every function call is a good pessimization if the struct never changes or rarely changes or only changes slightly. Some compilers generate the worse code of keeping a static copy and generating an inline memcpy to the auto variable on every function call. 6.7.8p9 says that unnamed members have indeterminate values even after initialization, except where explicitly stated otherwise. I couldn't find anywhere "explicitly stating otherwise" that padding is initialized. It takes an explicit statements in p21 to get the unnamed members in an initializer initialized, but padding isn't even. p21 says that any unnamed struct member is initialized as if it had static storage duration with no initializer, but I couldn't find anything requiring initialization for padding in that case. Apparently, only quality of implementation prevents it being initialized with passwords from the previous program :-(. Bruce From owner-svn-src-head@freebsd.org Sat Feb 20 02:18:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A88AAE81D; Sat, 20 Feb 2016 02:18:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 07D027FA; Sat, 20 Feb 2016 02:18:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 7D7F4782253; Sat, 20 Feb 2016 13:18:53 +1100 (AEDT) Date: Sat, 20 Feb 2016 13:18:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric cc: Alan Somers , Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r295768 - head/usr.sbin/iostat In-Reply-To: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> Message-ID: <20160220130138.M1403@besplex.bde.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=MqwXul9aSebHzNjHiJcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 02:18:58 -0000 On Sat, 20 Feb 2016, Dimitry Andric wrote: > On 19 Feb 2016, at 16:49, Alan Somers wrote: >> >> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: > ... >>>> -struct nlist namelist[] = { >>>> +static struct nlist namelist[] = { >>>> #define X_TTY_NIN 0 >>>> - { "_tty_nin" }, >>>> + { .n_name = "_tty_nin", >>>> + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, >>>> [...] >>> >>> You unlikely need this excessive explicit zeroization. >>> In this case it is implicitly prezeroed. > ... >> Yeah, it was being implicitly zeroized before. But Clang complained >> about the structures being only partially initialized. Since the >> whole point of my commit was to increase the WARNS level, I explicitly >> zeroed the zero fields to silence Clang. > > You got this warning, most likely: > > usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer [-Werror,-Wmissing-field-initializers] > { "_tty_nin" }, > ^ > > This warning is only produced when you use -Wall -W, and then initialize > structs partially, i.e. you initialize some fields but not others. I > think this is a quite reasonable warning for a high warning level. No, this more than defeats the reason for existence of C99 initializers. With C90 initializors, you sometimes had to write initializers for all the fields between the 2 that you care about, and get the order and number of al the fields right. At least you didn't have to write initializers for the trailing fields. With compiler warnings about missing initializers, you also have to write initializers for trailing fields. I forget if C99 initializers allows mixing named fields with unnamed fields, but style rules shouldn't allow it. > On the other hand, if this kind of construct is used throughout the > tree, and it is not seen as a big problem, we can simply silence this > particular warning using -Wno-missing-field -initializers. There is > already quite a list of warnings which are suppressed by default, even > at WARNS=6, namely: > > -Wno-empty-body > -Wno-format-y2k > -Wno-pointer-sign > -Wno-string-plus-int > -Wno-unused-const-variable > -Wno-unused-parameter We started using it for lists of functions for vfs, where some of the entries should be optional but all had to be supplied, in the correct order, for C90 initializers. These lists were reduced from excessively dynamic lists, and they ended up with not many optional entries, so they don't use the feature of omitting optional entries much. Bruce Bruce From owner-svn-src-head@freebsd.org Sat Feb 20 02:31:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A329AAEF28; Sat, 20 Feb 2016 02:31:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 528EFF12; Sat, 20 Feb 2016 02:31:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from coconut.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 2C97A56AE9; Fri, 19 Feb 2016 20:31:41 -0600 (CST) Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb To: Bryan Drewery , Stefan Esser , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dwmalone@FreeBSD.org References: <201602190842.u1J8gDOc015177@repo.freebsd.org> <56C7B60E.8080002@FreeBSD.org> From: Eric van Gyzen Message-ID: <56C7D019.3020807@FreeBSD.org> Date: Fri, 19 Feb 2016 20:31:53 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56C7B60E.8080002@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 02:31:42 -0000 On 2/19/16 6:40 PM, Bryan Drewery wrote: > On 2/19/2016 12:42 AM, Stefan Esser wrote: >> Author: se >> Date: Fri Feb 19 08:42:13 2016 >> New Revision: 295800 >> URL: https://svnweb.freebsd.org/changeset/base/295800 >> >> Log: >> Remove O_SYNC from the options passed to dbmopen(). > Uh, this is a full revert of r293312's changes to cap_mkdb which were > made for good reason. So this seems simply wrong without a better fix. > >> >> The output file is created as a temporary file that is moved over the >> existing file after completion. Thus there is no need to immediately >> flush all created db records to the temporary file. > This is not right either. Depending on the use of soft updates / > journaling the data and metadata (file name / rename) may be written at > different times. It is entirely possible to get a renamed file with no > or junk content without an fsync. That's exactly what r293312 mentions > in its commit message. dwmalone@ plans to put the fsync() in the db close method, which makes a lot of sense, and would fix this in a better way. https://reviews.freebsd.org/D5186 This commit probably should have waited for D5186 to be committed, but at least that seems imminent. Eric From owner-svn-src-head@freebsd.org Sat Feb 20 03:43:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C26FAAEE66; Sat, 20 Feb 2016 03:43:50 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F9F1277; Sat, 20 Feb 2016 03:43:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id g62so102152779wme.1; Fri, 19 Feb 2016 19:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=5aAU9f5d41ZYmRYl4SMzUKFcVhmHWQ/m4+/1iusp8qE=; b=MlDqvYX+ffkd/l5UuB55mbrWmPLkr8wc4TU/cotcArVMzHialO/1T7F4HXjW8wzV4T kIVXU2hlTQfqqz54Jow8ywqOdIS+2+dt61FoV5qzaKeCdVTD7A9PsKh19Se2iuqNEQd/ 8Z+ZWZ30A2kJA38vUWUfIXXAj4kWhAi91O5xCmtX5IF7qPmxMA1K5XPVKmlisHxWMGKz AtyOT3QntIa0hnF98hgLe08ojXxyIVt62ETJUx7iX/Ue8nk4aH6NHkipH39pw2bhZvQ4 eTYym+MhI92n0OAlZfNnhn1gmebKfC75ZQzVw/SwHBpKm8ZLvuGKv9C4h1vjbcQcM+CF t+cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5aAU9f5d41ZYmRYl4SMzUKFcVhmHWQ/m4+/1iusp8qE=; b=DNQg3I7txnoOkZO8/TSiogIy9GkWWzmIc34LPr5/dbmJDpFRjzvS9smASNwEAIfi1K 2I8VHvF6PraLSvtffcSV5j3tOU1Xa/18vITUzbf42rAYXPtYpF3w8ZjgX152YmDQDvC3 FTbkIZ+F7ylYtkvjzI4TPHeKUZv4b3dcgE+CEvbzKph4JCBlz2R6SG1YXvWiruwK/WnD vcr8A4TnakmyjhgWazNJK7ar8Sb2YdlOHlb0ninUaNl7ufDpnQOTrsPkGADvDxkhClg6 lhehTkjfM09HAoB+eTlWLD0uhU58iZwfzi1h3Oa7cLU7Ol6nqyJ+0Cq2PgPgYjkKjags NLCA== X-Gm-Message-State: AG10YOR1BcABalxrXtlaAETngOpDdCc6Ur9rSerGXm2nZWQczgQhcXFNZyyOJlW1ejIwz1fKWFsM+kEHBLuWEw== MIME-Version: 1.0 X-Received: by 10.28.98.84 with SMTP id w81mr436990wmb.57.1455939828145; Fri, 19 Feb 2016 19:43:48 -0800 (PST) Received: by 10.27.170.11 with HTTP; Fri, 19 Feb 2016 19:43:48 -0800 (PST) In-Reply-To: References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> Date: Fri, 19 Feb 2016 21:43:48 -0600 Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Benjamin Kaduk To: cem@freebsd.org Cc: Gleb Smirnoff , Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 03:43:50 -0000 On Fri, Feb 19, 2016 at 6:50 PM, Conrad Meyer wrote: > On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk wrote: > > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff > wrote: > >> Isn't zero filling part of the standard? I don't see why lack of > >> explicit zeroing is a warning? Looks a false warning to me. > > > > > > It is not quite as simple as this would make it sound. The elements or > > members of an aggregate (e.g.) structure type are initialized as if it > were > > an object of static storage duration (i.e., to zero) if the initializer > list > > does not contain enough initializers for all members of the aggregate > type, > > per item 21 of section 6.7.8 of n1256.pdf. However, such initialization > > does not necessarily need to zero any padding bytes that are present, > which > > may take unspecified values. Personally, I think this particular clang > > warning can be too aggressive, especially for complex structs, but on the > > other hand given the indeterminateness of padding, bzero/memset are > often a > > better choice anyway. > > > By definition, padding byte contents are unused. There is no reason > their values matter one way or another, so why do we care about the > distinction between bzero and member zero initialization? > Well, you can access them by treating the object as an array of char, and then memory sanitizer will complain about the uninitialized access, as in https://github.com/openssl/openssl/commit/f0496ad71fbacccf5a95f40d31d251bc8cf9dcfb -Ben P.S. Not really apropos of anything, but clang also has -Weverything which is just what it sounds like (as opposed to -Wall), which is a great way to expose several other warnings that Bruce will call bugs :) From owner-svn-src-head@freebsd.org Sat Feb 20 04:42:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112CEAAD4F0; Sat, 20 Feb 2016 04:42:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 963B41368; Sat, 20 Feb 2016 04:42:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 2BDFED42917; Sat, 20 Feb 2016 15:13:45 +1100 (AEDT) Date: Sat, 20 Feb 2016 15:13:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295833 - head/sys/sys In-Reply-To: <201602200134.u1K1YDOD016555@repo.freebsd.org> Message-ID: <20160220142119.U1712@besplex.bde.org> References: <201602200134.u1K1YDOD016555@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=JL7xwK0kLOeRsF3iG-gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 04:42:15 -0000 On Sat, 20 Feb 2016, Justin Hibbits wrote: > Log: > Fix the definition of RM_MAX_END. > > Even though casting from signed to unsigned is well-defined in C, it's better to > first cast to the larger unsigned type, then negate. Casting ~0 is well-defined, but ~0 isn't. The operation is complementation, not negation. > Modified: head/sys/sys/rman.h > ============================================================================== > --- head/sys/sys/rman.h Sat Feb 20 01:32:58 2016 (r295832) > +++ head/sys/sys/rman.h Sat Feb 20 01:34:13 2016 (r295833) > @@ -61,7 +61,7 @@ enum rman_type { RMAN_UNINIT = 0, RMAN_G > */ > #define RM_TEXTLEN 32 > > -#define RM_MAX_END ((rman_res_t)~0) > +#define RM_MAX_END (~(rman_res_t)0) If the operation were negation, then its result -0 would actually be well- defined. It would be 0 again, even in the 1's complement and signed magnitude cases where -0 can be represented. -0 cast to unsigned must give 0 again, and not be all-bits-1 even if it started as all-bits 1 representing -0 in 2's complement. ~0 was under-specified in C90 as being the bitwise complement. The value of that is not specified unless the promotion of the orginal type is unsigned (~(unsigned char)0 is also not specified except on exotic machines (no longer permitted by POSIX) with unsigned char the same size as unsigned int). ~0 is even more under-specified in C99 because C99 is more careful with representations and has trap representations. (This is not fixed in C11.) Complementing a non- trap-representation might give a trap representation if done bitwise, even starting from a nondescript value like 0. But if there are no trap or padding bits, the only reasonable interpretation of the spec is that ~0 gives all-bits-1 with whatever value that has. In the 2's complement case, the value is -1 and casting this to unsigned works right. In the 1's complement case, the value is -0 and casting this to unsigned gives unsigned plain 0. In the signed-magnitude case, I think it gives -0x7fffffff with 32-bit ints and casting this to unsigned gives 0x80000001. C90 allows other representations, so the result can be anything. The clearest way to write the expression is probably ((rman_res_t)-1) like the buggy ~0 version did in the 2's complement case. Everyone knows what -1 is. Conversion of -1 to unsigned is better known than what ~0 is. It takes an explicit specification for both. Conversion of -1 involves "[in extra precision] repeatedly adding or subtracting one more than the maximim value that can be represented in the new type until [the result is representable]". Thus ((rman_res_t)-1) is maxof(rman_res_t) + 1 - 1 == maxof(rman_res_t). (~(rman_res_t)0) involves the specification of the '~' operator saying that complementing the bits actually works for the unsigned case. The precise wording is "If the promoted type [of E] is an unsigned type, then the expression ~E is equivalent to the maximum value representable in that type minus E". Thus (~(rman_res_t)0) is maxof(rman_res_t) - 0 = maxof(rman_res_t). I think the precise wording is redundant, but this is not clear. Something is needed to ensure that complementing bits doesn't give a trap representation for the unsigned case. Complementing only value bits wouldn't give a trap representation, but complementing padding bits could (should) give a trap representation. The spec is too fuzzy to say which bits are complemented, except in the unsigned case padding bits must not be complemented if this would give a trap representation. Bruce From owner-svn-src-head@freebsd.org Sat Feb 20 04:48:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4730AAD713; Sat, 20 Feb 2016 04:48:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B20B815E9; Sat, 20 Feb 2016 04:48:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ob0-x230.google.com with SMTP id jq7so126156806obb.0; Fri, 19 Feb 2016 20:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=v0gedN86aWKlrpkvbx1PqsXkty9mt6f8LyKHaNKLfLY=; b=qtwH1pTRAcb3mB4T70FL9uQtB7kAQe4pq3TVYctwByHgEil0vSd1NqhvPec6BlfpW+ 5DPLhV8SD86klMmkiK/E+6C4SvOoVoHqHiGMa1I3zuh4yi/1z2/SkB2cVx/rPCWfDm4t WQFQgekE6BUBVCfr+cc+prN0oW76eb5QLqKr9u3kvm6qlO1cGGi7fv2j43Hztcm+cYO2 /9rnLVWPcMHVVVDqZfpWLqBmgYD5ONMUB7EkwgHAFXwe3L5kUuygZBViCkl3zhMX7e35 C1Ib/RORVS9WZ29DuKFe0l0mw6BmCh2zwhKaspg1vb3giHgWn0YjoS2EFYoFlMBqkEVg UnEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=v0gedN86aWKlrpkvbx1PqsXkty9mt6f8LyKHaNKLfLY=; b=1x7c70YkMCRGEV4IDz++h2oSSKCh4DsoHon0rH+1cqVM48mUx/UVrORL64ZKHIAIAR czx8YP7IFXM2W8JQvfkF7Zok9/QU4zrlElm8XIV33XW7JoQZ+ZK56Y7XeDU3+HGFpTpg eXEp7HsfFrqW+OaYkkHID6R13xQD7RGrcUUjaaOCf/qIOnISVd39l3hGfIFJnCPHvZPE z8TBKmFYhVKYEEPd7BXYgxP5KdsD0O+GvQ/MIgoczbGFVYmayjrQT4SP0jyt2IPc4E/b +/UUeMr3WOk8mAABubv+0JXq+D3NypoX4fEiUT9uHGpztL8Qjfb3rKe220q/EJrJ1biQ nWYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=v0gedN86aWKlrpkvbx1PqsXkty9mt6f8LyKHaNKLfLY=; b=aPrB/uGB5znc9VH9UdGziwP658hvnEmNgxwGCfaTiuzNMbPGuaS9ZLhM31uXT+y6fC UTgL1iwIfetSNGxNOZtU5lAXZvKPh7enc9+iB9KtgCp3ZRcI8cj016d+vgcrrR4NTwXU F6JZRPGT8u2d6AxTfRfh+ExJi5yEE0C0b9adXRAGq2fdc70E6xEHNwb0ovlGaz3GpxEc 8JeMJjNZY7WeYc7a+Ko9mcuNXVY2R1x0E4SZEoBJ439hVWrsu0YMYWZXn2UGoHe5kH8S jtE27TnH83RU90oJB2ICA8SpYMa4C8N2CMAJc8V5799Gxp67GIehFe6wEvOSm9sBRDDY k6Lg== X-Gm-Message-State: AG10YOQUpNHHfTs0dCVTKLhoSt8/GXklYlExcqVwP8EOsYFdozXH7MaKgKeGUNJmvWdBeXatZejbDLdkLreSYA== MIME-Version: 1.0 X-Received: by 10.60.115.33 with SMTP id jl1mr15283803oeb.12.1455943715905; Fri, 19 Feb 2016 20:48:35 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.182.33.8 with HTTP; Fri, 19 Feb 2016 20:48:35 -0800 (PST) In-Reply-To: <201602181307.u1ID7MeN059064@repo.freebsd.org> References: <201602181307.u1ID7MeN059064@repo.freebsd.org> Date: Fri, 19 Feb 2016 22:48:35 -0600 X-Google-Sender-Auth: BjannD8fAYMY_J1XKlPzaoZA3m8 Message-ID: Subject: Re: svn commit: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries From: Justin Hibbits To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 04:48:37 -0000 This was not tinderboxed. I'm getting build failures for powerpc and sparc64. Please revert or fix. Least of which: sys/dev/ofw/ofw_pci.c conflicts with sys/powerpc/ofw/ofw_pci.c, which I mentioned in phabricator long ago. Additionally, several files are missing includes of dev/ofw/ofw_bus_subr.h. One example from tinderbox: make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 7308: warning: duplicate script for target "ofw_pci.ln" ignored make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 2150: warning: using previous script for "ofw_pci.ln" defined here make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 7311: warning: duplicate script for target "ofw_pci.o" ignored make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 2154: warning: using previous script for "ofw_pci.o" defined here make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 7312: warning: duplicate script for target "ofw_pci.o" ignored make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" line 2154: warning: using previous script for "ofw_pci.o" defined here In file included from /home/jhibbits/head/sys/powerpc/powermac/uninorth.c:36: /home/jhibbits/head/sys/dev/ofw/ofw_pci.h:144: error: field 'sc_pci_iinfo' has incomplete type - Justin On 2/18/16, Zbigniew Bodek wrote: > Author: zbb > Date: Thu Feb 18 13:07:21 2016 > New Revision: 295756 > URL: https://svnweb.freebsd.org/changeset/base/295756 > > Log: > Extract common code from PowerPC's ofw_pci > > Import portions of the PowerPC OF PCI implementation into > new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and > ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations > are moved to sys/dev/ofw/ofw_pci.h. > > This creates a new ofw_pci_write_ivar() function and modifies > ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() > methods. > Most functions contain existing ppc implementations in the majority > unchanged. Now there is no need to have multiple identical copies > of methods for various architectures. > > Submitted by: Marcin Mazurek > Obtained from: Semihalf > Sponsored by: Annapurna Labs > Reviewed by: jhibbits, mmel > Differential Revision: https://reviews.freebsd.org/D4879 > > Added: > head/sys/dev/ofw/ofw_pci.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/ofw/ofw_pci.h > head/sys/dev/ofw/ofw_subr.c > head/sys/powerpc/mpc85xx/pci_mpc85xx.c > head/sys/powerpc/powermac/cpcht.c > head/sys/powerpc/powermac/grackle.c > head/sys/powerpc/powermac/uninorthpci.c > head/sys/powerpc/powermac/uninorthvar.h > head/sys/powerpc/pseries/rtas_pci.c > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/conf/files Thu Feb 18 13:07:21 2016 (r295756) > @@ -2108,6 +2108,7 @@ dev/ofw/ofw_subr.c optional fdt > dev/ofw/ofwbus.c optional fdt > dev/ofw/openfirm.c optional fdt > dev/ofw/openfirmio.c optional fdt > +dev/ofw/ofw_pci.c optional fdt pci > dev/ow/ow.c optional ow \ > dependency "owll_if.h" \ > dependency "own_if.h" > > Added: head/sys/dev/ofw/ofw_pci.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/ofw/ofw_pci.c Thu Feb 18 13:07:21 2016 (r295756) > @@ -0,0 +1,622 @@ > +/*- > + * Copyright (c) 2011 Nathan Whitehorn > + * 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 > + > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > + > +#include "pcib_if.h" > + > +/* > + * If it is necessary to set another value of this for > + * some platforms it should be set at fdt.h file > + */ > +#ifndef PCI_MAP_INTR > +#define PCI_MAP_INTR 4 > +#endif > + > +#define PCI_INTR_PINS 4 > + > +/* > + * bus interface. > + */ > +static struct resource * ofw_pci_alloc_resource(device_t, device_t, > + int, int *, u_long, u_long, u_long, u_int); > +static int ofw_pci_release_resource(device_t, device_t, int, int, > + struct resource *); > +static int ofw_pci_activate_resource(device_t, device_t, int, int, > + struct resource *); > +static int ofw_pci_deactivate_resource(device_t, device_t, int, int, > + struct resource *); > +static int ofw_pci_adjust_resource(device_t, device_t, int, > + struct resource *, u_long, u_long); > + > +/* > + * pcib interface > + */ > +static int ofw_pci_maxslots(device_t); > + > +/* > + * ofw_bus interface > + */ > +static phandle_t ofw_pci_get_node(device_t, device_t); > + > +/* > + * local methods > + */ > +static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *); > + > +/* > + * Driver methods. > + */ > +static device_method_t ofw_pci_methods[] = { > + > + /* Device interface */ > + DEVMETHOD(device_attach, ofw_pci_attach), > + > + /* Bus interface */ > + DEVMETHOD(bus_print_child, bus_generic_print_child), > + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), > + DEVMETHOD(bus_write_ivar, ofw_pci_write_ivar), > + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), > + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), > + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), > + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), > + DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), > + DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), > + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), > +#ifdef __powerpc__ > + DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), > +#endif > + > + /* pcib interface */ > + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), > + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), > + > + /* ofw_bus interface */ > + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), > + > + DEVMETHOD_END > +}; > + > +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); > + > +int > +ofw_pci_init(device_t dev) > +{ > + struct ofw_pci_softc *sc; > + phandle_t node; > + u_int32_t busrange[2]; > + struct ofw_pci_range *rp; > + int error; > + struct ofw_pci_cell_info *cell_info; > + > + node = ofw_bus_get_node(dev); > + sc = device_get_softc(dev); > + sc->sc_initialized = 1; > + sc->sc_range = NULL; > + > + cell_info = (struct ofw_pci_cell_info *)malloc(sizeof(*cell_info), > + M_DEVBUF, M_WAITOK | M_ZERO); > + > + sc->sc_cell_info = cell_info; > + > + if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8) > + busrange[0] = 0; > + > + sc->sc_dev = dev; > + sc->sc_node = node; > + sc->sc_bus = busrange[0]; > + > + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { > + phandle_t c; > + int n, i; > + > + sc->sc_nrange = 0; > + for (c = OF_child(node); c != 0; c = OF_peer(c)) { > + n = ofw_pci_nranges(c, cell_info); > + if (n > 0) > + sc->sc_nrange += n; > + } > + if (sc->sc_nrange == 0) { > + error = ENXIO; > + goto out; > + } > + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), > + M_DEVBUF, M_WAITOK); > + i = 0; > + for (c = OF_child(node); c != 0; c = OF_peer(c)) { > + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); > + if (n > 0) > + i += n; > + } > + KASSERT(i == sc->sc_nrange, ("range count mismatch")); > + } else { > + sc->sc_nrange = ofw_pci_nranges(node, cell_info); > + if (sc->sc_nrange <= 0) { > + device_printf(dev, "could not getranges\n"); > + error = ENXIO; > + goto out; > + } > + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), > + M_DEVBUF, M_WAITOK); > + ofw_pci_fill_ranges(node, sc->sc_range); > + } > + > + sc->sc_io_rman.rm_type = RMAN_ARRAY; > + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; > + error = rman_init(&sc->sc_io_rman); > + if (error) { > + device_printf(dev, "rman_init() failed. error = %d\n", error); > + goto out; > + } > + > + sc->sc_mem_rman.rm_type = RMAN_ARRAY; > + sc->sc_mem_rman.rm_descr = "PCI Memory"; > + error = rman_init(&sc->sc_mem_rman); > + if (error) { > + device_printf(dev, "rman_init() failed. error = %d\n", error); > + goto out; > + } > + > + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && > + rp->pci_hi != 0; rp++) { > + error = 0; > + > + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { > + case OFW_PCI_PHYS_HI_SPACE_CONFIG: > + break; > + case OFW_PCI_PHYS_HI_SPACE_IO: > + error = rman_manage_region(&sc->sc_io_rman, rp->pci, > + rp->pci + rp->size - 1); > + break; > + case OFW_PCI_PHYS_HI_SPACE_MEM32: > + case OFW_PCI_PHYS_HI_SPACE_MEM64: > + error = rman_manage_region(&sc->sc_mem_rman, rp->pci, > + rp->pci + rp->size - 1); > + break; > + } > + > + if (error) { > + device_printf(dev, > + "rman_manage_region(%x, %#jx, %#jx) failed. " > + "error = %d\n", rp->pci_hi & > + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, > + rp->pci + rp->size - 1, error); > + goto out; > + } > + } > + > + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); > + > +out: > + free(cell_info, M_DEVBUF); > + free(sc->sc_range, M_DEVBUF); > + rman_fini(&sc->sc_io_rman); > + rman_fini(&sc->sc_mem_rman); > + > + return (error); > +} > + > +int > +ofw_pci_attach(device_t dev) > +{ > + struct ofw_pci_softc *sc; > + int error; > + > + sc = device_get_softc(dev); > + if (!sc->sc_initialized) { > + error = ofw_pci_init(dev); > + if (error) > + return (error); > + } > + > + device_add_child(dev, "pci", -1); > + return (bus_generic_attach(dev)); > +} > + > +static int > +ofw_pci_maxslots(device_t dev) > +{ > + > + return (PCI_SLOTMAX); > +} > + > +int > +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) > +{ > + struct ofw_pci_softc *sc; > + struct ofw_pci_register reg; > + uint32_t pintr, mintr[PCI_MAP_INTR]; > + int intrcells; > + phandle_t iparent; > + > + sc = device_get_softc(bus); > + pintr = pin; > + > + /* Fabricate imap information in case this isn't an OFW device */ > + bzero(®, sizeof(reg)); > + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | > + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | > + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); > + > + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), > + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), > + mintr, sizeof(mintr), &iparent); > + if (intrcells != 0) { > + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); > + return (pintr); > + } > + > + /* > + * Maybe it's a real interrupt, not an intpin > + */ > + if (pin > PCI_INTR_PINS) > + return (pin); > + > + device_printf(bus, "could not route pin %d for device %d.%d\n", > + pin, pci_get_slot(dev), pci_get_function(dev)); > + return (PCI_INVALID_IRQ); > +} > + > +int > +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t > *result) > +{ > + struct ofw_pci_softc *sc; > + > + sc = device_get_softc(dev); > + > + switch (which) { > + case PCIB_IVAR_DOMAIN: > + *result = device_get_unit(dev); > + return (0); > + case PCIB_IVAR_BUS: > + *result = sc->sc_bus; > + return (0); > + default: > + break; > + } > + > + return (ENOENT); > +} > + > +int > +ofw_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t > value) > +{ > + struct ofw_pci_softc *sc; > + > + sc = device_get_softc(dev); > + > + switch (which) { > + case PCIB_IVAR_BUS: > + sc->sc_bus = value; > + return (0); > + default: > + break; > + } > + > + return (ENOENT); > +} > + > +int > +ofw_pci_nranges(phandle_t node, struct ofw_pci_cell_info *info) > +{ > + ssize_t nbase_ranges; > + > + if (info == NULL) > + return (-1); > + > + info->host_address_cells = 1; > + info->size_cells = 2; > + info->pci_address_cell = 3; > + > + OF_getencprop(OF_parent(node), "#address-cells", > + &(info->host_address_cells), sizeof(info->host_address_cells)); > + OF_getencprop(node, "#address-cells", > + &(info->pci_address_cell), sizeof(info->pci_address_cell)); > + OF_getencprop(node, "#size-cells", &(info->size_cells), > + sizeof(info->size_cells)); > + > + nbase_ranges = OF_getproplen(node, "ranges"); > + if (nbase_ranges <= 0) > + return (-1); > + > + return (nbase_ranges / sizeof(cell_t) / > + (info->pci_address_cell + info->host_address_cells + > + info->size_cells)); > +} > + > +static struct resource * > +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, > + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) > +{ > + struct ofw_pci_softc *sc; > + struct resource *rv; > + struct rman *rm; > + int needactivate; > + > + needactivate = flags & RF_ACTIVE; > + flags &= ~RF_ACTIVE; > + > + sc = device_get_softc(bus); > + > + switch (type) { > + case SYS_RES_MEMORY: > + rm = &sc->sc_mem_rman; > + break; > + > + case SYS_RES_IOPORT: > + rm = &sc->sc_io_rman; > + break; > + > + case SYS_RES_IRQ: > + return (bus_alloc_resource(bus, type, rid, start, end, count, > + flags)); > + > + default: > + device_printf(bus, "unknown resource request from %s\n", > + device_get_nameunit(child)); > + return (NULL); > + } > + > + rv = rman_reserve_resource(rm, start, end, count, flags, child); > + if (rv == NULL) { > + device_printf(bus, "failed to reserve resource for %s\n", > + device_get_nameunit(child)); > + return (NULL); > + } > + > + rman_set_rid(rv, *rid); > + > + if (needactivate) { > + if (bus_activate_resource(child, type, *rid, rv) != 0) { > + device_printf(bus, > + "failed to activate resource for %s\n", > + device_get_nameunit(child)); > + rman_release_resource(rv); > + return (NULL); > + } > + } > + > + return (rv); > +} > + > +static int > +ofw_pci_release_resource(device_t bus, device_t child, int type, int rid, > + struct resource *res) > +{ > + > + if (rman_get_flags(res) & RF_ACTIVE) { > + int error = bus_deactivate_resource(child, type, rid, res); > + if (error) > + return error; > + } > + > + return (rman_release_resource(res)); > +} > + > +static int > +ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid, > + struct resource *res) > +{ > + struct ofw_pci_softc *sc; > + bus_space_handle_t handle; > + bus_space_tag_t tag; > + int rv; > + > + sc = device_get_softc(bus); > + > + if (type == SYS_RES_IRQ) { > + return (bus_activate_resource(bus, type, rid, res)); > + } > + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { > + struct ofw_pci_range *rp; > + vm_offset_t start; > + int space; > + > + start = (vm_offset_t)rman_get_start(res); > + > + /* > + * Map this through the ranges list > + */ > + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && > + rp->pci_hi != 0; rp++) { > + if (start < rp->pci || start >= rp->pci + rp->size) > + continue; > + > + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { > + case OFW_PCI_PHYS_HI_SPACE_IO: > + space = SYS_RES_IOPORT; > + break; > + case OFW_PCI_PHYS_HI_SPACE_MEM32: > + case OFW_PCI_PHYS_HI_SPACE_MEM64: > + space = SYS_RES_MEMORY; > + break; > + default: > + space = -1; > + } > + > + if (type == space) { > + start += (rp->host - rp->pci); > + break; > + } > + } > + > + if (bootverbose) > + printf("ofw_pci mapdev: start %zx, len %ld\n", start, > + rman_get_size(res)); > + > + tag = BUS_GET_BUS_TAG(child, child); > + if (tag == NULL) > + return (ENOMEM); > + > + rman_set_bustag(res, tag); > + rv = bus_space_map(tag, start, > + rman_get_size(res), 0, &handle); > + if (rv != 0) > + return (ENOMEM); > + > + rman_set_bushandle(res, handle); > + rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ > + } > + > + return (rman_activate_resource(res)); > +} > + > +#ifdef __powerpc__ > +static bus_space_tag_t > +ofw_pci_bus_get_bus_tag(device_t bus, device_t child) > +{ > + > + return (&bs_le_tag) > +} > +#endif > + > +static int > +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int > rid, > + struct resource *res) > +{ > + > + /* > + * If this is a memory resource, unmap it. > + */ > + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { > + u_int32_t psize; > + > + psize = rman_get_size(res); > + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); > + } > + > + return (rman_deactivate_resource(res)); > +} > + > +static int > +ofw_pci_adjust_resource(device_t bus, device_t child, int type, > + struct resource *res, rman_res_t start, rman_res_t end) > +{ > + struct rman *rm = NULL; > + struct ofw_pci_softc *sc = device_get_softc(bus); > + > + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), > + ("active resources cannot be adjusted")); > + if (rman_get_flags(res) & RF_ACTIVE) > + return (EINVAL); > + > + switch (type) { > + case SYS_RES_MEMORY: > + rm = &sc->sc_mem_rman; > + break; > + case SYS_RES_IOPORT: > + rm = &sc->sc_io_rman; > + break; > + default: > + return (ENXIO); > + } > + > + if (!rman_is_region_manager(res, rm)) > + return (EINVAL); > + > + return (rman_adjust_resource(res, start, end)); > +} > + > +static phandle_t > +ofw_pci_get_node(device_t bus, device_t dev) > +{ > + struct ofw_pci_softc *sc; > + > + sc = device_get_softc(bus); > + /* We only have one child, the PCI bus, which needs our own node. */ > + > + return (sc->sc_node); > +} > + > +static int > +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) > +{ > + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; > + cell_t *base_ranges; > + ssize_t nbase_ranges; > + int nranges; > + int i, j, k; > + > + OF_getencprop(OF_parent(node), "#address-cells", &host_address_cells, > + sizeof(host_address_cells)); > + OF_getencprop(node, "#address-cells", &pci_address_cells, > + sizeof(pci_address_cells)); > + OF_getencprop(node, "#size-cells", &size_cells, sizeof(size_cells)); > + > + nbase_ranges = OF_getproplen(node, "ranges"); > + if (nbase_ranges <= 0) > + return (-1); > + nranges = nbase_ranges / sizeof(cell_t) / > + (pci_address_cells + host_address_cells + size_cells); > + > + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); > + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); > + > + for (i = 0, j = 0; i < nranges; i++) { > + ranges[i].pci_hi = base_ranges[j++]; > + ranges[i].pci = 0; > + for (k = 0; k < pci_address_cells - 1; k++) { > + ranges[i].pci <<= 32; > + ranges[i].pci |= base_ranges[j++]; > + } > + ranges[i].host = 0; > + for (k = 0; k < host_address_cells; k++) { > + ranges[i].host <<= 32; > + ranges[i].host |= base_ranges[j++]; > + } > + ranges[i].size = 0; > + for (k = 0; k < size_cells; k++) { > + ranges[i].size <<= 32; > + ranges[i].size |= base_ranges[j++]; > + } > + } > + > + free(base_ranges, M_DEVBUF); > + return (nranges); > +} > > Modified: head/sys/dev/ofw/ofw_pci.h > ============================================================================== > --- head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:07:21 2016 (r295756) > @@ -82,14 +82,19 @@ > #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 > #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 > > -#define OFW_PCI_PHYS_HI_BUS(hi) \ > +#define OFW_PCI_PHYS_HI_BUS(hi) \ > (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) > -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ > +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ > (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) > -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ > +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ > (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) > > /* > + * Export class definition for inheritance purposes > + */ > +DECLARE_CLASS(ofw_pci_driver); > + > +/* > * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. > */ > struct ofw_pci_register { > @@ -100,4 +105,50 @@ struct ofw_pci_register { > u_int32_t size_lo; > }; > > +struct ofw_pci_cell_info { > + pcell_t host_address_cells; > + pcell_t pci_address_cell; > + pcell_t size_cells; > + }; > + > +struct ofw_pci_range { > + uint32_t pci_hi; > + uint64_t pci; > + uint64_t host; > + uint64_t size; > +}; > + > +/* > + * Quirks for some adapters > + */ > +enum { > + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, > +}; > + > +struct ofw_pci_softc { > + device_t sc_dev; > + phandle_t sc_node; > + int sc_bus; > + int sc_initialized; > + int sc_quirks; > + > + struct ofw_pci_range *sc_range; > + int sc_nrange; > + struct ofw_pci_cell_info *sc_cell_info; > + > + struct rman sc_io_rman; > + struct rman sc_mem_rman; > + bus_space_tag_t sc_memt; > + bus_dma_tag_t sc_dmat; > + > + struct ofw_bus_iinfo sc_pci_iinfo; > +}; > + > +int ofw_pci_init(device_t); > +int ofw_pci_attach(device_t); > +int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); > +int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); > +int ofw_pci_route_interrupt(device_t, device_t, int); > +int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); > + > #endif /* _DEV_OFW_OFW_PCI_H_ */ > > Modified: head/sys/dev/ofw/ofw_subr.c > ============================================================================== > --- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:07:21 2016 (r295756) > @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > +#include > +#include > > static void > get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int > *pcip) > > Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c > ============================================================================== > --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:00:04 > 2016 (r295755) > +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:07:21 > 2016 (r295756) > @@ -55,15 +55,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#include > #include > #include > +#include > #include > #include > #include > > -#include > - > #include "ofw_bus_if.h" > #include "pcib_if.h" > > > Modified: head/sys/powerpc/powermac/cpcht.c > ============================================================================== > --- head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:07:21 2016 (r295756) > @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > > #include > #include > @@ -51,7 +50,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > +#include > > #include > #include > > Modified: head/sys/powerpc/powermac/grackle.c > ============================================================================== > --- head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:07:21 2016 (r295756) > @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > #include > +#include > > #include > #include > @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); > > #include > > -#include > #include > > #include > > Modified: head/sys/powerpc/powermac/uninorthpci.c > ============================================================================== > --- head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:00:04 > 2016 (r295755) > +++ head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:07:21 > 2016 (r295756) > @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > #include > +#include > > #include > #include > @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); > > #include > > -#include > #include > > #include > > Modified: head/sys/powerpc/powermac/uninorthvar.h > ============================================================================== > --- head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:00:04 > 2016 (r295755) > +++ head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:07:21 > 2016 (r295756) > @@ -30,7 +30,6 @@ > > #include > #include > -#include > > struct uninorth_softc { > struct ofw_pci_softc pci_sc; > > Modified: head/sys/powerpc/pseries/rtas_pci.c > ============================================================================== > --- head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:00:04 2016 (r295755) > +++ head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:07:21 2016 (r295756) > @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > #include > +#include > > #include > #include > @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#include > #include > > #include "pcib_if.h" > > From owner-svn-src-head@freebsd.org Sat Feb 20 04:50:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F367AAD82A; Sat, 20 Feb 2016 04:50:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46F981838; Sat, 20 Feb 2016 04:50:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ob0-x233.google.com with SMTP id jq7so126174022obb.0; Fri, 19 Feb 2016 20:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZXN75jfcEeXNzUZSWJ/vIMw8alSM41Gsk9fAHDQCFTc=; b=WH2R1m5QC7dd8Kvt6EO+rc9YZRhmiiH53W5/3jB3khAab4sL6qGUplAjorrvo/qOBx 5rZE8S40/NtBhSRTXRDEhRoKdGlHPt823LzA3yttxSJ8KS17TMF2MP065BKMS9luD/YQ KsReCUbopfmX/58uY6p2zYyvXCS0Z+IGIy7616FKoWf5usWamBPxWPhB8S7tZVhP6JUp p1A+BK34zR8eS/SxnSIJuuOwSDOjBP3zTLPKWm0nMmEpVE+VX5wv1ZEudu6yXl+vj40x 9+reIdXKwPtTwscmtUxXa5IkxtvCo8fIVQ0Bl9yv2tI30tStqs3x0avsvaGbToYRV/DV d6fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZXN75jfcEeXNzUZSWJ/vIMw8alSM41Gsk9fAHDQCFTc=; b=k+yNaYLQmmLtNy8CSkRcprZ0558+kIfUGspjwBHl+YqYcdvZHjD+3xA6cFn/4gdQu1 d9hbfuou255i4DDa5FT9aVkq0QVqINENen/2MEcPN3dGNKAROCLdSniA8B3hG33EMZSu OTL8uMwVRyn79qY2MwugIRAcZ6ycHRHIRe6ZyvB9AscT0SX4VJ4hu6zmd92DFebXhDzn BTk/UDT+VPuSTtAUdU+LMWVZZEDUM8U5b66Lg1X58oo0DcUSL9HKhD+VbRJ3ZwetDqwb c7GAQN7QBDt0/v8HUwtLU7cVrPvZwKYv2/YuKsGrL5YPqDA/U7X4OTwRTmJzfG2BGoTu /NNw== X-Gm-Message-State: AG10YOSSIverOjBVYdFG0P3Jcr7GOm1j+nAdVGMbhK3VkvQhnyRrXXC/zdjGUdZ9E4Nbjtj8Wn8OMPB8ObzJWQ== MIME-Version: 1.0 X-Received: by 10.60.81.103 with SMTP id z7mr15069053oex.59.1455943819689; Fri, 19 Feb 2016 20:50:19 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.182.33.8 with HTTP; Fri, 19 Feb 2016 20:50:19 -0800 (PST) In-Reply-To: <20160220142119.U1712@besplex.bde.org> References: <201602200134.u1K1YDOD016555@repo.freebsd.org> <20160220142119.U1712@besplex.bde.org> Date: Fri, 19 Feb 2016 22:50:19 -0600 X-Google-Sender-Auth: c2XmjAVP190esqpJVuEsSZkHI5M Message-ID: Subject: Re: svn commit: r295833 - head/sys/sys From: Justin Hibbits To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 04:50:20 -0000 On 2/19/16, Bruce Evans wrote: > On Sat, 20 Feb 2016, Justin Hibbits wrote: > >> Log: >> Fix the definition of RM_MAX_END. >> >> Even though casting from signed to unsigned is well-defined in C, it's >> better to >> first cast to the larger unsigned type, then negate. > > Casting ~0 is well-defined, but ~0 isn't. > > The operation is complementation, not negation. Yes, brain fart. I stand corrected of course. - Justin From owner-svn-src-head@freebsd.org Sat Feb 20 07:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B24AAE4B3; Sat, 20 Feb 2016 07:45:23 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB98919C2; Sat, 20 Feb 2016 07:45:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1K7jL7w023880; Sat, 20 Feb 2016 07:45:21 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1K7jL8n023879; Sat, 20 Feb 2016 07:45:21 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602200745.u1K7jL8n023879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sat, 20 Feb 2016 07:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295834 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 07:45:23 -0000 Author: skra Date: Sat Feb 20 07:45:21 2016 New Revision: 295834 URL: https://svnweb.freebsd.org/changeset/base/295834 Log: Rename busdma_machdep.c to busdma_machdep-v4.c, pmap.c to pmap-v4.c and trap.c to trap-v4.c to be plain and consistent with other armv4 specific files. Added: head/sys/arm/arm/busdma_machdep-v4.c - copied unchanged from r295833, head/sys/arm/arm/busdma_machdep.c head/sys/arm/arm/pmap-v4.c - copied unchanged from r295833, head/sys/arm/arm/pmap.c head/sys/arm/arm/trap-v4.c - copied unchanged from r295833, head/sys/arm/arm/trap.c Deleted: head/sys/arm/arm/busdma_machdep.c head/sys/arm/arm/pmap.c head/sys/arm/arm/trap.c Modified: head/sys/conf/files.arm Copied: head/sys/arm/arm/busdma_machdep-v4.c (from r295833, head/sys/arm/arm/busdma_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/busdma_machdep-v4.c Sat Feb 20 07:45:21 2016 (r295834, copy of r295833, head/sys/arm/arm/busdma_machdep.c) @@ -0,0 +1,1609 @@ +/*- + * Copyright (c) 2012 Ian Lepore + * Copyright (c) 2004 Olivier Houchard + * Copyright (c) 2002 Peter Grehan + * 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. + * + * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ARM bus dma support routines. + * + * XXX Things to investigate / fix some day... + * - What is the earliest that this API can be called? Could there be any + * fallout from changing the SYSINIT() order from SI_SUB_VM to SI_SUB_KMEM? + * - The manpage mentions the BUS_DMA_NOWAIT flag only in the context of the + * bus_dmamap_load() function. This code has historically (and still does) + * honor it in bus_dmamem_alloc(). If we got rid of that we could lose some + * error checking because some resource management calls would become WAITOK + * and thus "cannot fail." + * - The decisions made by _bus_dma_can_bounce() should be made once, at tag + * creation time, and the result stored in the tag. + * - It should be possible to take some shortcuts when mapping a buffer we know + * came from the uma(9) allocators based on what we know about such buffers + * (aligned, contiguous, etc). + * - The allocation of bounce pages could probably be cleaned up, then we could + * retire arm_remap_nocache(). + */ + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_BPAGES 64 +#define MAX_DMA_SEGMENTS 4096 +#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_addr_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; + struct bounce_zone *bounce_zone; + /* + * DMA range for this tag. If the page doesn't fall within + * one of these ranges, an error is returned. The caller + * may then decide what to do with the transfer. If the + * range pointer is NULL, it is ignored. + */ + struct arm32_dma_range *ranges; + int _nranges; +}; + +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 */ + vm_page_t datapage; /* physical page of client data */ + vm_offset_t dataoffs; /* page offset of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +struct sync_list { + vm_offset_t vaddr; /* kva of client data */ + vm_page_t pages; /* starting page of client data */ + vm_offset_t dataoffs; /* page offset of client data */ + bus_size_t datacount; /* client data count */ +}; + +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 uint32_t tags_total; +static uint32_t maps_total; +static uint32_t maps_dmamem; +static uint32_t maps_coherent; +static counter_u64_t maploads_total; +static counter_u64_t maploads_bounced; +static counter_u64_t maploads_coherent; +static counter_u64_t maploads_dmamem; +static counter_u64_t maploads_mbuf; +static counter_u64_t maploads_physmem; + +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, tags_total, CTLFLAG_RD, &tags_total, 0, + "Number of active tags"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_total, CTLFLAG_RD, &maps_total, 0, + "Number of active maps"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_dmamem, CTLFLAG_RD, &maps_dmamem, 0, + "Number of active maps for bus_dmamem_alloc buffers"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_coherent, CTLFLAG_RD, &maps_coherent, 0, + "Number of active maps with BUS_DMA_COHERENT flag set"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_total, CTLFLAG_RD, + &maploads_total, "Number of load operations performed"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_bounced, CTLFLAG_RD, + &maploads_bounced, "Number of load operations that used bounce buffers"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_coherent, CTLFLAG_RD, + &maploads_dmamem, "Number of load operations on BUS_DMA_COHERENT memory"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_dmamem, CTLFLAG_RD, + &maploads_dmamem, "Number of load operations on bus_dmamem_alloc buffers"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_mbuf, CTLFLAG_RD, + &maploads_mbuf, "Number of load operations for mbufs"); +SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_physmem, CTLFLAG_RD, + &maploads_physmem, "Number of load operations on physical buffers"); +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; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + int flags; +#define DMAMAP_COHERENT (1 << 0) +#define DMAMAP_DMAMEM_ALLOC (1 << 1) +#define DMAMAP_MBUF (1 << 2) +#define DMAMAP_CACHE_ALIGNED (1 << 3) + STAILQ_ENTRY(bus_dmamap) links; + bus_dma_segment_t *segments; + int sync_count; + struct sync_list slist[]; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; + +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_addr_t addr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +static void bus_dmamap_sync_sl(struct sync_list *sl, bus_dmasync_op_t op, + int bufaligned); + +/* + * ---------------------------------------------------------------------------- + * Begin block of code useful to transplant to other implementations. + */ + +static busdma_bufalloc_t coherent_allocator; /* Cache of coherent buffers */ +static busdma_bufalloc_t standard_allocator; /* Cache of standard buffers */ + +MALLOC_DEFINE(M_BUSDMA, "busdma", "busdma metadata"); +MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages"); + +static void +busdma_init(void *dummy) +{ + + maploads_total = counter_u64_alloc(M_WAITOK); + maploads_bounced = counter_u64_alloc(M_WAITOK); + maploads_coherent = counter_u64_alloc(M_WAITOK); + maploads_dmamem = counter_u64_alloc(M_WAITOK); + maploads_mbuf = counter_u64_alloc(M_WAITOK); + maploads_physmem = counter_u64_alloc(M_WAITOK); + + /* Create a cache of buffers in standard (cacheable) memory. */ + standard_allocator = busdma_bufalloc_create("buffer", + arm_dcache_align, /* minimum_alignment */ + NULL, /* uma_alloc func */ + NULL, /* uma_free func */ + 0); /* uma_zcreate_flags */ + + /* + * Create a cache of buffers in uncacheable memory, to implement the + * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. + */ + coherent_allocator = busdma_bufalloc_create("coherent", + arm_dcache_align, /* minimum_alignment */ + busdma_bufalloc_alloc_uncacheable, + busdma_bufalloc_free_uncacheable, + 0); /* uma_zcreate_flags */ +} + +/* + * This init historically used SI_SUB_VM, but now the init code requires + * malloc(9) using M_BUSDMA memory and the pcpu zones for counter(9), which get + * set up by SI_SUB_KMEM and SI_ORDER_LAST, so we'll go right after that by + * using SI_SUB_KMEM+1. + */ +SYSINIT(busdma, SI_SUB_KMEM+1, SI_ORDER_FIRST, busdma_init, NULL); + +/* + * End block of code useful to transplant to other implementations. + * ---------------------------------------------------------------------------- + */ + +/* + * 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. + */ +static 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); +} + +/* + * This routine checks the exclusion zone constraints from a tag against the + * physical RAM available on the machine. If a tag specifies an exclusion zone + * but there's no RAM in that zone, then we avoid allocating resources to bounce + * a request, and we can use any memory allocator (as opposed to needing + * kmem_alloc_contig() just because it can allocate pages in an address range). + * + * Most tags have BUS_SPACE_MAXADDR or BUS_SPACE_MAXADDR_32BIT (they are the + * same value on 32-bit architectures) as their lowaddr constraint, and we can't + * possibly have RAM at an address higher than the highest address we can + * express, so we take a fast out. + */ +static __inline int +_bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) +{ + int i; + + if (lowaddr >= BUS_SPACE_MAXADDR) + return (0); + + for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { + if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) + || (lowaddr < phys_avail[i] && + highaddr > phys_avail[i])) + return (1); + } + return (0); +} + +static __inline struct arm32_dma_range * +_bus_dma_inrange(struct arm32_dma_range *ranges, int nranges, + bus_addr_t curaddr) +{ + struct arm32_dma_range *dr; + int i; + + for (i = 0, dr = ranges; i < nranges; i++, dr++) { + if (curaddr >= dr->dr_sysbase && + round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len)) + return (dr); + } + + return (NULL); +} + +/* + * 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) +{ +#ifdef INVARIANTS + panic("driver error: busdma dflt_lock called"); +#else + printf("DRIVER_ERROR: busdma dflt_lock called\n"); +#endif +} + +/* + * Allocate a device specific dma_tag. + */ +int +bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_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; + /* Return a NULL tag on failure */ + *dmat = NULL; + + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_BUSDMA, 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 ? alignment : 1; + newtag->boundary = boundary; + newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_offset_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; + newtag->ranges = bus_dma_get_range(); + newtag->_nranges = bus_dma_get_range_nb(); + if (lockfunc != NULL) { + newtag->lockfunc = lockfunc; + newtag->lockfuncarg = lockfuncarg; + } else { + newtag->lockfunc = dflt_lock; + newtag->lockfuncarg = 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 (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) + || 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_BUSDMA); + 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; + } else + newtag->bounce_zone = NULL; + + if (error != 0) { + free(newtag, M_BUSDMA); + } else { + atomic_add_32(&tags_total, 1); + *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) { + atomic_subtract_32(&tags_total, 1); + free(dmat, M_BUSDMA); + /* + * 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); +} + +static int +allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + int error; + + /* + * 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; + + /* Initialize the new map */ + STAILQ_INIT(&(map->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + maxpages = MAX_BPAGES; + 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) + return (ENOMEM); + + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) + dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; + } + bz->map_count++; + } + return (0); +} + +static bus_dmamap_t +allocate_map(bus_dma_tag_t dmat, int mflags) +{ + int mapsize, segsize; + bus_dmamap_t map; + + /* + * Allocate the map. The map structure ends with an embedded + * variable-sized array of sync_list structures. Following that + * we allocate enough extra space to hold the array of bus_dma_segments. + */ + KASSERT(dmat->nsegments <= MAX_DMA_SEGMENTS, + ("cannot allocate %u dma segments (max is %u)", + dmat->nsegments, MAX_DMA_SEGMENTS)); + segsize = sizeof(struct bus_dma_segment) * dmat->nsegments; + mapsize = sizeof(*map) + sizeof(struct sync_list) * dmat->nsegments; + map = malloc(mapsize + segsize, M_BUSDMA, mflags | M_ZERO); + if (map == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); + return (NULL); + } + map->segments = (bus_dma_segment_t *)((uintptr_t)map + mapsize); + return (map); +} + +/* + * 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) +{ + bus_dmamap_t map; + int error = 0; + + *mapp = map = allocate_map(dmat, M_NOWAIT); + if (map == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* + * Bouncing might be required if the driver asks for an exclusion + * region, a data alignment that is stricter than 1, or DMA that begins + * or ends with a partial cacheline. Whether bouncing will actually + * happen can't be known until mapping time, but we need to pre-allocate + * resources now because we might not be allowed to at mapping time. + */ + error = allocate_bz_and_pages(dmat, map); + if (error != 0) { + free(map, M_BUSDMA); + *mapp = NULL; + return (error); + } + if (map->flags & DMAMAP_COHERENT) + atomic_add_32(&maps_coherent, 1); + atomic_add_32(&maps_total, 1); + dmat->map_count++; + + return (0); +} + +/* + * 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 (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; + if (map->flags & DMAMAP_COHERENT) + atomic_subtract_32(&maps_coherent, 1); + atomic_subtract_32(&maps_total, 1); + free(map, M_BUSDMA); + 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 listed in the dma tag. Returns a pointer to + * the allocated memory, and a pointer to an associated bus_dmamap. + */ +int +bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, + bus_dmamap_t *mapp) +{ + busdma_bufalloc_t ba; + struct busdma_bufzone *bufzone; + bus_dmamap_t map; + vm_memattr_t memattr; + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + + *mapp = map = allocate_map(dmat, mflags); + if (map == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + map->flags = DMAMAP_DMAMEM_ALLOC; + + /* Choose a busdma buffer allocator based on memory type flags. */ + if (flags & BUS_DMA_COHERENT) { + memattr = VM_MEMATTR_UNCACHEABLE; + ba = coherent_allocator; + map->flags |= DMAMAP_COHERENT; + } else { + memattr = VM_MEMATTR_DEFAULT; + ba = standard_allocator; + } + + /* + * Try to find a bufzone in the allocator that holds a cache of buffers + * of the right size for this request. If the buffer is too big to be + * held in the allocator cache, this returns NULL. + */ + bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); + + /* + * Allocate the buffer from the uma(9) allocator if... + * - It's small enough to be in the allocator (bufzone not NULL). + * - The alignment constraint isn't larger than the allocation size + * (the allocator aligns buffers to their size boundaries). + * - There's no need to handle lowaddr/highaddr exclusion zones. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed nsegments. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. + */ + if (bufzone != NULL && dmat->alignment <= bufzone->size && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { + *vaddr = uma_zalloc(bufzone->umazone, mflags); + } else if (dmat->nsegments >= btoc(dmat->maxsize) && + dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { + *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, + mflags, 0, dmat->lowaddr, memattr); + } else { + *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, + mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, + memattr); + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + free(map, M_BUSDMA); + *mapp = NULL; + return (ENOMEM); + } + if (map->flags & DMAMAP_COHERENT) + atomic_add_32(&maps_coherent, 1); + atomic_add_32(&maps_dmamem, 1); + atomic_add_32(&maps_total, 1); + dmat->map_count++; + + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, 0); + return (0); +} + +/* + * Free a piece of memory that was allocated via bus_dmamem_alloc, along with + * its associated map. + */ +void +bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + struct busdma_bufzone *bufzone; + busdma_bufalloc_t ba; + + if (map->flags & DMAMAP_COHERENT) + ba = coherent_allocator; + else + ba = standard_allocator; + + bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); + + if (bufzone != NULL && dmat->alignment <= bufzone->size && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) + uma_zfree(bufzone->umazone, vaddr); + else + kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->maxsize); + + dmat->map_count--; + if (map->flags & DMAMAP_COHERENT) + atomic_subtract_32(&maps_coherent, 1); + atomic_subtract_32(&maps_total, 1); + atomic_subtract_32(&maps_dmamem, 1); + free(map, M_BUSDMA); + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); +} + +static void +_bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + + if (map->pagesneeded == 0) { + CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", + dmat->lowaddr, dmat->boundary, dmat->alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", + map, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->maxsegsz); + if (run_filter(dmat, curaddr) != 0) { + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); + map->pagesneeded++; + } + curaddr += sgsize; + buflen -= sgsize; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static void +_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->pagesneeded == 0) { + CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", + dmat->lowaddr, dmat->boundary, dmat->alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", + map, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + if (__predict_true(pmap == kernel_pmap)) + paddr = pmap_kextract(vaddr); + else + paddr = pmap_extract(pmap, vaddr); + if (run_filter(dmat, paddr) != 0) + map->pagesneeded++; + vaddr += PAGE_SIZE; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static int +_bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) +{ + + /* Reserve Necessary Bounce Pages */ + 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 */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + + return (0); +} + +/* + * Add a single contiguous physical range to the segment list. + */ +static int +_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, + bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) +{ + bus_addr_t baddr, bmask; + int seg; + + /* + * Make sure we don't cross any boundaries. + */ + bmask = ~(dmat->boundary - 1); + if (dmat->boundary > 0) { + baddr = (curaddr + dmat->boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + if (dmat->ranges) { + struct arm32_dma_range *dr; + + dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, + curaddr); + if (dr == NULL) + return (0); + /* + * In a valid DMA range. Translate the physical + * memory address to an address in the DMA window. + */ + curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase; + + } + + seg = *segp; + /* + * Insert chunk into a segment, coalescing with + * the previous segment if possible. + */ + if (seg >= 0 && + curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (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) + return (0); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + *segp = seg; + return (sgsize); +} + +/* + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +int +_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) +{ + bus_addr_t curaddr; + bus_addr_t sl_end = 0; + bus_size_t sgsize; + struct sync_list *sl; + int error; + + if (segs == NULL) + segs = map->segments; + + counter_u64_add(maploads_total, 1); + counter_u64_add(maploads_physmem, 1); + + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); + if (map->pagesneeded != 0) { + counter_u64_add(maploads_bounced, 1); + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + sl = map->slist + map->sync_count - 1; + + while (buflen > 0) { + curaddr = buf; + sgsize = MIN(buflen, dmat->maxsegsz); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + sgsize); + } else { + if (map->sync_count > 0) + sl_end = VM_PAGE_TO_PHYS(sl->pages) + + sl->dataoffs + sl->datacount; + + if (map->sync_count == 0 || curaddr != sl_end) { + if (++map->sync_count > dmat->nsegments) + break; + sl++; + sl->vaddr = 0; + sl->datacount = sgsize; + sl->pages = PHYS_TO_VM_PAGE(curaddr); + sl->dataoffs = curaddr & PAGE_MASK; + } else + sl->datacount += sgsize; + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Feb 20 09:37:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89B4AAD3F8; Sat, 20 Feb 2016 09:37:48 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout11.t-online.de (mailout11.t-online.de [194.25.134.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49C789C1; Sat, 20 Feb 2016 09:37:48 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd04.aul.t-online.de (fwd04.aul.t-online.de [172.20.26.149]) by mailout11.t-online.de (Postfix) with SMTP id 70E4655598D; Sat, 20 Feb 2016 10:37:40 +0100 (CET) Received: from [192.168.119.17] (GMGY9QZJohooYLvD6khdW5O4fllH-DC8Eua8lkUnEF2Obo0eQImv2trfzRLU4Tvwe9@[87.151.212.124]) by fwd04.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1aX3yk-3Qnvcm0; Sat, 20 Feb 2016 10:37:30 +0100 Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb To: Eric van Gyzen , Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dwmalone@FreeBSD.org References: <201602190842.u1J8gDOc015177@repo.freebsd.org> <56C7B60E.8080002@FreeBSD.org> <56C7D019.3020807@FreeBSD.org> From: Stefan Esser X-Enigmail-Draft-Status: N1110 Message-ID: <56C833CD.4040309@freebsd.org> Date: Sat, 20 Feb 2016 10:37:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56C7D019.3020807@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-ID: GMGY9QZJohooYLvD6khdW5O4fllH-DC8Eua8lkUnEF2Obo0eQImv2trfzRLU4Tvwe9 X-TOI-MSGID: 5f85d3f1-6166-4529-8ed5-33d2bc96c439 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 09:37:48 -0000 Am 20.02.2016 um 03:31 schrieb Eric van Gyzen: > On 2/19/16 6:40 PM, Bryan Drewery wrote: >> On 2/19/2016 12:42 AM, Stefan Esser wrote: >>> Author: se >>> Date: Fri Feb 19 08:42:13 2016 >>> New Revision: 295800 >>> URL: https://svnweb.freebsd.org/changeset/base/295800 >>> >>> Log: >>> Remove O_SYNC from the options passed to dbmopen(). >> Uh, this is a full revert of r293312's changes to cap_mkdb which were >> made for good reason. So this seems simply wrong without a better fix. >> >>> The output file is created as a temporary file that is moved >>> over the >>> existing file after completion. Thus there is no need to immediately >>> flush all created db records to the temporary file. >> This is not right either. Depending on the use of soft updates / >> journaling the data and metadata (file name / rename) may be written at >> different times. It is entirely possible to get a renamed file with no >> or junk content without an fsync. That's exactly what r293312 mentions >> in its commit message. I had performed multiple tests and found, that the file was always created identical whether with or without O_SYNC. But I've got to admit, that I did not check the SVN log. After reading the commit log entry for r293312, I understand there is the risk of an empty db file if a system crash happens before all data and metadata has been flushed. I had assumed that one of the guarantees soft-updates makes is that data and meta-data operations are ordered relative to each other. I'm not sure, whether this is a hypothetical case, or whether such a case had been observed in reality, but I understand that you don't want to take risk when operating on critical system files. O_SYNC was first added to updates of the password db, and I think that was the file with the biggest risk of accidental damage due to a crash. But services_mkdb and cap_mkdb are only invoked by the administrator after the text files are modified and it is highly unlikely (but of course not impossible) that a crash occurs at just that moment. > dwmalone@ plans to put the fsync() in the db close method, which makes a > lot of sense, and would fix this in a better way. > > https://reviews.freebsd.org/D5186 > > This commit probably should have waited for D5186 to be committed, but > at least that seems imminent. Yes, I mentioned review D5186 in the commit log and was aware, that there was consensus that dwmalone's change to hash.c is about to be committed. I was afraid that D5186 could be committed without the removal of O_SYNC and that D5186 might be merged to 10.3, but that cap_mkdb kept O_SYNC and would be slow throughout the lifetime of 10.3. So the commit was expected to be followed by the fsync() patch in hash.c very soon and I had mentioned, that the MFC of the mkdb patch should be performed in conjunction (or after) the MFC of D5186. I think it is important that the mkdb utilities do not take tens of seconds and up to several minutes in 10.3 ... Regards, STefan From owner-svn-src-head@freebsd.org Sat Feb 20 11:36:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77FD0AAEA0A; Sat, 20 Feb 2016 11:36:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EFF61A92; Sat, 20 Feb 2016 11:36:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KBaaO5090566; Sat, 20 Feb 2016 11:36:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KBaagx090562; Sat, 20 Feb 2016 11:36:36 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201602201136.u1KBaagx090562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Feb 2016 11:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295836 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 11:36:37 -0000 Author: kp Date: Sat Feb 20 11:36:35 2016 New Revision: 295836 URL: https://svnweb.freebsd.org/changeset/base/295836 Log: ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering If one does 'ifconfig tap create name blah', it will return error because the 'name' command doesn't properly populate the request sent to ioctl(...). The 'description' command has the same bug, and is also fixed with this patch. If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0' (or other sequence number) is echoed, instead of the expected 'blah'. (assuming the name change actually succeeded) Submitted by: Marie Helene Kvello-Aune Differential Revision: https://reviews.freebsd.org/D5341 Modified: head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Sat Feb 20 10:56:46 2016 (r295835) +++ head/sbin/ifconfig/ifclone.c Sat Feb 20 11:36:35 2016 (r295836) @@ -144,11 +144,12 @@ ifclonecreate(int s, void *arg) } /* - * If we get a different name back than we put in, print it. + * If we get a different name back than we put in, update record and + * indicate it should be printed later. */ if (strncmp(name, ifr.ifr_name, sizeof(name)) != 0) { strlcpy(name, ifr.ifr_name, sizeof(name)); - printf("%s\n", name); + printifname = 1; } } Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sat Feb 20 10:56:46 2016 (r295835) +++ head/sbin/ifconfig/ifconfig.c Sat Feb 20 11:36:35 2016 (r295836) @@ -93,6 +93,7 @@ int clearaddr; int newaddr = 1; int verbose; int noload; +int printifname = 0; int supmedia = 0; int printkeys = 0; /* Print keying material for interfaces. */ @@ -108,6 +109,8 @@ static struct afswtch *af_getbyname(cons static struct afswtch *af_getbyfamily(int af); static void af_other_status(int); +void printifnamemaybe(void); + static struct option *opts = NULL; struct ifa_order_elt { @@ -297,6 +300,12 @@ sortifaddrs(struct ifaddrs *list, return (result); } +void printifnamemaybe() +{ + if (printifname) + printf("%s\n", name); +} + int main(int argc, char *argv[]) { @@ -314,6 +323,12 @@ main(int argc, char *argv[]) size_t iflen; all = downonly = uponly = namesonly = noload = verbose = 0; + + /* + * Ensure we print interface name when expected to, + * even if we terminate early due to error. + */ + atexit(printifnamemaybe); /* Parse leading line options */ strlcpy(options, "adklmnuv", sizeof(options)); @@ -1011,6 +1026,8 @@ setifname(const char *val, int dummy __u const struct afswtch *afp) { char *newname; + + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); newname = strdup(val); if (newname == NULL) @@ -1020,6 +1037,7 @@ setifname(const char *val, int dummy __u free(newname); err(1, "ioctl SIOCSIFNAME (set name)"); } + printifname = 1; strlcpy(name, newname, sizeof(name)); free(newname); } @@ -1031,6 +1049,8 @@ setifdescr(const char *val, int dummy __ { char *newdescr; + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + ifr.ifr_buffer.length = strlen(val) + 1; if (ifr.ifr_buffer.length == 1) { ifr.ifr_buffer.buffer = newdescr = NULL; Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Sat Feb 20 10:56:46 2016 (r295835) +++ head/sbin/ifconfig/ifconfig.h Sat Feb 20 11:36:35 2016 (r295836) @@ -133,6 +133,7 @@ extern int supmedia; extern int printkeys; extern int newaddr; extern int verbose; +extern int printifname; void setifcap(const char *, int value, int s, const struct afswtch *); From owner-svn-src-head@freebsd.org Sat Feb 20 11:49:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC35AAF093; Sat, 20 Feb 2016 11:49:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8401D31D; Sat, 20 Feb 2016 11:49:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1KBnKkh038437 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 20 Feb 2016 13:49:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1KBnKkh038437 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1KBnKwi038436; Sat, 20 Feb 2016 13:49:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Feb 2016 13:49:20 +0200 From: Konstantin Belousov To: Stefan Esser Cc: Eric van Gyzen , Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dwmalone@FreeBSD.org Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb Message-ID: <20160220114919.GZ91220@kib.kiev.ua> References: <201602190842.u1J8gDOc015177@repo.freebsd.org> <56C7B60E.8080002@FreeBSD.org> <56C7D019.3020807@FreeBSD.org> <56C833CD.4040309@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C833CD.4040309@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 11:49:31 -0000 On Sat, Feb 20, 2016 at 10:37:17AM +0100, Stefan Esser wrote: > I had assumed that one of the guarantees soft-updates makes is that > data and meta-data operations are ordered relative to each other. This is not true, SU never provided such guarantee. SU only ensures the correctness of the metadata for any moment in time, or innocent inconsistencies, where operation cannot be made atomic and consistent simultaneously. In other words, in this case, SU guarantees that the data blocks which are allocated for writes, are not used by other inode, as recorded by the metadata on disk, _if_ blocks are recorded in the on-disk inode. It makes absolutely no guarantees about the flushing of the data buffers. From owner-svn-src-head@freebsd.org Sat Feb 20 12:28:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C31DAAD9A1; Sat, 20 Feb 2016 12:28:23 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09ED51DE9; Sat, 20 Feb 2016 12:28:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KCSLpq005526; Sat, 20 Feb 2016 12:28:21 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KCSL46005517; Sat, 20 Feb 2016 12:28:21 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602201228.u1KCSL46005517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 20 Feb 2016 12:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295837 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 12:28:23 -0000 Author: zbb Date: Sat Feb 20 12:28:20 2016 New Revision: 295837 URL: https://svnweb.freebsd.org/changeset/base/295837 Log: Revert r295756: Extract common code from PowerPC's ofw_pci Import portions of the PowerPC OF PCI implementation into new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofw_pci.h. This creates a new ofw_pci_write_ivar() function and modifies ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures. Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879 This needs to return to the drawing board as it breaks both PowerPC and Sparc64 build. Pointed out by: jhibbits Deleted: head/sys/dev/ofw/ofw_pci.c Modified: head/sys/conf/files head/sys/dev/ofw/ofw_pci.h head/sys/dev/ofw/ofw_subr.c head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h head/sys/powerpc/pseries/rtas_pci.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/conf/files Sat Feb 20 12:28:20 2016 (r295837) @@ -2108,7 +2108,6 @@ dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt -dev/ofw/ofw_pci.c optional fdt pci dev/ow/ow.c optional ow \ dependency "owll_if.h" \ dependency "own_if.h" Modified: head/sys/dev/ofw/ofw_pci.h ============================================================================== --- head/sys/dev/ofw/ofw_pci.h Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/dev/ofw/ofw_pci.h Sat Feb 20 12:28:20 2016 (r295837) @@ -82,19 +82,14 @@ #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 -#define OFW_PCI_PHYS_HI_BUS(hi) \ +#define OFW_PCI_PHYS_HI_BUS(hi) \ (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) /* - * Export class definition for inheritance purposes - */ -DECLARE_CLASS(ofw_pci_driver); - -/* * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. */ struct ofw_pci_register { @@ -105,50 +100,4 @@ struct ofw_pci_register { u_int32_t size_lo; }; -struct ofw_pci_cell_info { - pcell_t host_address_cells; - pcell_t pci_address_cell; - pcell_t size_cells; - }; - -struct ofw_pci_range { - uint32_t pci_hi; - uint64_t pci; - uint64_t host; - uint64_t size; -}; - -/* - * Quirks for some adapters - */ -enum { - OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, -}; - -struct ofw_pci_softc { - device_t sc_dev; - phandle_t sc_node; - int sc_bus; - int sc_initialized; - int sc_quirks; - - struct ofw_pci_range *sc_range; - int sc_nrange; - struct ofw_pci_cell_info *sc_cell_info; - - struct rman sc_io_rman; - struct rman sc_mem_rman; - bus_space_tag_t sc_memt; - bus_dma_tag_t sc_dmat; - - struct ofw_bus_iinfo sc_pci_iinfo; -}; - -int ofw_pci_init(device_t); -int ofw_pci_attach(device_t); -int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); -int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); -int ofw_pci_route_interrupt(device_t, device_t, int); -int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); - #endif /* _DEV_OFW_OFW_PCI_H_ */ Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/dev/ofw/ofw_subr.c Sat Feb 20 12:28:20 2016 (r295837) @@ -39,9 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include static void get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat Feb 20 12:28:20 2016 (r295837) @@ -55,13 +55,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include #include +#include + #include "ofw_bus_if.h" #include "pcib_if.h" Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/cpcht.c Sat Feb 20 12:28:20 2016 (r295837) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -50,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/grackle.c Sat Feb 20 12:28:20 2016 (r295837) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/uninorthpci.c Sat Feb 20 12:28:20 2016 (r295837) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/powermac/uninorthvar.h Sat Feb 20 12:28:20 2016 (r295837) @@ -30,6 +30,7 @@ #include #include +#include struct uninorth_softc { struct ofw_pci_softc pci_sc; Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Sat Feb 20 11:36:35 2016 (r295836) +++ head/sys/powerpc/pseries/rtas_pci.c Sat Feb 20 12:28:20 2016 (r295837) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "pcib_if.h" From owner-svn-src-head@freebsd.org Sat Feb 20 12:32:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D657AADBF0; Sat, 20 Feb 2016 12:32:19 +0000 (UTC) (envelope-from zbodek@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C7E11F9; Sat, 20 Feb 2016 12:32:18 +0000 (UTC) (envelope-from zbodek@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id m1so70062651lfg.0; Sat, 20 Feb 2016 04:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=c1Wqe1ILO2fUN9v7y+BIXZ1juM6U/bh/rCaSum8maS4=; b=Rn1XsesDzgZ42EPUlwhXmQ9FDPdOMlc9nlhKrFbVZzPFv6Bo0wMmZIH6RX3ZsRkDBO L4ihmN7YO/A9KLJzUnAfV8K7lNncguV6bhxvEftHAJ/CI5mb260v2j7XcOS/isEubkdJ xxKyNuFzjZeTPeHXj5dhDNxPnQqvZZ0RFRE0JtZti66P/GqaukQkf+L2/IfTp0lC/U1N 9XGDCk5Djgm9o9MDpOzvM1vOBg+wTLF3MvglDY3Q3f4UHhKuhHHzOcD0SuRZSTcS13Xj CiNZZftbw152BNIm/e/CFmGhzdf7ZLo8E+eK/JCPo1HLNxybEfj0pgK9rPObzG8rDTaj 4W9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=c1Wqe1ILO2fUN9v7y+BIXZ1juM6U/bh/rCaSum8maS4=; b=Kza3cttUol76oGMqdzx+xAZlgG3YVPN6gUhGpMX2JV67FHJEgoa3Z+pFJ+uFO5AzQG DF/v9FEZYfg0O0xrxVFRYxYysDOWgeQoZxUUdEr7eJ4sA5U6mcm4TErGia60qtHkiaH0 2WNCK5s36L1utvpZeZfRIlUGkA8zg1KpMNbngauSRb/mo7VRvVqeB0YlBKo1u0xlVGMj TPIf8gc7ZL6nwjzDKKyaEtlkDvu+ppKiU7wRtmG7T5QpORkWtqj4PWAg+z+PIootFTA/ yxDkmKmouLAaJt3an9VlCiGI3vyJ88fIbXkBXdsKyNwkvWBZZOmWnUJ1IVrZY5uz0B3W YAjw== X-Gm-Message-State: AG10YORPVk9KwztGV8GNaFSBsFIs4YnqF3/PI/iKyRypDa65e/sU2ihnE3UtVRjXbLSJfUJaqXN64uyzIb/2kA== X-Received: by 10.25.158.136 with SMTP id h130mr7276057lfe.108.1455971535847; Sat, 20 Feb 2016 04:32:15 -0800 (PST) MIME-Version: 1.0 Sender: zbodek@gmail.com Received: by 10.25.141.130 with HTTP; Sat, 20 Feb 2016 04:31:56 -0800 (PST) In-Reply-To: References: <201602181307.u1ID7MeN059064@repo.freebsd.org> From: Zbigniew Bodek Date: Sat, 20 Feb 2016 13:31:56 +0100 X-Google-Sender-Auth: YSb7Utu8f79XFrIMeQQ_Y_wdug4 Message-ID: Subject: Re: svn commit: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 12:32:19 -0000 Hello Justin, Reverted in 295837. I am very sorry for trouble. This will need to return to the drawing board and I will double check the patch next time. Best regards zbb 2016-02-20 5:48 GMT+01:00 Justin Hibbits : > This was not tinderboxed. I'm getting build failures for powerpc and > sparc64. Please revert or fix. > > Least of which: sys/dev/ofw/ofw_pci.c conflicts with > sys/powerpc/ofw/ofw_pci.c, which I mentioned in phabricator long ago. > > Additionally, several files are missing includes of dev/ofw/ofw_bus_subr.h. > > One example from tinderbox: > > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 7308: warning: duplicate script for target "ofw_pci.ln" ignored > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 2150: warning: using previous script for "ofw_pci.ln" defined > here > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 7311: warning: duplicate script for target "ofw_pci.o" ignored > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 2154: warning: using previous script for "ofw_pci.o" defined here > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 7312: warning: duplicate script for target "ofw_pci.o" ignored > make[5]: "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" > line 2154: warning: using previous script for "ofw_pci.o" defined here > In file included from /home/jhibbits/head/sys/powerpc/powermac/uninorth.c:36: > /home/jhibbits/head/sys/dev/ofw/ofw_pci.h:144: error: field > 'sc_pci_iinfo' has incomplete type > > > - Justin > > On 2/18/16, Zbigniew Bodek wrote: >> Author: zbb >> Date: Thu Feb 18 13:07:21 2016 >> New Revision: 295756 >> URL: https://svnweb.freebsd.org/changeset/base/295756 >> >> Log: >> Extract common code from PowerPC's ofw_pci >> >> Import portions of the PowerPC OF PCI implementation into >> new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and >> ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations >> are moved to sys/dev/ofw/ofw_pci.h. >> >> This creates a new ofw_pci_write_ivar() function and modifies >> ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() >> methods. >> Most functions contain existing ppc implementations in the majority >> unchanged. Now there is no need to have multiple identical copies >> of methods for various architectures. >> >> Submitted by: Marcin Mazurek >> Obtained from: Semihalf >> Sponsored by: Annapurna Labs >> Reviewed by: jhibbits, mmel >> Differential Revision: https://reviews.freebsd.org/D4879 >> >> Added: >> head/sys/dev/ofw/ofw_pci.c (contents, props changed) >> Modified: >> head/sys/conf/files >> head/sys/dev/ofw/ofw_pci.h >> head/sys/dev/ofw/ofw_subr.c >> head/sys/powerpc/mpc85xx/pci_mpc85xx.c >> head/sys/powerpc/powermac/cpcht.c >> head/sys/powerpc/powermac/grackle.c >> head/sys/powerpc/powermac/uninorthpci.c >> head/sys/powerpc/powermac/uninorthvar.h >> head/sys/powerpc/pseries/rtas_pci.c >> >> Modified: head/sys/conf/files >> ============================================================================== >> --- head/sys/conf/files Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/conf/files Thu Feb 18 13:07:21 2016 (r295756) >> @@ -2108,6 +2108,7 @@ dev/ofw/ofw_subr.c optional fdt >> dev/ofw/ofwbus.c optional fdt >> dev/ofw/openfirm.c optional fdt >> dev/ofw/openfirmio.c optional fdt >> +dev/ofw/ofw_pci.c optional fdt pci >> dev/ow/ow.c optional ow \ >> dependency "owll_if.h" \ >> dependency "own_if.h" >> >> Added: head/sys/dev/ofw/ofw_pci.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/ofw/ofw_pci.c Thu Feb 18 13:07:21 2016 (r295756) >> @@ -0,0 +1,622 @@ >> +/*- >> + * Copyright (c) 2011 Nathan Whitehorn >> + * 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 >> + >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> + >> +#include "pcib_if.h" >> + >> +/* >> + * If it is necessary to set another value of this for >> + * some platforms it should be set at fdt.h file >> + */ >> +#ifndef PCI_MAP_INTR >> +#define PCI_MAP_INTR 4 >> +#endif >> + >> +#define PCI_INTR_PINS 4 >> + >> +/* >> + * bus interface. >> + */ >> +static struct resource * ofw_pci_alloc_resource(device_t, device_t, >> + int, int *, u_long, u_long, u_long, u_int); >> +static int ofw_pci_release_resource(device_t, device_t, int, int, >> + struct resource *); >> +static int ofw_pci_activate_resource(device_t, device_t, int, int, >> + struct resource *); >> +static int ofw_pci_deactivate_resource(device_t, device_t, int, int, >> + struct resource *); >> +static int ofw_pci_adjust_resource(device_t, device_t, int, >> + struct resource *, u_long, u_long); >> + >> +/* >> + * pcib interface >> + */ >> +static int ofw_pci_maxslots(device_t); >> + >> +/* >> + * ofw_bus interface >> + */ >> +static phandle_t ofw_pci_get_node(device_t, device_t); >> + >> +/* >> + * local methods >> + */ >> +static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *); >> + >> +/* >> + * Driver methods. >> + */ >> +static device_method_t ofw_pci_methods[] = { >> + >> + /* Device interface */ >> + DEVMETHOD(device_attach, ofw_pci_attach), >> + >> + /* Bus interface */ >> + DEVMETHOD(bus_print_child, bus_generic_print_child), >> + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), >> + DEVMETHOD(bus_write_ivar, ofw_pci_write_ivar), >> + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), >> + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), >> + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), >> + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), >> + DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), >> + DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), >> + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), >> +#ifdef __powerpc__ >> + DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), >> +#endif >> + >> + /* pcib interface */ >> + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), >> + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), >> + >> + /* ofw_bus interface */ >> + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), >> + >> + DEVMETHOD_END >> +}; >> + >> +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); >> + >> +int >> +ofw_pci_init(device_t dev) >> +{ >> + struct ofw_pci_softc *sc; >> + phandle_t node; >> + u_int32_t busrange[2]; >> + struct ofw_pci_range *rp; >> + int error; >> + struct ofw_pci_cell_info *cell_info; >> + >> + node = ofw_bus_get_node(dev); >> + sc = device_get_softc(dev); >> + sc->sc_initialized = 1; >> + sc->sc_range = NULL; >> + >> + cell_info = (struct ofw_pci_cell_info *)malloc(sizeof(*cell_info), >> + M_DEVBUF, M_WAITOK | M_ZERO); >> + >> + sc->sc_cell_info = cell_info; >> + >> + if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8) >> + busrange[0] = 0; >> + >> + sc->sc_dev = dev; >> + sc->sc_node = node; >> + sc->sc_bus = busrange[0]; >> + >> + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { >> + phandle_t c; >> + int n, i; >> + >> + sc->sc_nrange = 0; >> + for (c = OF_child(node); c != 0; c = OF_peer(c)) { >> + n = ofw_pci_nranges(c, cell_info); >> + if (n > 0) >> + sc->sc_nrange += n; >> + } >> + if (sc->sc_nrange == 0) { >> + error = ENXIO; >> + goto out; >> + } >> + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), >> + M_DEVBUF, M_WAITOK); >> + i = 0; >> + for (c = OF_child(node); c != 0; c = OF_peer(c)) { >> + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); >> + if (n > 0) >> + i += n; >> + } >> + KASSERT(i == sc->sc_nrange, ("range count mismatch")); >> + } else { >> + sc->sc_nrange = ofw_pci_nranges(node, cell_info); >> + if (sc->sc_nrange <= 0) { >> + device_printf(dev, "could not getranges\n"); >> + error = ENXIO; >> + goto out; >> + } >> + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), >> + M_DEVBUF, M_WAITOK); >> + ofw_pci_fill_ranges(node, sc->sc_range); >> + } >> + >> + sc->sc_io_rman.rm_type = RMAN_ARRAY; >> + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; >> + error = rman_init(&sc->sc_io_rman); >> + if (error) { >> + device_printf(dev, "rman_init() failed. error = %d\n", error); >> + goto out; >> + } >> + >> + sc->sc_mem_rman.rm_type = RMAN_ARRAY; >> + sc->sc_mem_rman.rm_descr = "PCI Memory"; >> + error = rman_init(&sc->sc_mem_rman); >> + if (error) { >> + device_printf(dev, "rman_init() failed. error = %d\n", error); >> + goto out; >> + } >> + >> + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && >> + rp->pci_hi != 0; rp++) { >> + error = 0; >> + >> + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { >> + case OFW_PCI_PHYS_HI_SPACE_CONFIG: >> + break; >> + case OFW_PCI_PHYS_HI_SPACE_IO: >> + error = rman_manage_region(&sc->sc_io_rman, rp->pci, >> + rp->pci + rp->size - 1); >> + break; >> + case OFW_PCI_PHYS_HI_SPACE_MEM32: >> + case OFW_PCI_PHYS_HI_SPACE_MEM64: >> + error = rman_manage_region(&sc->sc_mem_rman, rp->pci, >> + rp->pci + rp->size - 1); >> + break; >> + } >> + >> + if (error) { >> + device_printf(dev, >> + "rman_manage_region(%x, %#jx, %#jx) failed. " >> + "error = %d\n", rp->pci_hi & >> + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, >> + rp->pci + rp->size - 1, error); >> + goto out; >> + } >> + } >> + >> + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); >> + >> +out: >> + free(cell_info, M_DEVBUF); >> + free(sc->sc_range, M_DEVBUF); >> + rman_fini(&sc->sc_io_rman); >> + rman_fini(&sc->sc_mem_rman); >> + >> + return (error); >> +} >> + >> +int >> +ofw_pci_attach(device_t dev) >> +{ >> + struct ofw_pci_softc *sc; >> + int error; >> + >> + sc = device_get_softc(dev); >> + if (!sc->sc_initialized) { >> + error = ofw_pci_init(dev); >> + if (error) >> + return (error); >> + } >> + >> + device_add_child(dev, "pci", -1); >> + return (bus_generic_attach(dev)); >> +} >> + >> +static int >> +ofw_pci_maxslots(device_t dev) >> +{ >> + >> + return (PCI_SLOTMAX); >> +} >> + >> +int >> +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) >> +{ >> + struct ofw_pci_softc *sc; >> + struct ofw_pci_register reg; >> + uint32_t pintr, mintr[PCI_MAP_INTR]; >> + int intrcells; >> + phandle_t iparent; >> + >> + sc = device_get_softc(bus); >> + pintr = pin; >> + >> + /* Fabricate imap information in case this isn't an OFW device */ >> + bzero(®, sizeof(reg)); >> + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | >> + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | >> + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); >> + >> + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), >> + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), >> + mintr, sizeof(mintr), &iparent); >> + if (intrcells != 0) { >> + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); >> + return (pintr); >> + } >> + >> + /* >> + * Maybe it's a real interrupt, not an intpin >> + */ >> + if (pin > PCI_INTR_PINS) >> + return (pin); >> + >> + device_printf(bus, "could not route pin %d for device %d.%d\n", >> + pin, pci_get_slot(dev), pci_get_function(dev)); >> + return (PCI_INVALID_IRQ); >> +} >> + >> +int >> +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t >> *result) >> +{ >> + struct ofw_pci_softc *sc; >> + >> + sc = device_get_softc(dev); >> + >> + switch (which) { >> + case PCIB_IVAR_DOMAIN: >> + *result = device_get_unit(dev); >> + return (0); >> + case PCIB_IVAR_BUS: >> + *result = sc->sc_bus; >> + return (0); >> + default: >> + break; >> + } >> + >> + return (ENOENT); >> +} >> + >> +int >> +ofw_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t >> value) >> +{ >> + struct ofw_pci_softc *sc; >> + >> + sc = device_get_softc(dev); >> + >> + switch (which) { >> + case PCIB_IVAR_BUS: >> + sc->sc_bus = value; >> + return (0); >> + default: >> + break; >> + } >> + >> + return (ENOENT); >> +} >> + >> +int >> +ofw_pci_nranges(phandle_t node, struct ofw_pci_cell_info *info) >> +{ >> + ssize_t nbase_ranges; >> + >> + if (info == NULL) >> + return (-1); >> + >> + info->host_address_cells = 1; >> + info->size_cells = 2; >> + info->pci_address_cell = 3; >> + >> + OF_getencprop(OF_parent(node), "#address-cells", >> + &(info->host_address_cells), sizeof(info->host_address_cells)); >> + OF_getencprop(node, "#address-cells", >> + &(info->pci_address_cell), sizeof(info->pci_address_cell)); >> + OF_getencprop(node, "#size-cells", &(info->size_cells), >> + sizeof(info->size_cells)); >> + >> + nbase_ranges = OF_getproplen(node, "ranges"); >> + if (nbase_ranges <= 0) >> + return (-1); >> + >> + return (nbase_ranges / sizeof(cell_t) / >> + (info->pci_address_cell + info->host_address_cells + >> + info->size_cells)); >> +} >> + >> +static struct resource * >> +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, >> + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) >> +{ >> + struct ofw_pci_softc *sc; >> + struct resource *rv; >> + struct rman *rm; >> + int needactivate; >> + >> + needactivate = flags & RF_ACTIVE; >> + flags &= ~RF_ACTIVE; >> + >> + sc = device_get_softc(bus); >> + >> + switch (type) { >> + case SYS_RES_MEMORY: >> + rm = &sc->sc_mem_rman; >> + break; >> + >> + case SYS_RES_IOPORT: >> + rm = &sc->sc_io_rman; >> + break; >> + >> + case SYS_RES_IRQ: >> + return (bus_alloc_resource(bus, type, rid, start, end, count, >> + flags)); >> + >> + default: >> + device_printf(bus, "unknown resource request from %s\n", >> + device_get_nameunit(child)); >> + return (NULL); >> + } >> + >> + rv = rman_reserve_resource(rm, start, end, count, flags, child); >> + if (rv == NULL) { >> + device_printf(bus, "failed to reserve resource for %s\n", >> + device_get_nameunit(child)); >> + return (NULL); >> + } >> + >> + rman_set_rid(rv, *rid); >> + >> + if (needactivate) { >> + if (bus_activate_resource(child, type, *rid, rv) != 0) { >> + device_printf(bus, >> + "failed to activate resource for %s\n", >> + device_get_nameunit(child)); >> + rman_release_resource(rv); >> + return (NULL); >> + } >> + } >> + >> + return (rv); >> +} >> + >> +static int >> +ofw_pci_release_resource(device_t bus, device_t child, int type, int rid, >> + struct resource *res) >> +{ >> + >> + if (rman_get_flags(res) & RF_ACTIVE) { >> + int error = bus_deactivate_resource(child, type, rid, res); >> + if (error) >> + return error; >> + } >> + >> + return (rman_release_resource(res)); >> +} >> + >> +static int >> +ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid, >> + struct resource *res) >> +{ >> + struct ofw_pci_softc *sc; >> + bus_space_handle_t handle; >> + bus_space_tag_t tag; >> + int rv; >> + >> + sc = device_get_softc(bus); >> + >> + if (type == SYS_RES_IRQ) { >> + return (bus_activate_resource(bus, type, rid, res)); >> + } >> + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { >> + struct ofw_pci_range *rp; >> + vm_offset_t start; >> + int space; >> + >> + start = (vm_offset_t)rman_get_start(res); >> + >> + /* >> + * Map this through the ranges list >> + */ >> + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && >> + rp->pci_hi != 0; rp++) { >> + if (start < rp->pci || start >= rp->pci + rp->size) >> + continue; >> + >> + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { >> + case OFW_PCI_PHYS_HI_SPACE_IO: >> + space = SYS_RES_IOPORT; >> + break; >> + case OFW_PCI_PHYS_HI_SPACE_MEM32: >> + case OFW_PCI_PHYS_HI_SPACE_MEM64: >> + space = SYS_RES_MEMORY; >> + break; >> + default: >> + space = -1; >> + } >> + >> + if (type == space) { >> + start += (rp->host - rp->pci); >> + break; >> + } >> + } >> + >> + if (bootverbose) >> + printf("ofw_pci mapdev: start %zx, len %ld\n", start, >> + rman_get_size(res)); >> + >> + tag = BUS_GET_BUS_TAG(child, child); >> + if (tag == NULL) >> + return (ENOMEM); >> + >> + rman_set_bustag(res, tag); >> + rv = bus_space_map(tag, start, >> + rman_get_size(res), 0, &handle); >> + if (rv != 0) >> + return (ENOMEM); >> + >> + rman_set_bushandle(res, handle); >> + rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ >> + } >> + >> + return (rman_activate_resource(res)); >> +} >> + >> +#ifdef __powerpc__ >> +static bus_space_tag_t >> +ofw_pci_bus_get_bus_tag(device_t bus, device_t child) >> +{ >> + >> + return (&bs_le_tag) >> +} >> +#endif >> + >> +static int >> +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int >> rid, >> + struct resource *res) >> +{ >> + >> + /* >> + * If this is a memory resource, unmap it. >> + */ >> + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { >> + u_int32_t psize; >> + >> + psize = rman_get_size(res); >> + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); >> + } >> + >> + return (rman_deactivate_resource(res)); >> +} >> + >> +static int >> +ofw_pci_adjust_resource(device_t bus, device_t child, int type, >> + struct resource *res, rman_res_t start, rman_res_t end) >> +{ >> + struct rman *rm = NULL; >> + struct ofw_pci_softc *sc = device_get_softc(bus); >> + >> + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), >> + ("active resources cannot be adjusted")); >> + if (rman_get_flags(res) & RF_ACTIVE) >> + return (EINVAL); >> + >> + switch (type) { >> + case SYS_RES_MEMORY: >> + rm = &sc->sc_mem_rman; >> + break; >> + case SYS_RES_IOPORT: >> + rm = &sc->sc_io_rman; >> + break; >> + default: >> + return (ENXIO); >> + } >> + >> + if (!rman_is_region_manager(res, rm)) >> + return (EINVAL); >> + >> + return (rman_adjust_resource(res, start, end)); >> +} >> + >> +static phandle_t >> +ofw_pci_get_node(device_t bus, device_t dev) >> +{ >> + struct ofw_pci_softc *sc; >> + >> + sc = device_get_softc(bus); >> + /* We only have one child, the PCI bus, which needs our own node. */ >> + >> + return (sc->sc_node); >> +} >> + >> +static int >> +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) >> +{ >> + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; >> + cell_t *base_ranges; >> + ssize_t nbase_ranges; >> + int nranges; >> + int i, j, k; >> + >> + OF_getencprop(OF_parent(node), "#address-cells", &host_address_cells, >> + sizeof(host_address_cells)); >> + OF_getencprop(node, "#address-cells", &pci_address_cells, >> + sizeof(pci_address_cells)); >> + OF_getencprop(node, "#size-cells", &size_cells, sizeof(size_cells)); >> + >> + nbase_ranges = OF_getproplen(node, "ranges"); >> + if (nbase_ranges <= 0) >> + return (-1); >> + nranges = nbase_ranges / sizeof(cell_t) / >> + (pci_address_cells + host_address_cells + size_cells); >> + >> + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); >> + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); >> + >> + for (i = 0, j = 0; i < nranges; i++) { >> + ranges[i].pci_hi = base_ranges[j++]; >> + ranges[i].pci = 0; >> + for (k = 0; k < pci_address_cells - 1; k++) { >> + ranges[i].pci <<= 32; >> + ranges[i].pci |= base_ranges[j++]; >> + } >> + ranges[i].host = 0; >> + for (k = 0; k < host_address_cells; k++) { >> + ranges[i].host <<= 32; >> + ranges[i].host |= base_ranges[j++]; >> + } >> + ranges[i].size = 0; >> + for (k = 0; k < size_cells; k++) { >> + ranges[i].size <<= 32; >> + ranges[i].size |= base_ranges[j++]; >> + } >> + } >> + >> + free(base_ranges, M_DEVBUF); >> + return (nranges); >> +} >> >> Modified: head/sys/dev/ofw/ofw_pci.h >> ============================================================================== >> --- head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:07:21 2016 (r295756) >> @@ -82,14 +82,19 @@ >> #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 >> #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 >> >> -#define OFW_PCI_PHYS_HI_BUS(hi) \ >> +#define OFW_PCI_PHYS_HI_BUS(hi) \ >> (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) >> -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ >> +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ >> (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) >> -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ >> +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ >> (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) >> >> /* >> + * Export class definition for inheritance purposes >> + */ >> +DECLARE_CLASS(ofw_pci_driver); >> + >> +/* >> * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. >> */ >> struct ofw_pci_register { >> @@ -100,4 +105,50 @@ struct ofw_pci_register { >> u_int32_t size_lo; >> }; >> >> +struct ofw_pci_cell_info { >> + pcell_t host_address_cells; >> + pcell_t pci_address_cell; >> + pcell_t size_cells; >> + }; >> + >> +struct ofw_pci_range { >> + uint32_t pci_hi; >> + uint64_t pci; >> + uint64_t host; >> + uint64_t size; >> +}; >> + >> +/* >> + * Quirks for some adapters >> + */ >> +enum { >> + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, >> +}; >> + >> +struct ofw_pci_softc { >> + device_t sc_dev; >> + phandle_t sc_node; >> + int sc_bus; >> + int sc_initialized; >> + int sc_quirks; >> + >> + struct ofw_pci_range *sc_range; >> + int sc_nrange; >> + struct ofw_pci_cell_info *sc_cell_info; >> + >> + struct rman sc_io_rman; >> + struct rman sc_mem_rman; >> + bus_space_tag_t sc_memt; >> + bus_dma_tag_t sc_dmat; >> + >> + struct ofw_bus_iinfo sc_pci_iinfo; >> +}; >> + >> +int ofw_pci_init(device_t); >> +int ofw_pci_attach(device_t); >> +int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); >> +int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); >> +int ofw_pci_route_interrupt(device_t, device_t, int); >> +int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); >> + >> #endif /* _DEV_OFW_OFW_PCI_H_ */ >> >> Modified: head/sys/dev/ofw/ofw_subr.c >> ============================================================================== >> --- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:07:21 2016 (r295756) >> @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> -#include >> #include >> +#include >> +#include >> >> static void >> get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int >> *pcip) >> >> Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c >> ============================================================================== >> --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:00:04 >> 2016 (r295755) >> +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:07:21 >> 2016 (r295756) >> @@ -55,15 +55,13 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> -#include >> #include >> #include >> +#include >> #include >> #include >> #include >> >> -#include >> - >> #include "ofw_bus_if.h" >> #include "pcib_if.h" >> >> >> Modified: head/sys/powerpc/powermac/cpcht.c >> ============================================================================== >> --- head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:07:21 2016 (r295756) >> @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> -#include >> >> #include >> #include >> @@ -51,7 +50,7 @@ __FBSDID("$FreeBSD$"); >> >> #include >> #include >> -#include >> +#include >> >> #include >> #include >> >> Modified: head/sys/powerpc/powermac/grackle.c >> ============================================================================== >> --- head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:07:21 2016 (r295756) >> @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> -#include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> -#include >> #include >> >> #include >> >> Modified: head/sys/powerpc/powermac/uninorthpci.c >> ============================================================================== >> --- head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:00:04 >> 2016 (r295755) >> +++ head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:07:21 >> 2016 (r295756) >> @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> -#include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> -#include >> #include >> >> #include >> >> Modified: head/sys/powerpc/powermac/uninorthvar.h >> ============================================================================== >> --- head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:00:04 >> 2016 (r295755) >> +++ head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:07:21 >> 2016 (r295756) >> @@ -30,7 +30,6 @@ >> >> #include >> #include >> -#include >> >> struct uninorth_softc { >> struct ofw_pci_softc pci_sc; >> >> Modified: head/sys/powerpc/pseries/rtas_pci.c >> ============================================================================== >> --- head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:00:04 2016 (r295755) >> +++ head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:07:21 2016 (r295756) >> @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> -#include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> -#include >> #include >> >> #include "pcib_if.h" >> >> From owner-svn-src-head@freebsd.org Sat Feb 20 12:53:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 138B7AAE590; Sat, 20 Feb 2016 12:53:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5241F59; Sat, 20 Feb 2016 12:53:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KCrrSV014018; Sat, 20 Feb 2016 12:53:53 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KCrrrn014017; Sat, 20 Feb 2016 12:53:53 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201602201253.u1KCrrrn014017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Feb 2016 12:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295838 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 12:53:55 -0000 Author: kp Date: Sat Feb 20 12:53:53 2016 New Revision: 295838 URL: https://svnweb.freebsd.org/changeset/base/295838 Log: in pf_print_state_parts, do not use skw->proto to print the protocol but our local copy proto that we very carefully set beforehands. skw being NULL is perfectly valid there. Obtained from: OpenBSD (henning) Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Feb 20 12:28:20 2016 (r295837) +++ head/sys/netpfil/pf/pf.c Sat Feb 20 12:53:53 2016 (r295838) @@ -1848,7 +1848,7 @@ pf_print_state_parts(struct pf_state *s, printf("ICMPv6"); break; default: - printf("%u", skw->proto); + printf("%u", proto); break; } switch (dir) { From owner-svn-src-head@freebsd.org Sat Feb 20 13:22:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C49AAF1B6; Sat, 20 Feb 2016 13:22:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C041C1B08; Sat, 20 Feb 2016 13:22:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KDLxg4022808; Sat, 20 Feb 2016 13:21:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KDLx8v022807; Sat, 20 Feb 2016 13:21:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602201321.u1KDLx8v022807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Feb 2016 13:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295839 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 13:22:01 -0000 Author: kib Date: Sat Feb 20 13:21:59 2016 New Revision: 295839 URL: https://svnweb.freebsd.org/changeset/base/295839 Log: Switch /dev/hpet to use make_dev_s(9). Device needs si_drv1 initializated, do it correctly even though hpet cannot be loaded as module. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sat Feb 20 12:53:53 2016 (r295838) +++ head/sys/dev/acpica/acpi_hpet.c Sat Feb 20 13:21:59 2016 (r295839) @@ -422,8 +422,9 @@ hpet_attach(device_t dev) { struct hpet_softc *sc; struct hpet_timer *t; + struct make_dev_args mda; int i, j, num_msi, num_timers, num_percpu_et, num_percpu_t, cur_cpu; - int pcpu_master; + int pcpu_master, error; static int maxhpetet = 0; uint32_t val, val2, cvectors, dvectors; uint16_t vendor, rev; @@ -746,10 +747,14 @@ hpet_attach(device_t dev) } } - sc->pdev = make_dev(&hpet_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0600, "hpet%d", device_get_unit(dev)); - if (sc->pdev) { - sc->pdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_devsw = &hpet_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = sc; + error = make_dev_s(&mda, &sc->pdev, "hpet%d", device_get_unit(dev)); + if (error == 0) { sc->mmap_allow = 1; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", &sc->mmap_allow); @@ -766,9 +771,10 @@ hpet_attach(device_t dev) OID_AUTO, "mmap_allow_write", CTLFLAG_RW, &sc->mmap_allow_write, 0, "Allow userland write to the HPET register space"); - } else - device_printf(dev, "could not create /dev/hpet%d\n", - device_get_unit(dev)); + } else { + device_printf(dev, "could not create /dev/hpet%d, error %d\n", + device_get_unit(dev), error); + } return (0); } From owner-svn-src-head@freebsd.org Sat Feb 20 13:37:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59488AAF675; Sat, 20 Feb 2016 13:37:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF87266; Sat, 20 Feb 2016 13:37:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KDb5TG026211; Sat, 20 Feb 2016 13:37:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KDb4Lf026208; Sat, 20 Feb 2016 13:37:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602201337.u1KDb4Lf026208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Feb 2016 13:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295841 - in head/sys: dev/acpica x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 13:37:06 -0000 Author: kib Date: Sat Feb 20 13:37:04 2016 New Revision: 295841 URL: https://svnweb.freebsd.org/changeset/base/295841 Log: Some BIOSes ACPI bytecode needs to take (sleepable) acpi mutex for acpi_GetInteger() execution. Intel DMAR interrupt remapping code needs to know UID of the HPET to properly route the FSB interrupts from the HPET, even when interrupt remapping is disabled, and the code is executed under some non-sleepable mutexes. Cache HPET UIDs in the device softc at the attach time and provide lock-less method to get UID, use the method from the dmar hpet handling code instead of calling GetInteger(). Reported and tested by: Larry Rosenman Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpivar.h head/sys/x86/iommu/intel_drv.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sat Feb 20 13:36:24 2016 (r295840) +++ head/sys/dev/acpica/acpi_hpet.c Sat Feb 20 13:37:04 2016 (r295841) @@ -85,6 +85,7 @@ struct hpet_softc { struct resource *intr_res; void *intr_handle; ACPI_HANDLE handle; + uint32_t acpi_uid; uint64_t freq; uint32_t caps; struct timecounter tc; @@ -295,6 +296,15 @@ hpet_intr(void *arg) return (FILTER_STRAY); } +uint32_t +hpet_get_uid(device_t dev) +{ + struct hpet_softc *sc; + + sc = device_get_softc(dev); + return (sc->acpi_uid); +} + static ACPI_STATUS hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, void **status) @@ -746,6 +756,7 @@ hpet_attach(device_t dev) maxhpetet++; } } + acpi_GetInteger(sc->handle, "_UID", &sc->acpi_uid); make_dev_args_init(&mda); mda.mda_devsw = &hpet_cdevsw; Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sat Feb 20 13:36:24 2016 (r295840) +++ head/sys/dev/acpica/acpivar.h Sat Feb 20 13:37:04 2016 (r295841) @@ -441,6 +441,8 @@ int acpi_wakeup_machdep(struct acpi_sof int acpi_table_quirks(int *quirks); int acpi_machdep_quirks(int *quirks); +uint32_t hpet_get_uid(device_t dev); + /* Battery Abstraction. */ struct acpi_battinfo; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Sat Feb 20 13:36:24 2016 (r295840) +++ head/sys/x86/iommu/intel_drv.c Sat Feb 20 13:37:04 2016 (r295841) @@ -826,13 +826,9 @@ dmar_find_nonpci(u_int id, u_int entry_t struct dmar_unit * dmar_find_hpet(device_t dev, uint16_t *rid) { - ACPI_HANDLE handle; - uint32_t hpet_id; - handle = acpi_get_handle(dev); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &hpet_id))) - return (NULL); - return (dmar_find_nonpci(hpet_id, ACPI_DMAR_SCOPE_TYPE_HPET, rid)); + return (dmar_find_nonpci(hpet_get_uid(dev), ACPI_DMAR_SCOPE_TYPE_HPET, + rid)); } struct dmar_unit * From owner-svn-src-head@freebsd.org Sat Feb 20 17:29:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A55AAAF414; Sat, 20 Feb 2016 17:29:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC11E51; Sat, 20 Feb 2016 17:29:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1KHT5Jb095249; Sat, 20 Feb 2016 17:29:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1KHT5jf095248; Sat, 20 Feb 2016 17:29:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602201729.u1KHT5jf095248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 20 Feb 2016 17:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295842 - head/sys/boot/efi/loader/arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 17:29:06 -0000 Author: andrew Date: Sat Feb 20 17:29:04 2016 New Revision: 295842 URL: https://svnweb.freebsd.org/changeset/base/295842 Log: Add a missing call to dev_cleanup from the arm64 loader.efi. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/loader/arch/arm64/exec.c Modified: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/exec.c Sat Feb 20 13:37:04 2016 (r295841) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Sat Feb 20 17:29:04 2016 (r295842) @@ -117,6 +117,8 @@ elf64_exec(struct preloaded_file *fp) if (err != 0) return (err); + dev_cleanup(); + /* Clean D-cache under kernel area and invalidate whole I-cache */ clean_addr = (vm_offset_t)efi_translate(fp->f_addr); clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr; From owner-svn-src-head@freebsd.org Sat Feb 20 20:08:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF02AAF2D3; Sat, 20 Feb 2016 20:08:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ob0-x231.google.com (mail-ob0-x231.google.com [IPv6:2607:f8b0:4003:c01::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF6D61C28; Sat, 20 Feb 2016 20:08:19 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ob0-x231.google.com with SMTP id gc3so134708445obb.3; Sat, 20 Feb 2016 12:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ocTV4pM1o1GBXhpe51Y1e8PFkOm34OVuaSLlJcwE9TU=; b=jnrOnUJwNKSxejfA7g4NnbiUN0nyA54/SCVIjA7fR/ntD2/Q5fgFwBENO63YCs1sCX c++NJPMSVXkhaBjMMuKu06fwhVTFeCoDBHwIoltwfAQ7JyAYJ7rmOKeBhcJIQR1nKVDP 54VgT0XPAiTXSJbuC2IUH0mQbAdeCJB4IujekGUcW2S7DnIAiD/jsxkZgupoO1qOFrS+ InCFsPqQeRmGpdKLidEZKK/3UOeKBzfEZyFDfGJE+ARVdZv/JelKY6T6B9i0Pfa5OtdU 0LUDr1ImbxlB2iYbcPAwHEJCRiOQ4wNnvCHL+L1PbjcQ2YhUoaDw/Y4t21xNui5y5YBv MJ5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ocTV4pM1o1GBXhpe51Y1e8PFkOm34OVuaSLlJcwE9TU=; b=P0Ma2PounzLmZtDzfQ1F7z2yjI1xjvwFkDWCDndp4CMCcbm6whT6V1r0F5Pol6W1J8 miL6akeIoJIGtn8lxxAGarAPzTmOevA3FstUEjEMi2aR2NoNdVXY4jo7c7CrLVDcX93j WZ75soJZpfGYWsjCXCbWY5oUuV+C9P5/1cAveQHERQVh3z04uuOlrLjSksARjefb23/K gFa+Fe5hLgFkxwVVTeauHHjg3CBSRFtgYh5xaa2+3Xizme6y9SxLsN+wNr+5HSnH9dhY ZcJjBYgCuDefMbfDg2hFUMCQbCcJJn0MD1f43n20wGbB7ASK61iXPivZPzoY4qlswLR2 2Nbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ocTV4pM1o1GBXhpe51Y1e8PFkOm34OVuaSLlJcwE9TU=; b=SnrdqMLYTpUdxrJv6lxbZlpUnB0XxED/taZc/P/urHEbg9xfS8p8sVJgWyfhy59yS6 WIhMSSFyC9Tv7++pLZIrJIzYgR2C8hZOr6NeMhExczrF44LXLJlBIQwAK3BtdLOc3MCl WXC2gErjOa2AMiK/kZ3C9cm4n97otlrcDd5VFDyRcE13UDhbjsbsrtwO1/V2w0/F3ydm RRnhZA99ubOLJwD4cf+D8JC9GLPlDJw8vq5lUKSHbhnRuIk0LwaclkBay6mCwUAEOw8p IFcS25bMbIWWqN6jJq/XrLl6lEyMyx2yzWZHgBEBF7oj5+emCJp0P1n/4YycTB8gkxJZ FxIw== X-Gm-Message-State: AG10YOSmUr1G5YyVqtT7EoRUXH/TyGPHDMosOIGd4Xxx1w/lSkPT1O7DyoRCsKoa4HIH8DhgF4SWi66Y3MaNYA== MIME-Version: 1.0 X-Received: by 10.60.116.35 with SMTP id jt3mr17636394oeb.79.1455998899050; Sat, 20 Feb 2016 12:08:19 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.182.33.8 with HTTP; Sat, 20 Feb 2016 12:08:18 -0800 (PST) In-Reply-To: References: <201602181307.u1ID7MeN059064@repo.freebsd.org> Date: Sat, 20 Feb 2016 14:08:18 -0600 X-Google-Sender-Auth: ZypAK6kBWPTTPHup7eEaJFDBAf4 Message-ID: Subject: Re: svn commit: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries From: Justin Hibbits To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 20 Feb 2016 20:08:20 -0000 Thank you, zbb. - Justin On 2/20/16, Zbigniew Bodek wrote: > Hello Justin, > > Reverted in 295837. > I am very sorry for trouble. This will need to return to the drawing > board and I will double check the patch next time. > > Best regards > zbb > > 2016-02-20 5:48 GMT+01:00 Justin Hibbits : >> This was not tinderboxed. I'm getting build failures for powerpc and >> sparc64. Please revert or fix. >> >> Least of which: sys/dev/ofw/ofw_pci.c conflicts with >> sys/powerpc/ofw/ofw_pci.c, which I mentioned in phabricator long ago. >> >> Additionally, several files are missing includes of >> dev/ofw/ofw_bus_subr.h. >> >> One example from tinderbox: >> >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 7308: warning: duplicate script for target "ofw_pci.ln" ignored >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 2150: warning: using previous script for "ofw_pci.ln" defined >> here >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 7311: warning: duplicate script for target "ofw_pci.o" ignored >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 2154: warning: using previous script for "ofw_pci.o" defined here >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 7312: warning: duplicate script for target "ofw_pci.o" ignored >> make[5]: >> "/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile" >> line 2154: warning: using previous script for "ofw_pci.o" defined here >> In file included from >> /home/jhibbits/head/sys/powerpc/powermac/uninorth.c:36: >> /home/jhibbits/head/sys/dev/ofw/ofw_pci.h:144: error: field >> 'sc_pci_iinfo' has incomplete type >> >> >> - Justin >> >> On 2/18/16, Zbigniew Bodek wrote: >>> Author: zbb >>> Date: Thu Feb 18 13:07:21 2016 >>> New Revision: 295756 >>> URL: https://svnweb.freebsd.org/changeset/base/295756 >>> >>> Log: >>> Extract common code from PowerPC's ofw_pci >>> >>> Import portions of the PowerPC OF PCI implementation into >>> new file "ofw_pci.c", common for other platforms. The files ofw_pci.c >>> and >>> ofw_pci.h from sys/powerpc/ofw no longer exist. All required >>> declarations >>> are moved to sys/dev/ofw/ofw_pci.h. >>> >>> This creates a new ofw_pci_write_ivar() function and modifies >>> ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() >>> methods. >>> Most functions contain existing ppc implementations in the majority >>> unchanged. Now there is no need to have multiple identical copies >>> of methods for various architectures. >>> >>> Submitted by: Marcin Mazurek >>> Obtained from: Semihalf >>> Sponsored by: Annapurna Labs >>> Reviewed by: jhibbits, mmel >>> Differential Revision: https://reviews.freebsd.org/D4879 >>> >>> Added: >>> head/sys/dev/ofw/ofw_pci.c (contents, props changed) >>> Modified: >>> head/sys/conf/files >>> head/sys/dev/ofw/ofw_pci.h >>> head/sys/dev/ofw/ofw_subr.c >>> head/sys/powerpc/mpc85xx/pci_mpc85xx.c >>> head/sys/powerpc/powermac/cpcht.c >>> head/sys/powerpc/powermac/grackle.c >>> head/sys/powerpc/powermac/uninorthpci.c >>> head/sys/powerpc/powermac/uninorthvar.h >>> head/sys/powerpc/pseries/rtas_pci.c >>> >>> Modified: head/sys/conf/files >>> ============================================================================== >>> --- head/sys/conf/files Thu Feb 18 13:00:04 2016 (r295755) >>> +++ head/sys/conf/files Thu Feb 18 13:07:21 2016 (r295756) >>> @@ -2108,6 +2108,7 @@ dev/ofw/ofw_subr.c optional fdt >>> dev/ofw/ofwbus.c optional fdt >>> dev/ofw/openfirm.c optional fdt >>> dev/ofw/openfirmio.c optional fdt >>> +dev/ofw/ofw_pci.c optional fdt pci >>> dev/ow/ow.c optional ow \ >>> dependency "owll_if.h" \ >>> dependency "own_if.h" >>> >>> Added: head/sys/dev/ofw/ofw_pci.c >>> ============================================================================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/sys/dev/ofw/ofw_pci.c Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -0,0 +1,622 @@ >>> +/*- >>> + * Copyright (c) 2011 Nathan Whitehorn >>> + * 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 >>> + >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> + >>> +#include "pcib_if.h" >>> + >>> +/* >>> + * If it is necessary to set another value of this for >>> + * some platforms it should be set at fdt.h file >>> + */ >>> +#ifndef PCI_MAP_INTR >>> +#define PCI_MAP_INTR 4 >>> +#endif >>> + >>> +#define PCI_INTR_PINS 4 >>> + >>> +/* >>> + * bus interface. >>> + */ >>> +static struct resource * ofw_pci_alloc_resource(device_t, device_t, >>> + int, int *, u_long, u_long, u_long, u_int); >>> +static int ofw_pci_release_resource(device_t, device_t, int, int, >>> + struct resource *); >>> +static int ofw_pci_activate_resource(device_t, device_t, int, int, >>> + struct resource *); >>> +static int ofw_pci_deactivate_resource(device_t, device_t, int, int, >>> + struct resource *); >>> +static int ofw_pci_adjust_resource(device_t, device_t, int, >>> + struct resource *, u_long, u_long); >>> + >>> +/* >>> + * pcib interface >>> + */ >>> +static int ofw_pci_maxslots(device_t); >>> + >>> +/* >>> + * ofw_bus interface >>> + */ >>> +static phandle_t ofw_pci_get_node(device_t, device_t); >>> + >>> +/* >>> + * local methods >>> + */ >>> +static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *); >>> + >>> +/* >>> + * Driver methods. >>> + */ >>> +static device_method_t ofw_pci_methods[] = { >>> + >>> + /* Device interface */ >>> + DEVMETHOD(device_attach, ofw_pci_attach), >>> + >>> + /* Bus interface */ >>> + DEVMETHOD(bus_print_child, bus_generic_print_child), >>> + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), >>> + DEVMETHOD(bus_write_ivar, ofw_pci_write_ivar), >>> + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), >>> + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), >>> + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), >>> + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), >>> + DEVMETHOD(bus_activate_resource, >>> ofw_pci_activate_resource), >>> + DEVMETHOD(bus_deactivate_resource, >>> ofw_pci_deactivate_resource), >>> + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), >>> +#ifdef __powerpc__ >>> + DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), >>> +#endif >>> + >>> + /* pcib interface */ >>> + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), >>> + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), >>> + >>> + /* ofw_bus interface */ >>> + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), >>> + >>> + DEVMETHOD_END >>> +}; >>> + >>> +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); >>> + >>> +int >>> +ofw_pci_init(device_t dev) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + phandle_t node; >>> + u_int32_t busrange[2]; >>> + struct ofw_pci_range *rp; >>> + int error; >>> + struct ofw_pci_cell_info *cell_info; >>> + >>> + node = ofw_bus_get_node(dev); >>> + sc = device_get_softc(dev); >>> + sc->sc_initialized = 1; >>> + sc->sc_range = NULL; >>> + >>> + cell_info = (struct ofw_pci_cell_info *)malloc(sizeof(*cell_info), >>> + M_DEVBUF, M_WAITOK | M_ZERO); >>> + >>> + sc->sc_cell_info = cell_info; >>> + >>> + if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != >>> 8) >>> + busrange[0] = 0; >>> + >>> + sc->sc_dev = dev; >>> + sc->sc_node = node; >>> + sc->sc_bus = busrange[0]; >>> + >>> + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { >>> + phandle_t c; >>> + int n, i; >>> + >>> + sc->sc_nrange = 0; >>> + for (c = OF_child(node); c != 0; c = OF_peer(c)) { >>> + n = ofw_pci_nranges(c, cell_info); >>> + if (n > 0) >>> + sc->sc_nrange += n; >>> + } >>> + if (sc->sc_nrange == 0) { >>> + error = ENXIO; >>> + goto out; >>> + } >>> + sc->sc_range = malloc(sc->sc_nrange * >>> sizeof(sc->sc_range[0]), >>> + M_DEVBUF, M_WAITOK); >>> + i = 0; >>> + for (c = OF_child(node); c != 0; c = OF_peer(c)) { >>> + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); >>> + if (n > 0) >>> + i += n; >>> + } >>> + KASSERT(i == sc->sc_nrange, ("range count mismatch")); >>> + } else { >>> + sc->sc_nrange = ofw_pci_nranges(node, cell_info); >>> + if (sc->sc_nrange <= 0) { >>> + device_printf(dev, "could not getranges\n"); >>> + error = ENXIO; >>> + goto out; >>> + } >>> + sc->sc_range = malloc(sc->sc_nrange * >>> sizeof(sc->sc_range[0]), >>> + M_DEVBUF, M_WAITOK); >>> + ofw_pci_fill_ranges(node, sc->sc_range); >>> + } >>> + >>> + sc->sc_io_rman.rm_type = RMAN_ARRAY; >>> + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; >>> + error = rman_init(&sc->sc_io_rman); >>> + if (error) { >>> + device_printf(dev, "rman_init() failed. error = %d\n", >>> error); >>> + goto out; >>> + } >>> + >>> + sc->sc_mem_rman.rm_type = RMAN_ARRAY; >>> + sc->sc_mem_rman.rm_descr = "PCI Memory"; >>> + error = rman_init(&sc->sc_mem_rman); >>> + if (error) { >>> + device_printf(dev, "rman_init() failed. error = %d\n", >>> error); >>> + goto out; >>> + } >>> + >>> + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && >>> + rp->pci_hi != 0; rp++) { >>> + error = 0; >>> + >>> + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { >>> + case OFW_PCI_PHYS_HI_SPACE_CONFIG: >>> + break; >>> + case OFW_PCI_PHYS_HI_SPACE_IO: >>> + error = rman_manage_region(&sc->sc_io_rman, >>> rp->pci, >>> + rp->pci + rp->size - 1); >>> + break; >>> + case OFW_PCI_PHYS_HI_SPACE_MEM32: >>> + case OFW_PCI_PHYS_HI_SPACE_MEM64: >>> + error = rman_manage_region(&sc->sc_mem_rman, >>> rp->pci, >>> + rp->pci + rp->size - 1); >>> + break; >>> + } >>> + >>> + if (error) { >>> + device_printf(dev, >>> + "rman_manage_region(%x, %#jx, %#jx) failed. " >>> + "error = %d\n", rp->pci_hi & >>> + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, >>> + rp->pci + rp->size - 1, error); >>> + goto out; >>> + } >>> + } >>> + >>> + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); >>> + >>> +out: >>> + free(cell_info, M_DEVBUF); >>> + free(sc->sc_range, M_DEVBUF); >>> + rman_fini(&sc->sc_io_rman); >>> + rman_fini(&sc->sc_mem_rman); >>> + >>> + return (error); >>> +} >>> + >>> +int >>> +ofw_pci_attach(device_t dev) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + int error; >>> + >>> + sc = device_get_softc(dev); >>> + if (!sc->sc_initialized) { >>> + error = ofw_pci_init(dev); >>> + if (error) >>> + return (error); >>> + } >>> + >>> + device_add_child(dev, "pci", -1); >>> + return (bus_generic_attach(dev)); >>> +} >>> + >>> +static int >>> +ofw_pci_maxslots(device_t dev) >>> +{ >>> + >>> + return (PCI_SLOTMAX); >>> +} >>> + >>> +int >>> +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + struct ofw_pci_register reg; >>> + uint32_t pintr, mintr[PCI_MAP_INTR]; >>> + int intrcells; >>> + phandle_t iparent; >>> + >>> + sc = device_get_softc(bus); >>> + pintr = pin; >>> + >>> + /* Fabricate imap information in case this isn't an OFW device */ >>> + bzero(®, sizeof(reg)); >>> + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | >>> + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | >>> + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); >>> + >>> + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), >>> + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), >>> + mintr, sizeof(mintr), &iparent); >>> + if (intrcells != 0) { >>> + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); >>> + return (pintr); >>> + } >>> + >>> + /* >>> + * Maybe it's a real interrupt, not an intpin >>> + */ >>> + if (pin > PCI_INTR_PINS) >>> + return (pin); >>> + >>> + device_printf(bus, "could not route pin %d for device %d.%d\n", >>> + pin, pci_get_slot(dev), pci_get_function(dev)); >>> + return (PCI_INVALID_IRQ); >>> +} >>> + >>> +int >>> +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t >>> *result) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + >>> + sc = device_get_softc(dev); >>> + >>> + switch (which) { >>> + case PCIB_IVAR_DOMAIN: >>> + *result = device_get_unit(dev); >>> + return (0); >>> + case PCIB_IVAR_BUS: >>> + *result = sc->sc_bus; >>> + return (0); >>> + default: >>> + break; >>> + } >>> + >>> + return (ENOENT); >>> +} >>> + >>> +int >>> +ofw_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t >>> value) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + >>> + sc = device_get_softc(dev); >>> + >>> + switch (which) { >>> + case PCIB_IVAR_BUS: >>> + sc->sc_bus = value; >>> + return (0); >>> + default: >>> + break; >>> + } >>> + >>> + return (ENOENT); >>> +} >>> + >>> +int >>> +ofw_pci_nranges(phandle_t node, struct ofw_pci_cell_info *info) >>> +{ >>> + ssize_t nbase_ranges; >>> + >>> + if (info == NULL) >>> + return (-1); >>> + >>> + info->host_address_cells = 1; >>> + info->size_cells = 2; >>> + info->pci_address_cell = 3; >>> + >>> + OF_getencprop(OF_parent(node), "#address-cells", >>> + &(info->host_address_cells), >>> sizeof(info->host_address_cells)); >>> + OF_getencprop(node, "#address-cells", >>> + &(info->pci_address_cell), sizeof(info->pci_address_cell)); >>> + OF_getencprop(node, "#size-cells", &(info->size_cells), >>> + sizeof(info->size_cells)); >>> + >>> + nbase_ranges = OF_getproplen(node, "ranges"); >>> + if (nbase_ranges <= 0) >>> + return (-1); >>> + >>> + return (nbase_ranges / sizeof(cell_t) / >>> + (info->pci_address_cell + info->host_address_cells + >>> + info->size_cells)); >>> +} >>> + >>> +static struct resource * >>> +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int >>> *rid, >>> + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + struct resource *rv; >>> + struct rman *rm; >>> + int needactivate; >>> + >>> + needactivate = flags & RF_ACTIVE; >>> + flags &= ~RF_ACTIVE; >>> + >>> + sc = device_get_softc(bus); >>> + >>> + switch (type) { >>> + case SYS_RES_MEMORY: >>> + rm = &sc->sc_mem_rman; >>> + break; >>> + >>> + case SYS_RES_IOPORT: >>> + rm = &sc->sc_io_rman; >>> + break; >>> + >>> + case SYS_RES_IRQ: >>> + return (bus_alloc_resource(bus, type, rid, start, end, >>> count, >>> + flags)); >>> + >>> + default: >>> + device_printf(bus, "unknown resource request from %s\n", >>> + device_get_nameunit(child)); >>> + return (NULL); >>> + } >>> + >>> + rv = rman_reserve_resource(rm, start, end, count, flags, child); >>> + if (rv == NULL) { >>> + device_printf(bus, "failed to reserve resource for %s\n", >>> + device_get_nameunit(child)); >>> + return (NULL); >>> + } >>> + >>> + rman_set_rid(rv, *rid); >>> + >>> + if (needactivate) { >>> + if (bus_activate_resource(child, type, *rid, rv) != 0) { >>> + device_printf(bus, >>> + "failed to activate resource for %s\n", >>> + device_get_nameunit(child)); >>> + rman_release_resource(rv); >>> + return (NULL); >>> + } >>> + } >>> + >>> + return (rv); >>> +} >>> + >>> +static int >>> +ofw_pci_release_resource(device_t bus, device_t child, int type, int >>> rid, >>> + struct resource *res) >>> +{ >>> + >>> + if (rman_get_flags(res) & RF_ACTIVE) { >>> + int error = bus_deactivate_resource(child, type, rid, >>> res); >>> + if (error) >>> + return error; >>> + } >>> + >>> + return (rman_release_resource(res)); >>> +} >>> + >>> +static int >>> +ofw_pci_activate_resource(device_t bus, device_t child, int type, int >>> rid, >>> + struct resource *res) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + bus_space_handle_t handle; >>> + bus_space_tag_t tag; >>> + int rv; >>> + >>> + sc = device_get_softc(bus); >>> + >>> + if (type == SYS_RES_IRQ) { >>> + return (bus_activate_resource(bus, type, rid, res)); >>> + } >>> + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { >>> + struct ofw_pci_range *rp; >>> + vm_offset_t start; >>> + int space; >>> + >>> + start = (vm_offset_t)rman_get_start(res); >>> + >>> + /* >>> + * Map this through the ranges list >>> + */ >>> + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange >>> && >>> + rp->pci_hi != 0; rp++) { >>> + if (start < rp->pci || start >= rp->pci + >>> rp->size) >>> + continue; >>> + >>> + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { >>> + case OFW_PCI_PHYS_HI_SPACE_IO: >>> + space = SYS_RES_IOPORT; >>> + break; >>> + case OFW_PCI_PHYS_HI_SPACE_MEM32: >>> + case OFW_PCI_PHYS_HI_SPACE_MEM64: >>> + space = SYS_RES_MEMORY; >>> + break; >>> + default: >>> + space = -1; >>> + } >>> + >>> + if (type == space) { >>> + start += (rp->host - rp->pci); >>> + break; >>> + } >>> + } >>> + >>> + if (bootverbose) >>> + printf("ofw_pci mapdev: start %zx, len %ld\n", >>> start, >>> + rman_get_size(res)); >>> + >>> + tag = BUS_GET_BUS_TAG(child, child); >>> + if (tag == NULL) >>> + return (ENOMEM); >>> + >>> + rman_set_bustag(res, tag); >>> + rv = bus_space_map(tag, start, >>> + rman_get_size(res), 0, &handle); >>> + if (rv != 0) >>> + return (ENOMEM); >>> + >>> + rman_set_bushandle(res, handle); >>> + rman_set_virtual(res, (void *)handle); /* XXX for powerpc >>> only ? */ >>> + } >>> + >>> + return (rman_activate_resource(res)); >>> +} >>> + >>> +#ifdef __powerpc__ >>> +static bus_space_tag_t >>> +ofw_pci_bus_get_bus_tag(device_t bus, device_t child) >>> +{ >>> + >>> + return (&bs_le_tag) >>> +} >>> +#endif >>> + >>> +static int >>> +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int >>> rid, >>> + struct resource *res) >>> +{ >>> + >>> + /* >>> + * If this is a memory resource, unmap it. >>> + */ >>> + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { >>> + u_int32_t psize; >>> + >>> + psize = rman_get_size(res); >>> + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); >>> + } >>> + >>> + return (rman_deactivate_resource(res)); >>> +} >>> + >>> +static int >>> +ofw_pci_adjust_resource(device_t bus, device_t child, int type, >>> + struct resource *res, rman_res_t start, rman_res_t end) >>> +{ >>> + struct rman *rm = NULL; >>> + struct ofw_pci_softc *sc = device_get_softc(bus); >>> + >>> + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), >>> + ("active resources cannot be adjusted")); >>> + if (rman_get_flags(res) & RF_ACTIVE) >>> + return (EINVAL); >>> + >>> + switch (type) { >>> + case SYS_RES_MEMORY: >>> + rm = &sc->sc_mem_rman; >>> + break; >>> + case SYS_RES_IOPORT: >>> + rm = &sc->sc_io_rman; >>> + break; >>> + default: >>> + return (ENXIO); >>> + } >>> + >>> + if (!rman_is_region_manager(res, rm)) >>> + return (EINVAL); >>> + >>> + return (rman_adjust_resource(res, start, end)); >>> +} >>> + >>> +static phandle_t >>> +ofw_pci_get_node(device_t bus, device_t dev) >>> +{ >>> + struct ofw_pci_softc *sc; >>> + >>> + sc = device_get_softc(bus); >>> + /* We only have one child, the PCI bus, which needs our own node. >>> */ >>> + >>> + return (sc->sc_node); >>> +} >>> + >>> +static int >>> +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) >>> +{ >>> + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; >>> + cell_t *base_ranges; >>> + ssize_t nbase_ranges; >>> + int nranges; >>> + int i, j, k; >>> + >>> + OF_getencprop(OF_parent(node), "#address-cells", >>> &host_address_cells, >>> + sizeof(host_address_cells)); >>> + OF_getencprop(node, "#address-cells", &pci_address_cells, >>> + sizeof(pci_address_cells)); >>> + OF_getencprop(node, "#size-cells", &size_cells, >>> sizeof(size_cells)); >>> + >>> + nbase_ranges = OF_getproplen(node, "ranges"); >>> + if (nbase_ranges <= 0) >>> + return (-1); >>> + nranges = nbase_ranges / sizeof(cell_t) / >>> + (pci_address_cells + host_address_cells + size_cells); >>> + >>> + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); >>> + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); >>> + >>> + for (i = 0, j = 0; i < nranges; i++) { >>> + ranges[i].pci_hi = base_ranges[j++]; >>> + ranges[i].pci = 0; >>> + for (k = 0; k < pci_address_cells - 1; k++) { >>> + ranges[i].pci <<= 32; >>> + ranges[i].pci |= base_ranges[j++]; >>> + } >>> + ranges[i].host = 0; >>> + for (k = 0; k < host_address_cells; k++) { >>> + ranges[i].host <<= 32; >>> + ranges[i].host |= base_ranges[j++]; >>> + } >>> + ranges[i].size = 0; >>> + for (k = 0; k < size_cells; k++) { >>> + ranges[i].size <<= 32; >>> + ranges[i].size |= base_ranges[j++]; >>> + } >>> + } >>> + >>> + free(base_ranges, M_DEVBUF); >>> + return (nranges); >>> +} >>> >>> Modified: head/sys/dev/ofw/ofw_pci.h >>> ============================================================================== >>> --- head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:00:04 2016 >>> (r295755) >>> +++ head/sys/dev/ofw/ofw_pci.h Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -82,14 +82,19 @@ >>> #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 >>> #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 >>> >>> -#define OFW_PCI_PHYS_HI_BUS(hi) \ >>> +#define OFW_PCI_PHYS_HI_BUS(hi) \ >>> (((hi) & OFW_PCI_PHYS_HI_BUSMASK) >> OFW_PCI_PHYS_HI_BUSSHIFT) >>> -#define OFW_PCI_PHYS_HI_DEVICE(hi) \ >>> +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ >>> (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> >>> OFW_PCI_PHYS_HI_DEVICESHIFT) >>> -#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ >>> +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ >>> (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> >>> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) >>> >>> /* >>> + * Export class definition for inheritance purposes >>> + */ >>> +DECLARE_CLASS(ofw_pci_driver); >>> + >>> +/* >>> * This has the 3 32bit cell values, plus 2 more to make up a 64-bit >>> size. >>> */ >>> struct ofw_pci_register { >>> @@ -100,4 +105,50 @@ struct ofw_pci_register { >>> u_int32_t size_lo; >>> }; >>> >>> +struct ofw_pci_cell_info { >>> + pcell_t host_address_cells; >>> + pcell_t pci_address_cell; >>> + pcell_t size_cells; >>> + }; >>> + >>> +struct ofw_pci_range { >>> + uint32_t pci_hi; >>> + uint64_t pci; >>> + uint64_t host; >>> + uint64_t size; >>> +}; >>> + >>> +/* >>> + * Quirks for some adapters >>> + */ >>> +enum { >>> + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, >>> +}; >>> + >>> +struct ofw_pci_softc { >>> + device_t sc_dev; >>> + phandle_t sc_node; >>> + int sc_bus; >>> + int sc_initialized; >>> + int sc_quirks; >>> + >>> + struct ofw_pci_range *sc_range; >>> + int sc_nrange; >>> + struct ofw_pci_cell_info *sc_cell_info; >>> + >>> + struct rman sc_io_rman; >>> + struct rman sc_mem_rman; >>> + bus_space_tag_t sc_memt; >>> + bus_dma_tag_t sc_dmat; >>> + >>> + struct ofw_bus_iinfo sc_pci_iinfo; >>> +}; >>> + >>> +int ofw_pci_init(device_t); >>> +int ofw_pci_attach(device_t); >>> +int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); >>> +int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); >>> +int ofw_pci_route_interrupt(device_t, device_t, int); >>> +int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); >>> + >>> #endif /* _DEV_OFW_OFW_PCI_H_ */ >>> >>> Modified: head/sys/dev/ofw/ofw_subr.c >>> ============================================================================== >>> --- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:00:04 2016 >>> (r295755) >>> +++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> -#include >>> #include >>> +#include >>> +#include >>> >>> static void >>> get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int >>> *pcip) >>> >>> Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c >>> ============================================================================== >>> --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:00:04 >>> 2016 (r295755) >>> +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Feb 18 13:07:21 >>> 2016 (r295756) >>> @@ -55,15 +55,13 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> -#include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> #include >>> >>> -#include >>> - >>> #include "ofw_bus_if.h" >>> #include "pcib_if.h" >>> >>> >>> Modified: head/sys/powerpc/powermac/cpcht.c >>> ============================================================================== >>> --- head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:00:04 2016 >>> (r295755) >>> +++ head/sys/powerpc/powermac/cpcht.c Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> -#include >>> >>> #include >>> #include >>> @@ -51,7 +50,7 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> #include >>> -#include >>> +#include >>> >>> #include >>> #include >>> >>> Modified: head/sys/powerpc/powermac/grackle.c >>> ============================================================================== >>> --- head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:00:04 2016 >>> (r295755) >>> +++ head/sys/powerpc/powermac/grackle.c Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> -#include >>> #include >>> #include >>> +#include >>> >>> #include >>> #include >>> @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> -#include >>> #include >>> >>> #include >>> >>> Modified: head/sys/powerpc/powermac/uninorthpci.c >>> ============================================================================== >>> --- head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:00:04 >>> 2016 (r295755) >>> +++ head/sys/powerpc/powermac/uninorthpci.c Thu Feb 18 13:07:21 >>> 2016 (r295756) >>> @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> -#include >>> #include >>> #include >>> +#include >>> >>> #include >>> #include >>> @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> -#include >>> #include >>> >>> #include >>> >>> Modified: head/sys/powerpc/powermac/uninorthvar.h >>> ============================================================================== >>> --- head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:00:04 >>> 2016 (r295755) >>> +++ head/sys/powerpc/powermac/uninorthvar.h Thu Feb 18 13:07:21 >>> 2016 (r295756) >>> @@ -30,7 +30,6 @@ >>> >>> #include >>> #include >>> -#include >>> >>> struct uninorth_softc { >>> struct ofw_pci_softc pci_sc; >>> >>> Modified: head/sys/powerpc/pseries/rtas_pci.c >>> ============================================================================== >>> --- head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:00:04 2016 >>> (r295755) >>> +++ head/sys/powerpc/pseries/rtas_pci.c Thu Feb 18 13:07:21 2016 >>> (r295756) >>> @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> -#include >>> #include >>> #include >>> +#include >>> >>> #include >>> #include >>> @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> -#include >>> #include >>> >>> #include "pcib_if.h" >>> >>> >