From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 04:11:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 105B7F5F; Sun, 15 Dec 2013 04:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E910F1635; Sun, 15 Dec 2013 04:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF4Bhne018853; Sun, 15 Dec 2013 04:11:43 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF4Bhtg018852; Sun, 15 Dec 2013 04:11:43 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201312150411.rBF4Bhtg018852@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 15 Dec 2013 04:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259407 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 04:11:44 -0000 Author: mjg Date: Sun Dec 15 04:11:43 2013 New Revision: 259407 URL: http://svnweb.freebsd.org/changeset/base/259407 Log: proc exit: don't take PROC_LOCK while freeing rlimits Code wishing to check rlimits of some process should check whether it is exiting first, which current consumers do. MFC after: 2 weeks Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Dec 15 03:48:54 2013 (r259406) +++ head/sys/kern/kern_exit.c Sun Dec 15 04:11:43 2013 (r259407) @@ -385,10 +385,8 @@ exit1(struct thread *td, int rv) /* * Release our limits structure. */ - PROC_LOCK(p); plim = p->p_limit; p->p_limit = NULL; - PROC_UNLOCK(p); lim_free(plim); tidhash_remove(td); From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 07:05:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E4CBD6D; Sun, 15 Dec 2013 07:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E8ED1F6E; Sun, 15 Dec 2013 07:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF7508t079113; Sun, 15 Dec 2013 07:05:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF750Oa079112; Sun, 15 Dec 2013 07:05:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312150705.rBF750Oa079112@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 15 Dec 2013 07:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259410 - head/release/picobsd/build 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.17 Precedence: list List-Id: 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, 15 Dec 2013 07:05:00 -0000 Author: luigi Date: Sun Dec 15 07:04:59 2013 New Revision: 259410 URL: http://svnweb.freebsd.org/changeset/base/259410 Log: revise the helper functions to lookup binaries and their shared libraries. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun Dec 15 04:28:20 2013 (r259409) +++ head/release/picobsd/build/picobsd Sun Dec 15 07:04:59 2013 (r259410) @@ -91,7 +91,7 @@ log() { # message # unconditionally log and wait for input logverbose() { # message local foo - printf "\n*** %s\n" "$*" + printf "\n*** %s\n" "$*" >&2 read -p "=== Press enter to continue" foo return 0 } @@ -570,71 +570,89 @@ do_links() { # rootdir varname # cp -p ${u_progs} ${dst}/libexec # ignore errors # } +# find programs and required libraries. Accept -L libs -P path +# if no argument default to objdir/SHLIBDIRPREFIX for both find_progs() { # programs - local pass i old_libs="" tmp o="" - if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path - o="-P $2"; shift; shift - fi - # Result returned in global variables - u_libs="" ; u_progs="`find_progs_helper $*`" + # logverbose "find_progs: called with $*" + local i=`realpath ${o_objdir:-${_SHLIBDIRPREFIX}/..}` + # default values for -L and -P + local dir="-P $i" + local ldir="-L $i" + + while [ "$1" != "" ] ; do + if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path + ldir="-L $2"; shift; shift + elif [ x"$1" = "x-P" -a -d "$2" ] ; then # set prog search path + dir="-P $2"; shift; shift + else + break + fi + done + + # Results are returned in global variables + u_libs="" + u_progs="`find_progs_helper $dir $*`" [ -z "${u_progs}" ] && return 1 # not found, error - # use objdump to find libraries. Iterate to fetch recursive - # dependencies. - tmp="${u_progs}" ; pass=1 + + # use objdump to find libraries. + # Iterate to fetch recursive dependencies. + local tmp="${u_progs}" + local old_libs="" + local pass=1 while [ $pass -lt 10 ] ; do pass=$(($pass + 1)) i="`objdump -x ${tmp} | \ - awk '$1 == "NEEDED" { print $2 }' | sort | uniq`" + awk '$1 == "NEEDED" { print $2 }' | sort | uniq | tr '\n' ' '`" if [ "$old_libs" = "$i" ] ; then - log "libraries for: $my_progs ($u_progs) are ($i) $u_libs" - log "--- done find_progs ---" + # logverbose "find_progs: have `echo ${u_libs} | wc -w`/`echo ${i} | wc -w` libraries for: $my_progs ($u_progs)" + # logverbose "they are ($i) $u_libs" return 0 else # logverbose "old--- $old_libs --- new +++ $i +++" fi - u_libs="`find_progs_helper $o $i`" + u_libs="`find_progs_helper $ldir $i`" old_libs="$i" tmp="$tmp $u_libs" done log "WARNING: Too many passes, giving up" } -find_progs_helper() { # programs - local dir=${o_objdir:-${_SHLIBDIRPREFIX}/..} - local ldir="" - if [ x"$1" = "x-P" -a -d "$2" ] ; then # set path - ldir=$2; shift; shift - fi - local progs="$*" - local subdirs=". local/bin local/sbin local/lib local/libexec \ - bin sbin usr.bin usr.sbin libexec lib \ - gnu/usr.bin gnu/lib \ - secure/usr.bin secure/usr.sbin secure/libexec secure/lib" - local names="" # files to search - local o="" +# prints to stdout files and libs in the search paths +find_progs_helper() { # first arg is either -P or -L + local ty=$1 dir=$2 ; shift; shift + local progs="`echo $* | tr ' ' '\n' | sort -u | tr '\n' ' '`" + # first, extract absolute pathnames or files in this directory + + # accumulate others in $names + local names="" local i for i in $progs ; do - # full pathnames are just listed - [ -f "$i" ] && echo $i && continue - names="${names} ${o} -name $i" - o="-o" + [ -f "$i" ] && echo `realpath $i` && continue + names="${names} $i" done + # if nothing left, we are done [ -z "${names}" ] && return 0 - local places="" # places to search - for i in $subdirs ; do - [ -d "${dir}/${i}" ] && places="${places} ${dir}/${i}" - done - if [ -n "${ldir}" ] ; then - for i in $subdirs ; do - [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" - done + + local depth p + local places="" # places to search + if [ x-P = "x$ty" ] ; then # search programs + depth=2 + p=". local/bin local/sbin local/libexec \ + bin sbin usr/bin usr/sbin libexec gnu/usr.bin \ + secure/usr.bin secure/usr.sbin secure/libexec " + else + depth=3 + p="lib usr/lib gnu/lib secure/lib" fi - for i in $progs ; do - # full pathnames are just listed - [ -f "$i" ] && echo $i && continue - find ${places} -maxdepth 3 -type f -name ${i} | head -1 + for i in $p ; do + i="${dir}/${i}" + [ -d "${i}" ] && places="${places} `realpath ${i}`" + done + # logverbose "--- looking into $places" + places=`echo ${places} | tr ' ' '\n' | sort -u` + for i in $names ; do + find ${places} -maxdepth $depth -type f -name ${i} | head -1 done - # use maxdepth 3 because some libs are way down } # Populate the memory filesystem with binaries and non-variable @@ -746,6 +764,7 @@ populate_mfs_tree() { fi log "for a shared 'crunch' take libraries and dynamic loader as well" + # /stand/crunch is our main binary, we extract its libs find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 07:07:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6F20F5E; Sun, 15 Dec 2013 07:07:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C28321F84; Sun, 15 Dec 2013 07:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF77DJg079506; Sun, 15 Dec 2013 07:07:13 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF77D2g079503; Sun, 15 Dec 2013 07:07:13 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201312150707.rBF77D2g079503@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 15 Dec 2013 07:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259411 - head/sys/ofed/drivers/net/mlx4 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.17 Precedence: list List-Id: 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, 15 Dec 2013 07:07:13 -0000 Author: alfred Date: Sun Dec 15 07:07:13 2013 New Revision: 259411 URL: http://svnweb.freebsd.org/changeset/base/259411 Log: Defer start/stop port to workqueues. We need to do this because the Linux compat layer uses sx(9) for mutex, however the lagg code uses rmlocks and calls into the mellanox driver. This causes deadlock due to sleeping while holding a rmlock. Submitted by: Shahar Klein (shahark mellanox.com) MFC After: 3 days. Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/mlx4_en.h Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Dec 15 07:04:59 2013 (r259410) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Dec 15 07:07:13 2013 (r259411) @@ -153,6 +153,19 @@ restart: return (i); } +static void mlx4_en_stop_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->stop_port_task); +} + +static void mlx4_en_start_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->start_port_task); +} static void mlx4_en_set_multicast(struct net_device *dev) { @@ -473,6 +486,7 @@ static void mlx4_en_do_get_stats(struct queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); } + mlx4_en_QUERY_PORT(priv->mdev, priv->port); mutex_unlock(&mdev->state_lock); } @@ -498,8 +512,31 @@ static void mlx4_en_linkstate(struct wor mutex_unlock(&mdev->state_lock); } +static void mlx4_en_lock_and_stop_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + stop_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_stop_port(dev); + mutex_unlock(&mdev->state_lock); +} + +static void mlx4_en_lock_and_start_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + start_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_start_port(dev); + mutex_unlock(&mdev->state_lock); +} -int mlx4_en_start_port(struct net_device *dev) +int mlx4_en_do_start_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -691,7 +728,7 @@ cq_err: } -void mlx4_en_stop_port(struct net_device *dev) +void mlx4_en_do_stop_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -761,8 +798,8 @@ reset: mutex_lock(&mdev->state_lock); if (priv->port_up) { - mlx4_en_stop_port(dev); - if (mlx4_en_start_port(dev)) + mlx4_en_do_stop_port(dev); + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed restarting port %d\n", priv->port); } mutex_unlock(&mdev->state_lock); @@ -793,7 +830,7 @@ mlx4_en_init_locked(struct mlx4_en_priv dev = priv->dev; mdev = priv->mdev; if (dev->if_drv_flags & IFF_DRV_RUNNING) - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); if (!mdev->device_up) { en_err(priv, "Cannot open - device down/disabled\n"); @@ -816,7 +853,7 @@ mlx4_en_init_locked(struct mlx4_en_priv } mlx4_en_set_default_moderation(priv); - if (mlx4_en_start_port(dev)) + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed starting port:%d\n", priv->port); } @@ -905,7 +942,7 @@ void mlx4_en_destroy_netdev(struct net_d mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); mutex_lock(&mdev->state_lock); - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mutex_unlock(&mdev->state_lock); cancel_delayed_work(&priv->stats_task); @@ -925,7 +962,6 @@ void mlx4_en_destroy_netdev(struct net_d mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); - mtx_destroy(&priv->ioctl_lock.m); kfree(priv); if_free(dev); } @@ -951,9 +987,9 @@ static int mlx4_en_change_mtu(struct net * the port */ en_dbg(DRV, priv, "Change MTU called with card down!?\n"); } else { - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mlx4_en_set_default_moderation(priv); - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) { en_err(priv, "Failed restarting port:%d\n", priv->port); @@ -973,8 +1009,13 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); + /* + * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a + * non-sleepable lock. + * I moved it to the periodic mlx4_en_do_get_stats. + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + return (active); + */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1078,7 +1119,6 @@ static int mlx4_en_ioctl(struct ifnet *d error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: - mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) mlx4_en_start_port(dev); @@ -1087,16 +1127,24 @@ static int mlx4_en_ioctl(struct ifnet *d } else { if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); - if_link_state_change(dev, LINK_STATE_DOWN); + if_link_state_change(dev, LINK_STATE_DOWN); + /* + * Since mlx4_en_stop_port is defered we + * have to wait till it's finished. + */ + for (int count=0; count<10; count++) { + if (dev->if_drv_flags & IFF_DRV_RUNNING) { + DELAY(20000); + } else { + break; + } + } } } - mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: - spin_lock(&priv->ioctl_lock); mlx4_en_set_multicast(dev); - spin_unlock(&priv->ioctl_lock); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: @@ -1153,7 +1201,7 @@ static int mlx4_en_set_ring_size(struct mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); } mlx4_en_free_resources(priv); priv->prof->tx_ring_size = tx_size; @@ -1164,7 +1212,7 @@ static int mlx4_en_set_ring_size(struct goto out; } if (port_up) { - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) en_err(priv, "Failed starting port\n"); } @@ -1256,7 +1304,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(priv->dev); + mlx4_en_do_stop_port(priv->dev); } mlx4_en_free_resources(priv); priv->tx_ring_num = tx_ring_num; @@ -1265,7 +1313,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN if (error) en_err(priv, "Failed reallocating port resources\n"); if (error == 0 && port_up) { - error = -mlx4_en_start_port(priv->dev); + error = -mlx4_en_do_start_port(priv->dev); if (error) en_err(priv, "Failed starting port\n"); } @@ -1517,8 +1565,9 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->msg_enable = MLX4_EN_MSG_LEVEL; priv->ip_reasm = priv->mdev->profile.ip_reasm; mtx_init(&priv->stats_lock.m, "mlx4 stats", NULL, MTX_DEF); - mtx_init(&priv->ioctl_lock.m, "mlx4 ioctl", NULL, MTX_DEF); mtx_init(&priv->vlan_lock.m, "mlx4 vlan", NULL, MTX_DEF); + INIT_WORK(&priv->start_port_task, mlx4_en_lock_and_start_port); + INIT_WORK(&priv->stop_port_task, mlx4_en_lock_and_stop_port); INIT_WORK(&priv->mcast_task, mlx4_en_do_set_multicast); INIT_WORK(&priv->watchdog_task, mlx4_en_restart); INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mlx4_en.h Sun Dec 15 07:04:59 2013 (r259410) +++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h Sun Dec 15 07:07:13 2013 (r259411) @@ -493,7 +493,6 @@ struct mlx4_en_priv { spinlock_t vlan_lock; struct mlx4_en_port_state port_state; spinlock_t stats_lock; - spinlock_t ioctl_lock; unsigned long last_moder_packets[MAX_RX_RINGS]; unsigned long last_moder_tx_packets; @@ -546,6 +545,8 @@ struct mlx4_en_priv { struct mlx4_en_cq rx_cq[MAX_RX_RINGS]; struct mlx4_en_tx_hash_entry tx_hash[MLX4_EN_TX_HASH_SIZE]; struct work_struct mcast_task; + struct work_struct start_port_task; + struct work_struct stop_port_task; struct work_struct watchdog_task; struct work_struct linkstate_task; struct delayed_work stats_task; @@ -580,8 +581,8 @@ void mlx4_en_destroy_netdev(struct net_d int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, struct mlx4_en_port_profile *prof); -int mlx4_en_start_port(struct net_device *dev); -void mlx4_en_stop_port(struct net_device *dev); +int mlx4_en_do_start_port(struct net_device *dev); +void mlx4_en_do_stop_port(struct net_device *dev); void mlx4_en_free_resources(struct mlx4_en_priv *priv); int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 08:37:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C10BA39; Sun, 15 Dec 2013 08:37:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46E8813D6; Sun, 15 Dec 2013 08:37:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF8bPKw011584; Sun, 15 Dec 2013 08:37:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF8bON1011577; Sun, 15 Dec 2013 08:37:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312150837.rBF8bON1011577@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 15 Dec 2013 08:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259412 - in head/sys: conf dev/netmap modules/netmap 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.17 Precedence: list List-Id: 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, 15 Dec 2013 08:37:25 -0000 Author: luigi Date: Sun Dec 15 08:37:24 2013 New Revision: 259412 URL: http://svnweb.freebsd.org/changeset/base/259412 Log: split netmap code according to functions: - netmap.c base code - netmap_freebsd.c FreeBSD-specific code - netmap_generic.c emulate netmap over standard drivers - netmap_mbq.c simple mbuf tailq - netmap_mem2.c memory management - netmap_vale.c VALE switch simplify devce-specific code Added: head/sys/dev/netmap/netmap_freebsd.c (contents, props changed) head/sys/dev/netmap/netmap_generic.c (contents, props changed) head/sys/dev/netmap/netmap_mbq.c (contents, props changed) head/sys/dev/netmap/netmap_mbq.h (contents, props changed) head/sys/dev/netmap/netmap_vale.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/modules/netmap/Makefile head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/conf/files Sun Dec 15 08:37:24 2013 (r259412) @@ -1880,7 +1880,11 @@ dev/nand/nfc_if.m optional nand dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/netmap.c optional netmap +dev/netmap/netmap_freebsd.c optional netmap +dev/netmap/netmap_generic.c optional netmap +dev/netmap/netmap_mbq.c optional netmap dev/netmap/netmap_mem2.c optional netmap +dev/netmap/netmap_vale.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge \ Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_em_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -26,7 +26,7 @@ /* * $FreeBSD$ * - * netmap support for em. + * netmap support for: em. * * For more details on netmap support please see ixgbe_netmap.h */ @@ -39,10 +39,6 @@ #include -static void em_netmap_block_tasks(struct adapter *); -static void em_netmap_unblock_tasks(struct adapter *); - - // XXX do we need to block/unblock the tasks ? static void em_netmap_block_tasks(struct adapter *adapter) @@ -85,45 +81,31 @@ em_netmap_unblock_tasks(struct adapter * /* - * Register/unregister routine + * Register/unregister. We are already under netmap lock. */ static int -em_netmap_reg(struct ifnet *ifp, int onoff) +em_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; /* no netmap support here */ + EM_CORE_LOCK(adapter); em_disable_intr(adapter); /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); em_netmap_block_tasks(adapter); - + /* enable or disable flags and callbacks in na and ifp */ if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - em_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + nm_set_native_flags(na); } else { -fail: - /* return to non-netmap mode */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - em_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } + em_init_locked(adapter); /* also enable intr */ em_netmap_unblock_tasks(adapter); - return (error); + EM_CORE_UNLOCK(adapter); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -131,93 +113,103 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +em_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ u_int report_frequency = kring->nkr_num_slots >> 1; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); /* - * Process new packets to send. j is the current index in the - * netmap ring, l is the corresponding index in the NIC ring. + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (j != k) { /* we have new packets to send */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - struct e1000_tx_desc *curr = &txr->tx_base[l]; - struct em_buffer *txbuf = &txr->tx_buffers[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_TXD_CMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } + /* device-specific */ + struct e1000_tx_desc *curr = &txr->tx_base[nic_i]; + struct em_buffer *txbuf = &txr->tx_buffers[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_TXD_CMD_RS : 0; + + NM_CHECK_ADDR_LEN(addr, len); - slot->flags &= ~NS_REPORT; if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->upper.data = 0; curr->lower.data = htole32(adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } - kring->nr_hwcur = k; /* the saved ring->cur */ - kring->nr_hwavail -= n; + kring->nr_hwcur = cur; /* the saved ring->cur */ + /* decrease avail by # of packets sent minus previous ones */ + kring->nr_hwavail -= new_slots; + /* synchronize the NIC ring */ bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), l); + /* (re)start the tx unit up to slot nic_i (excluded) */ + E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), nic_i); } - if (n == 0 || kring->nr_hwavail < 1) { + /* + * Second part: reclaim buffers for completed transmissions. + */ + if (flags & NAF_FORCE_RECLAIM || kring->nr_hwavail < 1) { int delta; /* record completed transmissions using TDH */ - l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ - D("TDH wrap %d", l); - l -= kring->nkr_num_slots; + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ + D("TDH wrap %d", nic_i); + nic_i -= kring->nkr_num_slots; } - delta = l - txr->next_to_clean; + delta = nic_i - txr->next_to_clean; if (delta) { /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; - txr->next_to_clean = l; + txr->next_to_clean = nic_i; kring->nr_hwavail += delta; } } - /* update avail to what the kernel knows */ - ring->avail = kring->nr_hwavail; + + nm_txsync_finalize(kring, cur); return 0; } @@ -227,19 +219,23 @@ em_netmap_txsync(struct ifnet *ifp, u_in * Reconcile kernel and user view of the receive ring. */ static int -em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) +em_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, l, n, lim = kring->nkr_num_slots - 1; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, resvd; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_rxsync_prologue(kring, &resvd); /* cur + res */ int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - u_int k = ring->cur, resvd = ring->reserved; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + + if (cur > lim) return netmap_ring_reinit(kring); /* XXX check sync modes */ @@ -247,84 +243,85 @@ em_netmap_rxsync(struct ifnet *ifp, u_in BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* - * Import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring. + * First part: import newly received packets. */ - l = rxr->next_to_check; - j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { uint16_t slot_flags = kring->nkr_slot_flags; + nic_i = rxr->next_to_check; + nm_i = netmap_idx_n2k(kring, nic_i); + for (n = 0; ; n++) { - struct e1000_rx_desc *curr = &rxr->rx_base[l]; + struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; uint32_t staterr = le32toh(curr->status); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - ring->slot[j].len = le16toh(curr->length); - ring->slot[j].flags = slot_flags; - bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, + ring->slot[nm_i].len = le16toh(curr->length); + ring->slot[nm_i].flags = slot_flags; + bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[nic_i].map, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; + nm_i = nm_next(nm_i, lim); /* make sure next_to_refresh follows next_to_check */ - rxr->next_to_refresh = l; // XXX - l = (l == lim) ? 0 : l + 1; + rxr->next_to_refresh = nic_i; // XXX + nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ - rxr->next_to_check = l; + rxr->next_to_check = nic_i; kring->nr_hwavail += n; } kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has released */ - j = kring->nr_hwcur; /* netmap ring index */ - if (resvd > 0) { - if (resvd + ring->avail >= lim + 1) { - D("XXX invalid reserve/avail %d %d", resvd, ring->avail); - ring->reserved = resvd = 0; // XXX panic... - } - k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; - } - if (j != k) { /* userspace has released some packets. */ - l = netmap_idx_k2n(kring, j); /* NIC ring index */ - for (n = 0; j != k; n++) { - struct netmap_slot *slot = &ring->slot[j]; - struct e1000_rx_desc *curr = &rxr->rx_base[l]; - struct em_buffer *rxbuf = &rxr->rx_buffers[l]; + /* + * Second part: skip past packets that userspace has released. + */ + nm_i = kring->nr_hwcur; + if (nm_i != cur) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(slot, &paddr); - if (addr == netmap_buffer_base) { /* bad buf */ - return netmap_ring_reinit(kring); - } + struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; + struct em_buffer *rxbuf = &rxr->rx_buffers[nic_i]; + + if (addr == netmap_buffer_base) /* bad buf */ + goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ + curr->buffer_addr = htole64(paddr); netmap_reload_map(rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->status = 0; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } kring->nr_hwavail -= n; - kring->nr_hwcur = k; + kring->nr_hwcur = cur; + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* * IMPORTANT: we must leave one free slot in the ring, - * so move l back by one unit + * so move nic_i back by one unit */ - l = (l == 0) ? lim : l - 1; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); + nic_i = (nic_i == 0) ? lim : nic_i - 1; + E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), nic_i); } - /* tell userspace that there are new packets */ + + /* tell userspace that there might be new packets */ ring->avail = kring->nr_hwavail - resvd; + return 0; + +ring_reset: + return netmap_ring_reinit(kring); } @@ -342,7 +339,8 @@ em_netmap_attach(struct adapter *adapter na.nm_txsync = em_netmap_txsync; na.nm_rxsync = em_netmap_rxsync; na.nm_register = em_netmap_reg; - netmap_attach(&na, adapter->num_queues); + na.num_tx_rings = na.num_rx_rings = adapter->num_queues; + netmap_attach(&na); } /* end of file */ Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_igb_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -37,44 +37,43 @@ #include /* vtophys ? */ #include +/* + * Adaptation to different versions of the driver. + */ + +#ifndef IGB_MEDIA_RESET +/* at the same time as IGB_MEDIA_RESET was defined, the + * tx buffer descriptor was renamed, so use this to revert + * back to the old name. + */ +#define igb_tx_buf igb_tx_buffer +#endif + /* - * register-unregister routine + * Register/unregister. We are already under netmap lock. */ static int -igb_netmap_reg(struct ifnet *ifp, int onoff) +igb_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; /* no netmap support here */ + IGB_CORE_LOCK(adapter); igb_disable_intr(adapter); /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* enable or disable flags and callbacks in na and ifp */ if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - igb_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + nm_set_native_flags(na); } else { -fail: - /* restore if_transmit */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - igb_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } - return (error); + igb_init_locked(adapter); /* also enable intr */ + IGB_CORE_UNLOCK(adapter); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -82,68 +81,62 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +igb_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ u_int report_frequency = kring->nkr_num_slots >> 1; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + /* 82575 needs the queue index added */ + u32 olinfo_status = + (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; + + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD); - /* check for new packets to send. - * j indexes the netmap ring, l indexes the nic ring, and - * j = kring->nr_hwcur, l = E1000_TDT (not tracked), - * j == (l + kring->nkr_hwofs) % ring_size + /* + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (j != k) { /* we have new packets to send */ - /* 82575 needs the queue index added */ - u32 olinfo_status = - (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; - - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - union e1000_adv_tx_desc *curr = - (union e1000_adv_tx_desc *)&txr->tx_base[l]; -#ifndef IGB_MEDIA_RESET -/* at the same time as IGB_MEDIA_RESET was defined, the - * tx buffer descriptor was renamed, so use this to revert - * back to the old name. - */ -#define igb_tx_buf igb_tx_buffer -#endif - struct igb_tx_buf *txbuf = &txr->tx_buffers[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_ADVTXD_DCMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } + /* device-specific */ + union e1000_adv_tx_desc *curr = + (union e1000_adv_tx_desc *)&txr->tx_base[nic_i]; + struct igb_tx_buf *txbuf = &txr->tx_buffers[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_ADVTXD_DCMD_RS : 0; + + NM_CHECK_ADDR_LEN(addr, len); - slot->flags &= ~NS_REPORT; if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->read.buffer_addr = htole64(paddr); // XXX check olinfo and cmd_type_len curr->read.olinfo_status = @@ -151,48 +144,56 @@ igb_netmap_txsync(struct ifnet *ifp, u_i (len<< E1000_ADVTXD_PAYLEN_SHIFT)); curr->read.cmd_type_len = htole32(len | E1000_ADVTXD_DTYP_DATA | - E1000_ADVTXD_DCMD_IFCS | - E1000_ADVTXD_DCMD_DEXT | - E1000_ADVTXD_DCMD_EOP | flags); + E1000_ADVTXD_DCMD_IFCS | + E1000_ADVTXD_DCMD_DEXT | + E1000_ADVTXD_DCMD_EOP | flags); + /* make sure changes to the buffer are synced */ bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } - kring->nr_hwcur = k; /* the saved ring->cur */ - kring->nr_hwavail -= n; + kring->nr_hwcur = cur; /* the saved ring->cur */ + /* decrease avail by # of packets sent minus previous ones */ + kring->nr_hwavail -= new_slots; /* Set the watchdog XXX ? */ txr->queue_status = IGB_QUEUE_WORKING; txr->watchdog_time = ticks; + /* synchronize the NIC ring */ bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), l); + /* (re)start the tx unit up to slot nic_i (excluded) */ + E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), nic_i); } - if (n == 0 || kring->nr_hwavail < 1) { + /* + * Second part: reclaim buffers for completed transmissions. + */ + if (flags & NAF_FORCE_RECLAIM || kring->nr_hwavail < 1) { int delta; /* record completed transmissions using TDH */ - l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ - D("TDH wrap %d", l); - l -= kring->nkr_num_slots; + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ + D("TDH wrap %d", nic_i); + nic_i -= kring->nkr_num_slots; } - delta = l - txr->next_to_clean; + delta = nic_i - txr->next_to_clean; if (delta) { /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; - txr->next_to_clean = l; + txr->next_to_clean = nic_i; kring->nr_hwavail += delta; } } - /* update avail to what the kernel knows */ - ring->avail = kring->nr_hwavail; + + nm_txsync_finalize(kring, cur); return 0; } @@ -202,101 +203,107 @@ igb_netmap_txsync(struct ifnet *ifp, u_i * Reconcile kernel and user view of the receive ring. */ static int -igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) +igb_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, l, n, lim = kring->nkr_num_slots - 1; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, resvd; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_rxsync_prologue(kring, &resvd); /* cur + res */ int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - u_int k = ring->cur, resvd = ring->reserved; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + + if (cur > lim) return netmap_ring_reinit(kring); /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* - * import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring. + * First part: import newly received packets. */ - l = rxr->next_to_check; - j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { uint16_t slot_flags = kring->nkr_slot_flags; + nic_i = rxr->next_to_check; + nm_i = netmap_idx_n2k(kring, nic_i); + for (n = 0; ; n++) { - union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; + union e1000_adv_rx_desc *curr = &rxr->rx_base[nic_i]; uint32_t staterr = le32toh(curr->wb.upper.status_error); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - ring->slot[j].len = le16toh(curr->wb.upper.length); - ring->slot[j].flags = slot_flags; + ring->slot[nm_i].len = le16toh(curr->wb.upper.length); + ring->slot[nm_i].flags = slot_flags; bus_dmamap_sync(rxr->ptag, - rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + rxr->rx_buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ - rxr->next_to_check = l; + rxr->next_to_check = nic_i; kring->nr_hwavail += n; } kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has released */ - j = kring->nr_hwcur; /* netmap ring index */ - if (resvd > 0) { - if (resvd + ring->avail >= lim + 1) { - D("XXX invalid reserve/avail %d %d", resvd, ring->avail); - ring->reserved = resvd = 0; // XXX panic... - } - k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; - } - if (j != k) { /* userspace has released some packets. */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - struct netmap_slot *slot = ring->slot + j; - union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; - struct igb_rx_buf *rxbuf = rxr->rx_buffers + l; + /* + * Second part: skip past packets that userspace has released. + */ + nm_i = kring->nr_hwcur; + if (nm_i != cur) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(slot, &paddr); - if (addr == netmap_buffer_base) { /* bad buf */ - return netmap_ring_reinit(kring); - } + union e1000_adv_rx_desc *curr = &rxr->rx_base[nic_i]; + struct igb_rx_buf *rxbuf = &rxr->rx_buffers[nic_i]; + + if (addr == netmap_buffer_base) /* bad buf */ + goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } - curr->read.pkt_addr = htole64(paddr); curr->wb.upper.status_error = 0; + curr->read.pkt_addr = htole64(paddr); bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + BUS_DMASYNC_PREREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } kring->nr_hwavail -= n; - kring->nr_hwcur = k; + kring->nr_hwcur = cur; + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* * IMPORTANT: we must leave one free slot in the ring, - * so move l back by one unit + * so move nic_i back by one unit */ - l = (l == 0) ? lim : l - 1; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); + nic_i = (nic_i == 0) ? lim : nic_i - 1; + E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), nic_i); } - /* tell userspace that there are new packets */ + + /* tell userspace that there might be new packets */ ring->avail = kring->nr_hwavail - resvd; + return 0; + +ring_reset: + return netmap_ring_reinit(kring); } @@ -314,6 +321,8 @@ igb_netmap_attach(struct adapter *adapte na.nm_txsync = igb_netmap_txsync; na.nm_rxsync = igb_netmap_rxsync; na.nm_register = igb_netmap_reg; - netmap_attach(&na, adapter->num_queues); -} + na.num_tx_rings = na.num_rx_rings = adapter->num_queues; + netmap_attach(&na); +} + /* end of file */ Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_lem_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -27,11 +27,12 @@ /* * $FreeBSD$ * - * netmap support for "lem" + * netmap support for: lem * * For details on netmap support please see ixgbe_netmap.h */ + #include #include #include @@ -40,17 +41,13 @@ /* - * Register/unregister + * Register/unregister. We are already under netmap lock. */ static int -lem_netmap_reg(struct ifnet *ifp, int onoff) +lem_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; EM_CORE_LOCK(adapter); @@ -64,24 +61,14 @@ lem_netmap_reg(struct ifnet *ifp, int on taskqueue_drain(adapter->tq, &adapter->rxtx_task); taskqueue_drain(adapter->tq, &adapter->link_task); #endif /* !EM_LEGCY_IRQ */ - if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - lem_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + /* enable or disable flags and callbacks in na and ifp */ + if (onoff) { + nm_set_native_flags(na); } else { -fail: - /* return to non-netmap mode */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - lem_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } + lem_init_locked(adapter); /* also enable intr */ #ifndef EM_LEGACY_IRQ taskqueue_unblock(adapter->tq); // XXX do we need this ? @@ -89,7 +76,7 @@ fail: EM_CORE_UNLOCK(adapter); - return (error); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -97,108 +84,102 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -lem_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +lem_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; + + /* device-specific */ + struct adapter *adapter = ifp->if_softc; - ND("%s: hwofs %d, hwcur %d hwavail %d lease %d cur %d avail %d", - ifp->if_xname, - kring->nkr_hwofs, kring->nr_hwcur, kring->nr_hwavail, - kring->nkr_hwlease, - ring->cur, ring->avail); - /* take a copy of ring->cur now, and never read it again */ - k = ring->cur; - if (k > lim) + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); + /* - * Process new packets to send. j is the current index in the - * netmap ring, l is the corresponding index in the NIC ring. + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (netmap_verbose > 255) - RD(5, "device %s send %d->%d", ifp->if_xname, j, k); - if (j != k) { /* we have new packets to send */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; - struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_TXD_CMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } - ND("slot %d NIC %d %s", j, l, nm_dump_buf(addr, len, 128, NULL)); + /* device-specific */ + struct e1000_tx_desc *curr = &adapter->tx_desc_base[nic_i]; + struct em_buffer *txbuf = &adapter->tx_buffer_area[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_TXD_CMD_RS : 0; - slot->flags &= ~NS_REPORT; - if (1 || slot->flags & NS_BUF_CHANGED) { + NM_CHECK_ADDR_LEN(addr, len); + + if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(adapter->txtag, txbuf->map, addr); curr->buffer_addr = htole64(paddr); - slot->flags &= ~NS_BUF_CHANGED; + netmap_reload_map(adapter->txtag, txbuf->map, addr); } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->upper.data = 0; - curr->lower.data = - htole32( adapter->txd_cmd | len | + curr->lower.data = htole32(adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); - - ND("len %d kring %d nic %d", len, j, l); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 08:52:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E159BC13; Sun, 15 Dec 2013 08:52:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDDE214F8; Sun, 15 Dec 2013 08:52:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF8qGG8018018; Sun, 15 Dec 2013 08:52:16 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF8qGDf018017; Sun, 15 Dec 2013 08:52:16 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201312150852.rBF8qGDf018017@svn.freebsd.org> From: Joel Dahl Date: Sun, 15 Dec 2013 08:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259413 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: 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, 15 Dec 2013 08:52:17 -0000 Author: joel (doc committer) Date: Sun Dec 15 08:52:16 2013 New Revision: 259413 URL: http://svnweb.freebsd.org/changeset/base/259413 Log: mdoc: sort SEE ALSO. Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sun Dec 15 08:37:24 2013 (r259412) +++ head/usr.sbin/bhyve/bhyve.8 Sun Dec 15 08:52:16 2013 (r259413) @@ -288,8 +288,8 @@ bhyve -c 4 \e\ .Xr nmdm 4 , .Xr vmm 4 , .Xr ethers 5 , -.Xr bhyveload 8 , -.Xr bhyvectl 8 +.Xr bhyvectl 8 , +.Xr bhyveload 8 .Sh HISTORY .Nm first appeared in From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 14:01:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C65C5825; Sun, 15 Dec 2013 14:01:21 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3470B16E7; Sun, 15 Dec 2013 14:01:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBFE1F9h053545; Sun, 15 Dec 2013 16:01:15 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBFE1F9h053545 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBFE1FqG053544; Sun, 15 Dec 2013 16:01:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 15 Dec 2013 16:01:15 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi Message-ID: <20131215140115.GM59496@kib.kiev.ua> References: <201312142207.rBEM7fnW075560@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5R8EFYLX8234Xn45" Content-Disposition: inline In-Reply-To: <201312142207.rBEM7fnW075560@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 15 Dec 2013 14:01:21 -0000 --5R8EFYLX8234Xn45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Dec 14 22:07:40 2013 > New Revision: 259397 > URL: http://svnweb.freebsd.org/changeset/base/259397 >=20 > Log: > Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the ke= rnel > support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI > (though not API) is changed. No behavior is changed relative to r257345 > except that LUNs with non-zero high 32 bits will no longer be ignored > during device enumeration for SIMs that have set PIM_EXTLUNS. Does libcam.so version need to be bumped ? --5R8EFYLX8234Xn45 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSrbYqAAoJEJDCuSvBvK1BglkP+gKL05HB4AsoFOQYHdcFZWUb x60h2QgP4qnwV4Q3c5k8xPv0e5HM7q9XqcEIVg7407wyxhf+VMdkJ4IqqIRftcj2 kRefwU/3XVTfE5aeNDa8W80pXH0sCnzDiKKnDtpU4qR7XoJLgookVLiQdpkMCfhm Lz00QkDyjXafbhim5wwXeohSj/yTWaDnCgyK/aTPsoYJwq0HbgHtFVakEMl3Iix4 NThTWGmwTd7VpUdn7rJ8IqxJWI8RrXj1HM4w8+D1TQ4usx1LvHh0d/JSPqOAl1Ys +M9wujKpA+3uMkXWoYq9QhXUD5jXjmegR08rzofIytl5yU1Z+nNQ4glz5KzwGtIP 6xk/RymFrL+cv9tFeICqnbjsmHtMxI6pcvycQrjSVPuNx3vD7uTfw2mN68zWv4am HPW2D7pghRLoNqAGTi+4OXHzsf2ti8m3gQ1ORD4KaGev3YXo+qZX1DH+uEDeyFgd umkaYWXiJ4jOQyEuLAL01yU8fuZQ1EF/Z/wDnfSVK5WRL//59zoTCXBKEg5H5Sb1 S4VYJd6RHdiBoiHLy6zg3OfKCXnGGov7Yk+7HjU0nNQT806z0Nw8JU/DpjGGLs4Q Y1pQGyoh+7h9bm5jDau7NIN19WAyEb8lc2E7A4l92BKzg90pBNq6kUZSxksN0X59 CfF7m50C5YnR1cEhRL5P =4IkZ -----END PGP SIGNATURE----- --5R8EFYLX8234Xn45-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 15:45:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01629C2B; Sun, 15 Dec 2013 15:45:52 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C214E1D2E; Sun, 15 Dec 2013 15:45:51 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXU00200U756A00@smtpauth3.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:45:44 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.15.153615, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXU00G81UG6JO10@smtpauth3.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:45:43 -0600 (CST) Message-id: <52ADCEA6.80308@freebsd.org> Date: Sun, 15 Dec 2013 09:45:42 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Konstantin Belousov Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi References: <201312142207.rBEM7fnW075560@svn.freebsd.org> <20131215140115.GM59496@kib.kiev.ua> In-reply-to: <20131215140115.GM59496@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 15 Dec 2013 15:45:52 -0000 On 12/15/13 08:01, Konstantin Belousov wrote: > On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sat Dec 14 22:07:40 2013 >> New Revision: 259397 >> URL: http://svnweb.freebsd.org/changeset/base/259397 >> >> Log: >> Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel >> support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI >> (though not API) is changed. No behavior is changed relative to r257345 >> except that LUNs with non-zero high 32 bits will no longer be ignored >> during device enumeration for SIMs that have set PIM_EXTLUNS. > Does libcam.so version need to be bumped ? Yes, it should have been. I'll go do this now. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 15:51:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61FBAF6D; Sun, 15 Dec 2013 15:51:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBA41D9B; Sun, 15 Dec 2013 15:51:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFFp6vu071576; Sun, 15 Dec 2013 15:51:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFFp512071573; Sun, 15 Dec 2013 15:51:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312151551.rBFFp512071573@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Dec 2013 15:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259416 - in head: . lib/libcam 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.17 Precedence: list List-Id: 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, 15 Dec 2013 15:51:06 -0000 Author: nwhitehorn Date: Sun Dec 15 15:51:05 2013 New Revision: 259416 URL: http://svnweb.freebsd.org/changeset/base/259416 Log: Bump libcam shared library version forgotten in r259397. Submitted by: kib Modified: head/ObsoleteFiles.inc head/lib/libcam/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Dec 15 15:37:07 2013 (r259415) +++ head/ObsoleteFiles.inc Sun Dec 15 15:51:05 2013 (r259416) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20131215: libcam version bumped +OLD_LIBS+=lib/libcam.so.6 usr/lib32/libcam.so.6 # 20131202: libcapsicum and libcasper moved to /lib/ OLD_LIBS+=usr/lib/libcapsicum.so.0 OLD_LIBS+=usr/lib/libcasper.so.0 Modified: head/lib/libcam/Makefile ============================================================================== --- head/lib/libcam/Makefile Sun Dec 15 15:37:07 2013 (r259415) +++ head/lib/libcam/Makefile Sun Dec 15 15:51:05 2013 (r259416) @@ -42,6 +42,6 @@ MLINKS+= cam.3 cam_open_device.3 \ SDIR= ${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR} -I${SDIR} -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 .include From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 16:17:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D91AD9AF; Sun, 15 Dec 2013 16:17:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C541A1ED9; Sun, 15 Dec 2013 16:17:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFGH0gq080063; Sun, 15 Dec 2013 16:17:00 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFGH0cs080061; Sun, 15 Dec 2013 16:17:00 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201312151617.rBFGH0cs080061@svn.freebsd.org> From: Hiroki Sato Date: Sun, 15 Dec 2013 16:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259417 - head/usr.sbin/ypbind 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.17 Precedence: list List-Id: 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, 15 Dec 2013 16:17:01 -0000 Author: hrs Date: Sun Dec 15 16:17:00 2013 New Revision: 259417 URL: http://svnweb.freebsd.org/changeset/base/259417 Log: Replace Sun RPC license for TI-RPC library with a 3-clause BSD license, with the explicit permission of Sun Microsystems in 2009. The code in question in this file was copied from lib/libc/rpc/pmap_getport.c. Modified: head/usr.sbin/ypbind/yp_ping.c Modified: head/usr.sbin/ypbind/yp_ping.c ============================================================================== --- head/usr.sbin/ypbind/yp_ping.c Sun Dec 15 15:51:05 2013 (r259416) +++ head/usr.sbin/ypbind/yp_ping.c Sun Dec 15 16:17:00 2013 (r259417) @@ -30,35 +30,33 @@ * SUCH DAMAGE. */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. +/*- + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. */ - #if 0 #ifndef lint static char *sccsid = "@(#)from: clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 16:40:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17E543DB; Sun, 15 Dec 2013 16:40:22 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D914B1037; Sun, 15 Dec 2013 16:40:21 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXU00M00TIFWH00@smtpauth2.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:40:12 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.15.152715, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXU00FKQU6ZU100@smtpauth2.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:40:12 -0600 (CST) Message-id: <52ADCD5B.5000401@freebsd.org> Date: Sun, 15 Dec 2013 09:40:11 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Konstantin Belousov Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi References: <201312142207.rBEM7fnW075560@svn.freebsd.org> <20131215140115.GM59496@kib.kiev.ua> In-reply-to: <20131215140115.GM59496@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 15 Dec 2013 16:40:22 -0000 On 12/15/13 08:01, Konstantin Belousov wrote: > On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sat Dec 14 22:07:40 2013 >> New Revision: 259397 >> URL: http://svnweb.freebsd.org/changeset/base/259397 >> >> Log: >> Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel >> support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI >> (though not API) is changed. No behavior is changed relative to r257345 >> except that LUNs with non-zero high 32 bits will no longer be ignored >> during device enumeration for SIMs that have set PIM_EXTLUNS. > Does libcam.so version need to be bumped ? It wasn't the last time. Maybe it should have been? -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 16:58:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA477978; Sun, 15 Dec 2013 16:58:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9635B114B; Sun, 15 Dec 2013 16:58:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFGwNip095392; Sun, 15 Dec 2013 16:58:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFGwNQ0095391; Sun, 15 Dec 2013 16:58:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312151658.rBFGwNQ0095391@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Dec 2013 16:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259418 - head/sys/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.17 Precedence: list List-Id: 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, 15 Dec 2013 16:58:23 -0000 Author: nwhitehorn Date: Sun Dec 15 16:58:23 2013 New Revision: 259418 URL: http://svnweb.freebsd.org/changeset/base/259418 Log: Set max_lun to zero. This field is ignored unless we are manually probing LUNs anyway, and we certainly don't want to probe 2^32 values by hand in that case. MFC after: 2 weeks Modified: head/sys/powerpc/pseries/phyp_vscsi.c Modified: head/sys/powerpc/pseries/phyp_vscsi.c ============================================================================== --- head/sys/powerpc/pseries/phyp_vscsi.c Sun Dec 15 16:17:00 2013 (r259417) +++ head/sys/powerpc/pseries/phyp_vscsi.c Sun Dec 15 16:58:23 2013 (r259418) @@ -426,7 +426,7 @@ vscsi_cam_action(struct cam_sim *sim, un cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; cpi->max_target = 0; - cpi->max_lun = ~(lun_id_t)(0); + cpi->max_lun = 0; cpi->initiator_id = ~0; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "IBM", HBA_IDLEN); From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 18:07:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDBC4A04; Sun, 15 Dec 2013 18:07:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAA5C155A; Sun, 15 Dec 2013 18:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFI7PCn021204; Sun, 15 Dec 2013 18:07:25 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFI7PHw021202; Sun, 15 Dec 2013 18:07:25 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312151807.rBFI7PHw021202@svn.freebsd.org> From: Justin Hibbits Date: Sun, 15 Dec 2013 18:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259421 - head/sys/powerpc/aim 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.17 Precedence: list List-Id: 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, 15 Dec 2013 18:07:25 -0000 Author: jhibbits Date: Sun Dec 15 18:07:25 2013 New Revision: 259421 URL: http://svnweb.freebsd.org/changeset/base/259421 Log: Save r3 before using it for the trap check, else we end up saving the new r3, containing the trap instruction encoding (0x7c810808), and restoring it back with the frame on return. This caused it to panic on my ppc32 machine, but somehow my ppc64 machine overlooked it, because I was using such a simple dtrace probe. X-MFC-with: r259245 MFC after: 2 weeks Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:07:25 2013 (r259421) @@ -897,11 +897,13 @@ CNAME(dblow): #ifdef KDTRACE_HOOKS /* Privileged, so drop to KDB */ mfsrr0 %r1 - lwz %r4,0(%r1) + mtsprg3 %r3 + lwz %r1,0(%r1) /* Check if it's a DTrace trap. */ li %r3,0x0808 addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r4 + cmplw %cr0,%r3,%r1 + mfsprg3 %r3 beq %cr0,1b #endif /* Privileged, so drop to KDB */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:07:25 2013 (r259421) @@ -804,11 +804,13 @@ CNAME(dblow): #ifdef KDTRACE_HOOKS /* Privileged, so drop to KDB */ mfsrr0 %r1 - lwz %r4,0(%r1) + mtsprg3 %r3 + lwz %r1,0(%r1) /* Check if it's a DTrace trap. */ li %r3,0x0808 addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r4 + cmplw %cr0,%r3,%r1 + mfsprg3 %r3 beq %cr0,1b #endif GET_CPUINFO(%r1) From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 18:13:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54456DA3; Sun, 15 Dec 2013 18:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 410B815FE; Sun, 15 Dec 2013 18:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFIDhcF024563; Sun, 15 Dec 2013 18:13:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFIDhgW024562; Sun, 15 Dec 2013 18:13:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312151813.rBFIDhgW024562@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Dec 2013 18:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259422 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 18:13:43 -0000 Author: kib Date: Sun Dec 15 18:13:42 2013 New Revision: 259422 URL: http://svnweb.freebsd.org/changeset/base/259422 Log: Revert r259045. It seems that clang miscompiles code related to UDP with -fno-strict-overflow. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Dec 15 18:07:25 2013 (r259421) +++ head/sys/conf/kern.mk Sun Dec 15 18:13:42 2013 (r259422) @@ -148,12 +148,6 @@ INLINE_LIMIT?= 8000 CFLAGS+= -ffreestanding # -# Do not allow a compiler to optimize out overflow checks for signed -# types. -# -CFLAGS+= -fno-strict-overflow - -# # GCC SSP support # .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 18:26:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8813A37D; Sun, 15 Dec 2013 18:26:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7520116BB; Sun, 15 Dec 2013 18:26:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFIQW4h028468; Sun, 15 Dec 2013 18:26:32 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFIQWWB028467; Sun, 15 Dec 2013 18:26:32 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312151826.rBFIQWWB028467@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 15 Dec 2013 18:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259424 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 18:26:32 -0000 Author: bjk (doc committer) Date: Sun Dec 15 18:26:31 2013 New Revision: 259424 URL: http://svnweb.freebsd.org/changeset/base/259424 Log: Increment __FreeBSD_version for the behavior change of gss_pseudo_random introduced in r259286. Approved by: hrs (mentor, src committer) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 15 18:22:51 2013 (r259423) +++ head/sys/sys/param.h Sun Dec 15 18:26:31 2013 (r259424) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 18:34:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09E2B704; Sun, 15 Dec 2013 18:34:25 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id E17C21767; Sun, 15 Dec 2013 18:34:24 +0000 (UTC) Received: from [IPv6:2601:9:8200:372:592f:3ab3:8cd8:ec31] (unknown [IPv6:2601:9:8200:372:592f:3ab3:8cd8:ec31]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id C3E2F39828; Sun, 15 Dec 2013 10:34:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1387132464; bh=kwhLvPekC9Hk3KSTMneoKJ5/khZY4meOPUutla+ehW0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Ykow9oKtxLcxOSIOAgQnIqBNyuqlSy5xgojJ177OaABX7H038e4LolzjPrtOmuvZh wW2Kb410F05slSJhtyr0AIXXRuG7G8ZtY14LR07WErAWSAOJ9IkxI7MiPI88VeLkCv QMyH+YlJ6oV0ESp+pZkwiv3r9y1NBNGzNhpRK1Jo= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1812\)) Subject: Re: svn commit: r259422 - head/sys/conf From: Rui Paulo In-Reply-To: <201312151813.rBFIDhgW024562@svn.freebsd.org> Date: Sun, 15 Dec 2013 10:33:47 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1812) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 15 Dec 2013 18:34:25 -0000 On 15 Dec 2013, at 10:13, Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 15 18:13:42 2013 > New Revision: 259422 > URL: http://svnweb.freebsd.org/changeset/base/259422 >=20 > Log: > Revert r259045. >=20 > It seems that clang miscompiles code related to UDP with = -fno-strict-overflow. Could you please file a bug report if you haven't already? Thanks, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 19:09:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41F7E7D9 for ; Sun, 15 Dec 2013 19:09:15 +0000 (UTC) Received: from mail-pb0-x22b.google.com (mail-pb0-x22b.google.com [IPv6:2607:f8b0:400e:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1204B19F3 for ; Sun, 15 Dec 2013 19:09:15 +0000 (UTC) Received: by mail-pb0-f43.google.com with SMTP id rq2so4556039pbb.30 for ; Sun, 15 Dec 2013 11:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=kuNiKHzueQr46rY44hJwps6CAUdx+T+A+YjM+5rT0/Y=; b=Onh+l0Bix7f75Zlu1pRXTT5HdoqrBr86JpctlnKzxN307ZPhg+vHaDLVgoJiJx/MOp O8Y5jClJg5R5EYRZoIOCr8ImNKyigmWwzHKX91hMvkpg1LsZTD9HQ/YCbWlW5vu43ELD +FsQGbNh0wrXMGT1sKaFRWgKsgLe6dQnfyJCg= 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=kuNiKHzueQr46rY44hJwps6CAUdx+T+A+YjM+5rT0/Y=; b=RyBdIOYcAbP8jGikNdwXtqIpX/UYZ9HGd5FxyAh6Q5Gn2D/p6xKEAERQWhGkBfBnpT xfHrSdjwFms0xZJe9Y/wnyhyMfmLhAnzZOw5/eGkdxHyeWG02G4eZFYAas4z6spM0Jgk mxNEzO80neXTcltBgbuosAn+LKp8qWSVdloqquH9EWA4Rg5z5NP5PfPu2mIvk4BXy8Pu c1BGCXd2VWeK+OftIieR6epzU/OJvFaO39GgW3n5RzhVAbQJ+T45CqKVit5GyMyaktTK 921bmpWFMKp/apmPqHR4Hs3E/s9pKtX6zGTxZ4uU72ICu90k68j9KJcwR3sDwRgnbwcd wlJg== X-Gm-Message-State: ALoCoQnM08CeHFyHue3e8WbxGkiW/EmvvYbxELBvJWgGN3rBpCWtrtv7Odbr2VwhjGxWXhorBSzy X-Received: by 10.69.31.170 with SMTP id kn10mr15791694pbd.106.1387134554611; Sun, 15 Dec 2013 11:09:14 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.57.98 with HTTP; Sun, 15 Dec 2013 11:08:44 -0800 (PST) In-Reply-To: <201312151813.rBFIDhgW024562@svn.freebsd.org> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Dec 2013 14:08:44 -0500 X-Google-Sender-Auth: hd-3wN7kgoNd_WJvE-PKHzXi6sU Message-ID: Subject: Re: svn commit: r259422 - head/sys/conf To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 15 Dec 2013 19:09:15 -0000 On Sun, Dec 15, 2013 at 1:13 PM, Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 15 18:13:42 2013 > New Revision: 259422 > URL: http://svnweb.freebsd.org/changeset/base/259422 > > Log: > Revert r259045. > > It seems that clang miscompiles code related to UDP with -fno-strict-overflow. = Is this actual miscompilation or just a missed optimization opportunity? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 19:18:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72F81A99; Sun, 15 Dec 2013 19:18:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9D31A85; Sun, 15 Dec 2013 19:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFJIJGG047069; Sun, 15 Dec 2013 19:18:19 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFJIJFk047068; Sun, 15 Dec 2013 19:18:19 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312151918.rBFJIJFk047068@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 15 Dec 2013 19:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259425 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 19:18:19 -0000 Author: bjk (doc committer) Date: Sun Dec 15 19:18:18 2013 New Revision: 259425 URL: http://svnweb.freebsd.org/changeset/base/259425 Log: Add an UPDATING entry for the gss_pseudo_random behavior change Approved by: hrs (mentor, src committer) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Dec 15 18:26:31 2013 (r259424) +++ head/UPDATING Sun Dec 15 19:18:18 2013 (r259425) @@ -31,6 +31,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131213: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 1100004. + 20131108: The WITHOUT_ATF build knob has been removed and its functionality has been subsumed into the more generic WITHOUT_TESTS. If you were From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 20:38:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5474D75D; Sun, 15 Dec 2013 20:38:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40EBD1041; Sun, 15 Dec 2013 20:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFKc80e076472; Sun, 15 Dec 2013 20:38:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFKc7vS076470; Sun, 15 Dec 2013 20:38:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312152038.rBFKc7vS076470@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 20:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259426 - in head/release: . scripts 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.17 Precedence: list List-Id: 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, 15 Dec 2013 20:38:08 -0000 Author: gjb Date: Sun Dec 15 20:38:07 2013 New Revision: 259426 URL: http://svnweb.freebsd.org/changeset/base/259426 Log: Add a pkg(8) repository configuration file for cdrom-based package installation. As part of the 'pkg-stage' target, copy the configuration file to the 'packages/repos/' directory on the DVD filesystem. MFC after: 3 days X-MFC-Before: -RC3 Sponsored by: The FreeBSD Foundation Added: head/release/scripts/FreeBSD_install_cdrom.conf (contents, props changed) Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Dec 15 19:18:18 2013 (r259425) +++ head/release/Makefile Sun Dec 15 20:38:07 2013 (r259426) @@ -225,7 +225,11 @@ pkg-stage: .if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf) sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ ${REVISION} + mkdir -p ${.OBJDIR}/dvd/packages/repos/ + cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ + ${.OBJDIR}/dvd/packages/repos/ .endif + touch ${.TARGET} cdrom: disc1.iso bootonly.iso dvdrom: dvd1.iso Added: head/release/scripts/FreeBSD_install_cdrom.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/FreeBSD_install_cdrom.conf Sun Dec 15 20:38:07 2013 (r259426) @@ -0,0 +1,12 @@ +# +# $FreeBSD$ +# +# The pkg(8) repository configuration file for the installation DVD. +# + +FreeBSD_install_cdrom: { + url: "file:///dist/packages/${ABI}", + mirror_type: "none", + enabled: yes +} + From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 20:47:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E98BDA42; Sun, 15 Dec 2013 20:47:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4F3D10D4; Sun, 15 Dec 2013 20:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFKlRSE079899; Sun, 15 Dec 2013 20:47:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFKlRrJ079898; Sun, 15 Dec 2013 20:47:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312152047.rBFKlRrJ079898@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 20:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259427 - head/usr.sbin/bsdconfig/share/packages 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.17 Precedence: list List-Id: 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, 15 Dec 2013 20:47:28 -0000 Author: gjb Date: Sun Dec 15 20:47:27 2013 New Revision: 259427 URL: http://svnweb.freebsd.org/changeset/base/259427 Log: Export 'REPOS_DIR' when the selected source medium for package installation is cdrom. This enables bsdconfig(8) to make use of the on-disc pkg(8) repository configuration, which fixes package selection and installation from the dvd installer. MFC after: 3 days M-MFC-With: r259426 X-MFC-Before: -RC3 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Dec 15 20:38:07 2013 (r259426) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Dec 15 20:47:27 2013 (r259427) @@ -119,6 +119,9 @@ f_index_initialize() $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_CDROM) + __site="file://$MOUNTPOINT/packages/$PKG_ABI" + export REPOS_DIR="$MOUNTPOINT/packages/repos" ;; *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 22:51:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D6A1953; Sun, 15 Dec 2013 22:51:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39DE9185D; Sun, 15 Dec 2013 22:51:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMpREf027151; Sun, 15 Dec 2013 22:51:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMpRgn027150; Sun, 15 Dec 2013 22:51:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152251.rBFMpRgn027150@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259428 - head/sys/geom/eli 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.17 Precedence: list List-Id: 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, 15 Dec 2013 22:51:27 -0000 Author: pjd Date: Sun Dec 15 22:51:26 2013 New Revision: 259428 URL: http://svnweb.freebsd.org/changeset/base/259428 Log: Clear content of keyfiles loaded by the loader after processing them. Pointed out by: rwatson MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sun Dec 15 20:47:27 2013 (r259427) +++ head/sys/geom/eli/g_eli.c Sun Dec 15 22:51:26 2013 (r259428) @@ -990,6 +990,7 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); g_eli_crypto_hmac_update(ctx, data, size); + bzero(data, size); } } From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 22:52:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07409AAC; Sun, 15 Dec 2013 22:52:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E78F71865; Sun, 15 Dec 2013 22:52:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMqI0N027284; Sun, 15 Dec 2013 22:52:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMqIdj027283; Sun, 15 Dec 2013 22:52:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152252.rBFMqIdj027283@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259429 - head/sys/geom/eli 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.17 Precedence: list List-Id: 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, 15 Dec 2013 22:52:19 -0000 Author: pjd Date: Sun Dec 15 22:52:18 2013 New Revision: 259429 URL: http://svnweb.freebsd.org/changeset/base/259429 Log: Clear some more places with potentially sensitive data. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_crypto.c Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Sun Dec 15 22:51:26 2013 (r259428) +++ head/sys/geom/eli/g_eli_crypto.c Sun Dec 15 22:52:18 2013 (r259429) @@ -288,10 +288,12 @@ g_eli_crypto_hmac_final(struct hmac_ctx bzero(ctx, sizeof(*ctx)); SHA512_Update(&lctx, digest, sizeof(digest)); SHA512_Final(digest, &lctx); + bzero(&lctx, sizeof(lctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) mdsize = SHA512_MDLEN; bcopy(digest, md, mdsize); + bzero(digest, sizeof(digest)); } void From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 22:58:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 685C7DAB; Sun, 15 Dec 2013 22:58:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AAF81899; Sun, 15 Dec 2013 22:58:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMwAKl027970; Sun, 15 Dec 2013 22:58:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMw9ip027967; Sun, 15 Dec 2013 22:58:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152258.rBFMw9ip027967@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259430 - head/lib/libnv 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.17 Precedence: list List-Id: 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, 15 Dec 2013 22:58:10 -0000 Author: pjd Date: Sun Dec 15 22:58:09 2013 New Revision: 259430 URL: http://svnweb.freebsd.org/changeset/base/259430 Log: MFp4 @1189139: Get rid of the msg_peek() function, which has a problem. If there was less data in the socket buffer than requested by the caller, the function would busy loop, as select(2) will always return immediately. We can just receive nvlhdr now, because some time ago we splitted receive of data from the receive of descriptors. MFC after: 1 week Modified: head/lib/libnv/msgio.c head/lib/libnv/msgio.h head/lib/libnv/nvlist.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/msgio.c Sun Dec 15 22:58:09 2013 (r259430) @@ -113,30 +113,6 @@ fd_wait(int fd, bool doread) NULL, NULL); } -int -msg_peek(int sock, void *buf, size_t size) -{ - ssize_t done; - - PJDLOG_ASSERT(sock >= 0); - PJDLOG_ASSERT(size > 0); - - do { - fd_wait(sock, true); - done = recv(sock, buf, size, MSG_PEEK | MSG_WAITALL); - if (done == -1) { - if (errno == EAGAIN || errno == EINTR) - continue; - return (-1); - } else if (done == 0) { - errno = ENOTCONN; - return (-1); - } - } while (done != (ssize_t)size); - - return (0); -} - static int msg_recv(int sock, struct msghdr *msg) { Modified: head/lib/libnv/msgio.h ============================================================================== --- head/lib/libnv/msgio.h Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/msgio.h Sun Dec 15 22:58:09 2013 (r259430) @@ -38,8 +38,6 @@ struct cmsgcred; struct iovec; struct msghdr; -int msg_peek(int sock, void *buf, size_t size); - int cred_send(int sock); int cred_recv(int sock, struct cmsgcred *cred); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/nvlist.c Sun Dec 15 22:58:09 2013 (r259430) @@ -724,11 +724,11 @@ nvlist_recv(int sock) { struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; + unsigned char *buf; size_t nfds, size; - void *buf; int serrno, *fds; - if (msg_peek(sock, &nvlhdr, sizeof(nvlhdr)) == -1) + if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); if (!nvlist_check_header(&nvlhdr)) @@ -741,10 +741,12 @@ nvlist_recv(int sock) if (buf == NULL) return (NULL); + memcpy(buf, &nvlhdr, sizeof(nvlhdr)); + ret = NULL; fds = NULL; - if (buf_recv(sock, buf, size) == -1) + if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1) goto out; if (nfds > 0) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 22:59:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD3C5F02; Sun, 15 Dec 2013 22:59:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9939D18A6; Sun, 15 Dec 2013 22:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMxYgm028146; Sun, 15 Dec 2013 22:59:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMxYjU028145; Sun, 15 Dec 2013 22:59:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152259.rBFMxYjU028145@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259431 - head/sbin/casperd 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.17 Precedence: list List-Id: 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, 15 Dec 2013 22:59:34 -0000 Author: pjd Date: Sun Dec 15 22:59:34 2013 New Revision: 259431 URL: http://svnweb.freebsd.org/changeset/base/259431 Log: MFp4 @1189141: Change casperd's zygote process title. MFC after: 1 week Modified: head/sbin/casperd/zygote.c Modified: head/sbin/casperd/zygote.c ============================================================================== --- head/sbin/casperd/zygote.c Sun Dec 15 22:58:09 2013 (r259430) +++ head/sbin/casperd/zygote.c Sun Dec 15 22:59:34 2013 (r259431) @@ -122,6 +122,8 @@ zygote_main(int sock) assert(sock > STDERR_FILENO); + setproctitle("zygote"); + if (pjdlog_mode_get() != PJDLOG_MODE_STD) stdnull(); for (fd = STDERR_FILENO + 1; fd < sock; fd++) From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:02:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29FE6125; Sun, 15 Dec 2013 23:02:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16270190A; Sun, 15 Dec 2013 23:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN2aYP031102; Sun, 15 Dec 2013 23:02:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN2a5N031099; Sun, 15 Dec 2013 23:02:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152302.rBFN2a5N031099@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259432 - head/contrib/tcpdump 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:02:37 -0000 Author: pjd Date: Sun Dec 15 23:02:36 2013 New Revision: 259432 URL: http://svnweb.freebsd.org/changeset/base/259432 Log: Make use of casperd's system.dns service when running without the -n option. Now tcpdump(8) is sandboxed even if DNS resolution is required. Sponsored by: The FreeBSD Foundation Modified: head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Sun Dec 15 22:59:34 2013 (r259431) +++ head/contrib/tcpdump/addrtoname.c Sun Dec 15 23:02:36 2013 (r259432) @@ -32,6 +32,10 @@ static const char rcsid[] _U_ = #include "config.h" #endif +#ifdef __FreeBSD__ +#include +#include +#endif #include #ifdef USE_ETHER_NTOHOST @@ -203,6 +207,9 @@ intoa(u_int32_t addr) static u_int32_t f_netmask; static u_int32_t f_localnet; +#ifdef HAVE_LIBCAPSICUM +extern cap_channel_t *capdns; +#endif /* * Return a name for the IP address pointed to by ap. This address @@ -248,7 +255,13 @@ getname(const u_char *ap) */ if (!nflag && (addr & f_netmask) == f_localnet) { - hp = gethostbyaddr((char *)&addr, 4, AF_INET); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) { + hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, + AF_INET); + } else +#endif + hp = gethostbyaddr((char *)&addr, 4, AF_INET); if (hp) { char *dotp; @@ -293,7 +306,13 @@ getname6(const u_char *ap) * Do not print names if -n was given. */ if (!nflag) { - hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) { + hp = cap_gethostbyaddr(capdns, (char *)&addr, + sizeof(addr), AF_INET6); + } else +#endif + hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); if (hp) { char *dotp; Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Sun Dec 15 22:59:34 2013 (r259431) +++ head/contrib/tcpdump/tcpdump.c Sun Dec 15 23:02:36 2013 (r259432) @@ -76,6 +76,12 @@ extern int SIZE_BUF; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#include +#include +#include +#endif /* HAVE_LIBCAPSICUM */ #endif /* __FreeBSD__ */ #ifndef WIN32 #include @@ -123,6 +129,10 @@ static int infoprint; char *program_name; +#ifdef HAVE_LIBCAPSICUM +cap_channel_t *capdns; +#endif + int32_t thiszone; /* seconds offset from gmt to local time */ /* Forwards */ @@ -684,6 +694,45 @@ get_next_file(FILE *VFile, char *ptr) return ret; } +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t * +capdns_setup(void) +{ + cap_channel_t *capcas, *capdnsloc; + const char *types[1]; + int families[2]; + + capcas = cap_init(); + if (capcas == NULL) { + warning("unable to contact casperd"); + return (NULL); + } + capdnsloc = cap_service_open(capcas, "system.dns"); + /* Casper capability no longer needed. */ + cap_close(capcas); + if (capdnsloc == NULL) { + warning("unable to open system.dns service"); + return (NULL); + } + /* Limit system.dns to reverse DNS lookups. */ + types[0] = "ADDR"; + if (cap_dns_type_limit(capdnsloc, types, 1) < 0) { + warning("unable to limit access to system.dns service"); + cap_close(capdnsloc); + return (NULL); + } + families[0] = AF_INET; + families[1] = AF_INET6; + if (cap_dns_family_limit(capdnsloc, families, 2) < 0) { + warning("unable to limit access to system.dns service"); + cap_close(capdnsloc); + return (NULL); + } + + return (capdnsloc); +} +#endif /* HAVE_LIBCAPSICUM */ + int main(int argc, char **argv) { @@ -1417,6 +1466,12 @@ main(int argc, char **argv) free(cmdbuf); exit(0); } + +#ifdef HAVE_LIBCAPSICUM + if (!nflag) + capdns = capdns_setup(); +#endif /* HAVE_LIBCAPSICUM */ + init_addrtoname(localnet, netmask); init_checksum(); @@ -1615,7 +1670,12 @@ main(int argc, char **argv) #endif /* WIN32 */ #ifdef __FreeBSD__ - cansandbox = (nflag && VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL); +#ifdef HAVE_LIBCAPSICUM + cansandbox = (cansandbox && (nflag || capdns != NULL)); +#else + cansandbox = (cansandbox && nflag); +#endif if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); if (cap_sandboxed()) From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:05:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A53C230A; Sun, 15 Dec 2013 23:05:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 917D01921; Sun, 15 Dec 2013 23:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN5Jel031572; Sun, 15 Dec 2013 23:05:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN5JKT031571; Sun, 15 Dec 2013 23:05:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152305.rBFN5JKT031571@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259433 - head/usr.sbin/tcpdump/tcpdump 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:05:19 -0000 Author: pjd Date: Sun Dec 15 23:05:19 2013 New Revision: 259433 URL: http://svnweb.freebsd.org/changeset/base/259433 Log: Add Casper support. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Sun Dec 15 23:02:36 2013 (r259432) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Sun Dec 15 23:05:19 2013 (r259433) @@ -162,6 +162,11 @@ CFLAGS+= -DLBL_ALIGN DPADD= ${LIBL} ${LIBPCAP} LDADD= -ll -lpcap +.if ${MK_CASPER} != "no" +DPADD+= ${LIBCAPSICUM} ${LIBNV} +LDADD+= -lcapsicum -lnv +CFLAGS+=-DHAVE_LIBCAPSICUM +.endif .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:09:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A8F5494; Sun, 15 Dec 2013 23:09:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79D131940; Sun, 15 Dec 2013 23:09:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN96aC032129; Sun, 15 Dec 2013 23:09:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN96Z9032127; Sun, 15 Dec 2013 23:09:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152309.rBFN96Z9032127@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259434 - head/usr.bin/kdump 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:09:06 -0000 Author: pjd Date: Sun Dec 15 23:09:05 2013 New Revision: 259434 URL: http://svnweb.freebsd.org/changeset/base/259434 Log: Make use of Casper's system.pwd and system.grp services when the -r option is given to convert uids and gids to user names and group names even when running in capability mode sandbox. While here log on stderr when we successfully enter the sandbox. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Sun Dec 15 23:05:19 2013 (r259433) +++ head/usr.bin/kdump/Makefile Sun Dec 15 23:09:05 2013 (r259434) @@ -12,6 +12,12 @@ SRCS= kdump_subr.c kdump.c ioctl.c subr DPSRCS= kdump_subr.h CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. +.if ${MK_CASPER} != "no" +DPADD+= ${LIBCAPSICUM} ${LIBNV} +LDADD+= -lcapsicum -lnv +CFLAGS+=-DHAVE_LIBCAPSICUM +.endif + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun Dec 15 23:05:19 2013 (r259433) +++ head/usr.bin/kdump/kdump.c Sun Dec 15 23:09:05 2013 (r259434) @@ -74,9 +74,18 @@ extern int errno; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#include +#include +#include +#endif #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#endif #include #include #include @@ -167,6 +176,10 @@ struct proc_info TAILQ_HEAD(trace_procs, proc_info) trace_procs; +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t *cappwd, *capgrp; +#endif + static void strerror_init(void) { @@ -192,6 +205,64 @@ localtime_init(void) (void)localtime(<ime); } +#ifdef HAVE_LIBCAPSICUM +static int +cappwdgrp_setup(cap_channel_t **cappwdp, cap_channel_t **capgrpp) +{ + cap_channel_t *capcas, *cappwdloc, *capgrploc; + const char *cmds[1], *fields[1]; + + capcas = cap_init(); + if (capcas == NULL) { + warn("unable to contact casperd"); + return (NULL); + } + cappwdloc = cap_service_open(capcas, "system.pwd"); + capgrploc = cap_service_open(capcas, "system.grp"); + /* Casper capability no longer needed. */ + cap_close(capcas); + if (cappwdloc == NULL || capgrploc == NULL) { + if (cappwdloc == NULL) + warn("unable to open system.pwd service"); + if (capgrploc == NULL) + warn("unable to open system.grp service"); + goto fail; + } + /* Limit system.pwd to only getpwuid() function and pw_name field. */ + cmds[0] = "getpwuid"; + if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) { + warn("unable to limit access to system.pwd service"); + goto fail; + } + fields[0] = "pw_name"; + if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) { + warn("unable to limit access to system.pwd service"); + goto fail; + } + /* Limit system.grp to only getgrgid() function and gr_name field. */ + cmds[0] = "getgrgid"; + if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) { + warn("unable to limit access to system.grp service"); + goto fail; + } + fields[0] = "gr_name"; + if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) { + warn("unable to limit access to system.grp service"); + goto fail; + } + + *cappwdp = cappwdloc; + *capgrpp = capgrploc; + return (0); +fail: + if (capgrploc == NULL) + cap_close(cappwdloc); + if (capgrploc == NULL) + cap_close(capgrploc); + return (-1); +} +#endif /* HAVE_LIBCAPSICUM */ + int main(int argc, char *argv[]) { @@ -265,14 +336,28 @@ main(int argc, char *argv[]) strerror_init(); localtime_init(); - +#ifdef HAVE_LIBCAPSICUM + if (resolv != 0) { + if (cappwdgrp_setup(&cappwd, &capgrp) < 0) { + cappwd = NULL; + capgrp = NULL; + } + } + if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + } +#else if (resolv == 0) { if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); } +#endif limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); + if (cap_sandboxed()) + fprintf(stderr, "capability mode sandbox enabled\n"); TAILQ_INIT(&trace_procs); drop_logged = 0; @@ -1664,11 +1749,31 @@ ktrstat(struct stat *statp) printf("mode=%s, ", mode); } printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); - if (resolv == 0 || (pwd = getpwuid(statp->st_uid)) == NULL) + if (resolv == 0) { + pwd = NULL; + } else { +#ifdef HAVE_LIBCAPSICUM + if (cappwd != NULL) + pwd = cap_getpwuid(cappwd, statp->st_uid); + else +#endif + pwd = getpwuid(statp->st_uid); + } + if (pwd == NULL) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else printf("uid=\"%s\", ", pwd->pw_name); - if (resolv == 0 || (grp = getgrgid(statp->st_gid)) == NULL) + if (resolv == 0) { + grp = NULL; + } else { +#ifdef HAVE_LIBCAPSICUM + if (capgrp != NULL) + grp = cap_getgrgid(capgrp, statp->st_gid); + else +#endif + grp = getgrgid(statp->st_gid); + } + if (grp == NULL) printf("gid=%ju, ", (uintmax_t)statp->st_gid); else printf("gid=\"%s\", ", grp->gr_name); From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:12:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C14ED62F; Sun, 15 Dec 2013 23:12:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD7DA19DB; Sun, 15 Dec 2013 23:12:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNCgBd035100; Sun, 15 Dec 2013 23:12:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNCgjq035099; Sun, 15 Dec 2013 23:12:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152312.rBFNCgjq035099@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259435 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:12:42 -0000 Author: pjd Date: Sun Dec 15 23:12:42 2013 New Revision: 259435 URL: http://svnweb.freebsd.org/changeset/base/259435 Log: Forgot to regenerate after r257736. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:09:05 2013 (r259434) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:12:42 2013 (r259435) @@ -368,7 +368,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */ { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ + { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:14:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E604B778; Sun, 15 Dec 2013 23:14:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1F6619E3; Sun, 15 Dec 2013 23:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNERjF035380; Sun, 15 Dec 2013 23:14:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNERxD035379; Sun, 15 Dec 2013 23:14:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152314.rBFNERxD035379@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259436 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:14:28 -0000 Author: pjd Date: Sun Dec 15 23:14:27 2013 New Revision: 259436 URL: http://svnweb.freebsd.org/changeset/base/259436 Log: Allow for pselect(2) in capability mode. Noticed by: David Drysdale Modified: head/sys/kern/capabilities.conf Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Sun Dec 15 23:12:42 2013 (r259435) +++ head/sys/kern/capabilities.conf Sun Dec 15 23:14:27 2013 (r259436) @@ -559,10 +559,11 @@ sctp_generic_sendmsg_iov sctp_peeloff ## -## Allow select(2), which will be scoped by capability rights. +## Allow pselect(2) and select(2), which will be scoped by capability rights. ## ## XXXRW: But is it? ## +pselect select ## From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:15:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 647E68B7; Sun, 15 Dec 2013 23:15:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50F6919E8; Sun, 15 Dec 2013 23:15:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNFDe5035573; Sun, 15 Dec 2013 23:15:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNFDo9035572; Sun, 15 Dec 2013 23:15:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152315.rBFNFDo9035572@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259437 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:15:13 -0000 Author: pjd Date: Sun Dec 15 23:15:12 2013 New Revision: 259437 URL: http://svnweb.freebsd.org/changeset/base/259437 Log: Regenerate after r259436. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:14:27 2013 (r259436) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:15:12 2013 (r259437) @@ -556,7 +556,7 @@ struct sysent sysent[] = { { AS(pdkill_args), (sy_call_t *)sys_pdkill, AUE_PDKILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 519 = pdkill */ { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait4 */ - { AS(pselect_args), (sy_call_t *)sys_pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 522 = pselect */ + { AS(pselect_args), (sy_call_t *)sys_pselect, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 522 = pselect */ { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ { AS(rctl_get_racct_args), (sy_call_t *)sys_rctl_get_racct, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_racct */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:19:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B9F5A36; Sun, 15 Dec 2013 23:19:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77C9C19FB; Sun, 15 Dec 2013 23:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNJhFR036072; Sun, 15 Dec 2013 23:19:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNJhVM036071; Sun, 15 Dec 2013 23:19:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152319.rBFNJhVM036071@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259438 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:19:43 -0000 Author: pjd Date: Sun Dec 15 23:19:42 2013 New Revision: 259438 URL: http://svnweb.freebsd.org/changeset/base/259438 Log: Fix syscalls that can be loaded as kernel modules - they were not given the flag allowing to call them from capability mode sandbox. Noticed by: David Drysdale Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Sun Dec 15 23:15:12 2013 (r259437) +++ head/sys/kern/makesyscalls.sh Sun Dec 15 23:19:42 2013 (r259438) @@ -460,7 +460,7 @@ s/\$//g printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 if (flag("NOSTD")) { - printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT") > sysent + printf("lkmressys, AUE_NULL, NULL, 0, 0, %s, SY_THR_ABSENT },", flags) > sysent column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { if (funcname == "nosys" || funcname == "sysarch" || From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:20:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05956B8A; Sun, 15 Dec 2013 23:20:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9F671A06; Sun, 15 Dec 2013 23:20:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNKQM5038041; Sun, 15 Dec 2013 23:20:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNKQ9u038040; Sun, 15 Dec 2013 23:20:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152320.rBFNKQ9u038040@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259439 - 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:20:27 -0000 Author: pjd Date: Sun Dec 15 23:20:26 2013 New Revision: 259439 URL: http://svnweb.freebsd.org/changeset/base/259439 Log: Regenerate after r259438. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:19:42 2013 (r259438) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:20:26 2013 (r259439) @@ -289,9 +289,9 @@ struct sysent sysent[] = { { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 252 = openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ - { AS(aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 255 = aio_read */ - { AS(aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 256 = aio_write */ - { AS(lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 257 = lio_listio */ + { AS(aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 255 = aio_read */ + { AS(aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 256 = aio_write */ + { AS(lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 257 = lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 260 = nosys */ @@ -348,13 +348,13 @@ struct sysent sysent[] = { { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */ - { AS(aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 314 = aio_return */ - { AS(aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 315 = aio_suspend */ - { AS(aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 316 = aio_cancel */ - { AS(aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 317 = aio_error */ - { AS(oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 318 = oaio_read */ - { AS(oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 319 = oaio_write */ - { AS(olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 320 = olio_listio */ + { AS(aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 314 = aio_return */ + { AS(aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 315 = aio_suspend */ + { AS(aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 316 = aio_cancel */ + { AS(aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 317 = aio_error */ + { AS(oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 318 = oaio_read */ + { AS(oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 319 = oaio_write */ + { AS(olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 320 = olio_listio */ { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */ @@ -393,7 +393,7 @@ struct sysent sysent[] = { { AS(extattr_set_file_args), (sy_call_t *)sys_extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)sys_extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)sys_extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */ - { AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = aio_waitcomplete */ + { AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 359 = aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ @@ -492,14 +492,14 @@ struct sysent sysent[] = { { AS(thr_new_args), (sy_call_t *)sys_thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = thr_new */ { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */ { AS(kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = kmq_open */ - { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = kmq_setattr */ - { AS(kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = kmq_timedreceive */ - { AS(kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = kmq_timedsend */ - { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ + { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = kmq_setattr */ + { AS(kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 459 = kmq_timedreceive */ + { AS(kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 460 = kmq_timedsend */ + { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 461 = kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ - { AS(aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 465 = aio_fsync */ + { AS(aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 465 = aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 15 23:49:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99970892; Sun, 15 Dec 2013 23:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8562F1D3C; Sun, 15 Dec 2013 23:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNngra046917; Sun, 15 Dec 2013 23:49:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNng6r046916; Sun, 15 Dec 2013 23:49:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152349.rBFNng6r046916@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259440 - head/usr.bin/kdump 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.17 Precedence: list List-Id: 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, 15 Dec 2013 23:49:42 -0000 Author: pjd Date: Sun Dec 15 23:49:42 2013 New Revision: 259440 URL: http://svnweb.freebsd.org/changeset/base/259440 Log: Include bsd.own.mk for MK_CASPER to work. Reported by: nwhitehorn Modified: head/usr.bin/kdump/Makefile Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Sun Dec 15 23:20:26 2013 (r259439) +++ head/usr.bin/kdump/Makefile Sun Dec 15 23:49:42 2013 (r259440) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + .if (${MACHINE_ARCH} == "amd64") SFX= 32 .endif From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 00:50:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81FA1FD4; Mon, 16 Dec 2013 00:50:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5500A114D; Mon, 16 Dec 2013 00:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG0oFSI071412; Mon, 16 Dec 2013 00:50:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG0oFjY071411; Mon, 16 Dec 2013 00:50:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312160050.rBG0oFjY071411@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 16 Dec 2013 00:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259441 - 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.17 Precedence: list List-Id: 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, 16 Dec 2013 00:50:15 -0000 Author: marcel Date: Mon Dec 16 00:50:14 2013 New Revision: 259441 URL: http://svnweb.freebsd.org/changeset/base/259441 Log: Properly drain the TTY when both revoke(2) and close(2) end up closing the TTY. In such a case, ttydev_close() is called multiple times and each time, t_revokecnt is incremented and cv_broadcast() is called for both the t_outwait and t_inwait condition variables. Let's say revoke(2) comes in first and gets to call tty_drain() from ttydev_leave(). Let's say that the revoke comes from init(8) as the result of running "shutdown -r now". Since shutdown prints various messages to the console before announing that the machine will reboot immediately, let's also say that the output queue is not empty and that tty_drain() has something to do. Let's assume this all happens on a 9600 baud serial console, so it takes a time to drain. The shutdown command will exit(2) and as such will end up closing stdout. Let's say this close will come in second, bump t_revokecnt and call tty_wakeup(). This has tty_wait() return prematurely and the next thing that will happen is that the thread doing revoke(2) will flush the TTY. Since the drain wasn't complete, the flush will effectively drop whatever is left in t_outq. This change takes into account that tty_drain() will return ERESTART due to the fact that t_revokecnt was bumped and in that case simply call tty_drain() again. The thread in question is already performing the close so it can safely finish draining the TTY before destroying the TTY structure. Now all messages from shutdown will be printed on the serial console. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Dec 15 23:49:42 2013 (r259440) +++ head/sys/kern/tty.c Mon Dec 16 00:50:14 2013 (r259441) @@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) - tty_drain(tp); + if (!tty_gone(tp)) { + while (tty_drain(tp) == ERESTART) + ; + } ttydisc_close(tp); From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 01:58:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0BBDE9C; Mon, 16 Dec 2013 01:58:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2121546; Mon, 16 Dec 2013 01:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG1wC9Q094340; Mon, 16 Dec 2013 01:58:12 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG1wCBZ094339; Mon, 16 Dec 2013 01:58:12 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160158.rBG1wCBZ094339@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 01:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259446 - head/contrib/tzcode/stdtime 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.17 Precedence: list List-Id: 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, 16 Dec 2013 01:58:12 -0000 Author: bjk (doc committer) Date: Mon Dec 16 01:58:12 2013 New Revision: 259446 URL: http://svnweb.freebsd.org/changeset/base/259446 Log: tzfile.5: catch up to r204333 The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h is not an installed header, so the man page refers to its location in the source tree. The documentation could be more clear about the internal nature of the header, but those changes should go through upstream tzcode. PR: docs/176864 Approved by: hrs (mentor) Modified: head/contrib/tzcode/stdtime/tzfile.5 Modified: head/contrib/tzcode/stdtime/tzfile.5 ============================================================================== --- head/contrib/tzcode/stdtime/tzfile.5 Mon Dec 16 01:47:52 2013 (r259445) +++ head/contrib/tzcode/stdtime/tzfile.5 Mon Dec 16 01:58:12 2013 (r259446) @@ -6,7 +6,7 @@ .Nm tzfile .Nd timezone information .Sh SYNOPSIS -.Fd #include \&"/usr/src/lib/libc/stdtime/tzfile.h\&" +.Fd #include \&"/usr/src/contrib/tzcode/stdtime/tzfile.h\&" .Sh DESCRIPTION The time zone information files used by .Xr tzset 3 From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 10:50:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3222734F; Mon, 16 Dec 2013 10:50:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E74E1158; Mon, 16 Dec 2013 10:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGAoD79085135; Mon, 16 Dec 2013 10:50:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGAoDYk085134; Mon, 16 Dec 2013 10:50:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312161050.rBGAoDYk085134@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 10:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259462 - head/sys/dev/usb/controller 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.17 Precedence: list List-Id: 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, 16 Dec 2013 10:50:14 -0000 Author: hselasky Date: Mon Dec 16 10:50:13 2013 New Revision: 259462 URL: http://svnweb.freebsd.org/changeset/base/259462 Log: Fix regression issue after r259248: Some Intel XHCI controlles timeout processing so-called "TRBs" when the final LINK TRB of a so-called "TD" has the CHAIN-BIT set. MFC after: 1 week Tested by: glebius @ Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Dec 16 09:48:08 2013 (r259461) +++ head/sys/dev/usb/controller/xhci.c Mon Dec 16 10:50:13 2013 (r259462) @@ -1942,6 +1942,8 @@ restart: /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); + /* remove CHAIN-BIT from last LINK TRB */ + td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 11:04:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76F2A9CB; Mon, 16 Dec 2013 11:04:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6366C12A2; Mon, 16 Dec 2013 11:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGB40nV091816; Mon, 16 Dec 2013 11:04:00 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGB3xm4091806; Mon, 16 Dec 2013 11:03:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312161103.rBGB3xm4091806@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 16 Dec 2013 11:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259463 - in head/etc: defaults rc.d 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.17 Precedence: list List-Id: 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, 16 Dec 2013 11:04:00 -0000 Author: pjd Date: Mon Dec 16 11:03:59 2013 New Revision: 259463 URL: http://svnweb.freebsd.org/changeset/base/259463 Log: Start-up script for casperd daemon. Sponsored by: The FreeBSD Foundation Added: head/etc/rc.d/casperd (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Dec 16 10:50:13 2013 (r259462) +++ head/etc/defaults/rc.conf Mon Dec 16 11:03:59 2013 (r259463) @@ -658,6 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +casperd_enable="NO" # casperd(8) daemon ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Dec 16 10:50:13 2013 (r259462) +++ head/etc/rc.d/Makefile Mon Dec 16 11:03:59 2013 (r259463) @@ -26,6 +26,7 @@ FILES= DAEMON \ bridge \ bsnmpd \ ${_bthidd} \ + casperd \ ccd \ cleanvar \ cleartmp \ Added: head/etc/rc.d/casperd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/casperd Mon Dec 16 11:03:59 2013 (r259463) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: casperd +# REQUIRE: NETWORKING syslogd +# BEFORE: DAEMON +# KEYWORD: shutdown + +. /etc/rc.subr + +name="casperd" +rcvar="casperd_enable" +pidfile="/var/run/${name}.pid" +command="/sbin/${name}" + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 12:20:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50FFF1A4; Mon, 16 Dec 2013 12:20:20 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1C641ABD; Mon, 16 Dec 2013 12:20:19 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBGCK9Ig035890; Mon, 16 Dec 2013 14:20:09 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBGCK9Ig035890 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBGCK9F0035889; Mon, 16 Dec 2013 14:20:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Dec 2013 14:20:09 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r259422 - head/sys/conf Message-ID: <20131216122009.GR59496@kib.kiev.ua> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jLvNI2QOEej4S1S5" Content-Disposition: inline In-Reply-To: <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 12:20:20 -0000 --jLvNI2QOEej4S1S5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 15, 2013 at 10:33:47AM -0800, Rui Paulo wrote: > On 15 Dec 2013, at 10:13, Konstantin Belousov wrote: >=20 > > Author: kib > > Date: Sun Dec 15 18:13:42 2013 > > New Revision: 259422 > > URL: http://svnweb.freebsd.org/changeset/base/259422 > >=20 > > Log: > > Revert r259045. > >=20 > > It seems that clang miscompiles code related to UDP with -fno-strict-o= verflow. >=20 > Could you please file a bug report if you haven't already? I do not intend to do any further analysis of the issue. --jLvNI2QOEej4S1S5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSru/4AAoJEJDCuSvBvK1BWEQP/1XZk3H8Bqv++FwHoIOIwYs7 X475QgZd7ENEWMNxLuvWa2kccqbuGQVbTxcHGRlWLbTxFuEDEkNxGnEGTo5juim0 ZLjIlLBCrL7c2YPyEHYoYXSH/ghr7t7hOmICkcnQg3dVHy9cDj7Q7/qqP3zKasUQ 5yi4oF3cQNNZDqH2aqcHNagKAMB+2wzubq0ZA1XOejYGiHZgOPhG/2HSDbGHCSgp TdqH35f0OfHmUUU5YTJ9HurJS+9qEzQRic2Kh/TZaxpMzMgjaCa4yjKXMNFzk+4R Gk4+Bdi+8fJHRpctcWmGU2ZYAra1rz/AyWkgRjz8GpXYbs2cHjmCJ8hDpaRzTOTE 8nZ5FL3Y9Ghpu0tHBqyDusJiAHL0T08oJgxiM6F0x2XfNyGSwcPMtxIMm9pWWif1 cGuS1H0UpKONmmerVUvinhxRL31lzvTYyGzxBp8qiUDZQXQ3kDLFCfGm2aX/VIyK Ap0KECaDTib/i6WxV8XhIRdrCLe84ofsdTQpXoFlzrXTC2ySZcyGdVcOvzUfVf2q TyOhPMi3TzCr351J44dS5zCyKSQYCTtyQWzL121I89CsGZfjk4+4eKf6UwSgA0x8 VD/2uaTf4KXYcNcE6q+oe6m9Ovwe/89AypvKqbAsMY3MLOeIoKynt0hTqU9AGOTG /4r3BmSiih7JDhsv3nkh =GdOM -----END PGP SIGNATURE----- --jLvNI2QOEej4S1S5-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 13:32:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EE42583; Mon, 16 Dec 2013 13:32:47 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3E71047; Mon, 16 Dec 2013 13:32:47 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 112137E6A; Mon, 16 Dec 2013 13:32:40 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id E3A191D55; Mon, 16 Dec 2013 14:32:39 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312051650.26379.jhb@freebsd.org> <86a9g5uofn.fsf@nine.des.no> <201312131231.04749.jhb@freebsd.org> Date: Mon, 16 Dec 2013 14:32:39 +0100 In-Reply-To: <201312131231.04749.jhb@freebsd.org> (John Baldwin's message of "Fri, 13 Dec 2013 12:31:04 -0500") Message-ID: <86k3f4kjk8.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 13:32:47 -0000 John Baldwin writes: > Dag-Erling Sm=C3=B8rgrav writes: > > John Baldwin writes: > > > LINT64 is yet another kernel config covered by 'make tinderbox', > > > but not by the periodic tinderbox. It is probably worth adding to > > > the periodic tinderbox (someday it'd be nice if the two > > > tinderboxes built the same set of things). > > Some day it would be nice if people talked to me directly instead of > > sniping from the sidelines. > Ah, but when people have raised this exact issue before (that tcbuild > and 'make tinderbox' build different things), you have blown them off > repeatedly. I have no idea what tcbuild is. I blow people off when they complain that the tinderbox doesn't work exactly like 'make tinderbox' because it's not intended to. > > Oh, and 'make tinderbox' should die. > No, it is very developer friendly as it Just Works(tm) as a single > command from an existing source tree checkout. We already had 'make universe'. The story behind 'make tinderbox' is that Alfred threw a fit over a tinderbox breakage and insisted, despite being provided with ample proof to the contrary, that my tinderbox was a black box which nobody knew how worked and nobody could reproduce and that tinderbox reports were therefore worthless. He then proceeded to implement 'make tinderbox' purely to piss me off. It serves no other purpose and needs to die. > It also happens to build more of the tree than the periodic tinderbox > (by building more kernel configs, albeit doing quite a bit of > duplicate work for platforms like arm in the process). That's simply not true. The tinderbox builds exactly the same kernels as 'make tinderbox' if they're present. The issue here is that a bug in the source tree prevents some of these kernel configurations from being generated, hence the tinderbox cannot build them. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 13:52:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66CA1B4A; Mon, 16 Dec 2013 13:52:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5317211B4; Mon, 16 Dec 2013 13:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGDqJHk057197; Mon, 16 Dec 2013 13:52:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGDqJkX057196; Mon, 16 Dec 2013 13:52:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312161352.rBGDqJkX057196@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Dec 2013 13:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259464 - 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.17 Precedence: list List-Id: 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, 16 Dec 2013 13:52:19 -0000 Author: mav Date: Mon Dec 16 13:52:18 2013 New Revision: 259464 URL: http://svnweb.freebsd.org/changeset/base/259464 Log: Fix periodic per-CPU timers startup on boot. Reported by: neel MFC after: 2 weeks Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon Dec 16 11:03:59 2013 (r259463) +++ head/sys/kern/kern_clocksource.c Mon Dec 16 13:52:18 2013 (r259464) @@ -233,7 +233,8 @@ handleevents(sbintime_t now, int fake) if (!busy) { state->idle = 0; state->nextevent = t; - loadtimer(now, 0); + loadtimer(now, (fake == 2) && + (timer->et_flags & ET_FLAGS_PERCPU)); } ET_HW_UNLOCK(state); return (done); From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 15:51:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 105B2737; Mon, 16 Dec 2013 15:51:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0C621B4F; Mon, 16 Dec 2013 15:50:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGFoxf3001345; Mon, 16 Dec 2013 15:50:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGFox0N001344; Mon, 16 Dec 2013 15:50:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161550.rBGFox0N001344@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 15:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 15:51:00 -0000 Author: dteske Date: Mon Dec 16 15:50:59 2013 New Revision: 259468 URL: http://svnweb.freebsd.org/changeset/base/259468 Log: Add a fix for Long-standing problem with VMware. Described in below links: https://communities.vmware.com/thread/107230 https://communities.vmware.com/docs/DOC-11677 Basically, ignore the ``function 62'' and ``function 63'' interpretations of the left/right command key when we're in the lengthiest portion of the installation (initiated by the `auto' module). The net effect is that you can now (once you've started the installer from the media) escape the VM without prematurely terminating the current action due to spurious escape sequence. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 2013 (r259467) +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 2013 (r259468) @@ -49,6 +49,10 @@ error() { ############################################################ MAIN +# Don't send ESC on function-key 62/63 (left/right command key) +f_quietly kbdcontrol -f 62 '' +f_quietly kbdcontrol -f 63 '' + f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 15:52:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F49D96E; Mon, 16 Dec 2013 15:52:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC771C92; Mon, 16 Dec 2013 15:52:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGFqjJl001579; Mon, 16 Dec 2013 15:52:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGFqjrO001578; Mon, 16 Dec 2013 15:52:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161552.rBGFqjrO001578@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 15:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259469 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 15:52:45 -0000 Author: dteske Date: Mon Dec 16 15:52:44 2013 New Revision: 259469 URL: http://svnweb.freebsd.org/changeset/base/259469 Log: Mask error from newaliases(1) when the hostname is not fully qualified. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Mon Dec 16 15:50:59 2013 (r259468) +++ head/usr.sbin/bsdinstall/scripts/config Mon Dec 16 15:52:44 2013 (r259469) @@ -42,7 +42,7 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHR [ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/ # Set up other things from installed config -chroot $BSDINSTALL_CHROOT /usr/bin/newaliases +chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 ################################################################################ # END From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 16:06:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCE35E7E; Mon, 16 Dec 2013 16:06:34 +0000 (UTC) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 991C61D89; Mon, 16 Dec 2013 16:06:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXW00900PYUTA00@smtpauth4.wiscmail.wisc.edu>; Mon, 16 Dec 2013 10:06:27 -0600 (CST) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.16.155715, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXW0089IQ2QVA00@smtpauth4.wiscmail.wisc.edu>; Mon, 16 Dec 2013 10:06:27 -0600 (CST) Message-id: <52AF2502.1060503@freebsd.org> Date: Mon, 16 Dec 2013 10:06:26 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> In-reply-to: <201312161550.rBGFox0N001344@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 16:06:34 -0000 Please add this to release/rc.local instead under the console setup. There is no guarantee that "auto" is running from an environment where this is defined -- for example, it may be running from a serial console or an xterm -- and the actual installer should not be polluted with assumptions about the media from which it runs. -Nathan On 12/16/13 09:50, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 15:50:59 2013 > New Revision: 259468 > URL: http://svnweb.freebsd.org/changeset/base/259468 > > Log: > Add a fix for Long-standing problem with VMware. Described in below links: > https://communities.vmware.com/thread/107230 > https://communities.vmware.com/docs/DOC-11677 > > Basically, ignore the ``function 62'' and ``function 63'' interpretations > of the left/right command key when we're in the lengthiest portion of the > installation (initiated by the `auto' module). > > The net effect is that you can now (once you've started the installer from > the media) escape the VM without prematurely terminating the current action > due to spurious escape sequence. > > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/scripts/auto > > Modified: head/usr.sbin/bsdinstall/scripts/auto > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 2013 (r259467) > +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 2013 (r259468) > @@ -49,6 +49,10 @@ error() { > > ############################################################ MAIN > > +# Don't send ESC on function-key 62/63 (left/right command key) > +f_quietly kbdcontrol -f 62 '' > +f_quietly kbdcontrol -f 63 '' > + > f_dprintf "Began Installation at %s" "$( date )" > > rm -rf $BSDINSTALL_TMPETC From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 17:03:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C7E06C6; Mon, 16 Dec 2013 17:03:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5870F1352; Mon, 16 Dec 2013 17:03:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGH3jLk026245; Mon, 16 Dec 2013 17:03:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGH3jGV026244; Mon, 16 Dec 2013 17:03:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161703.rBGH3jGV026244@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 17:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259470 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 17:03:45 -0000 Author: dteske Date: Mon Dec 16 17:03:44 2013 New Revision: 259470 URL: http://svnweb.freebsd.org/changeset/base/259470 Log: As per discussions on -current, re-add /var/mail (removed in r257842) but this time with atime=on in support of various software that requires it. Discussed on: -current MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 15:52:44 2013 (r259469) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:03:44 2013 (r259470) @@ -132,6 +132,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /var mountpoint=/var /var/crash compression=lz4,exec=off,setuid=off /var/log compression=lz4,exec=off,setuid=off + /var/mail compression=lz4,atime=on /var/tmp compression=lz4,exec=on,setuid=off " # END-QUOTE From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 17:05:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1905839; Mon, 16 Dec 2013 17:05:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDD531362; Mon, 16 Dec 2013 17:05:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGH53BJ026443; Mon, 16 Dec 2013 17:05:03 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGH53e2026442; Mon, 16 Dec 2013 17:05:03 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312161705.rBGH53e2026442@svn.freebsd.org> From: Bryan Drewery Date: Mon, 16 Dec 2013 17:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259471 - head/share/misc 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.17 Precedence: list List-Id: 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, 16 Dec 2013 17:05:03 -0000 Author: bdrewery Date: Mon Dec 16 17:05:03 2013 New Revision: 259471 URL: http://svnweb.freebsd.org/changeset/base/259471 Log: Add myself to the src-committers list Approved by: bapt (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Dec 16 17:03:44 2013 (r259470) +++ head/share/misc/committers-src.dot Mon Dec 16 17:05:03 2013 (r259471) @@ -114,6 +114,7 @@ art [label="Artem Belevich\nart@FreeBSD. asomers [label="Alan Somers\nasomers@FreeBSD.org\n2013/04/24"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] +bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] @@ -331,6 +332,8 @@ avg -> art avg -> pluknet avg -> smh +bapt -> bdrewery + benno -> grehan billf -> dougb From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 17:11:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFCDAA4C; Mon, 16 Dec 2013 17:11:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1B113DB; Mon, 16 Dec 2013 17:11:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGHB9Mo029657; Mon, 16 Dec 2013 17:11:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGHB9TN029656; Mon, 16 Dec 2013 17:11:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161711.rBGHB9TN029656@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259472 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 17:11:09 -0000 Author: dteske Date: Mon Dec 16 17:11:09 2013 New Revision: 259472 URL: http://svnweb.freebsd.org/changeset/base/259472 Log: Accept NULL input as also meaning zero swap. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:05:03 2013 (r259471) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:11:09 2013 (r259472) @@ -1387,7 +1387,7 @@ while :; do f_dialog_input input \ "$msg_please_enter_amount_of_swap_space" \ "$ZFSBOOT_SWAP_SIZE" && - ZFSBOOT_SWAP_SIZE="$input" + ZFSBOOT_SWAP_SIZE="${input:-0}" ;; esac done From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 18:45:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F6527E6; Mon, 16 Dec 2013 18:45:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED11C1E9B; Mon, 16 Dec 2013 18:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGIjNBr065612; Mon, 16 Dec 2013 18:45:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGIjLeF065600; Mon, 16 Dec 2013 18:45:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312161845.rBGIjLeF065600@svn.freebsd.org> From: Dimitry Andric Date: Mon, 16 Dec 2013 18:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259473 - in head: lib/clang lib/clang/include lib/clang/include/llvm/Config lib/clang/libllvmpowerpcasmparser usr.bin/clang/clang usr.bin/clang/llc usr.bin/clang/lldb usr.bin/clang/llv... 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.17 Precedence: list List-Id: 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, 16 Dec 2013 18:45:24 -0000 Author: dim Date: Mon Dec 16 18:45:21 2013 New Revision: 259473 URL: http://svnweb.freebsd.org/changeset/base/259473 Log: Enable llvm's integrated assembler for PowerPC, since it should now be good enough for typical usage. Requested by: rdivacky MFC after: 1 week Added: head/lib/clang/include/PPCGenAsmMatcher.inc (contents, props changed) head/lib/clang/libllvmpowerpcasmparser/ head/lib/clang/libllvmpowerpcasmparser/Makefile (contents, props changed) Modified: head/lib/clang/Makefile head/lib/clang/include/llvm/Config/AsmParsers.def head/usr.bin/clang/clang/Makefile head/usr.bin/clang/llc/Makefile head/usr.bin/clang/lldb/Makefile head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/lib/clang/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -74,6 +74,7 @@ SUBDIR= libclanganalysis \ libllvmmipsdisassembler \ libllvmmipsinfo \ libllvmmipsinstprinter \ + libllvmpowerpcasmparser \ libllvmpowerpccodegen \ libllvmpowerpcdesc \ libllvmpowerpcinfo \ Added: head/lib/clang/include/PPCGenAsmMatcher.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenAsmMatcher.inc Mon Dec 16 18:45:21 2013 (r259473) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenAsmMatcher.inc.h" Modified: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmParsers.def Mon Dec 16 17:11:09 2013 (r259472) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Mon Dec 16 18:45:21 2013 (r259473) @@ -2,6 +2,7 @@ LLVM_ASM_PARSER(ARM) LLVM_ASM_PARSER(Mips) +LLVM_ASM_PARSER(PowerPC) LLVM_ASM_PARSER(X86) #undef LLVM_ASM_PARSER Added: head/lib/clang/libllvmpowerpcasmparser/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmpowerpcasmparser/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +LIB= llvmpowerpcasmparser + +SRCDIR= lib/Target/PowerPC/AsmParser +INCDIR= lib/Target/PowerPC +SRCS= PPCAsmParser.cpp + +TGHDRS= PPCGenAsmMatcher \ + PPCGenInstrInfo \ + PPCGenRegisterInfo \ + PPCGenSubtargetInfo + +.include "../clang.lib.mk" Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/clang/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -85,8 +85,9 @@ LIBDEPS=clangfrontendtool \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llc/Makefile ============================================================================== --- head/usr.bin/clang/llc/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llc/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -24,8 +24,9 @@ LIBDEPS=llvmirreader \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/lldb/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -106,6 +106,7 @@ LIBDEPS=\ llvmmipsinstprinter \ llvmpowerpcdesc \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ llvmruntimedyld \ llvmvectorize \ llvmx86desc \ Modified: head/usr.bin/clang/llvm-mc/Makefile ============================================================================== --- head/usr.bin/clang/llvm-mc/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-mc/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -24,8 +24,9 @@ LIBDEPS=llvmmcdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llvm-objdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-objdump/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-objdump/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -30,8 +30,9 @@ LIBDEPS=llvmmcdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llvm-rtdyld/Makefile ============================================================================== --- head/usr.bin/clang/llvm-rtdyld/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-rtdyld/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -28,8 +28,9 @@ LIBDEPS=llvmdebuginfo \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/opt/Makefile ============================================================================== --- head/usr.bin/clang/opt/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/opt/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -25,8 +25,9 @@ LIBDEPS=llvmarmdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 18:53:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37316DB6; Mon, 16 Dec 2013 18:53:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22FC91F58; Mon, 16 Dec 2013 18:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGIrA2e068804; Mon, 16 Dec 2013 18:53:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGIrAvu068803; Mon, 16 Dec 2013 18:53:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161853.rBGIrAvu068803@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 18:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259474 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 18:53:10 -0000 Author: dteske Date: Mon Dec 16 18:53:09 2013 New Revision: 259474 URL: http://svnweb.freebsd.org/changeset/base/259474 Log: Bug-fixes and debugging improvments: + De-obfuscate debugging to show actual values + Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax] + Log commands that were previously quiet + Added some new comemnts and updated some existing ones + Add missing local for `disk' used in zfs_create_boot() + Use $disks instead of multiply-expanding $* in zfs_create_boot() + Pedantically unset variable holding geli(8) passphrase after use + Pedantically add double-quotes around zpool names and zfs datasets + Fix quotation expansion for zpool_cache entries of loader.conf(5) + Some limited whitespace changes MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 18:45:21 2013 (r259473) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 18:53:09 2013 (r259474) @@ -156,8 +156,10 @@ CHMOD_MODE='chmod %s "%s"' DD_WITH_OPTIONS='dd if="%s" of="%s" %s' ECHO_APPEND='echo "%s" >> "%s"' GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_DETACH_F='geli detach -f "%s"' GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' GNOP_CREATE='gnop create -S 4096 "%s"' +GNOP_DESTROY='gnop destroy "%s"' GPART_ADD='gpart add -t %s "%s"' GPART_ADD_INDEX='gpart add -i %s -t %s "%s"' GPART_ADD_INDEX_WITH_SIZE='gpart add -i %s -t %s -s %s "%s"' @@ -166,19 +168,23 @@ GPART_ADD_LABEL_WITH_SIZE='gpart add -l GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' +GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' +GRAID_DELETE='graid delete "%s"' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' +ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' ZPOOL_SET='zpool set %s "%s"' # @@ -612,6 +618,8 @@ dialog_menu_layout() # replacement drivers do not have the exact same sector counts. # # NOTE: The MBR layout is more complicated (GPT is preferred). +# NOTE: $swapsize and $gelisize should be defined by the calling function. +# NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { @@ -664,13 +672,13 @@ zfs_create_diskpart() # NOTE: Failure is ok here, blank disk will have nothing to destroy. # f_dprintf "$funcname: Destroying all data/layouts on \`%s'..." "$disk" - f_quietly gpart destroy -F $disk - f_quietly graid destroy $disk - f_quietly zpool labelclear -f /dev/$disk # Kill it with fire + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk + f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" /dev/$disk # Make doubly-sure backup GPT is destroyed - f_quietly gpart create -s gpt $disk - f_quietly gpart destroy -F $disk + f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk # Calculate partition size given desired amount of swap f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" @@ -694,36 +702,35 @@ zfs_create_diskpart() # # 1. Create GPT layout using labels # - f_eval_catch $funcname gpart "$GPART_CREATE" gpt \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" gpt $disk || return $FAILURE # # 2. Add small freebsd-boot partition labeled `boot#' # f_eval_catch $funcname gpart "$GPART_ADD_LABEL_WITH_SIZE" \ - gptboot\$index freebsd-boot 512k \$disk || + gptboot$index freebsd-boot 512k $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 \$disk || + /boot/pmbr /boot/gptzfsboot 1 $disk || return $FAILURE - # zpool will use the `zfs#' GPT labels + # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 # Change things around if we are using geli(8) if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then bootpart=p2 targetpart=p3 partsize=$(( $partsize - $gelisize )) - f_dprintf "$funcname: gelisize=[%s]" \ - "gelisize=[$gelisize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" boot\$index \ - freebsd-zfs \${gelisize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ + freebsd-zfs ${gelisize}b $disk || return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + f_eval_catch -d $funcname geli "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # @@ -731,30 +738,29 @@ zfs_create_diskpart() # NOTE: Using above calculated partsize to leave room for swap. # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: partsize=[%s]" \ - "partsize=[$partsize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs\$index \ - freebsd-zfs \${partsize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" zfs$index \ + freebsd-zfs ${partsize}b $disk || return $FAILURE else f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs\$index freebsd-zfs \$disk || + zfs$index freebsd-zfs $disk || return $FAILURE fi - f_quietly zpool labelclear -f "/dev/$disk$targetpart" + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # # 4. Add freebsd-swap partition labeled `swap#' # if [ $swapsize -gt 0 ]; then f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap\$index freebsd-swap \$disk || + swap$index freebsd-swap $disk || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap\$index none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/gpt/swap$index none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi ;; @@ -763,25 +769,28 @@ zfs_create_diskpart() # # 1. Create MBR layout (no labels) # - f_eval_catch $funcname gpart "$GPART_CREATE" mbr \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" mbr $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE" /boot/mbr \ - \$disk || return $FAILURE + $disk || return $FAILURE # # 2. Add freebsd slice with all available space # - f_eval_catch $funcname gpart "$GPART_ADD" freebsd \$disk || + f_eval_catch $funcname gpart "$GPART_ADD" freebsd $disk || return $FAILURE - f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 \$disk || + f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 $disk || return $FAILURE - f_quietly zpool labelclear -f /dev/${disk}s1 # Pedantic - f_quietly gpart destroy -F ${disk}s1 # Pedantic + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1 + # Pedantically nuke any old scheme + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" ${disk}s1 # # 3. Write BSD scheme to the freebsd slice # - f_eval_catch $funcname gpart "$GPART_CREATE" BSD \${disk}s1 || + f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE # zpool will use s1a (no labels) @@ -792,15 +801,17 @@ zfs_create_diskpart() bootpart=s1a targetpart=s1d partsize=$(( $partsize - $gelisize )) mbrindex=4 # If this is s1a then make the zpool s1d - f_dprintf "$funcname: mbrindex=[%s] gelisize=[%s]" \ - "$mbrindex" "$gelisize" f_eval_catch $funcname gpart \ "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs \${gelisize}b \${disk}s1 || + 1 freebsd-zfs ${gelisize}b ${disk}s1 || return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # @@ -808,19 +819,17 @@ zfs_create_diskpart() # NOTE: Using above calculated partsize to leave room for swap. # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: mbrindex=[%s] partsize=[%s]" \ - "$mbrindex" "$partsize" f_eval_catch $funcname gpart \ "$GPART_ADD_INDEX_WITH_SIZE" \ - \$mbrindex freebsd-zfs \${partsize}b \ - \${disk}s1 || return $FAILURE + $mbrindex freebsd-zfs ${partsize}b \ + ${disk}s1 || return $FAILURE else - f_dprintf "$funcname: mbrindex=[%s]" "$mbrindex" f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - \$mbrindex freebsd-zfs \${disk}s1 || + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE fi - f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic # # 5. Add freebsd-swap partition @@ -831,8 +840,8 @@ zfs_create_diskpart() return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/\${disk}s1b none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/${disk}s1b none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi ;; @@ -852,13 +861,13 @@ zfs_create_boot() local funcname=zfs_create_boot local poolname="$1" vdev_type="$2" local bootpart targetpart + shift 2 # poolname vdev_type + local disks="$*" disk + local bootpart targetpart # Set by zfs_create_diskpart() below - shift 2 # name vdev_type - - # We may need this later - local disks="$*" - + # # Pedantic checks; should never be seen + # if [ ! "$poolname" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ @@ -874,16 +883,19 @@ zfs_create_boot() f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ "$poolname" "$vdev_type" + # # Initialize fstab(5) + # f_dprintf "$funcname: Initializing temporary fstab(5) file..." - f_eval_catch $funcname sh \ - "$SHELL_TRUNCATE" \$BSDINSTALL_TMPETC/fstab || + f_eval_catch $funcname sh "$SHELL_TRUNCATE" $BSDINSTALL_TMPETC/fstab || return $FAILURE f_eval_catch $funcname printf "$PRINTF_FSTAB" \ "# Device" Mountpoint FStype Options Dump "Pass#" \ - \$BSDINSTALL_TMPETC/fstab || return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE + # # Expand SI units in desired sizes + # f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." local swapsize gelisize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then @@ -904,23 +916,24 @@ zfs_create_boot() f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + # # Prepare the disks + # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." local n=0 - for disk in $*; do + for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE n=$(( $n + 1 )) done + # Now $bootpart and $targetpart are set (suffix for $disk) # MBR boot loader hack part 1 # We have to do this early because geli gets in the way later if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Copying MBR boot loader to disks..." - f_dprintf "$funcname: disks=[%s]" "$disks" for disk in $disks; do - f_dprintf "$funcname: disk=[%s]" "$disk" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\${disk}s1 count=1 || + /boot/zfsboot /dev/${disk}s1 count=1 || return $FAILURE done fi @@ -935,12 +948,9 @@ zfs_create_boot() [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - f_dprintf "$funcname: *=[%s]" "$*" - for disk in $*; do - f_dprintf "$funcname: disk=[%s] part=[%s]" \ - "$disk" "$part" + for disk in $disks; do f_eval_catch $funcname gnop "$GNOP_CREATE" \ - \$disk\$part || return $FAILURE + $disk$part || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then unenc_list="$unenc_list $disk$part.nop" else @@ -950,7 +960,7 @@ zfs_create_boot() set -- $new_list else local new_list= - for disk in $*; do + for disk in $disks; do new_list="$new_list $disk$targetpart" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && unenc_list="$unenc_list $disk$bootpart" @@ -969,34 +979,30 @@ zfs_create_boot() f_dprintf "$funcname: Setting up disk encryption..." # Create the parent directories for our unencrypted pool - f_quietly umount /mnt + f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ - \$BSDINSTALL_CHROOT || return $FAILURE + $BSDINSTALL_CHROOT || return $FAILURE # Create mirror across the unencrypted partition on all disks [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror - f_dprintf "$funcname: %s %s %s" \ - "ZFSBOOT_GELI_POOL_NAME=[$ZFSBOOT_GELI_POOL_NAME]" \ - "bootvdev=[$bootvdev]" "unenc_list=[$unenc_list]" - options="-o altroot=\"\$BSDINSTALL_CHROOT\"" - options="$options -m \"/\$ZFSBOOT_GELI_POOL_NAME\"" - options="$options -f" + options="-o altroot=$BSDINSTALL_CHROOT" + options="$options -m \"/$ZFSBOOT_GELI_POOL_NAME\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" \$ZFSBOOT_GELI_POOL_NAME \$bootvdev \ + "$options" "$ZFSBOOT_GELI_POOL_NAME" $bootvdev \ \$unenc_list || return $FAILURE - f_dprintf "$funcname: geli_pool=[%s]" "$geli_pool" - f_eval_catch $funcname mkdir "$MKDIR_P" \$geli_pool/boot || + f_eval_catch $funcname mkdir "$MKDIR_P" $geli_pool/boot || return $FAILURE # Generate an encryption key using random(4) - f_dprintf "$funcname: key=[%s]" "$key" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random \$geli_pool/\$key "bs=4096 count=1" || + /dev/random $geli_pool/$key "bs=4096 count=1" || return $FAILURE + # # Create the geli(8) GEOMS + # local geli_list if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password @@ -1005,53 +1011,55 @@ zfs_create_boot() f_show_err "$msg_user_cancelled" return $FAILURE fi - f_dprintf "$funcname: disks=[%s]" "$disks" + + # Initialize geli(8) on each of the target partitions for disk in $disks; do - f_dprintf "$funcname: disk=[%s] targetpart=[%s]" \ - "$disk" "$targetpart" f_dialog_info "$msg_geli_setup" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_PASSWORD_INIT" \ - \$geli_pool/boot/\$disk\$targetpart.eli \ - AES-XTS \$geli_pool/\$key \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_PASSWORD_INIT" \ + "$geli_pool/boot/$disk$targetpart.eli" \ + AES-XTS "$geli_pool/$key" \ + $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_ATTACH" \$geli_pool/\$key \ - \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH" \ + "$geli_pool/\$key" $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi geli_list="$geli_list $disk$targetpart.eli" done + unset pw_password # Sensitive info set -- $geli_list + + # Clean up f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE - f_quietly umount /mnt # done with tmpfs + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # - # Create the ZFS pool with desired type and disk devices + # Create the ZFS root pool with desired type and disk devices # local vdevs="$*" f_dprintf "$funcname: Creating boot pool..." - f_dprintf "poolname=[%s] vdev_type=[%s] vdevs=[%s]" \ - "$poolname" "$vdev_type" "$vdevs" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\" -m none -f" \ - \$poolname \$vdev_type \$vdevs + "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + $poolname $vdev_type $vdevs # Customize the zpool a bit... local option f_dprintf "$funcname: Setting miscellaneous options on boot pool..." for option in checksum=fletcher4 atime=off; do - f_dprintf "$funcname: option=[%s]" "$option" - f_eval_catch $funcname zfs "$ZFS_SET" \$option \$poolname || - return $FAILURE + f_eval_catch $funcname zfs "$ZFS_SET" $option "$poolname" || + return $FAILURE done # @@ -1074,10 +1082,8 @@ zfs_create_boot() # Replace both commas and spaces with ` -o ' f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options - f_dprintf "$funcname: dataset=[%s] options=[%s]" \ - "$dataset" "$options" f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "\${options:+-o \$options}" \$poolname\$dataset || + "${options:+-o $options}" "$poolname$dataset" || return $FAILURE done @@ -1085,57 +1091,52 @@ zfs_create_boot() f_dprintf "$funcname: Modifying directory permissions..." local dir for dir in /tmp /var/tmp; do - f_dprintf "$funcname: dir=[%s]" "$dir" f_eval_catch $funcname chmod "$CHMOD_MODE" 1777 \ - \$BSDINSTALL_CHROOTDIR\$dir || return $FAILURE + $BSDINSTALL_CHROOTDIR$dir || return $FAILURE done # Create symlink(s) if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_dprintf "$funcname: Creating /boot symlink for GELI..." f_eval_catch $funcname ln "$LN_SF" \ - \$ZFSBOOT_GELI_POOL_NAME/boot \ - \$BSDINSTALL_CHROOT/boot || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME/boot" \ + $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property f_dprintf "$funcname: Setting bootfs property..." - f_dprintf "$funcname: %s %s" \ - "ZFSBOOT_BEROOT_NAME=[$ZFSBOOT_BEROOT_NAME]" \ - "ZFSBOOT_BOOTFS_NAME=[$ZFSBOOT_BOOTFS_NAME]" f_eval_catch $funcname zpool "$ZPOOL_SET" \ - bootfs=\"\$poolname/\$ZFSBOOT_BEROOT_NAME/\$ZFSBOOT_BOOTFS_NAME\" \ - \$poolname || return $FAILURE + "bootfs=\"$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ + "$poolname" || return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \$poolname || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$poolname" || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_quietly gnop destroy $disk$bootpart.nop + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$bootpart.nop else - f_quietly gnop destroy $disk$targetpart.nop + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$targetpart.nop fi done # MBR boot loader hack part 2 if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." - f_dprintf "$funcname: disks=[%s]" # Stick the ZFS boot loader in the "convienient hole" after # the ZFS internal metadata for disk in $disks; do - f_dprintf "$funcname: disk=[%s] bootpart=[%s]" \ - "$disk" "$bootpart" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\$disk\$bootpart \ + /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done fi @@ -1143,42 +1144,42 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \$poolname || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$poolname" || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR f_dprintf "$funcname: Configuring zpool.cache..." - f_eval_catch $funcname mkdir "$MKDIR_P" \$BSDINSTALL_CHROOT/boot/zfs || + f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ - cachefile=\"\$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\" \ - \$poolname || return $FAILURE + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$poolname" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ "$funcname" f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_enable=\"YES\"' \ - \$BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE + $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE # We're all done unless we should go on to do encryption [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # Some additional geli(8) requirements for loader.conf(5) for option in \ - zpool_cache_load=\"YES\" \ - zpool_cache_type=\"/boot/zfs/zpool.cache\" \ - zpool_cache_name=\"/boot/zfs/zpool.cache\" \ + 'zpool_cache_load=\"YES\"' \ + 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ + 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ ; do - f_eval_catch $funcname echo "$ECHO_APPEND" \$option \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || + f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done @@ -1187,30 +1188,26 @@ zfs_create_boot() # f_dprintf "$funcname: Configuring disk encryption..." f_eval_catch $funcname echo "$ECHO_APPEND" 'aesni_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - f_dprintf "$funcname: disks=[%s]" "$disks" + "\"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE for disk in $disks; do - f_dprintf "$funcname: %s %s %s" \ - "disk=[$disk]" "targetpart=[$targetpart]" \ - "ZFSBOOT_GELI_KEY_FILE=[$ZFSBOOT_GELI_KEY_FILE]" f_eval_catch $funcname printf "$PRINTF_CONF" \ - geli_%s_keyfile0_load '"$disk$targetpart" YES' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + geli_%s_keyfile0_load "$disk$targetpart YES" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart $disk$targetpart:geli_keyfile0" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_name \ - '"$disk$targetpart" "$ZFSBOOT_GELI_KEY_FILE"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart \"$ZFSBOOT_GELI_KEY_FILE\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE done @@ -1259,7 +1256,7 @@ f_dialog_backtitle "$msg_freebsd_install # f_dprintf "BSDINSTALL_CHROOT=[%s]" "$BSDINSTALL_CHROOT" f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC" -f_dprintf "PRINTF_FSTAB=[%s]" "$PRINTF_FSTAB" +f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # # Loop over the main menu until we've accomplished what we came here to do From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:31:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F448B43; Mon, 16 Dec 2013 19:31:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61C4011FF; Mon, 16 Dec 2013 19:31:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJVOXF083410; Mon, 16 Dec 2013 19:31:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJVOhs083409; Mon, 16 Dec 2013 19:31:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312161931.rBGJVOhs083409@svn.freebsd.org> From: Adrian Chadd Date: Mon, 16 Dec 2013 19:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259475 - 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:31:24 -0000 Author: adrian Date: Mon Dec 16 19:31:23 2013 New Revision: 259475 URL: http://svnweb.freebsd.org/changeset/base/259475 Log: Migrate the sendfile_sync struct to use a UMA zone rather than M_TEMP. This allows it to be better tracked as well as being able to leverage UMA for more interesting/useful behaviour at a later date. Sponsored by: Netflix, Inc. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 (r259474) +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 (r259475) @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#include +#include +#include #include #include @@ -130,6 +133,7 @@ static int sfreadahead = 1; SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); +static uma_zone_t zone_sfsync; static void sfstat_init(const void *unused) @@ -140,6 +144,22 @@ sfstat_init(const void *unused) } SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); +static void +sf_sync_init(const void *unused) +{ + + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), + NULL, NULL, +#ifdef INVARIANTS + trash_init, trash_fini, +#else + NULL, NULL, +#endif + UMA_ALIGN_CACHE, + 0); +} +SYSINIT(sf_sync, SI_SUB_MBUF, SI_ORDER_FIRST, sf_sync_init, NULL); + static int sfstat_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1898,7 +1918,7 @@ sf_sync_alloc(uint32_t flags) { struct sendfile_sync *sfs; - sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); + sfs = uma_zalloc(zone_sfsync, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); sfs->flags = flags; @@ -1953,7 +1973,7 @@ sf_sync_free(struct sendfile_sync *sfs) KASSERT(sfs->count == 0, ("sendfile sync still busy")); cv_destroy(&sfs->cv); mtx_destroy(&sfs->mtx); - free(sfs, M_TEMP); + uma_zfree(zone_sfsync, sfs); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:37:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6B7BF23; Mon, 16 Dec 2013 19:37:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D20BE1262; Mon, 16 Dec 2013 19:37:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJbF2C084151; Mon, 16 Dec 2013 19:37:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJbFn9084150; Mon, 16 Dec 2013 19:37:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161937.rBGJbFn9084150@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259476 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:37:16 -0000 Author: dteske Date: Mon Dec 16 19:37:15 2013 New Revision: 259476 URL: http://svnweb.freebsd.org/changeset/base/259476 Log: Improve default ZFS disk layout (tested): + For GPT, always provision zfs# partition after swap [for resizability] + For MBR, always use a boot pool to relialy place root vdevs at EOD NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less) + Generalize boot pool logic so it can be used for any scheme (namely MBR) + Update existing comments and some whitespace fixes + Change some variable names to make reading/debugging the code easier in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property) + Because zroot vdevs are at EOD, no longer need to calculate partsize (vdev consumes remaining space after allocating swap) + Optimize processing of disks -- no reason to loop over the disks 3-4 separate times when we can logically use a single loop to do everything Discussed on: -stable MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:31:23 2013 (r259475) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:37:15 2013 (r259476) @@ -66,23 +66,30 @@ f_include $BSDCFG_SHARE/variable.subr # # Should we use geli(8) to encrypt the drives? +# NB: Automatically enables ZFSBOOT_BOOT_POOL # : ${ZFSBOOT_GELI_ENCRYPTION=} # -# Default name the unencrypted pool when using geli(8) to encrypt the drives +# Default path to the geli(8) keyfile used in drive encryption # -: ${ZFSBOOT_GELI_POOL_NAME:=bootpool} +: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} # -# Default size for the unencrypted boot pool when using geli(8) +# Create a separate boot pool? +# NB: Automatically set when using geli(8) or MBR # -: ${ZFSBOOT_GELI_BOOT_SIZE:=2g} +: ${ZFSBOOT_BOOT_POOL=} # -# Default path to the geli(8) keyfile used in drive encryption +# Default name for boot pool when enabled (e.g., geli(8) or MBR) # -: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} +: ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} + +# +# Default size for boot pool when enabled (e.g., geli(8) or MBR) +# +: ${ZFSBOOT_BOOT_POOL_SIZE:=2g} # # Default disks to use (always empty unless being scripted) @@ -212,8 +219,8 @@ msg_geli_setup="Initializing encryption msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" +msg_invalid_boot_pool_size="Invalid boot pool size \`%s'" msg_invalid_disk_argument="Invalid disk argument \`%s'" -msg_invalid_geli_boot_size="Invalid geli(8) boot size \`%s'" msg_invalid_index_argument="Invalid index argument \`%s'" msg_invalid_swap_size="Invalid swap size \`%s'" msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" @@ -617,15 +624,13 @@ dialog_menu_layout() # so we can have some real swap. This also provides wiggle room incase your # replacement drivers do not have the exact same sector counts. # -# NOTE: The MBR layout is more complicated (GPT is preferred). -# NOTE: $swapsize and $gelisize should be defined by the calling function. +# NOTE: $swapsize and $bootsize should be defined by the calling function. # NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" - local disksize partsize # Check arguments if [ ! "$disk" ]; then @@ -680,18 +685,10 @@ zfs_create_diskpart() f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk - # Calculate partition size given desired amount of swap - f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" - if ! device_$disk get capacity disksize; then - f_dprintf "$funcname: Unable to get disk capacity of \`%s'" \ - "$disk" - msg_error="$msg_error: $funcname" \ - f_show_err "$msg_unable_to_get_disk_capacity" "$disk" - return $FAILURE - fi - partsize=$(( $disksize - $swapsize )) - f_dprintf "$funcname: disksize=[%s] partsize=[%s]" \ - "$disksize" "$partsize" + # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 # # Lay down the desired type of partition scheme @@ -717,45 +714,36 @@ zfs_create_diskpart() # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 + [ ${swapsize:-0} -gt 0 ] && targetpart=p3 - # Change things around if we are using geli(8) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # + # Prepare boot pool if enabled (e.g., for geli(8)) + # + if [ "$ZFSBOOT_BOOT_POOL" ]; then bootpart=p2 targetpart=p3 - partsize=$(( $partsize - $gelisize )) + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ - freebsd-zfs ${gelisize}b $disk || + freebsd-zfs ${bootsize}b $disk || return $FAILURE - # Pedantically nuke any old labels, stop geli + # Pedantically nuke any old labels f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/$disk$bootpart - f_eval_catch -d $funcname geli "$GELI_DETACH_F" \ - /dev/$disk$targetpart + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart + fi fi # - # 3. Add freebsd-zfs partition labeled `zfs#' for zpool - # NOTE: Using above calculated partsize to leave room for swap. + # 3. Add freebsd-swap partition labeled `swap#' # if [ ${swapsize:-0} -gt 0 ]; then f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs$index \ - freebsd-zfs ${partsize}b $disk || - return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs$index freebsd-zfs $disk || - return $FAILURE - fi - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$targetpart - - # - # 4. Add freebsd-swap partition labeled `swap#' - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap$index freebsd-swap $disk || + "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ + freebsd-swap ${swapsize}b $disk || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ @@ -763,6 +751,14 @@ zfs_create_diskpart() $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 4. Add freebsd-zfs partition labeled `zfs#' for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ + zfs$index freebsd-zfs $disk || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart ;; MBR) f_dprintf "$funcname: Creating MBR layout..." @@ -793,21 +789,21 @@ zfs_create_diskpart() f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE - # zpool will use s1a (no labels) - bootpart=s1a targetpart=s1a mbrindex=1 + # NB: zpool will use s1a (no labels) + bootpart=s1a targetpart=s1d mbrindex=4 - # Change things around if we are using geli(8) + # + # Always prepare a boot pool on MBR + # + ZFSBOOT_BOOT_POOL=1 + f_eval_catch $funcname gpart \ + "$GPART_ADD_INDEX_WITH_SIZE" \ + 1 freebsd-zfs ${bootsize}b ${disk}s1 || + return $FAILURE + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - bootpart=s1a targetpart=s1d - partsize=$(( $partsize - $gelisize )) - mbrindex=4 # If this is s1a then make the zpool s1d - f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs ${gelisize}b ${disk}s1 || - return $FAILURE - # Pedantically nuke any old labels - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$bootpart # Pedantically detach targetpart for later f_eval_catch -d $funcname geli \ "$GELI_DETACH_F" \ @@ -815,28 +811,12 @@ zfs_create_diskpart() fi # - # 4. Partition the BSD slice for ZFS - # NOTE: Using above calculated partsize to leave room for swap. + # 4. Add freebsd-swap partition # if [ ${swapsize:-0} -gt 0 ]; then f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - $mbrindex freebsd-zfs ${partsize}b \ - ${disk}s1 || return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - $mbrindex freebsd-zfs ${disk}s1 || - return $FAILURE - fi - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$targetpart # Pedantic - - # - # 5. Add freebsd-swap partition - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - 2 freebsd-swap \${disk}s1 || + "$GPART_ADD_INDEX_WITH_SIZE" 2 \ + freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ @@ -844,6 +824,17 @@ zfs_create_diskpart() $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 5. Add freebsd-zfs partition for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /boot/zfsboot /dev/${disk}s1 count=1 || + return $FAILURE ;; esac # $ZFSBOOT_PARTITION_SCHEME @@ -859,8 +850,10 @@ zfs_create_diskpart() zfs_create_boot() { local funcname=zfs_create_boot - local poolname="$1" vdev_type="$2" - local bootpart targetpart + local zroot_name="$1" + local zroot_vdevtype="$2" + local zroot_vdevs= # Calculated below + local boot_vdevs= # Used for geli(8) and/or MBR layouts shift 2 # poolname vdev_type local disks="$*" disk local bootpart targetpart # Set by zfs_create_diskpart() below @@ -868,7 +861,7 @@ zfs_create_boot() # # Pedantic checks; should never be seen # - if [ ! "$poolname" ]; then + if [ ! "$zroot_name" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ f_show_err "$msg_null_poolname" @@ -881,7 +874,7 @@ zfs_create_boot() return $FAILURE fi f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ - "$poolname" "$vdev_type" + "$zroot_name" "$zroot_vdevtype" # # Initialize fstab(5) @@ -896,114 +889,114 @@ zfs_create_boot() # # Expand SI units in desired sizes # - f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." - local swapsize gelisize + f_dprintf "$funcname: Expanding supplied size values..." + local swapsize bootsize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then f_dprintf "$funcname: Invalid swap size \`%s'" \ "$ZFSBOOT_SWAP_SIZE" f_show_err "$msg_invalid_swap_size" "$ZFSBOOT_SWAP_SIZE" return $FAILURE fi - if ! f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize; then - f_dprintf "$funcname: Invalid geli(8) boot size \`%s'" \ - "$ZFSBOOT_GELI_BOOT_SIZE" - f_show_err "$msg_invalid_geli_boot_size" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + if ! f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize; then + f_dprintf "$funcname: Invalid boot pool size \`%s'" \ + "$ZFSBOOT_BOOT_POOL_SIZE" + f_show_err "$msg_invalid_boot_pool_size" \ + "$ZFSBOOT_BOOT_POOL_SIZE" return $FAILURE fi f_dprintf "$funcname: ZFSBOOT_SWAP_SIZE=[%s] swapsize=[%s]" \ "$ZFSBOOT_SWAP_SIZE" "$swapsize" - f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ - "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + f_dprintf "$funcname: ZFSBOOT_BOOT_POOL_SIZE=[%s] bootsize=[%s]" \ + "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" # - # Prepare the disks + # Prepare the disks and build pool device list(s) # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." + [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && + f_dprintf "$funcname: With 4k alignment using gnop(8)..." local n=0 for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - n=$(( $n + 1 )) - done - # Now $bootpart and $targetpart are set (suffix for $disk) - - # MBR boot loader hack part 1 - # We have to do this early because geli gets in the way later - if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then - f_dprintf "$funcname: Copying MBR boot loader to disks..." - for disk in $disks; do - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/${disk}s1 count=1 || - return $FAILURE - done - fi - - # Forced 4k alignment support provided by Geom NOP (see gnop(8)) - local unenc_list= - if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then - local part="$targetpart" new_list= - - # We don't gnop the encrypted partition because geli will do - # this for us gnop the unencrypted disk - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" - - f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - for disk in $disks; do - f_eval_catch $funcname gnop "$GNOP_CREATE" \ - $disk$part || return $FAILURE + # Now $bootpart and $targetpart are set (suffix for $disk) + + # Forced 4k alignment support using Geom NOP (see gnop(8)) + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$bootpart || return $FAILURE + fi + # Don't gnop encrypted partition if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - unenc_list="$unenc_list $disk$part.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.eli" else - new_list="$new_list $disk$targetpart.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$targetpart || + return $FAILURE fi - done - set -- $new_list - else - local new_list= - for disk in $disks; do - new_list="$new_list $disk$targetpart" - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - unenc_list="$unenc_list $disk$bootpart" - done - set -- $new_list - fi + else + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart" + fi + zroot_vdevs="$zroot_vdevs $disk$targetpart" + fi + + n=$(( $n + 1 )) + done # disks # - # If encryption is enabled, we need to create the GEOMs + # If we need/want a boot pool, create it # - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - local bootvdev= options= - local geli_pool="$BSDINSTALL_CHROOT/$ZFSBOOT_GELI_POOL_NAME" - local key="$ZFSBOOT_GELI_KEY_FILE" + if [ "$ZFSBOOT_BOOT_POOL" ]; then + local bootpool_vdevtype= # Calculated below + local bootpool_options= # Calculated below + local bootpool_name="$ZFSBOOT_BOOT_POOL_NAME" + local bootpool="$BSDINSTALL_CHROOT/$bootpool_name" + local zroot_key="${ZFSBOOT_GELI_KEY_FILE#/}" - f_dprintf "$funcname: Setting up disk encryption..." + f_dprintf "$funcname: Setting up boot pool..." + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + f_dprintf "$funcname: For encrypted root disk..." - # Create the parent directories for our unencrypted pool + # Create parent directory for boot pool f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ $BSDINSTALL_CHROOT || return $FAILURE - # Create mirror across the unencrypted partition on all disks - [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror + # Create mirror across the boot partition on all disks + [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && + bootpool_vdevtype=mirror - options="-o altroot=$BSDINSTALL_CHROOT" - options="$options -m \"/$ZFSBOOT_GELI_POOL_NAME\" -f" + bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" "$ZFSBOOT_GELI_POOL_NAME" $bootvdev \ - \$unenc_list || return $FAILURE + "$bootpool_options" "$bootpool_name" \ + $bootpool_vdevtype $boot_vdevs || return $FAILURE - f_eval_catch $funcname mkdir "$MKDIR_P" $geli_pool/boot || + f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE - # Generate an encryption key using random(4) - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random $geli_pool/$key "bs=4096 count=1" || - return $FAILURE + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Generate an encryption key using random(4) + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /dev/random "$bootpool/$zroot_key" \ + "bs=4096 count=1" || return $FAILURE + else + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ + "$bootpool_name" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs + fi - # - # Create the geli(8) GEOMS - # - local geli_list + fi + + # + # Create the geli(8) GEOMS + # + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Prompt user for password (twice) if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password then @@ -1018,8 +1011,8 @@ zfs_create_boot() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD if ! echo "$pw_password" | f_eval_catch \ $funcname geli "$GELI_PASSWORD_INIT" \ - "$geli_pool/boot/$disk$targetpart.eli" \ - AES-XTS "$geli_pool/$key" \ + "$bootpool/boot/$disk$targetpart.eli" \ + AES-XTS "$bootpool/$zroot_key" \ $disk$targetpart then f_interactive || f_die @@ -1028,42 +1021,39 @@ zfs_create_boot() fi if ! echo "$pw_password" | f_eval_catch \ $funcname geli "$GELI_ATTACH" \ - "$geli_pool/\$key" $disk$targetpart + "$bootpool/$zroot_key" $disk$targetpart then f_interactive || f_die unset pw_password # Sensitive info return $FAILURE fi - geli_list="$geli_list $disk$targetpart.eli" done unset pw_password # Sensitive info - set -- $geli_list # Clean up - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" "$bootpool_name" || + return $FAILURE f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # # Create the ZFS root pool with desired type and disk devices # - local vdevs="$*" - f_dprintf "$funcname: Creating boot pool..." + f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ - $poolname $vdev_type $vdevs + "$zroot_name" $zroot_vdevtype $zroot_vdevs - # Customize the zpool a bit... + # Customize the zroot a bit... local option - f_dprintf "$funcname: Setting miscellaneous options on boot pool..." + f_dprintf "$funcname: Setting miscellaneous options on root pool..." for option in checksum=fletcher4 atime=off; do - f_eval_catch $funcname zfs "$ZFS_SET" $option "$poolname" || + f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || return $FAILURE done # - # Create ZFS dataset layout within the new boot pool + # Create ZFS dataset layout within the new root pool # f_dprintf "$funcname: Creating ZFS datasets..." echo "$ZFSBOOT_DATASETS" | while read dataset options; do @@ -1083,7 +1073,7 @@ zfs_create_boot() f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "${options:+-o $options}" "$poolname$dataset" || + "${options:+-o $options}" "$zroot_name$dataset" || return $FAILURE done @@ -1096,40 +1086,41 @@ zfs_create_boot() done # Create symlink(s) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_dprintf "$funcname: Creating /boot symlink for GELI..." - f_eval_catch $funcname ln "$LN_SF" \ - "$ZFSBOOT_GELI_POOL_NAME/boot" \ + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_dprintf "$funcname: Creating /boot symlink for boot pool..." + f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \ $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property + local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" f_dprintf "$funcname: Setting bootfs property..." f_eval_catch $funcname zpool "$ZPOOL_SET" \ - "bootfs=\"$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ - "$poolname" || return $FAILURE + "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || + return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$poolname" || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + "$bootpool_name" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ $disk$bootpart.nop - else + fi + if [ ! "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ $disk$targetpart.nop fi done - # MBR boot loader hack part 2 + # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." # Stick the ZFS boot loader in the "convienient hole" after @@ -1144,12 +1135,12 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" "$poolname" || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR @@ -1158,7 +1149,7 @@ zfs_create_boot() return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ - "$poolname" || return $FAILURE + "$zroot_name" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination @@ -1169,8 +1160,8 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE - # We're all done unless we should go on to do encryption - [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + # We're all done unless we should go on for boot pool + [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS # Some additional geli(8) requirements for loader.conf(5) for option in \ @@ -1182,6 +1173,12 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done + f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + + # We're all done unless we should go on to do encryption + [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # # Configure geli(8)-based encryption @@ -1191,9 +1188,6 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE for disk in $disks; do f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_load "$disk$targetpart YES" \ @@ -1294,11 +1288,11 @@ while :; do # Make sure each disk will be at least 50% ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize then minsize=$swapsize teeny_disks= - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - minsize=$(( $minsize + $gelisize )) + [ "$ZFSBOOT_BOOT_POOL" ] && + minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do device_$disk get capacity disksize || continue disksize=$(( $disksize - $minsize )) @@ -1306,14 +1300,15 @@ while :; do teeny_disks="$teeny_disks $disk" done if [ "$teeny_disks" ]; then - f_dprintf "swapsize=[%s] gelisize[%s]" \ + f_dprintf "swapsize=[%s] bootsize[%s] %s" \ "$ZFSBOOT_SWAP_SIZE" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + "$ZFSBOOT_BOOT_POOL_SIZE" \ + "minsize=[$minsize]" f_dprintf "These disks are too small: %s" \ "$teeny_disks" f_show_err "$msg_these_disks_are_too_small" \ "$ZFSBOOT_SWAP_SIZE" \ - "$ZFSBOOT_GELI_BOOT_SIZE" \ + "$ZFSBOOT_BOOT_POOL_SIZE" \ "$teeny_disks" continue fi From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:43:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE609213; Mon, 16 Dec 2013 19:43:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA21512F6; Mon, 16 Dec 2013 19:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJh43g087194; Mon, 16 Dec 2013 19:43:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJh4W2087193; Mon, 16 Dec 2013 19:43:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161943.rBGJh4W2087193@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259477 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:43:04 -0000 Author: dteske Date: Mon Dec 16 19:43:04 2013 New Revision: 259477 URL: http://svnweb.freebsd.org/changeset/base/259477 Log: fletcher4 is currently the default. Discussed on: -current MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:37:15 2013 (r259476) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:43:04 2013 (r259477) @@ -1047,7 +1047,7 @@ zfs_create_boot() # Customize the zroot a bit... local option f_dprintf "$funcname: Setting miscellaneous options on root pool..." - for option in checksum=fletcher4 atime=off; do + for option in atime=off; do f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || return $FAILURE done From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:44:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5481F36C; Mon, 16 Dec 2013 19:44:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 407BD1310; Mon, 16 Dec 2013 19:44:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJikiQ087440; Mon, 16 Dec 2013 19:44:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJikXT087439; Mon, 16 Dec 2013 19:44:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161944.rBGJikXT087439@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259478 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:44:46 -0000 Author: dteske Date: Mon Dec 16 19:44:45 2013 New Revision: 259478 URL: http://svnweb.freebsd.org/changeset/base/259478 Log: De-uglify the geli(8)-setup infobox by adding a newline. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:43:04 2013 (r259477) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) @@ -215,7 +215,7 @@ msg_force_4k_sectors="Force 4K Sectors?" msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" msg_freebsd_installer="FreeBSD Installer" msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" -msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk" msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:47:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1D6A513; Mon, 16 Dec 2013 19:47:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDAAF1346; Mon, 16 Dec 2013 19:47:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJl4Ik087763; Mon, 16 Dec 2013 19:47:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJl4Jh087762; Mon, 16 Dec 2013 19:47:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161947.rBGJl4Jh087762@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:47:05 -0000 Author: dteske Date: Mon Dec 16 19:47:04 2013 New Revision: 259479 URL: http://svnweb.freebsd.org/changeset/base/259479 Log: Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). Discussed on: -current, -stable MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) @@ -1159,6 +1159,9 @@ zfs_create_boot() $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'kern.geom.label.disk_ident.enable=\"0\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:51:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96088822; Mon, 16 Dec 2013 19:51:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 822091438; Mon, 16 Dec 2013 19:51:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJpB9W090590; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJpBtQ090589; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161951.rBGJpBtQ090589@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259480 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:51:11 -0000 Author: dteske Date: Mon Dec 16 19:51:11 2013 New Revision: 259480 URL: http://svnweb.freebsd.org/changeset/base/259480 Log: Fix a long-standing edge-case that would result in a ghosted `zroot' pool and subsequent headaches caused by multiple pools with the same name. Specifically, blast away any labels on the designated swap partition. Problem was when you install to a given layout *with* swap and then turn around and re-install the same layout *without* swap (we weren't doing a labelclear for the swap device, so would end up with an "UNAVAIL" status zroot pool that may only exist in the pool cache). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:51:11 2013 (r259480) @@ -745,6 +745,9 @@ zfs_create_diskpart() "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ freebsd-swap ${swapsize}b $disk || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/gpt/swap$index # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/gpt/swap$index none swap sw 0 0 \ @@ -818,6 +821,9 @@ zfs_create_diskpart() "$GPART_ADD_INDEX_WITH_SIZE" 2 \ freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1b # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/${disk}s1b none swap sw 0 0 \ From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:54:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E42D2B4E; Mon, 16 Dec 2013 19:54:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D077614F7; Mon, 16 Dec 2013 19:54:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJstPT091000; Mon, 16 Dec 2013 19:54:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJsto3090999; Mon, 16 Dec 2013 19:54:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161954.rBGJsto3090999@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259481 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:54:56 -0000 Author: dteske Date: Mon Dec 16 19:54:55 2013 New Revision: 259481 URL: http://svnweb.freebsd.org/changeset/base/259481 Log: Auto-enable 4k sector alignment when disk encryption is requested (it is required in such a case). But don't prevent the user from pointing the gun at his/her foot -- you can disable 4k alignment after enabling geli). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:51:11 2013 (r259480) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:54:55 2013 (r259481) @@ -1372,6 +1372,7 @@ while :; do if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then ZFSBOOT_GELI_ENCRYPTION= else + ZFSBOOT_GNOP_4K_FORCE_ALIGN=1 ZFSBOOT_GELI_ENCRYPTION=1 fi ;; From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:59:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49FB3D1D; Mon, 16 Dec 2013 19:59:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 347E71536; Mon, 16 Dec 2013 19:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJxZDs091614; Mon, 16 Dec 2013 19:59:35 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJxWp2091559; Mon, 16 Dec 2013 19:59:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312161959.rBGJxWp2091559@svn.freebsd.org> From: Neel Natu Date: Mon, 16 Dec 2013 19:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259482 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve 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.17 Precedence: list List-Id: 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, 16 Dec 2013 19:59:35 -0000 Author: neel Date: Mon Dec 16 19:59:31 2013 New Revision: 259482 URL: http://svnweb.freebsd.org/changeset/base/259482 Log: Add an API to deliver message signalled interrupts to vcpus. This allows callers treat the MSI 'addr' and 'data' fields as opaque and also lets bhyve implement multiple destination modes: physical, flat and clustered. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) Reviewed by: grehan@ Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/io/ppt.h head/sys/amd64/vmm/io/vhpet.c head/sys/amd64/vmm/io/vioapic.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_lapic.h head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/lib/libvmmapi/vmmapi.c Mon Dec 16 19:59:31 2013 (r259482) @@ -397,6 +397,18 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu } int +vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) +{ + struct vm_lapic_msi vmmsi; + + bzero(&vmmsi, sizeof(vmmsi)); + vmmsi.addr = addr; + vmmsi.msg = msg; + + return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi)); +} + +int vm_ioapic_assert_irq(struct vmctx *ctx, int irq) { struct vm_ioapic_irq ioapic_irq; @@ -552,7 +564,7 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) + uint64_t addr, uint64_t msg, int numvec) { struct vm_pptdev_msi pptmsi; @@ -561,8 +573,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu pptmsi.bus = bus; pptmsi.slot = slot; pptmsi.func = func; - pptmsi.destcpu = destcpu; - pptmsi.vector = vector; + pptmsi.msg = msg; + pptmsi.addr = addr; pptmsi.numvec = numvec; return (ioctl(ctx->fd, VM_PPTDEV_MSI, &pptmsi)); @@ -570,7 +582,7 @@ vm_setup_msi(struct vmctx *ctx, int vcpu int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct vm_pptdev_msix pptmsix; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/lib/libvmmapi/vmmapi.h Mon Dec 16 19:59:31 2013 (r259482) @@ -67,6 +67,7 @@ int vm_inject_event(struct vmctx *ctx, i int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vector, int error_code); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); @@ -82,9 +83,9 @@ int vm_unassign_pptdev(struct vmctx *ctx int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int dest, int vector, int numvec); + uint64_t addr, uint64_t msg, int numvec); int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/include/vmm_dev.h Mon Dec 16 19:59:31 2013 (r259482) @@ -66,6 +66,11 @@ struct vm_event { int error_code_valid; }; +struct vm_lapic_msi { + uint64_t msg; + uint64_t addr; +}; + struct vm_lapic_irq { int cpuid; int vector; @@ -103,8 +108,8 @@ struct vm_pptdev_msi { int slot; int func; int numvec; /* 0 means disabled */ - int vector; - int destcpu; + uint64_t msg; + uint64_t addr; }; struct vm_pptdev_msix { @@ -113,7 +118,7 @@ struct vm_pptdev_msix { int slot; int func; int idx; - uint32_t msg; + uint64_t msg; uint32_t vector_control; uint64_t addr; }; @@ -175,6 +180,7 @@ enum { IOCNUM_IOAPIC_ASSERT_IRQ = 33, IOCNUM_IOAPIC_DEASSERT_IRQ = 34, IOCNUM_IOAPIC_PULSE_IRQ = 35, + IOCNUM_LAPIC_MSI = 36, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -211,6 +217,8 @@ enum { _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) +#define VM_LAPIC_MSI \ + _IOW('v', IOCNUM_LAPIC_MSI, struct vm_lapic_msi) #define VM_IOAPIC_ASSERT_IRQ \ _IOW('v', IOCNUM_IOAPIC_ASSERT_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_DEASSERT_IRQ \ Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/ppt.c Mon Dec 16 19:59:31 2013 (r259482) @@ -72,8 +72,8 @@ MALLOC_DEFINE(M_PPTMSIX, "pptmsix", "Pas struct pptintr_arg { /* pptintr(pptintr_arg) */ struct pptdev *pptdev; - int vec; - int vcpu; + uint64_t addr; + uint64_t msg_data; }; static struct pptdev { @@ -412,16 +412,14 @@ ppt_map_mmio(struct vm *vm, int bus, int static int pptintr(void *arg) { - int vec; struct pptdev *ppt; struct pptintr_arg *pptarg; pptarg = arg; ppt = pptarg->pptdev; - vec = pptarg->vec; if (ppt->vm != NULL) - lapic_intr_edge(ppt->vm, pptarg->vcpu, vec); + lapic_intr_msi(ppt->vm, pptarg->addr, pptarg->msg_data); else { /* * XXX @@ -441,15 +439,13 @@ pptintr(void *arg) int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) + uint64_t addr, uint64_t msg, int numvec) { int i, rid, flags; int msi_count, startrid, error, tmp; struct pptdev *ppt; - if ((destcpu >= VM_MAXCPU || destcpu < 0) || - (vector < 0 || vector > 255) || - (numvec < 0 || numvec > MAX_MSIMSGS)) + if (numvec < 0 || numvec > MAX_MSIMSGS) return (EINVAL); ppt = ppt_find(bus, slot, func); @@ -513,8 +509,8 @@ ppt_setup_msi(struct vm *vm, int vcpu, i break; ppt->msi.arg[i].pptdev = ppt; - ppt->msi.arg[i].vec = vector + i; - ppt->msi.arg[i].vcpu = destcpu; + ppt->msi.arg[i].addr = addr; + ppt->msi.arg[i].msg_data = msg + i; error = bus_setup_intr(ppt->dev, ppt->msi.res[i], INTR_TYPE_NET | INTR_MPSAFE, @@ -534,7 +530,7 @@ ppt_setup_msi(struct vm *vm, int vcpu, i int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct pptdev *ppt; struct pci_devinfo *dinfo; @@ -605,8 +601,8 @@ ppt_setup_msix(struct vm *vm, int vcpu, return (ENXIO); ppt->msix.arg[idx].pptdev = ppt; - ppt->msix.arg[idx].vec = msg & 0xFF; - ppt->msix.arg[idx].vcpu = (addr >> 12) & 0xFF; + ppt->msix.arg[idx].addr = addr; + ppt->msix.arg[idx].msg_data = msg; /* Setup the MSI-X interrupt */ error = bus_setup_intr(ppt->dev, ppt->msix.res[idx], Modified: head/sys/amd64/vmm/io/ppt.h ============================================================================== --- head/sys/amd64/vmm/io/ppt.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/ppt.h Mon Dec 16 19:59:31 2013 (r259482) @@ -33,9 +33,9 @@ int ppt_unassign_all(struct vm *vm); int ppt_map_mmio(struct vm *vm, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec); + uint64_t addr, uint64_t msg, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); int ppt_num_devices(struct vm *vm); boolean_t ppt_is_mmio(struct vm *vm, vm_paddr_t gpa); Modified: head/sys/amd64/vmm/io/vhpet.c ============================================================================== --- head/sys/amd64/vmm/io/vhpet.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vhpet.c Mon Dec 16 19:59:31 2013 (r259482) @@ -240,8 +240,7 @@ vhpet_timer_edge_trig(struct vhpet *vhpe static void vhpet_timer_interrupt(struct vhpet *vhpet, int n) { - int apicid, vector, vcpuid, pin; - cpuset_t dmask; + int pin; /* If interrupts are not enabled for this timer then just return. */ if (!vhpet_timer_interrupt_enabled(vhpet, n)) @@ -256,26 +255,8 @@ vhpet_timer_interrupt(struct vhpet *vhpe } if (vhpet_timer_msi_enabled(vhpet, n)) { - /* - * XXX should have an API 'vlapic_deliver_msi(vm, addr, data)' - * - assuming physical delivery mode - * - no need to interpret contents of 'msireg' here - */ - vector = vhpet->timer[n].msireg & 0xff; - apicid = (vhpet->timer[n].msireg >> (32 + 12)) & 0xff; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vhpet->vm, apicid); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } else { - /* broadcast */ - dmask = vm_active_cpus(vhpet->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } - } + lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, + vhpet->timer[n].msireg & 0xffffffff); return; } Modified: head/sys/amd64/vmm/io/vioapic.c ============================================================================== --- head/sys/amd64/vmm/io/vioapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vioapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_ktr.h" #include "vmm_lapic.h" +#include "vlapic.h" #include "vioapic.h" #define IOREGSEL 0x00 @@ -91,25 +92,14 @@ pinstate_str(bool asserted) else return ("deasserted"); } - -static const char * -trigger_str(bool level) -{ - - if (level) - return ("level"); - else - return ("edge"); -} #endif static void vioapic_send_intr(struct vioapic *vioapic, int pin) { - int vector, apicid, vcpuid; - uint32_t low, high; - cpuset_t dmask; - bool level; + int vector, delmode; + uint32_t low, high, dest; + bool level, phys; KASSERT(pin >= 0 && pin < REDIR_ENTRIES, ("vioapic_set_pinstate: invalid pin number %d", pin)); @@ -120,52 +110,20 @@ vioapic_send_intr(struct vioapic *vioapi low = vioapic->rtbl[pin].reg; high = vioapic->rtbl[pin].reg >> 32; - /* - * XXX We only deal with: - * - physical destination - * - fixed delivery mode - */ - if ((low & IOART_DESTMOD) != IOART_DESTPHY) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported dest mode " - "0x%08x", pin, low); - return; - } - - if ((low & IOART_DELMOD) != IOART_DELFIXED) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported delivery mode " - "0x%08x", pin, low); - return; - } - if ((low & IOART_INTMASK) == IOART_INTMSET) { VIOAPIC_CTR1(vioapic, "ioapic pin%d: masked", pin); return; } + phys = ((low & IOART_DESTMOD) == IOART_DESTPHY); + delmode = low & IOART_DELMOD; level = low & IOART_TRGRLVL ? true : false; if (level) vioapic->rtbl[pin].reg |= IOART_REM_IRR; vector = low & IOART_INTVEC; - apicid = high >> APIC_ID_SHIFT; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vioapic->vm, apicid); - VIOAPIC_CTR4(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on vcpuid %d", pin, trigger_str(level), - vector, vcpuid); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } else { - /* broadcast */ - VIOAPIC_CTR3(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on all vcpus", pin, trigger_str(level), vector); - dmask = vm_active_cpus(vioapic->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } - } + dest = high >> APIC_ID_SHIFT; + vlapic_deliver_intr(vioapic->vm, level, dest, phys, delmode, vector); } static void Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vlapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -145,6 +145,84 @@ struct vlapic { #define VLAPIC_BUS_FREQ tsc_freq +static __inline uint32_t +vlapic_get_id(struct vlapic *vlapic) +{ + + if (x2apic(vlapic)) + return (vlapic->vcpuid); + else + return (vlapic->vcpuid << 24); +} + +static __inline uint32_t +vlapic_get_ldr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + int apicid; + uint32_t ldr; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) { + apicid = vlapic_get_id(vlapic); + ldr = 1 << (apicid & 0xf); + ldr |= (apicid & 0xffff0) << 12; + return (ldr); + } else + return (lapic->ldr); +} + +static __inline uint32_t +vlapic_get_dfr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) + return (0); + else + return (lapic->dfr); +} + +static void +vlapic_set_dfr(struct vlapic *vlapic, uint32_t data) +{ + uint32_t dfr; + struct LAPIC *lapic; + + if (x2apic(vlapic)) { + VM_CTR1(vlapic->vm, "write to DFR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + dfr = (lapic->dfr & APIC_DFR_RESERVED) | (data & APIC_DFR_MODEL_MASK); + if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) + VLAPIC_CTR0(vlapic, "vlapic DFR in Flat Model"); + else if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER) + VLAPIC_CTR0(vlapic, "vlapic DFR in Cluster Model"); + else + VLAPIC_CTR1(vlapic, "vlapic DFR in Unknown Model %#x", dfr); + + lapic->dfr = dfr; +} + +static void +vlapic_set_ldr(struct vlapic *vlapic, uint32_t data) +{ + struct LAPIC *lapic; + + /* LDR is read-only in x2apic mode */ + if (x2apic(vlapic)) { + VLAPIC_CTR1(vlapic, "write to LDR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + lapic->ldr = data & ~APIC_LDR_RESERVED; + VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); +} + static int vlapic_timer_divisor(uint32_t dcr) { @@ -610,12 +688,115 @@ vlapic_set_icr_timer(struct vlapic *vlap VLAPIC_TIMER_UNLOCK(vlapic); } +/* + * This function populates 'dmask' with the set of vcpus that match the + * addressing specified by the (dest, phys, lowprio) tuple. + * + * 'x2apic_dest' specifies whether 'dest' is interpreted as x2APIC (32-bit) + * or xAPIC (8-bit) destination field. + */ +static void +vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32_t dest, bool phys, + bool lowprio, bool x2apic_dest) +{ + struct vlapic *vlapic; + uint32_t dfr, ldr, ldest, cluster; + uint32_t mda_flat_ldest, mda_cluster_ldest, mda_ldest, mda_cluster_id; + cpuset_t amask; + int vcpuid; + + if ((x2apic_dest && dest == 0xffffffff) || + (!x2apic_dest && dest == 0xff)) { + /* + * Broadcast in both logical and physical modes. + */ + *dmask = vm_active_cpus(vm); + return; + } + + if (phys) { + /* + * Physical mode: destination is APIC ID. + */ + CPU_ZERO(dmask); + vcpuid = vm_apicid2vcpuid(vm, dest); + if (vcpuid < VM_MAXCPU) + CPU_SET(vcpuid, dmask); + } else { + /* + * In the "Flat Model" the MDA is interpreted as an 8-bit wide + * bitmask. This model is only avilable in the xAPIC mode. + */ + mda_flat_ldest = dest & 0xff; + + /* + * In the "Cluster Model" the MDA is used to identify a + * specific cluster and a set of APICs in that cluster. + */ + if (x2apic_dest) { + mda_cluster_id = dest >> 16; + mda_cluster_ldest = dest & 0xffff; + } else { + mda_cluster_id = (dest >> 4) & 0xf; + mda_cluster_ldest = dest & 0xf; + } + + /* + * Logical mode: match each APIC that has a bit set + * in it's LDR that matches a bit in the ldest. + */ + CPU_ZERO(dmask); + amask = vm_active_cpus(vm); + while ((vcpuid = CPU_FFS(&amask)) != 0) { + vcpuid--; + CPU_CLR(vcpuid, &amask); + + vlapic = vm_lapic(vm, vcpuid); + dfr = vlapic_get_dfr(vlapic); + ldr = vlapic_get_ldr(vlapic); + + if ((dfr & APIC_DFR_MODEL_MASK) == + APIC_DFR_MODEL_FLAT) { + ldest = ldr >> 24; + mda_ldest = mda_flat_ldest; + } else if ((dfr & APIC_DFR_MODEL_MASK) == + APIC_DFR_MODEL_CLUSTER) { + if (x2apic(vlapic)) { + cluster = ldr >> 16; + ldest = ldr & 0xffff; + } else { + cluster = ldr >> 28; + ldest = (ldr >> 24) & 0xf; + } + if (cluster != mda_cluster_id) + continue; + mda_ldest = mda_cluster_ldest; + } else { + /* + * Guest has configured a bad logical + * model for this vcpu - skip it. + */ + VLAPIC_CTR1(vlapic, "vlapic has bad logical " + "model %x - cannot deliver interrupt", dfr); + continue; + } + + if ((mda_ldest & ldest) != 0) { + CPU_SET(vcpuid, dmask); + if (lowprio) + break; + } + } + } +} + static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); static int lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu) { int i; + bool phys; cpuset_t dmask; uint32_t dest, vec, mode; struct vlapic *vlapic2; @@ -631,7 +812,9 @@ lapic_process_icr(struct vlapic *vlapic, if (mode == APIC_DELMODE_FIXED || mode == APIC_DELMODE_NMI) { switch (icrval & APIC_DEST_MASK) { case APIC_DEST_DESTFLD: - CPU_SETOF(dest, &dmask); + phys = ((icrval & APIC_DESTMODE_LOG) == 0); + vlapic_calcdest(vlapic->vm, &dmask, dest, phys, false, + x2apic(vlapic)); break; case APIC_DEST_SELF: CPU_SETOF(vlapic->vcpuid, &dmask); @@ -820,10 +1003,7 @@ vlapic_read(struct vlapic *vlapic, uint6 switch(offset) { case APIC_OFFSET_ID: - if (x2apic(vlapic)) - *data = vlapic->vcpuid; - else - *data = vlapic->vcpuid << 24; + *data = vlapic_get_id(vlapic); break; case APIC_OFFSET_VER: *data = lapic->version; @@ -841,10 +1021,10 @@ vlapic_read(struct vlapic *vlapic, uint6 *data = lapic->eoi; break; case APIC_OFFSET_LDR: - *data = lapic->ldr; + *data = vlapic_get_ldr(vlapic); break; case APIC_OFFSET_DFR: - *data = lapic->dfr; + *data = vlapic_get_dfr(vlapic); break; case APIC_OFFSET_SVR: *data = lapic->svr; @@ -921,8 +1101,10 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_process_eoi(vlapic); break; case APIC_OFFSET_LDR: + vlapic_set_ldr(vlapic, data); break; case APIC_OFFSET_DFR: + vlapic_set_dfr(vlapic, data); break; case APIC_OFFSET_SVR: lapic_set_svr(vlapic, data); @@ -1041,6 +1223,34 @@ vlapic_set_x2apic_state(struct vm *vm, i vlapic->msr_apicbase &= ~APICBASE_X2APIC; } +void +vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, + int delmode, int vec) +{ + bool lowprio; + int vcpuid; + cpuset_t dmask; + + if (delmode != APIC_DELMODE_FIXED && delmode != APIC_DELMODE_LOWPRIO) { + VM_CTR1(vm, "vlapic intr invalid delmode %#x", delmode); + return; + } + lowprio = (delmode == APIC_DELMODE_LOWPRIO); + + /* + * We don't provide any virtual interrupt redirection hardware so + * all interrupts originating from the ioapic or MSI specify the + * 'dest' in the legacy xAPIC format. + */ + vlapic_calcdest(vm, &dmask, dest, phys, lowprio, false); + + while ((vcpuid = CPU_FFS(&dmask)) != 0) { + vcpuid--; + CPU_CLR(vcpuid, &dmask); + lapic_set_intr(vm, vcpuid, vec, level); + } +} + bool vlapic_enabled(struct vlapic *vlapic) { Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vlapic.h Mon Dec 16 19:59:31 2013 (r259482) @@ -103,4 +103,6 @@ void vlapic_set_apicbase(struct vlapic * void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state s); bool vlapic_enabled(struct vlapic *vlapic); +void vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, + int delmode, int vec); #endif /* _VLAPIC_H_ */ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_dev.c Mon Dec 16 19:59:31 2013 (r259482) @@ -152,6 +152,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_run *vmrun; struct vm_event *vmevent; struct vm_lapic_irq *vmirq; + struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; struct vm_capability *vmcap; struct vm_pptdev *pptdev; @@ -254,7 +255,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c pptmsi = (struct vm_pptdev_msi *)data; error = ppt_setup_msi(sc->vm, pptmsi->vcpu, pptmsi->bus, pptmsi->slot, pptmsi->func, - pptmsi->destcpu, pptmsi->vector, + pptmsi->addr, pptmsi->msg, pptmsi->numvec); break; case VM_PPTDEV_MSIX: @@ -262,8 +263,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = ppt_setup_msix(sc->vm, pptmsix->vcpu, pptmsix->bus, pptmsix->slot, pptmsix->func, pptmsix->idx, - pptmsix->msg, pptmsix->vector_control, - pptmsix->addr); + pptmsix->addr, pptmsix->msg, + pptmsix->vector_control); break; case VM_MAP_PPTDEV_MMIO: pptmmio = (struct vm_pptdev_mmio *)data; @@ -296,6 +297,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmirq = (struct vm_lapic_irq *)data; error = lapic_intr_edge(sc->vm, vmirq->cpuid, vmirq->vector); break; + case VM_LAPIC_MSI: + vmmsi = (struct vm_lapic_msi *)data; + error = lapic_intr_msi(sc->vm, vmmsi->addr, vmmsi->msg); + break; case VM_IOAPIC_ASSERT_IRQ: ioapic_irq = (struct vm_ioapic_irq *)data; error = vioapic_assert_irq(sc->vm, ioapic_irq->irq); Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_lapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -38,9 +38,18 @@ __FBSDID("$FreeBSD$"); #include #include "vmm_ipi.h" +#include "vmm_ktr.h" #include "vmm_lapic.h" #include "vlapic.h" +/* + * Some MSI message definitions + */ +#define MSI_X86_ADDR_MASK 0xfff00000 +#define MSI_X86_ADDR_BASE 0xfee00000 +#define MSI_X86_ADDR_RH 0x00000008 /* Redirection Hint */ +#define MSI_X86_ADDR_LOG 0x00000004 /* Destination Mode */ + int lapic_pending_intr(struct vm *vm, int cpu) { @@ -80,6 +89,44 @@ lapic_set_intr(struct vm *vm, int cpu, i return (0); } +int +lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg) +{ + int delmode, vec; + uint32_t dest; + bool phys; + + VM_CTR2(vm, "lapic MSI addr: %#lx msg: %#lx", addr, msg); + + if ((addr & MSI_X86_ADDR_MASK) != MSI_X86_ADDR_BASE) { + VM_CTR1(vm, "lapic MSI invalid addr %#lx", addr); + return (-1); + } + + /* + * Extract the x86-specific fields from the MSI addr/msg + * params according to the Intel Arch spec, Vol3 Ch 10. + * + * The PCI specification does not support level triggered + * MSI/MSI-X so ignore trigger level in 'msg'. + * + * The 'dest' is interpreted as a logical APIC ID if both + * the Redirection Hint and Destination Mode are '1' and + * physical otherwise. + */ + dest = (addr >> 12) & 0xff; + phys = ((addr & (MSI_X86_ADDR_RH | MSI_X86_ADDR_LOG)) != + (MSI_X86_ADDR_RH | MSI_X86_ADDR_LOG)); + delmode = msg & APIC_DELMODE_MASK; + vec = msg & 0xff; + + VM_CTR3(vm, "lapic MSI %s dest %#x, vec %d", + phys ? "physical" : "logical", dest, vec); + + vlapic_deliver_intr(vm, LAPIC_TRIG_EDGE, dest, phys, delmode, vec); + return (0); +} + static boolean_t x2apic_msr(u_int msr) { Modified: head/sys/amd64/vmm/vmm_lapic.h ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_lapic.h Mon Dec 16 19:59:31 2013 (r259482) @@ -84,4 +84,5 @@ lapic_intr_edge(struct vm *vm, int cpu, return (lapic_set_intr(vm, cpu, vector, LAPIC_TRIG_EDGE)); } +int lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg); #endif Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_emul.c Mon Dec 16 19:59:31 2013 (r259482) @@ -850,19 +850,14 @@ msicap_cfgwrite(struct pci_devinst *pi, else msgdata = pci_get_cfgdata16(pi, capoff + 8); - /* - * XXX check delivery mode, destination mode etc - */ mme = msgctrl & PCIM_MSICTRL_MME_MASK; pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; if (pi->pi_msi.enabled) { - pi->pi_msi.cpu = (addrlo >> 12) & 0xff; - pi->pi_msi.vector = msgdata & 0xff; - pi->pi_msi.msgnum = 1 << (mme >> 4); + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); } else { - pi->pi_msi.cpu = 0; - pi->pi_msi.vector = 0; - pi->pi_msi.msgnum = 0; + pi->pi_msi.maxmsgnum = 0; } } @@ -1060,10 +1055,10 @@ pci_msi_enabled(struct pci_devinst *pi) } int -pci_msi_msgnum(struct pci_devinst *pi) +pci_msi_maxmsgnum(struct pci_devinst *pi) { if (pi->pi_msi.enabled) - return (pi->pi_msi.msgnum); + return (pi->pi_msi.maxmsgnum); else return (0); } @@ -1092,19 +1087,17 @@ pci_generate_msix(struct pci_devinst *pi mte = &pi->pi_msix.table[index]; if ((mte->vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { /* XXX Set PBA bit if interrupt is disabled */ - vm_lapic_irq(pi->pi_vmctx, - (mte->addr >> 12) & 0xff, mte->msg_data & 0xff); + vm_lapic_msi(pi->pi_vmctx, mte->addr, mte->msg_data); } } void -pci_generate_msi(struct pci_devinst *pi, int msg) +pci_generate_msi(struct pci_devinst *pi, int index) { - if (pci_msi_enabled(pi) && msg < pci_msi_msgnum(pi)) { - vm_lapic_irq(pi->pi_vmctx, - pi->pi_msi.cpu, - pi->pi_msi.vector + msg); + if (pci_msi_enabled(pi) && index < pci_msi_maxmsgnum(pi)) { + vm_lapic_msi(pi->pi_vmctx, pi->pi_msi.addr, + pi->pi_msi.msg_data + index); } } @@ -1511,10 +1504,10 @@ pci_emul_diow(struct vmctx *ctx, int vcp * Special magic value to generate an interrupt */ if (offset == 4 && size == 4 && pci_msi_enabled(pi)) - pci_generate_msi(pi, value % pci_msi_msgnum(pi)); + pci_generate_msi(pi, value % pci_msi_maxmsgnum(pi)); if (value == 0xabcdef) { - for (i = 0; i < pci_msi_msgnum(pi); i++) + for (i = 0; i < pci_msi_maxmsgnum(pi); i++) pci_generate_msi(pi, i); } } Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_emul.h Mon Dec 16 19:59:31 2013 (r259482) @@ -109,10 +109,10 @@ struct pci_devinst { int pi_bar_getsize; struct { - int enabled; - int cpu; - int vector; - int msgnum; + int enabled; + uint64_t addr; + uint64_t msg_data; + int maxmsgnum; } pi_msi; struct { Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_passthru.c Mon Dec 16 19:59:31 2013 (r259482) @@ -348,9 +348,9 @@ msix_table_write(struct vmctx *ctx, int error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, - index, entry->msg_data, - entry->vector_control, - entry->addr); + index, entry->addr, + entry->msg_data, + entry->vector_control); } } } @@ -653,8 +653,9 @@ passthru_cfgwrite(struct vmctx *ctx, int msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val); error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.cpu, - pi->pi_msi.vector, pi->pi_msi.msgnum); + sc->psc_sel.pc_dev, sc->psc_sel.pc_func, + pi->pi_msi.addr, pi->pi_msi.msg_data, + pi->pi_msi.maxmsgnum); if (error != 0) { printf("vm_setup_msi returned error %d\r\n", errno); exit(1); @@ -667,15 +668,16 @@ passthru_cfgwrite(struct vmctx *ctx, int if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, - sc->psc_sel.pc_func, i, - pi->pi_msix.table[i].msg_data, - pi->pi_msix.table[i].vector_control, - pi->pi_msix.table[i].addr); + error = vm_setup_msix(ctx, vcpu, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func, i, + pi->pi_msix.table[i].addr, + pi->pi_msix.table[i].msg_data, + pi->pi_msix.table[i].vector_control); if (error) { - printf("vm_setup_msix returned error %d\r\n", errno); + printf("vm_setup_msix error %d\r\n", + errno); exit(1); } } From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 20:40:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 073B8D6; Mon, 16 Dec 2013 20:40:24 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4DE1A9B; Mon, 16 Dec 2013 20:40:22 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBGKeLl5049531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Dec 2013 00:40:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBGKeLIu049530; Tue, 17 Dec 2013 00:40:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Dec 2013 00:40:21 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259475 - head/sys/kern Message-ID: <20131216204021.GW29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312161931.rBGJVOhs083409@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 20:40:24 -0000 Adrian, On Mon, Dec 16, 2013 at 07:31:24PM +0000, Adrian Chadd wrote: A> Modified: head/sys/kern/uipc_syscalls.c A> ============================================================================== A> --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 (r259474) A> +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 (r259475) A> @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); A> #include A> #endif A> A> +#include A> +#include A> +#include A> #include A> A> #include A> @@ -130,6 +133,7 @@ static int sfreadahead = 1; A> SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, A> &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); A> A> +static uma_zone_t zone_sfsync; A> A> static void A> sfstat_init(const void *unused) A> @@ -140,6 +144,22 @@ sfstat_init(const void *unused) A> } A> SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); A> A> +static void A> +sf_sync_init(const void *unused) A> +{ A> + A> + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), A> + NULL, NULL, A> +#ifdef INVARIANTS A> + trash_init, trash_fini, A> +#else A> + NULL, NULL, A> +#endif A> + UMA_ALIGN_CACHE, A> + 0); A> +} You do not need the INVARIANTS ifdef, because uma(9) will do the same thing for you automatically. Thus, you also do not need to pollute namespace with uma_int.h and uma_dbg.h. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 21:26:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63324D5; Mon, 16 Dec 2013 21:26:16 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 330011F37; Mon, 16 Dec 2013 21:26:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7648138044; Mon, 16 Dec 2013 15:26:14 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 75U1GgZXJgHI; Mon, 16 Dec 2013 15:26:14 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 51A9C38043; Mon, 16 Dec 2013 15:26:14 -0600 (CST) Message-ID: <52AF6FF6.1030909@freebsd.org> Date: Mon, 16 Dec 2013 15:26:14 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> In-Reply-To: <201312161947.rBGJl4Jh087762@svn.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.17 Precedence: list List-Id: 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, 16 Dec 2013 21:26:16 -0000 On 12/16/13 13:47, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 19:47:04 2013 > New Revision: 259479 > URL: http://svnweb.freebsd.org/changeset/base/259479 > > Log: > Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). > > Discussed on: -current, -stable > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/scripts/zfsboot > > Modified: head/usr.sbin/bsdinstall/scripts/zfsboot > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) > +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) > @@ -1159,6 +1159,9 @@ zfs_create_boot() > $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE > f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ > $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE > + f_eval_catch $funcname echo "$ECHO_APPEND" \ > + 'kern.geom.label.disk_ident.enable=\"0\"' \ > + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE > > # We're all done unless we should go on for boot pool > [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 21:40:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3260A26; Mon, 16 Dec 2013 21:40:32 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 976DE1099; Mon, 16 Dec 2013 21:40:32 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLeVJg020928 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:40:31 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:40:30 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Mon, 16 Dec 2013 21:40:29 +0000 Message-ID: <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> In-Reply-To: <52AF6FF6.1030909@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <997BDFA71312B5408B33AFA96C102208@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 16 Dec 2013 21:40:33 -0000 On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: > On 12/16/13 13:47, Devin Teske wrote: >> Author: dteske >> Date: Mon Dec 16 19:47:04 2013 >> New Revision: 259479 >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.= org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6= vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21= DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083f= b1c3a7e >>=20 >> Log: >> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >> Discussed on: -current, -stable >> MFC after: 3 days >>=20 >> Modified: >> head/usr.sbin/bsdinstall/scripts/zfsboot >>=20 >> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r= 259478) >> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r= 259479) >> @@ -1159,6 +1159,9 @@ zfs_create_boot() >> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >> # We're all done unless we should go on for boot pool >> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >=20 > Uh -- what is all of this? Why are we disabling kernel functions dependin= g on what the root filesystem is? Please don't MFC this. http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html NB: Happy to rip it out... but want something in-reply to those threads (pr= etty please). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 21:48:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0515ED01; Mon, 16 Dec 2013 21:48:39 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B952810EC; Mon, 16 Dec 2013 21:48:38 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa05.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLmbsI012464 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:48:37 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:48:36 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7JpXwGqA Date: Mon, 16 Dec 2013 21:48:35 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> In-Reply-To: <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <4360776B995F63419A3A9F54A2429B37@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 16 Dec 2013 21:48:39 -0000 On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >=20 > On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >=20 >> On 12/16/13 13:47, Devin Teske wrote: >>> Author: dteske >>> Date: Mon Dec 16 19:47:04 2013 >>> New Revision: 259479 >>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd= .org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs= 6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F2= 1DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083= fb1c3a7e >>>=20 >>> Log: >>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>> Discussed on: -current, -stable >>> MFC after: 3 days >>>=20 >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>=20 >>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (= r259478) >>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (= r259479) >>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>> # We're all done unless we should go on for boot pool >>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>=20 >> Uh -- what is all of this? Why are we disabling kernel functions dependi= ng on what the root filesystem is? Please don't MFC this. >=20 > http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.ht= ml > http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.ht= ml >=20 > NB: Happy to rip it out... but want something in-reply to those threads (= pretty please). Basically... the logic is... The ZFS pool is built on vdevs of a specific name. The names that are used should remain the same. Adding this to the loader.conf ensures that the nam= es that the pool(s) was/were built upon do not change. This goes beyond just a swap partition I imagine. For example... copying the data to a new drive using a duplicator. I'm sure there are other cases too. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 21:50:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1671CEAC; Mon, 16 Dec 2013 21:50:58 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id BD0011151; Mon, 16 Dec 2013 21:50:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 5434838044; Mon, 16 Dec 2013 15:50:57 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id pGP3Mc9NiuI6; Mon, 16 Dec 2013 15:50:57 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 4144F3803F; Mon, 16 Dec 2013 15:50:57 -0600 (CST) Message-ID: <52AF75C1.9040502@freebsd.org> Date: Mon, 16 Dec 2013 15:50:57 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 21:50:58 -0000 On 12/16/13 15:48, Teske, Devin wrote: > On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: > >> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >> >>> On 12/16/13 13:47, Devin Teske wrote: >>>> Author: dteske >>>> Date: Mon Dec 16 19:47:04 2013 >>>> New Revision: 259479 >>>> URL: https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259479&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=fW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21DVtgyGU%3D%0A&s=cdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083fb1c3a7e >>>> >>>> Log: >>>> Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). >>>> Discussed on: -current, -stable >>>> MFC after: 3 days >>>> >>>> Modified: >>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>> >>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>> ============================================================================== >>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) >>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) >>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ >>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>> + 'kern.geom.label.disk_ident.enable=\"0\"' \ >>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>> # We're all done unless we should go on for boot pool >>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>> Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html >> >> NB: Happy to rip it out... but want something in-reply to those threads (pretty please). > Basically... the logic is... > > The ZFS pool is built on vdevs of a specific name. The names that are used > should remain the same. Adding this to the loader.conf ensures that the names > that the pool(s) was/were built upon do not change. > > This goes beyond just a swap partition I imagine. For example... copying the > data to a new drive using a duplicator. I'm sure there are other cases too. Thanks for the explanation! I wonder if we should just turn off the disk ident stuff by default globally -- it was causing problems for me as well without ZFS root. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 21:55:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9E7FE9; Mon, 16 Dec 2013 21:55:17 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC8E1190; Mon, 16 Dec 2013 21:55:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa02.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLtF25004481 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:55:16 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:55:14 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Mon, 16 Dec 2013 21:55:13 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> In-Reply-To: <52AF75C1.9040502@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <675E989217A2A247963055F63A7E4744@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 16 Dec 2013 21:55:17 -0000 On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: > On 12/16/13 15:48, Teske, Devin wrote: >> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>=20 >>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>=20 >>>> On 12/16/13 13:47, Devin Teske wrote: >>>>> Author: dteske >>>>> Date: Mon Dec 16 19:47:04 2013 >>>>> New Revision: 259479 >>>>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freeb= sd.org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMr= js6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2= F21DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a0= 83fb1c3a7e >>>>>=20 >>>>> Log: >>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>> Discussed on: -current, -stable >>>>> MFC after: 3 days >>>>>=20 >>>>> Modified: >>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>=20 >>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013= (r259478) >>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013= (r259479) >>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>> # We're all done unless we should go on for boot pool >>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>> Uh -- what is all of this? Why are we disabling kernel functions depen= ding on what the root filesystem is? Please don't MFC this. >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org/p= ipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILCq%2= FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=3D= WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c5e1= 05a7869c580884327a8721c2f44c1711b319212a23db7 >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org/p= ipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILCq%2= FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=3D= WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e3eb= d45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>=20 >>> NB: Happy to rip it out... but want something in-reply to those threads= (pretty please). >> Basically... the logic is... >>=20 >> The ZFS pool is built on vdevs of a specific name. The names that are us= ed >> should remain the same. Adding this to the loader.conf ensures that the = names >> that the pool(s) was/were built upon do not change. >>=20 >> This goes beyond just a swap partition I imagine. For example... copying= the >> data to a new drive using a duplicator. I'm sure there are other cases t= oo. >=20 > Thanks for the explanation! I wonder if we should just turn off the disk = ident stuff by default globally -- it was causing problems for me as well w= ithout ZFS root. As I was making the commit to zfsboot... the very thought had occurred to m= e. I'm happy to rip this out in favor of a new global default. The end-result = is that what Johan experienced won't be repeated. I think there's an urgency to get something to solve this into 10. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 22:03:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248C9527; Mon, 16 Dec 2013 22:03:36 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id C7B56123D; Mon, 16 Dec 2013 22:03:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 406C438043; Mon, 16 Dec 2013 16:03:35 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id krgNaNQGaJ00; Mon, 16 Dec 2013 16:03:35 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 2D2203803F; Mon, 16 Dec 2013 16:03:35 -0600 (CST) Message-ID: <52AF78B6.20706@freebsd.org> Date: Mon, 16 Dec 2013 16:03:34 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 16 Dec 2013 22:03:36 -0000 On 12/16/13 15:55, Teske, Devin wrote: > On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: > >> On 12/16/13 15:48, Teske, Devin wrote: >>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>> >>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>> >>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>> Author: dteske >>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>> New Revision: 259479 >>>>>> URL: https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259479&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=fW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21DVtgyGU%3D%0A&s=cdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083fb1c3a7e >>>>>> >>>>>> Log: >>>>>> Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). >>>>>> Discussed on: -current, -stable >>>>>> MFC after: 3 days >>>>>> >>>>>> Modified: >>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>> >>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>> ============================================================================== >>>>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) >>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) >>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ >>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>> + 'kern.geom.label.disk_ident.enable=\"0\"' \ >>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>> # We're all done unless we should go on for boot pool >>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>> Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. >>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=LTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=4f16f0d6399e3a3c5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=LTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=17882f97e3633c1e3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>> >>>> NB: Happy to rip it out... but want something in-reply to those threads (pretty please). >>> Basically... the logic is... >>> >>> The ZFS pool is built on vdevs of a specific name. The names that are used >>> should remain the same. Adding this to the loader.conf ensures that the names >>> that the pool(s) was/were built upon do not change. >>> >>> This goes beyond just a swap partition I imagine. For example... copying the >>> data to a new drive using a duplicator. I'm sure there are other cases too. >> Thanks for the explanation! I wonder if we should just turn off the disk ident stuff by default globally -- it was causing problems for me as well without ZFS root. > As I was making the commit to zfsboot... the very thought had occurred to me. > > I'm happy to rip this out in favor of a new global default. The end-result is that > what Johan experienced won't be repeated. > > I think there's an urgency to get something to solve this into 10. Yeah, I can see that. Let me bring this up on -CURRENT, with a short timeout, and see what the options are. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 22:04:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9A1266F; Mon, 16 Dec 2013 22:04:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C44151246; Mon, 16 Dec 2013 22:04:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGM4lOO040502; Mon, 16 Dec 2013 22:04:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGM4lse040501; Mon, 16 Dec 2013 22:04:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312162204.rBGM4lse040501@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 Dec 2013 22:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259484 - 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.17 Precedence: list List-Id: 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, 16 Dec 2013 22:04:48 -0000 Author: nwhitehorn Date: Mon Dec 16 22:04:47 2013 New Revision: 259484 URL: http://svnweb.freebsd.org/changeset/base/259484 Log: Use the common Open Firmware PCI interrupt routing code instead of the duplicate version in dev/fdt. Tested by: zbb Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Mon Dec 16 19:59:34 2013 (r259483) +++ head/sys/arm/mv/mv_pci.c Mon Dec 16 22:04:47 2013 (r259484) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -142,7 +143,7 @@ struct mv_pcib_softc { int sc_type; int sc_mode; /* Endpoint / Root Complex */ - struct fdt_pci_intr sc_intr_info; + struct ofw_bus_iinfo sc_pci_iinfo; }; /* Local forward prototypes */ @@ -155,7 +156,6 @@ static void mv_pcib_hw_cfgwrite(struct m static int mv_pcib_init(struct mv_pcib_softc *, int, int); static int mv_pcib_init_all_bars(struct mv_pcib_softc *, int, int, int, int); static void mv_pcib_init_bridge(struct mv_pcib_softc *, int, int, int); -static int mv_pcib_intr_info(phandle_t, struct mv_pcib_softc *); static inline void pcib_write_irq_mask(struct mv_pcib_softc *, uint32_t); static void mv_pcib_enable(struct mv_pcib_softc *, uint32_t); static int mv_pcib_mem_init(struct mv_pcib_softc *); @@ -243,8 +243,8 @@ mv_pcib_probe(device_t self) if (!fdt_is_type(node, "pci")) return (ENXIO); - if (!(fdt_is_compatible(node, "mrvl,pcie") || - fdt_is_compatible(node, "mrvl,pci"))) + if (!(ofw_bus_is_compatible(self, "mrvl,pcie") || + ofw_bus_is_compatible(self, "mrvl,pci"))) return (ENXIO); device_set_desc(self, "Marvell Integrated PCI/PCI-E Controller"); @@ -299,11 +299,8 @@ mv_pcib_attach(device_t self) /* * Get PCI interrupt info. */ - if ((sc->sc_mode == MV_MODE_ROOT) && - (mv_pcib_intr_info(node, sc) != 0)) { - device_printf(self, "could not retrieve interrupt info\n"); - return (ENXIO); - } + if (sc->sc_mode == MV_MODE_ROOT) + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(pcell_t)); /* * Configure decode windows for PCI(E) access. @@ -881,19 +878,33 @@ mv_pcib_write_config(device_t dev, u_int } static int -mv_pcib_route_interrupt(device_t pcib, device_t dev, int pin) +mv_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct mv_pcib_softc *sc; - int err, interrupt; - - sc = device_get_softc(pcib); - - err = fdt_pci_route_intr(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev), pin, &sc->sc_intr_info, &interrupt); - if (err == 0) - return (interrupt); + struct ofw_pci_register reg; + uint32_t pintr, mintr; + phandle_t iparent; + uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; + + 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); + + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, + sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + &iparent, maskbuf)) + return (ofw_bus_map_intr(dev, iparent, mintr)); + + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); - device_printf(pcib, "could not route pin %d for device %d.%d\n", + 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); } @@ -938,17 +949,6 @@ mv_pcib_decode_win(phandle_t node, struc return (0); } -static int -mv_pcib_intr_info(phandle_t node, struct mv_pcib_softc *sc) -{ - int error; - - if ((error = fdt_pci_intr_info(node, &sc->sc_intr_info)) != 0) - return (error); - - return (0); -} - #if defined(SOC_MV_ARMADAXP) static int mv_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 23:57:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D445633; Mon, 16 Dec 2013 23:57:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F316D1D4C; Mon, 16 Dec 2013 23:57:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGNvhPP081709; Mon, 16 Dec 2013 23:57:43 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGNvhrr081706; Mon, 16 Dec 2013 23:57:43 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312162357.rBGNvhrr081706@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Dec 2013 23:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259487 - head/sys/dev/netmap 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.17 Precedence: list List-Id: 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, 16 Dec 2013 23:57:44 -0000 Author: luigi Date: Mon Dec 16 23:57:43 2013 New Revision: 259487 URL: http://svnweb.freebsd.org/changeset/base/259487 Log: fix the build using __builtin_prefetch() instead of redefining prefetch() Modified: head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Dec 16 23:57:43 2013 (r259487) @@ -220,8 +220,8 @@ ixgbe_netmap_txsync(struct netmap_adapte if (nm_i != cur) { /* we have new packets to send */ nic_i = netmap_idx_k2n(kring, nm_i); - prefetch(&ring->slot[nm_i]); - prefetch(&txr->tx_buffers[nic_i]); + __builtin_prefetch(&ring->slot[nm_i]); + __builtin_prefetch(&txr->tx_buffers[nic_i]); for (n = 0; nm_i != cur; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; @@ -237,8 +237,8 @@ ixgbe_netmap_txsync(struct netmap_adapte IXGBE_TXD_CMD_RS : 0; /* prefetch for next round */ - prefetch(&ring->slot[nm_i + 1]); - prefetch(&txr->tx_buffers[nic_i + 1]); + __builtin_prefetch(&ring->slot[nm_i + 1]); + __builtin_prefetch(&txr->tx_buffers[nic_i + 1]); NM_CHECK_ADDR_LEN(addr, len); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/netmap_kern.h Mon Dec 16 23:57:43 2013 (r259487) @@ -61,7 +61,6 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) -#define prefetch(x) __builtin_prefetch(x) MALLOC_DECLARE(M_NETMAP); Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/netmap_vale.c Mon Dec 16 23:57:43 2013 (r259487) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -// #define prefetch(x) __builtin_prefetch(x) - #define BDG_RWLOCK_T struct rwlock // struct rwlock @@ -1003,7 +1001,7 @@ nm_bdg_preflush(struct netmap_vp_adapter ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? (void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot); - prefetch(buf); + __builtin_prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { frags++; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 00:54:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14F5AF10; Tue, 17 Dec 2013 00:54:17 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 902A312BA; Tue, 17 Dec 2013 00:54:16 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id i17so4473689qcy.9 for ; Mon, 16 Dec 2013 16:54:15 -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=9HU4fnO6UR7BgsjGzEfIbvOMvHqRUaoqBELZpxpVdko=; b=ZdrrqLX6TpE345mWVEsadOdkcC3uHUyXY+e9knfeClkJcvYvyiHDy05nIWEOJUYybX 4HwWkf+BH3nGVb/FHdjQIUpoGUAQQoG8cqSZ8eE7Y4S4/HsBlQrKVKEc9QPFU3O6/7aq uKBKlK+spbq+0QKGLAzNJhhMwhz4cMUp3ssFkzY/9Y8YvCULD1zVF6uAIgPdRg/ccC/U N/NAYH7cFDUCgqYkpuDkFD+cq/QkucEQqgF2kjcHdvBv90VvJdHRZNSHTFi+r7o4xZse F2V+cPkTNA9aPXmCmpnb6gFpsgJh2+AQvPspZyySzBW8efNWthpp1QaTnQN2MO9PO7Bk 4PVg== MIME-Version: 1.0 X-Received: by 10.224.67.200 with SMTP id s8mr37726510qai.75.1387241655792; Mon, 16 Dec 2013 16:54:15 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 16:54:15 -0800 (PST) Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 16:54:15 -0800 (PST) In-Reply-To: <20131216204021.GW29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> <20131216204021.GW29088@FreeBSD.org> Date: Mon, 16 Dec 2013 16:54:15 -0800 X-Google-Sender-Auth: qxXvn-GqDuSLp7kYpuJ0AWT5RVw Message-ID: Subject: Re: svn commit: r259475 - head/sys/kern From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 00:54:17 -0000 Ok. I'll go find where I copy pastes thus from. The mbuf code perhaps? Should we do a big quick tidy up? Adrian On Dec 16, 2013 1:40 PM, "Gleb Smirnoff" wrote: > Adrian, > > On Mon, Dec 16, 2013 at 07:31:24PM +0000, Adrian Chadd wrote: > A> Modified: head/sys/kern/uipc_syscalls.c > A> > ============================================================================== > A> --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 > (r259474) > A> +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 > (r259475) > A> @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); > A> #include > A> #endif > A> > A> +#include > A> +#include > A> +#include > A> #include > A> > A> #include > A> @@ -130,6 +133,7 @@ static int sfreadahead = 1; > A> SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, > A> &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE > blocks"); > A> > A> +static uma_zone_t zone_sfsync; > A> > A> static void > A> sfstat_init(const void *unused) > A> @@ -140,6 +144,22 @@ sfstat_init(const void *unused) > A> } > A> SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); > A> > A> +static void > A> +sf_sync_init(const void *unused) > A> +{ > A> + > A> + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct > sendfile_sync), > A> + NULL, NULL, > A> +#ifdef INVARIANTS > A> + trash_init, trash_fini, > A> +#else > A> + NULL, NULL, > A> +#endif > A> + UMA_ALIGN_CACHE, > A> + 0); > A> +} > > You do not need the INVARIANTS ifdef, because uma(9) will do the same thing > for you automatically. Thus, you also do not need to pollute namespace with > uma_int.h and uma_dbg.h. > > -- > Totus tuus, Glebius. > From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 01:29:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AE6EEDC; Tue, 17 Dec 2013 01:29:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0408115B6; Tue, 17 Dec 2013 01:29:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBH1TXYf051215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Dec 2013 05:29:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBH1TXG9051214; Tue, 17 Dec 2013 05:29:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Dec 2013 05:29:33 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259475 - head/sys/kern Message-ID: <20131217012933.GY29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> <20131216204021.GW29088@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 01:29:37 -0000 On Mon, Dec 16, 2013 at 04:54:15PM -0800, Adrian Chadd wrote: A> Ok. I'll go find where I copy pastes thus from. The mbuf code perhaps? A> A> Should we do a big quick tidy up? Nope, the mbuf code is somewhat different, due to secondary zones. An item freed there isn't actually freed, that's why they need a shift of trashing memory not in ctor/dtor, but in init/fini. Actually, now I see that your code is not only extraneous but wrong. You probably wanted to set ctor/dtor methods, not init/fini. So just remove it, in case of INVARIANTS the UMA automatically does all needed trash filling and later checking. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 03:06:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DCF8A98; Tue, 17 Dec 2013 03:06:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9131F73; Tue, 17 Dec 2013 03:06:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH36MLK052556; Tue, 17 Dec 2013 03:06:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH36MtI052555; Tue, 17 Dec 2013 03:06:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312170306.rBH36MtI052555@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 Dec 2013 03:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259489 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 03:06:22 -0000 Author: adrian Date: Tue Dec 17 03:06:21 2013 New Revision: 259489 URL: http://svnweb.freebsd.org/changeset/base/259489 Log: Remove the invariants stuff I copy/paste'd from the mbuf code when setting up the UMA zone. This should (a) be correct(er) and (b) it should build on non-amd64. Pointed out by: glebius Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Dec 17 01:02:34 2013 (r259488) +++ head/sys/kern/uipc_syscalls.c Tue Dec 17 03:06:21 2013 (r259489) @@ -80,9 +80,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include -#include #include #include @@ -95,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(INET) || defined(INET6) #ifdef SCTP @@ -150,11 +148,7 @@ sf_sync_init(const void *unused) zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), NULL, NULL, -#ifdef INVARIANTS - trash_init, trash_fini, -#else NULL, NULL, -#endif UMA_ALIGN_CACHE, 0); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 03:38:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 937A4AD8; Tue, 17 Dec 2013 03:38:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF00121E; Tue, 17 Dec 2013 03:38:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH3caiI063801; Tue, 17 Dec 2013 03:38:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH3caqG063800; Tue, 17 Dec 2013 03:38:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312170338.rBH3caqG063800@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 17 Dec 2013 03:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259490 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 17 Dec 2013 03:38:36 -0000 Author: rodrigc Date: Tue Dec 17 03:38:36 2013 New Revision: 259490 URL: http://svnweb.freebsd.org/changeset/base/259490 Log: Add release note items from Chelsio. Submitted by: np Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 03:06:21 2013 (r259489) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 03:38:36 2013 (r259490) @@ -248,6 +248,12 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. + The &man.cxgbe.4; driver has been updated to support + 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. + + The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + (kernel verbs only) for Chelsio's T4 and T5 based cards. + From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 04:19:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF6FFDED; Tue, 17 Dec 2013 04:19:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBD8162E; Tue, 17 Dec 2013 04:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH4J3dp078737; Tue, 17 Dec 2013 04:19:03 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH4J38J078736; Tue, 17 Dec 2013 04:19:03 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312170419.rBH4J38J078736@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 17 Dec 2013 04:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259493 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 17 Dec 2013 04:19:03 -0000 Author: rodrigc Date: Tue Dec 17 04:19:03 2013 New Revision: 259493 URL: http://svnweb.freebsd.org/changeset/base/259493 Log: Add OFED and Mellanox items to release notes. Submitted by: Meny Yossefi Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:16:20 2013 (r259492) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:19:03 2013 (r259493) @@ -254,6 +254,15 @@ The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. + The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + updated to the same version as supplied by Linux version 3.7 + + The Mellanox Infiniband driver has been updated to firmware + version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where + each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added + for dynamically loading kernel modules for Infiniband core (ibcore) and + IP over Infiniband (ipoib). + From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 04:50:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1B0D9B0 for ; Tue, 17 Dec 2013 04:50:21 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAB8D186C for ; Tue, 17 Dec 2013 04:50:21 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id m20so4509695qcx.18 for ; Mon, 16 Dec 2013 20:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=dMXMgcrG+09Zoe/v19vfESVoM/mZARhjH/hCeGAja7g=; b=kmaYJUi53HWrqWml2n9IjNop27lHpgaPZcHJRDyGf1i/r+CK/88mJsRINYXLJ+9gwj t5xp3sR6VYWMYd1Rypq7tE8LzQ6I+jh4yec27j1bF/AI4pmZwa3sF5leQ4077ij6WXsC MwdJJPhRkah/lE3U1BdH4AMIVrAFFSMt6gt8c= 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:from:date :message-id:subject:to:cc:content-type; bh=dMXMgcrG+09Zoe/v19vfESVoM/mZARhjH/hCeGAja7g=; b=mKOhO7QxxH+4K8uGf/+lA8gcrot4z4lL0PvUXxOJU23BqLazf2UQdrpWBVvJeGtJrA EV56W5Z/2Lg1+1OUO6Jilr+ubLCY0FEy6N7JhvtUYqO3UPg9gOgk+e9GA6rcoTZHzsTe 9AblmO3Lh91KIfvTQfc11KKk7n/g0X5vhl1VT1Trs/kVu9ywKM23eIrfeAI4pT9Yevwz CyHiqrdA497VooTsn2H6Dv7JvOATAR7/URhLaCCdd9fBFlQnLrCRIE13r5ynPmFdTZMX vSWJrA7PqYV2RCHQD4OTnnzHFUavGgcdxLTLiPl4O989tDVLGzeN4r1SDNTei+/HPF3c KYuw== X-Gm-Message-State: ALoCoQlBPmfyURMR1qbOoOo6xAYOfNHWxwJ5+I13r9c/ubEn4M7i9X1Bvum6Huu7c6wlNg4iACDR X-Received: by 10.229.194.1 with SMTP id dw1mr39033788qcb.20.1387255820318; Mon, 16 Dec 2013 20:50:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.86.42 with HTTP; Mon, 16 Dec 2013 20:49:50 -0800 (PST) In-Reply-To: <201312161954.rBGJsto3090999@svn.freebsd.org> References: <201312161954.rBGJsto3090999@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 23:49:50 -0500 Message-ID: Subject: Re: svn commit: r259481 - head/usr.sbin/bsdinstall/scripts To: Devin Teske Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 04:50:22 -0000 On Mon, Dec 16, 2013 at 2:54 PM, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 19:54:55 2013 > New Revision: 259481 > URL: http://svnweb.freebsd.org/changeset/base/259481 > > Log: > Auto-enable 4k sector alignment when disk encryption is requested (it is > required in such a case). Nice > But don't prevent the user from pointing the > gun at his/her foot -- you can disable 4k alignment after enabling geli). Why? Is there ever a reason you would want to do this? -- Eitan Adler From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 04:55:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96337C5E for ; Tue, 17 Dec 2013 04:55:36 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF091907 for ; Tue, 17 Dec 2013 04:55:36 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so4578170qcv.15 for ; Mon, 16 Dec 2013 20:55:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AjezaFV2EjIr5e8wtU94VkDiRqAFxlB7zFRuTRDu9uY=; b=mTxE6cvIuwQ2UTqeaYdd0NSR3gM1gYelwl5LnoS+N2S+wtsRcR7EnxpMbAWI4kOHQM I82arjFz+pcQ/rKORY1NX1LipB5dW5IQSJFvnhVdqwf0iGAA1682eVhaqTc4xnkoo08T 4RC5JAwn06r+i6ZhRi/YGB5wQp0ZHjqgAhExk= 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=AjezaFV2EjIr5e8wtU94VkDiRqAFxlB7zFRuTRDu9uY=; b=jzaf7LwpZstDNqqVhJdy124I6kxpzeCt4nfoCHSWHlWNEnF46QX81kjX4NM6Z0wX1v k18E4Qo/1zS2NUUEqmOHbGTcTGocYG5fJaFEtIstdtc9Q8UliuPCx7QqAZr5BNMknUOE yBK4auSIKgH2SZN8td52qIAjqXNFjdQILQY25jGWnPVKRBIdbITOCPvElYB2sLXZVYs4 ivyj4CosvagBNZCFdQ/hmreDO8hSvG1V/OzhDkdRRqrSfzcmIiIv2k40vPddGEpoG9cY ttYKMvAKKz9y4hOr3hEMk11AXfGHHorDRJG2TN9aFYL25h0PCLAulnRgJlJ1wthzze3r M17Q== X-Gm-Message-State: ALoCoQnsslMYp/InnC4LFk+9pqj/DZcfk2B4C6Z/sGmtBTk7xiWNwzE/Og454QcMT2EiDMTWdOu7 X-Received: by 10.224.61.198 with SMTP id u6mr39235440qah.41.1387256135524; Mon, 16 Dec 2013 20:55:35 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.86.42 with HTTP; Mon, 16 Dec 2013 20:55:05 -0800 (PST) In-Reply-To: <201312161103.rBGB3xm4091806@svn.freebsd.org> References: <201312161103.rBGB3xm4091806@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 23:55:05 -0500 X-Google-Sender-Auth: lVLNo-p446VYTjEd1jqFwRnzz-E Message-ID: Subject: Re: svn commit: r259463 - in head/etc: defaults rc.d To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 04:55:36 -0000 On Mon, Dec 16, 2013 at 6:03 AM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Mon Dec 16 11:03:59 2013 > New Revision: 259463 > URL: http://svnweb.freebsd.org/changeset/base/259463 > > Log: > Start-up script for casperd daemon. > > Sponsored by: The FreeBSD Foundation > > Added: > head/etc/rc.d/casperd (contents, props changed) > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/Makefile > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Mon Dec 16 10:50:13 2013 (r259462) > +++ head/etc/defaults/rc.conf Mon Dec 16 11:03:59 2013 (r259463) > @@ -658,6 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a > newsyslog_flags="-CN" # Newsyslog flags to create marked files > mixer_enable="YES" # Run the sound mixer. > opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off > +casperd_enable="NO" # casperd(8) daemon Why is casper disabled by default? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 05:13:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78DBE70C; Tue, 17 Dec 2013 05:13:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 660F01A95; Tue, 17 Dec 2013 05:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH5DceL099491; Tue, 17 Dec 2013 05:13:38 GMT (envelope-from milki@svn.freebsd.org) Received: (from milki@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH5DcRJ099490; Tue, 17 Dec 2013 05:13:38 GMT (envelope-from milki@svn.freebsd.org) Message-Id: <201312170513.rBH5DcRJ099490@svn.freebsd.org> From: Jonathan Chu Date: Tue, 17 Dec 2013 05:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259495 - head/share/misc 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.17 Precedence: list List-Id: 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, 17 Dec 2013 05:13:38 -0000 Author: milki (ports committer) Date: Tue Dec 17 05:13:37 2013 New Revision: 259495 URL: http://svnweb.freebsd.org/changeset/base/259495 Log: milki is a new committer for ports. Approved by: swills (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Dec 17 04:26:20 2013 (r259494) +++ head/share/misc/committers-ports.dot Tue Dec 17 05:13:37 2013 (r259495) @@ -154,6 +154,7 @@ mat [label="Mathieu Arnold\nmat@FreeBSD. matthew [label="Matthew Seaman\nmatthew@FreeBSD.org\n2012/02/07"] mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] mharo [label="Michael Haro\nmharo@FreeBSD.org\n1999/04/13"] +milki [label="Jonathan Chu\nmilki@FreeBSD.org\n2013/12/15"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] mm [label="Martin Matuska\nmm@FreeBSD.org\n2007/04/04"] mnag [label="Marcus Alves Grando\nmnag@FreeBSD.org\n2005/09/15"] @@ -301,6 +302,7 @@ eadler -> antoine eadler -> dbn eadler -> bdrewery eadler -> gjb +eadler -> milki eadler -> tj eadler -> vg @@ -510,6 +512,7 @@ stas -> araujo steve -> netchild swills -> feld +swills -> milki swills -> pclin tabthorpe -> ashish From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 07:47:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AB4F20D; Tue, 17 Dec 2013 07:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E102A169B; Tue, 17 Dec 2013 07:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH7lRaS053647; Tue, 17 Dec 2013 07:47:27 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH7lRKG053646; Tue, 17 Dec 2013 07:47:27 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312170747.rBH7lRKG053646@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Dec 2013 07:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259497 - head/sys/i386/i386 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.17 Precedence: list List-Id: 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, 17 Dec 2013 07:47:28 -0000 Author: pluknet Date: Tue Dec 17 07:47:27 2013 New Revision: 259497 URL: http://svnweb.freebsd.org/changeset/base/259497 Log: Nuke symbols.raw This file seems to be unused since the switch to the ELF binary format. Discussed with: jhb Deleted: head/sys/i386/i386/symbols.raw From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 07:59:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31DF3407; Tue, 17 Dec 2013 07:59:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D760173F; Tue, 17 Dec 2013 07:59:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH7x0JK057236; Tue, 17 Dec 2013 07:59:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH7x05p057235; Tue, 17 Dec 2013 07:59:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312170759.rBH7x05p057235@svn.freebsd.org> From: Dimitry Andric Date: Tue, 17 Dec 2013 07:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259498 - head/contrib/llvm/tools/clang/lib/Headers 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.17 Precedence: list List-Id: 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, 17 Dec 2013 07:59:01 -0000 Author: dim Date: Tue Dec 17 07:59:00 2013 New Revision: 259498 URL: http://svnweb.freebsd.org/changeset/base/259498 Log: Pull in r197399 from upstream clang trunk: Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Modified: head/contrib/llvm/tools/clang/lib/Headers/cpuid.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Tue Dec 17 07:47:27 2013 (r259497) +++ head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Tue Dec 17 07:59:00 2013 (r259498) @@ -79,6 +79,7 @@ #define bit_ACPI 0x00400000 #define bit_MMX 0x00800000 #define bit_FXSR 0x01000000 +#define bit_FXSAVE bit_FXSR /* for gcc compat */ #define bit_SSE 0x02000000 #define bit_SSE2 0x04000000 #define bit_SS 0x08000000 From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 10:33:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E2AF328; Tue, 17 Dec 2013 10:33:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7BA144D; Tue, 17 Dec 2013 10:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHAXSCt015280; Tue, 17 Dec 2013 10:33:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHAXScc015279; Tue, 17 Dec 2013 10:33:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312171033.rBHAXScc015279@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 17 Dec 2013 10:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259502 - head/sbin/iscontrol 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.17 Precedence: list List-Id: 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, 17 Dec 2013 10:33:28 -0000 Author: trasz Date: Tue Dec 17 10:33:27 2013 New Revision: 259502 URL: http://svnweb.freebsd.org/changeset/base/259502 Log: Reword the part about mutual CHAP. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sbin/iscontrol/iscsi.conf.5 Modified: head/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- head/sbin/iscontrol/iscsi.conf.5 Tue Dec 17 10:03:04 2013 (r259501) +++ head/sbin/iscontrol/iscsi.conf.5 Tue Dec 17 10:33:27 2013 (r259502) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2013 +.Dd December 17, 2013 .Dt ISCSI.CONF 5 .Os .Sh NAME @@ -145,10 +145,9 @@ the chap-name, defaults to .Em hostname . .It Cm chapDigest can be MD5 or SHA1. -.It Cm tgtChapSecret/tgtChapName -same as the none -.Em tgt -counterpart, but to authenticate the target. +.It Cm tgtChapName/tgtChapSecret +name and secret used for mutual CHAP; by default, mutual CHAP +is not used. .El .Sh FILES .Bl -tag -width indent From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 10:53:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2298791A; Tue, 17 Dec 2013 10:53:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F13315E2; Tue, 17 Dec 2013 10:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHArHEr022370; Tue, 17 Dec 2013 10:53:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHArHM8022369; Tue, 17 Dec 2013 10:53:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312171053.rBHArHM8022369@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 17 Dec 2013 10:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259503 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 10:53:18 -0000 Author: ae Date: Tue Dec 17 10:53:17 2013 New Revision: 259503 URL: http://svnweb.freebsd.org/changeset/base/259503 Log: Free mbuf in case of error. MFC after: 1 week Modified: head/sys/netinet6/send.c Modified: head/sys/netinet6/send.c ============================================================================== --- head/sys/netinet6/send.c Tue Dec 17 10:33:27 2013 (r259502) +++ head/sys/netinet6/send.c Tue Dec 17 10:53:17 2013 (r259503) @@ -163,6 +163,7 @@ send_output(struct mbuf *m, struct ifnet nd6_ra_input(m, sizeof(struct ip6_hdr), icmp6len); break; default: + m_freem(m); return (ENOSYS); } return (0); From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 11:15:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61A54F55; Tue, 17 Dec 2013 11:15:10 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 846C5177E; Tue, 17 Dec 2013 11:15:09 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id z2so3509170wiv.7 for ; Tue, 17 Dec 2013 03:15:08 -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=mNd4Cb2Sn19M7agcgqABwtLFDsWFpNpWgFj1kzz9zyM=; b=ToHK98YsOd1hxhT9EFm+x6VOIuD2+MMrkXWjvYBh4EWTVVeHr++oJxmH/XjGGhJxTx gIeCf4ZPCll29EgRMEORmBaOXuA3xOj4ubu5S9r84MTKzzq4EMs6NX9MW4J8ZiMTMlFp EJ4s4YhfcychRN6Mu2IFJry5YY69H7MkUU1aEXpeCsmOfDq+XUO6cDnrYZqdwI7cJ0ft HLJl7crLwtOvOqFRl6ewR309/cMrIp0itfH8wyEPuGGs+gwK2LcByiz0pwy0FCJmQTOv QnJoZ2YdkuscXtpA0o3pKL4q6M7vPMXkulAinJk7ULuZtaLwhDdTjDLf0uQANGdNlIy0 a+KQ== MIME-Version: 1.0 X-Received: by 10.194.237.226 with SMTP id vf2mr12055913wjc.58.1387278907996; Tue, 17 Dec 2013 03:15:07 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.217.64.198 with HTTP; Tue, 17 Dec 2013 03:15:07 -0800 (PST) In-Reply-To: <201312150837.rBF8bON1011577@svn.freebsd.org> References: <201312150837.rBF8bON1011577@svn.freebsd.org> Date: Tue, 17 Dec 2013 15:15:07 +0400 X-Google-Sender-Auth: txMFFxnHx9x6PlmwrzaZRG1t4QQ Message-ID: Subject: Re: svn commit: r259412 - in head/sys: conf dev/netmap modules/netmap net From: Sergey Kandaurov To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 11:15:10 -0000 On 15 December 2013 12:37, Luigi Rizzo wrote: > Author: luigi > Date: Sun Dec 15 08:37:24 2013 > New Revision: 259412 > URL: http://svnweb.freebsd.org/changeset/base/259412 > > Log: > split netmap code according to functions: > - netmap.c base code > - netmap_freebsd.c FreeBSD-specific code > - netmap_generic.c emulate netmap over standard drivers > - netmap_mbq.c simple mbuf tailq > - netmap_mem2.c memory management > - netmap_vale.c VALE switch > > simplify devce-specific code > This breaks VIMAGE due to removal of necessary includes in netmap.c. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 13:37:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D67C8FE3; Tue, 17 Dec 2013 13:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2ADD12D0; Tue, 17 Dec 2013 13:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDb2OE080947; Tue, 17 Dec 2013 13:37:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDb2Yx080943; Tue, 17 Dec 2013 13:37:02 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201312171337.rBHDb2Yx080943@svn.freebsd.org> From: Attilio Rao Date: Tue, 17 Dec 2013 13:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259509 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 13:37:02 -0000 Author: attilio Date: Tue Dec 17 13:37:02 2013 New Revision: 259509 URL: http://svnweb.freebsd.org/changeset/base/259509 Log: - Assert for not leaking readers rw locks counter on userland return. - Use a correct spin_cnt for KDTRACE_HOOK case in rw read lock. Sponsored by: EMC / Isilon storage division Modified: head/sys/kern/kern_rwlock.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Dec 17 13:18:41 2013 (r259508) +++ head/sys/kern/kern_rwlock.c Tue Dec 17 13:37:02 2013 (r259509) @@ -440,6 +440,9 @@ __rw_rlock(volatile uintptr_t *c, const break; cpu_spinwait(); } +#ifdef KDTRACE_HOOKS + spin_cnt += rowner_loops - i; +#endif if (i != rowner_loops) continue; } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Dec 17 13:18:41 2013 (r259508) +++ head/sys/kern/subr_trap.c Tue Dec 17 13:37:02 2013 (r259509) @@ -152,6 +152,9 @@ userret(struct thread *td, struct trapfr ("userret: Returning in a critical section")); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held", td->td_locks)); + KASSERT(td->td_rw_rlocks == 0, + ("userret: Returning with %d rwlocks held in read mode", + td->td_rw_rlocks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); KASSERT(td->td_no_sleeping == 0, From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 14:50:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6EF8D78; Tue, 17 Dec 2013 14:50:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 872541ADB; Tue, 17 Dec 2013 14:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHEoajx009880; Tue, 17 Dec 2013 14:50:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHEoaeB009878; Tue, 17 Dec 2013 14:50:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171450.rBHEoaeB009878@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 14:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259513 - in head/sys: dev/ofw 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.17 Precedence: list List-Id: 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, 17 Dec 2013 14:50:36 -0000 Author: nwhitehorn Date: Tue Dec 17 14:50:35 2013 New Revision: 259513 URL: http://svnweb.freebsd.org/changeset/base/259513 Log: Configure interrupt sense based on device tree information. This extends the OF interrupt map API to return sense information to the caller and the PowerPC Open Firmware PCI base driver to use it to program the PIC. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 13:49:35 2013 (r259512) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 14:50:35 2013 (r259513) @@ -285,7 +285,7 @@ ofw_bus_lookup_imap(phandle_t node, stru * maskbuf must point to a buffer of length physsz + intrsz. * The interrupt is returned in result, which must point to a buffer of length * rintrsz (which gives the expected size of the mapped interrupt). - * Returns 1 if a mapping was found, 0 otherwise. + * Returns number of cells in the interrupt if a mapping was found, 0 otherwise. */ int ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz, @@ -325,19 +325,13 @@ ofw_bus_search_intrmap(void *intr, int i tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); - /* - * XXX: Apple hardware uses a second cell to set information - * on the interrupt trigger type. This information should - * be used somewhere to program the PIC. - */ - if (bcmp(ref, mptr, physsz + intrsz) == 0) { bcopy(mptr + physsz + intrsz + sizeof(parent), - result, rintrsz); + result, MIN(rintrsz, pintrsz)); if (iparent != NULL) *iparent = parent; - return (1); + return (pintrsz/sizeof(pcell_t)); } mptr += tsz; i -= tsz; Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 13:49:35 2013 (r259512) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 14:50:35 2013 (r259513) @@ -256,7 +256,8 @@ ofw_pci_route_interrupt(device_t bus, de { struct ofw_pci_softc *sc; struct ofw_pci_register reg; - uint32_t pintr, mintr; + uint32_t pintr, mintr[2]; + int intrcells; phandle_t iparent; uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; @@ -269,10 +270,15 @@ ofw_pci_route_interrupt(device_t bus, de (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) - return (ofw_bus_map_intr(dev, iparent, mintr)); + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent, maskbuf); + if (intrcells) { + pintr = ofw_bus_map_intr(dev, iparent, mintr[0]); + if (intrcells == 2) + ofw_bus_config_intr(dev, pintr, mintr[1]); + return (pintr); + } /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 14:51:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3DF0ED9; Tue, 17 Dec 2013 14:51:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 829931AEF; Tue, 17 Dec 2013 14:51:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHEpme7010488; Tue, 17 Dec 2013 14:51:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHEpmLW010486; Tue, 17 Dec 2013 14:51:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171451.rBHEpmLW010486@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 14:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259514 - head/sys/dev/fdt 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.17 Precedence: list List-Id: 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, 17 Dec 2013 14:51:48 -0000 Author: nwhitehorn Date: Tue Dec 17 14:51:47 2013 New Revision: 259514 URL: http://svnweb.freebsd.org/changeset/base/259514 Log: Remove dead code. Most of this was in an #if 0 block; the rest is not used and duplicates functionality in dev/ofw. Modified: head/sys/dev/fdt/fdt_common.h head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Tue Dec 17 14:50:35 2013 (r259513) +++ head/sys/dev/fdt/fdt_common.h Tue Dec 17 14:51:47 2013 (r259514) @@ -47,14 +47,6 @@ struct fdt_pci_range { u_long len; }; -struct fdt_pci_intr { - int addr_cells; - int intr_cells; - int map_len; - pcell_t *map; - pcell_t *mask; -}; - struct fdt_sense_level { enum intr_trigger trig; enum intr_polarity pol; @@ -110,11 +102,9 @@ int fdt_is_enabled(phandle_t); int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_pci_intr_info(phandle_t, struct fdt_pci_intr *); int fdt_pci_ranges(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); int fdt_pci_ranges_decode(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); -int fdt_pci_route_intr(int, int, int, int, struct fdt_pci_intr *, int *); int fdt_ranges_verify(pcell_t *, int, int, int, int); int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Tue Dec 17 14:50:35 2013 (r259513) +++ head/sys/dev/fdt/fdt_pci.c Tue Dec 17 14:51:47 2013 (r259514) @@ -180,159 +180,6 @@ fdt_pci_ranges(phandle_t node, struct fd return (0); } -static int -fdt_addr_cells(phandle_t node, int *addr_cells) -{ - pcell_t cell; - int cell_size; - - cell_size = sizeof(cell); - if (OF_getprop(node, "#address-cells", &cell, cell_size) < cell_size) - return (EINVAL); - *addr_cells = fdt32_to_cpu((int)cell); - - if (*addr_cells > 3) - return (ERANGE); - return (0); -} - -static int -fdt_interrupt_cells(phandle_t node) -{ - pcell_t intr_cells; - - if (OF_getprop(node, "#interrupt-cells", &intr_cells, - sizeof(intr_cells)) <= 0) { - debugf("no intr-cells defined, defaulting to 1\n"); - intr_cells = 1; - } - intr_cells = fdt32_to_cpu(intr_cells); - - return ((int)intr_cells); -} - -int -fdt_pci_intr_info(phandle_t node, struct fdt_pci_intr *intr_info) -{ - void *map, *mask; - int acells, icells; - int error, len; - - error = fdt_addr_cells(node, &acells); - if (error) - return (error); - - icells = fdt_interrupt_cells(node); - - /* - * Retrieve the interrupt map and mask properties. - */ - len = OF_getprop_alloc(node, "interrupt-map-mask", 1, &mask); - if (len / sizeof(pcell_t) != (acells + icells)) { - debugf("bad mask len = %d\n", len); - goto err; - } - - len = OF_getprop_alloc(node, "interrupt-map", 1, &map); - if (len <= 0) { - debugf("bad map len = %d\n", len); - goto err; - } - - intr_info->map_len = len; - intr_info->map = map; - intr_info->mask = mask; - intr_info->addr_cells = acells; - intr_info->intr_cells = icells; - - debugf("acells=%u, icells=%u, map_len=%u\n", acells, icells, len); - return (0); - -err: - free(mask, M_OFWPROP); - return (ENXIO); -} - -int -fdt_pci_route_intr(int bus, int slot, int func, int pin, - struct fdt_pci_intr *intr_info, int *interrupt) -{ - pcell_t child_spec[4], masked[4]; - phandle_t iph; - pcell_t intr_par; - pcell_t *map_ptr; - uint32_t addr; - int i, j, map_len; - int par_intr_cells, par_addr_cells, child_spec_cells, row_cells; - int par_idx, spec_idx, err, trig, pol; - - child_spec_cells = intr_info->addr_cells + intr_info->intr_cells; - if (child_spec_cells > sizeof(child_spec) / sizeof(pcell_t)) - return (ENOMEM); - - addr = (bus << 16) | (slot << 11) | (func << 8); - child_spec[0] = addr; - child_spec[1] = 0; - child_spec[2] = 0; - child_spec[3] = pin; - - map_len = intr_info->map_len; - map_ptr = intr_info->map; - - par_idx = child_spec_cells; - i = 0; - while (i < map_len) { - iph = fdt32_to_cpu(map_ptr[par_idx]); - intr_par = OF_xref_phandle(iph); - - err = fdt_addr_cells(intr_par, &par_addr_cells); - if (err != 0) { - debugf("could not retrieve intr parent #addr-cells\n"); - return (err); - } - par_intr_cells = fdt_interrupt_cells(intr_par); - - row_cells = child_spec_cells + 1 + par_addr_cells + - par_intr_cells; - - /* - * Apply mask and look up the entry in interrupt map. - */ - for (j = 0; j < child_spec_cells; j++) { - masked[j] = child_spec[j] & - fdt32_to_cpu(intr_info->mask[j]); - - if (masked[j] != fdt32_to_cpu(map_ptr[j])) - goto next; - } - - /* - * Decode interrupt of the parent intr controller. - */ - spec_idx = child_spec_cells + 1 + par_addr_cells; - err = fdt_intr_decode(intr_par, &map_ptr[spec_idx], - interrupt, &trig, &pol); - if (err != 0) { - debugf("could not decode interrupt\n"); - return (err); - } - debugf("decoded intr = %d, trig = %d, pol = %d\n", *interrupt, - trig, pol); - -#if defined(__powerpc__) - powerpc_config_intr(FDT_MAP_IRQ(iph, *interrupt), trig, - pol); -#endif - return (0); - -next: - map_ptr += row_cells; - i += (row_cells * sizeof(pcell_t)); - } - - return (ENXIO); -} - #if defined(__arm__) int fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, @@ -360,217 +207,3 @@ fdt_pci_devmap(phandle_t node, struct ar } #endif -#if 0 -static int -fdt_pci_config_bar(device_t dev, int bus, int slot, int func, int bar) -{ -} - -static int -fdt_pci_config_normal(device_t dev, int bus, int slot, int func) -{ - int bar; - uint8_t command, intline, intpin; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - bar = 0; - while (bar <= PCIR_MAX_BAR_0) - bar += fdt_pci_config_bar(dev, bus, slot, func, bar); - - /* Perform interrupt routing. */ - intpin = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(dev, bus, slot, func, intpin); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); -} - -static int -fdt_pci_config_bridge(device_t dev, int bus, int secbus, int slot, int func) -{ - int maxbar; - uint8_t command; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - maxbar = (hdrtype & PCIM_HDRTYPE) ? 1 : 6; - bar = 0; - while (bar < maxbar) - bar += fsl_pcib_init_bar(sc, bus, slot, func, - bar); - - /* Perform interrupt routing. */ - intpin = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(sc, bus, slot, func, - intpin); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_COMMAND, command, 1); - - /* - * Handle PCI-PCI bridges - */ - class = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_CLASS, 1); - subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_SUBCLASS, 1); - - /* Allow only proper PCI-PCI briges */ - if (class != PCIC_BRIDGE) - continue; - if (subclass != PCIS_BRIDGE_PCI) - continue; - - secbus++; - - /* Program I/O decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEL_1, sc->sc_ioport.rm_start >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITL_1, sc->sc_ioport.rm_end >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEH_1, sc->sc_ioport.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITH_1, sc->sc_ioport.rm_end >> 16, 2); - - /* Program (non-prefetchable) memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMBASE_1, sc->sc_iomem.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMLIMIT_1, sc->sc_iomem.rm_end >> 16, 2); - - /* Program prefetchable memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEL_1, 0x0010, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITL_1, 0x000f, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEH_1, 0x00000000, 4); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITH_1, 0x00000000, 4); - - /* Read currect bus register configuration */ - old_pribus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_PRIBUS_1, 1); - old_secbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SECBUS_1, 1); - old_subbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SUBBUS_1, 1); - - if (bootverbose) - printf("PCI: reading firmware bus numbers for " - "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus); - - new_pribus = bus; - new_secbus = secbus; - - secbus = fsl_pcib_init(sc, secbus, - (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); - - new_subbus = secbus; - - if (bootverbose) - printf("PCI: translate firmware bus numbers " - "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus, - new_pribus, new_secbus, new_subbus); - - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PRIBUS_1, new_pribus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SECBUS_1, new_secbus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SUBBUS_1, new_subbus, 1); - -} - -static int -fdt_pci_config_slot(device_t dev, int bus, int secbus, int slot) -{ - int func, maxfunc; - uint16_t vendor; - uint8_t hdrtype; - - maxfunc = 0; - for (func = 0; func <= maxfunc; func++) { - hdrtype = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_HDRTYPE, 1); - if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) - continue; - if (func == 0 && (hdrtype & PCIM_MFDEV)) - maxfunc = PCI_FUNCMAX; - - vendor = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_VENDOR, 2); - if (vendor == 0xffff) - continue; - - if ((hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_NORMAL) - fdt_pci_config_normal(dev, bus, slot, func); - else - secbus = fdt_pci_config_bridge(dev, bus, secbus, - slot, func); - } - - return (secbus); -} - -static int -fdt_pci_config_bus(device_t dev, int bus, int maxslot) -{ - int func, maxfunc, secbus, slot; - - secbus = bus; - for (slot = 0; slot <= maxslot; slot++) - secbus = fdt_pci_config_slot(dev, bus, secbus, slot); - - return (secbus); -} - -int -fdt_pci_config_domain(device_t dev) -{ - pcell_t bus_range[2]; - phandle_t root; - int bus, error, maxslot; - - root = ofw_bus_get_node(dev); - if (root == 0) - return (EINVAL); - if (!fdt_is_type(root, "pci")) - return (EINVAL); - - /* - * Determine the bus number of the root in this domain. - * Lacking any information, this will be bus 0. - * Write the bus number to the bus device, using the IVAR. - */ - if ((OF_getprop(root, "bus-range", bus_range, sizeof(bus_range)) <= 0) - bus = 0; - else - bus = fdt32_to_cpu(bus_range[0]); - - error = BUS_WRITE_IVAR(dev, NULL, PCIB_IVAR_BUS, bus); - if (error) - return (error); - - /* Get the maximum slot number for bus-enumeration. */ - maxslot = PCIB_MAXSLOTS(dev); - - bus = fdt_pci_config_bus(dev, bus, maxslot); - return (0); -} -#endif From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 15:11:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB871816; Tue, 17 Dec 2013 15:11:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94F021D90; Tue, 17 Dec 2013 15:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFBRrQ018263; Tue, 17 Dec 2013 15:11:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFBPm4018244; Tue, 17 Dec 2013 15:11:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171511.rBHFBPm4018244@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 15:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259516 - in head/sys: arm/mv dev/ofw powerpc/ofw sparc64/ebus sparc64/isa sparc64/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.17 Precedence: list List-Id: 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, 17 Dec 2013 15:11:27 -0000 Author: nwhitehorn Date: Tue Dec 17 15:11:24 2013 New Revision: 259516 URL: http://svnweb.freebsd.org/changeset/base/259516 Log: Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf internally instead of requiring the caller to allocate it. Modified: head/sys/arm/mv/mv_pci.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/isa/ofw_isa.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/ofw_pcib_subr.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/arm/mv/mv_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -884,7 +884,6 @@ mv_pcib_route_interrupt(device_t bus, de struct ofw_pci_register reg; uint32_t pintr, mintr; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; @@ -897,7 +896,7 @@ mv_pcib_route_interrupt(device_t bus, de if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) + &iparent)) return (ofw_bus_map_intr(dev, iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 15:11:24 2013 (r259516) @@ -251,8 +251,9 @@ ofw_bus_setup_iinfo(phandle_t node, stru int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, - phandle_t *iparent, void *maskbuf) + phandle_t *iparent) { + uint8_t maskbuf[regsz + pintrsz]; int rv; if (ii->opi_imapsz <= 0) Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/dev/ofw/ofw_bus_subr.h Tue Dec 17 15:11:24 2013 (r259516) @@ -68,7 +68,7 @@ bus_child_pnpinfo_str_t ofw_bus_gen_chil /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, - void *, int, void *, int, phandle_t *, void *); + void *, int, void *, int, phandle_t *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -259,7 +259,6 @@ ofw_pci_route_interrupt(device_t bus, de uint32_t pintr, mintr[2]; int intrcells; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; @@ -272,7 +271,7 @@ ofw_pci_route_interrupt(device_t bus, de intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), - mintr, sizeof(mintr), &iparent, maskbuf); + mintr, sizeof(mintr), &iparent); if (intrcells) { pintr = ofw_bus_map_intr(dev, iparent, mintr[0]); if (intrcells == 2) Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -134,9 +134,9 @@ ofw_pcib_pci_route_interrupt(device_t br struct ofw_pcib_softc *sc; struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; - cell_t pintr, mintr; + cell_t pintr, mintr[2]; + int intrcells; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); ii = &sc->ops_iinfo; @@ -149,15 +149,20 @@ ofw_pcib_pci_route_interrupt(device_t br (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) { + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, + sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), + &iparent); + if (intrcells) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems * in some cases, and never seems to be required. */ - return (ofw_bus_map_intr(dev, iparent, mintr)); + mintr[0] = ofw_bus_map_intr(dev, iparent, mintr[0]); + if (intrcells == 2) + ofw_bus_config_intr(dev, mintr[0], mintr[1]); + + return (mintr[0]); } } else if (intpin >= 1 && intpin <= 4) { /* Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/ebus/ebus.c Tue Dec 17 15:11:24 2013 (r259516) @@ -638,7 +638,6 @@ ebus_setup_dinfo(device_t dev, struct eb uint64_t start; uint32_t rintr; int i, nintr, nreg, rv; - uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; edi = malloc(sizeof(*edi), M_DEVBUF, M_ZERO | M_WAITOK); if (ofw_bus_gen_setup_devinfo(&edi->edi_obdinfo, node) != 0) { @@ -673,7 +672,7 @@ ebus_setup_dinfo(device_t dev, struct eb intr = intrs[i]; rv = ofw_bus_lookup_imap(node, &sc->sc_iinfo, ®, sizeof(reg), &intr, sizeof(intr), &rintr, - sizeof(rintr), NULL, maskbuf); + sizeof(rintr), NULL); #ifndef SUN4V if (rv != 0) rintr = INTMAP_VEC(sc->sc_ign, rintr); Modified: head/sys/sparc64/isa/ofw_isa.c ============================================================================== --- head/sys/sparc64/isa/ofw_isa.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/isa/ofw_isa.c Tue Dec 17 15:11:24 2013 (r259516) @@ -129,7 +129,6 @@ ofw_isa_route_intr(device_t bridge, phan ofw_isa_intr_t intr) { struct isa_regs reg; - uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; device_t pbridge; ofw_isa_intr_t mintr; @@ -139,7 +138,7 @@ ofw_isa_route_intr(device_t bridge, phan * fully specified, so we may not continue to map. */ if (!ofw_bus_lookup_imap(node, ii, ®, sizeof(reg), - &intr, sizeof(intr), &mintr, sizeof(mintr), NULL, maskbuf)) { + &intr, sizeof(intr), &mintr, sizeof(mintr), NULL)) { /* Try routing at the parent bridge. */ mintr = PCIB_ROUTE_INTERRUPT(pbridge, bridge, intr); } Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/fire.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1470,13 +1470,12 @@ fire_route_interrupt(device_t bridge, de struct fire_softc *sc; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf) != 0) + NULL) != 0) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", Modified: head/sys/sparc64/pci/ofw_pcib_subr.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcib_subr.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/ofw_pcib_subr.c Tue Dec 17 15:11:24 2013 (r259516) @@ -70,7 +70,6 @@ ofw_pcib_gen_route_interrupt(device_t br struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); ii = &sc->ops_iinfo; @@ -78,7 +77,7 @@ ofw_pcib_gen_route_interrupt(device_t br pintr = intpin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) { + NULL)) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/psycho.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1046,13 +1046,12 @@ psycho_route_interrupt(device_t bridge, struct ofw_pci_register reg; bus_addr_t intrmap; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) + NULL)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/schizo.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1119,13 +1119,12 @@ schizo_route_interrupt(device_t bridge, struct schizo_softc *sc; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) + NULL)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 15:23:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4C3BDE3; Tue, 17 Dec 2013 15:23:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF3E91E70; Tue, 17 Dec 2013 15:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFNmkr022090; Tue, 17 Dec 2013 15:23:48 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFNmJ5022087; Tue, 17 Dec 2013 15:23:48 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312171523.rBHFNmJ5022087@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 17 Dec 2013 15:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259517 - in head/sys/arm: broadcom/bcm2835 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.17 Precedence: list List-Id: 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, 17 Dec 2013 15:23:48 -0000 Author: ray Date: Tue Dec 17 15:23:47 2013 New Revision: 259517 URL: http://svnweb.freebsd.org/changeset/base/259517 Log: Add vt support for RPi. (No early stage yet.) Sponsored by: The FreeBSD Foundation Added: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c - copied, changed from r259364, head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B Copied and modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c (from r259364, head/sys/arm/broadcom/bcm2835/bcm2835_fb.c) ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 13 23:56:53 2013 (r259364, copy source) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:23:47 2013 (r259517) @@ -60,47 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include +#include "fb_if.h" #include "mbox_if.h" -#define BCMFB_FONT_HEIGHT 16 - -struct argb { - uint8_t a; - uint8_t r; - uint8_t g; - uint8_t b; -}; - -static struct argb bcmfb_palette[16] = { - {0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0xaa}, - {0x00, 0x00, 0xaa, 0x00}, - {0x00, 0x00, 0xaa, 0xaa}, - {0x00, 0xaa, 0x00, 0x00}, - {0x00, 0xaa, 0x00, 0xaa}, - {0x00, 0xaa, 0x55, 0x00}, - {0x00, 0xaa, 0xaa, 0xaa}, - {0x00, 0x55, 0x55, 0x55}, - {0x00, 0x55, 0x55, 0xff}, - {0x00, 0x55, 0xff, 0x55}, - {0x00, 0x55, 0xff, 0xff}, - {0x00, 0xff, 0x55, 0x55}, - {0x00, 0xff, 0x55, 0xff}, - {0x00, 0xff, 0xff, 0x55}, - {0x00, 0xff, 0xff, 0xff} -}; - -/* mouse pointer from dev/syscons/scgfbrndr.c */ -static u_char mouse_pointer[16] = { - 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, - 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 -}; - #define FB_WIDTH 640 #define FB_HEIGHT 480 #define FB_DEPTH 24 @@ -121,8 +88,7 @@ struct bcm_fb_config { struct bcmsc_softc { device_t dev; - struct cdev * cdev; - struct mtx mtx; + struct fb_info *info; bus_dma_tag_t dma_tag; bus_dmamap_t dma_map; struct bcm_fb_config* fb_config; @@ -131,56 +97,34 @@ struct bcmsc_softc { }; -struct video_adapter_softc { - /* Videoadpater part */ - video_adapter_t va; - int console; - - intptr_t fb_addr; - intptr_t fb_paddr; - unsigned int fb_size; - - unsigned int height; - unsigned int width; - unsigned int depth; - unsigned int stride; - - unsigned int xmargin; - unsigned int ymargin; - - unsigned char *font; - int initialized; -}; - -static struct bcmsc_softc *bcmsc_softc; -static struct video_adapter_softc va_softc; - -#define bcm_fb_lock(_sc) mtx_lock(&(_sc)->mtx) -#define bcm_fb_unlock(_sc) mtx_unlock(&(_sc)->mtx) -#define bcm_fb_lock_assert(sc) mtx_assert(&(_sc)->mtx, MA_OWNED) - static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); -static void bcmfb_update_margins(video_adapter_t *adp); -static int bcmfb_configure(int); static void bcm_fb_init(void *arg) { struct bcmsc_softc *sc = arg; - struct video_adapter_softc *va_sc = &va_softc; - int err; volatile struct bcm_fb_config* fb_config = sc->fb_config; + struct fb_info *info; phandle_t node; pcell_t cell; device_t mbox; + device_t fbd; + int err = 0; node = ofw_bus_get_node(sc->dev); fb_config->xres = 0; fb_config->yres = 0; fb_config->bpp = 0; + fb_config->vxres = 0; + fb_config->vyres = 0; + fb_config->xoffset = 0; + fb_config->yoffset = 0; + fb_config->base = 0; + fb_config->pitch = 0; + fb_config->screen_size = 0; if ((OF_getprop(node, "broadcom,width", &cell, sizeof(cell))) > 0) fb_config->xres = (int)fdt32_to_cpu(cell); @@ -197,14 +141,6 @@ bcm_fb_init(void *arg) if (fb_config->bpp == 0) fb_config->bpp = FB_DEPTH; - fb_config->vxres = 0; - fb_config->vyres = 0; - fb_config->xoffset = 0; - fb_config->yoffset = 0; - fb_config->base = 0; - fb_config->pitch = 0; - fb_config->screen_size = 0; - bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); @@ -228,17 +164,33 @@ bcm_fb_init(void *arg) fb_config->pitch, fb_config->base, fb_config->screen_size); - va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); - va_sc->fb_paddr = fb_config->base; - va_sc->fb_size = fb_config->screen_size; - va_sc->depth = fb_config->bpp; - va_sc->stride = fb_config->pitch; - - va_sc->width = fb_config->xres; - va_sc->height = fb_config->yres; - bcmfb_update_margins(&va_sc->va); - } - else { + + + + info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); + info->fb_name = device_get_nameunit(sc->dev); + info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + info->fb_pbase = fb_config->base; + info->fb_size = fb_config->screen_size; + info->fb_bpp = info->fb_depth = fb_config->bpp; + info->fb_stride = fb_config->pitch; + info->fb_width = fb_config->xres; + info->fb_height = fb_config->yres; + + sc->info = info; + + fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + if (fbd == NULL) { + device_printf(sc->dev, "Failed to add fbd child\n"); + return; + } + if (device_probe_and_attach(fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + return; + } + + + } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); return; } @@ -249,18 +201,10 @@ bcm_fb_init(void *arg) static int bcm_fb_probe(device_t dev) { - int error = 0; - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) return (ENXIO); - device_set_desc(dev, "BCM2835 framebuffer device"); - - error = sc_probe_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD); - if (error != 0) - return (error); - + device_set_desc(dev, "BCM2835 VT framebuffer driver"); return (BUS_PROBE_DEFAULT); } @@ -272,13 +216,7 @@ bcm_fb_attach(device_t dev) int dma_size = sizeof(struct bcm_fb_config); int err; - if (bcmsc_softc) - return (ENXIO); - - bcmsc_softc = sc; - sc->dev = dev; - mtx_init(&sc->mtx, "bcm2835fb", "fb", MTX_DEF); err = bus_dma_tag_create( bus_get_dma_tag(sc->dev), @@ -291,8 +229,8 @@ bcm_fb_attach(device_t dev) NULL, NULL, /* lockfunc, lockarg */ &sc->dma_tag); - err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, - 0, &sc->dma_map); + err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, 0, + &sc->dma_map); if (err) { device_printf(dev, "cannot allocate framebuffer\n"); goto fail; @@ -306,14 +244,6 @@ bcm_fb_attach(device_t dev) goto fail; } - err = (sc_attach_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD)); - - if (err) { - device_printf(dev, "failed to attach syscons\n"); - goto fail; - } - /* * We have to wait until interrupts are enabled. * Mailbox relies on it to get data from VideoCore @@ -345,12 +275,25 @@ bcm_fb_dmamap_cb(void *arg, bus_dma_segm *addr = PHYS_TO_VCBUS(segs[0].ds_addr); } +static struct fb_info * +bcm_fb_helper_getinfo(device_t dev) +{ + struct bcmsc_softc *sc; + + sc = device_get_softc(dev); + + return (sc->info); +} + static device_method_t bcm_fb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcm_fb_probe), DEVMETHOD(device_attach, bcm_fb_attach), - { 0, 0 } + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, bcm_fb_helper_getinfo), + + DEVMETHOD_END }; static devclass_t bcm_fb_devclass; @@ -362,637 +305,3 @@ static driver_t bcm_fb_driver = { }; DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); - -/* - * Video driver routines and glue. - */ -static vi_probe_t bcmfb_probe; -static vi_init_t bcmfb_init; -static vi_get_info_t bcmfb_get_info; -static vi_query_mode_t bcmfb_query_mode; -static vi_set_mode_t bcmfb_set_mode; -static vi_save_font_t bcmfb_save_font; -static vi_load_font_t bcmfb_load_font; -static vi_show_font_t bcmfb_show_font; -static vi_save_palette_t bcmfb_save_palette; -static vi_load_palette_t bcmfb_load_palette; -static vi_set_border_t bcmfb_set_border; -static vi_save_state_t bcmfb_save_state; -static vi_load_state_t bcmfb_load_state; -static vi_set_win_org_t bcmfb_set_win_org; -static vi_read_hw_cursor_t bcmfb_read_hw_cursor; -static vi_set_hw_cursor_t bcmfb_set_hw_cursor; -static vi_set_hw_cursor_shape_t bcmfb_set_hw_cursor_shape; -static vi_blank_display_t bcmfb_blank_display; -static vi_mmap_t bcmfb_mmap; -static vi_ioctl_t bcmfb_ioctl; -static vi_clear_t bcmfb_clear; -static vi_fill_rect_t bcmfb_fill_rect; -static vi_bitblt_t bcmfb_bitblt; -static vi_diag_t bcmfb_diag; -static vi_save_cursor_palette_t bcmfb_save_cursor_palette; -static vi_load_cursor_palette_t bcmfb_load_cursor_palette; -static vi_copy_t bcmfb_copy; -static vi_putp_t bcmfb_putp; -static vi_putc_t bcmfb_putc; -static vi_puts_t bcmfb_puts; -static vi_putm_t bcmfb_putm; - -static video_switch_t bcmfbvidsw = { - .probe = bcmfb_probe, - .init = bcmfb_init, - .get_info = bcmfb_get_info, - .query_mode = bcmfb_query_mode, - .set_mode = bcmfb_set_mode, - .save_font = bcmfb_save_font, - .load_font = bcmfb_load_font, - .show_font = bcmfb_show_font, - .save_palette = bcmfb_save_palette, - .load_palette = bcmfb_load_palette, - .set_border = bcmfb_set_border, - .save_state = bcmfb_save_state, - .load_state = bcmfb_load_state, - .set_win_org = bcmfb_set_win_org, - .read_hw_cursor = bcmfb_read_hw_cursor, - .set_hw_cursor = bcmfb_set_hw_cursor, - .set_hw_cursor_shape = bcmfb_set_hw_cursor_shape, - .blank_display = bcmfb_blank_display, - .mmap = bcmfb_mmap, - .ioctl = bcmfb_ioctl, - .clear = bcmfb_clear, - .fill_rect = bcmfb_fill_rect, - .bitblt = bcmfb_bitblt, - .diag = bcmfb_diag, - .save_cursor_palette = bcmfb_save_cursor_palette, - .load_cursor_palette = bcmfb_load_cursor_palette, - .copy = bcmfb_copy, - .putp = bcmfb_putp, - .putc = bcmfb_putc, - .puts = bcmfb_puts, - .putm = bcmfb_putm, -}; - -VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure); - -static vr_init_t bcmrend_init; -static vr_clear_t bcmrend_clear; -static vr_draw_border_t bcmrend_draw_border; -static vr_draw_t bcmrend_draw; -static vr_set_cursor_t bcmrend_set_cursor; -static vr_draw_cursor_t bcmrend_draw_cursor; -static vr_blink_cursor_t bcmrend_blink_cursor; -static vr_set_mouse_t bcmrend_set_mouse; -static vr_draw_mouse_t bcmrend_draw_mouse; - -/* - * We use our own renderer; this is because we must emulate a hardware - * cursor. - */ -static sc_rndr_sw_t bcmrend = { - bcmrend_init, - bcmrend_clear, - bcmrend_draw_border, - bcmrend_draw, - bcmrend_set_cursor, - bcmrend_draw_cursor, - bcmrend_blink_cursor, - bcmrend_set_mouse, - bcmrend_draw_mouse -}; - -RENDERER(bcmfb, 0, bcmrend, gfb_set); -RENDERER_MODULE(bcmfb, gfb_set); - -static void -bcmrend_init(scr_stat* scp) -{ -} - -static void -bcmrend_clear(scr_stat* scp, int c, int attr) -{ -} - -static void -bcmrend_draw_border(scr_stat* scp, int color) -{ -} - -static void -bcmrend_draw(scr_stat* scp, int from, int count, int flip) -{ - video_adapter_t* adp = scp->sc->adp; - int i, c, a; - - if (!flip) { - /* Normal printing */ - vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count); - } else { - /* This is for selections and such: invert the color attribute */ - for (i = count; i-- > 0; ++from) { - c = sc_vtb_getc(&scp->vtb, from); - a = sc_vtb_geta(&scp->vtb, from) >> 8; - vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); - } - } -} - -static void -bcmrend_set_cursor(scr_stat* scp, int base, int height, int blink) -{ -} - -static void -bcmrend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip) -{ - video_adapter_t* adp = scp->sc->adp; - struct video_adapter_softc *sc; - int row, col; - uint8_t *addr; - int i, j, bytes; - - sc = (struct video_adapter_softc *)adp; - - if (scp->curs_attr.height <= 0) - return; - - if (sc->fb_addr == 0) - return; - - if (off >= adp->va_info.vi_width * adp->va_info.vi_height) - return; - - /* calculate the coordinates in the video buffer */ - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - - addr = (uint8_t *)sc->fb_addr - + (row + sc->ymargin)*(sc->stride) - + (sc->depth/8) * (col + sc->xmargin); - - bytes = sc->depth/8; - - /* our cursor consists of simply inverting the char under it */ - for (i = 0; i < adp->va_info.vi_cheight; i++) { - for (j = 0; j < adp->va_info.vi_cwidth; j++) { - switch (sc->depth) { - case 32: - case 24: - addr[bytes*j + 2] ^= 0xff; - /* FALLTHROUGH */ - case 16: - addr[bytes*j + 1] ^= 0xff; - addr[bytes*j] ^= 0xff; - break; - default: - break; - } - } - - addr += sc->stride; - } -} - -static void -bcmrend_blink_cursor(scr_stat* scp, int at, int flip) -{ -} - -static void -bcmrend_set_mouse(scr_stat* scp) -{ -} - -static void -bcmrend_draw_mouse(scr_stat* scp, int x, int y, int on) -{ - vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8); -} - -static uint16_t bcmfb_static_window[ROW*COL]; -extern u_char dflt_font_16[]; - -/* - * Update videoadapter settings after changing resolution - */ -static void -bcmfb_update_margins(video_adapter_t *adp) -{ - struct video_adapter_softc *sc; - video_info_t *vi; - - sc = (struct video_adapter_softc *)adp; - vi = &adp->va_info; - - sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; -} - -static int -bcmfb_configure(int flags) -{ - struct video_adapter_softc *va_sc; - - va_sc = &va_softc; - phandle_t display, root; - pcell_t cell; - - if (va_sc->initialized) - return (0); - - va_sc->width = 0; - va_sc->height = 0; - - /* - * It seems there is no way to let syscons framework know - * that framebuffer resolution has changed. So just try - * to fetch data from FDT and go with defaults if failed - */ - root = OF_finddevice("/"); - if ((root != 0) && - (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { - if ((OF_getprop(display, "broadcom,width", - &cell, sizeof(cell))) > 0) - va_sc->width = (int)fdt32_to_cpu(cell); - - if ((OF_getprop(display, "broadcom,height", - &cell, sizeof(cell))) > 0) - va_sc->height = (int)fdt32_to_cpu(cell); - } - - if (va_sc->width == 0) - va_sc->width = FB_WIDTH; - if (va_sc->height == 0) - va_sc->height = FB_HEIGHT; - - bcmfb_init(0, &va_sc->va, 0); - - va_sc->initialized = 1; - - return (0); -} - -static int -bcmfb_probe(int unit, video_adapter_t **adp, void *arg, int flags) -{ - - return (0); -} - -static int -bcmfb_init(int unit, video_adapter_t *adp, int flags) -{ - struct video_adapter_softc *sc; - video_info_t *vi; - - sc = (struct video_adapter_softc *)adp; - vi = &adp->va_info; - - vid_init_struct(adp, "bcmfb", -1, unit); - - sc->font = dflt_font_16; - vi->vi_cheight = BCMFB_FONT_HEIGHT; - vi->vi_cwidth = 8; - - vi->vi_width = sc->width/8; - vi->vi_height = sc->height/vi->vi_cheight; - - /* - * Clamp width/height to syscons maximums - */ - if (vi->vi_width > COL) - vi->vi_width = COL; - if (vi->vi_height > ROW) - vi->vi_height = ROW; - - sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; - - - adp->va_window = (vm_offset_t) bcmfb_static_window; - adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; - - vid_register(&sc->va); - - return (0); -} - -static int -bcmfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - bcopy(&adp->va_info, info, sizeof(*info)); - return (0); -} - -static int -bcmfb_query_mode(video_adapter_t *adp, video_info_t *info) -{ - return (0); -} - -static int -bcmfb_set_mode(video_adapter_t *adp, int mode) -{ - return (0); -} - -static int -bcmfb_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - return (0); -} - -static int -bcmfb_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - struct video_adapter_softc *sc = (struct video_adapter_softc *)adp; - - sc->font = data; - - return (0); -} - -static int -bcmfb_show_font(video_adapter_t *adp, int page) -{ - return (0); -} - -static int -bcmfb_save_palette(video_adapter_t *adp, u_char *palette) -{ - return (0); -} - -static int -bcmfb_load_palette(video_adapter_t *adp, u_char *palette) -{ - return (0); -} - -static int -bcmfb_set_border(video_adapter_t *adp, int border) -{ - return (bcmfb_blank_display(adp, border)); -} - -static int -bcmfb_save_state(video_adapter_t *adp, void *p, size_t size) -{ - return (0); -} - -static int -bcmfb_load_state(video_adapter_t *adp, void *p) -{ - return (0); -} - -static int -bcmfb_set_win_org(video_adapter_t *adp, off_t offset) -{ - return (0); -} - -static int -bcmfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - *col = *row = 0; - - return (0); -} - -static int -bcmfb_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - return (0); -} - -static int -bcmfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - return (0); -} - -static int -bcmfb_blank_display(video_adapter_t *adp, int mode) -{ - - struct video_adapter_softc *sc; - - sc = (struct video_adapter_softc *)adp; - if (sc && sc->fb_addr) - memset((void*)sc->fb_addr, 0, sc->fb_size); - - return (0); -} - -static int -bcmfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - struct video_adapter_softc *sc; - - sc = (struct video_adapter_softc *)adp; - - /* - * This might be a legacy VGA mem request: if so, just point it at the - * framebuffer, since it shouldn't be touched - */ - if (offset < sc->stride*sc->height) { - *paddr = sc->fb_paddr + offset; - return (0); - } - - return (EINVAL); -} - -static int -bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - struct video_adapter_softc *sc; - struct fbtype *fb; - - sc = (struct video_adapter_softc *)adp; - - switch (cmd) { - case FBIOGTYPE: - fb = (struct fbtype *)data; - fb->fb_type = FBTYPE_PCIMISC; - fb->fb_height = sc->height; - fb->fb_width = sc->width; - fb->fb_depth = sc->depth; - if (sc->depth <= 1 || sc->depth > 8) - fb->fb_cmsize = 0; - else - fb->fb_cmsize = 1 << sc->depth; - fb->fb_size = sc->fb_size; - break; - default: - return (fb_commonioctl(adp, cmd, data)); - } - - return (0); -} - -static int -bcmfb_clear(video_adapter_t *adp) -{ - - return (bcmfb_blank_display(adp, 0)); -} - -static int -bcmfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - - return (0); -} - -static int -bcmfb_bitblt(video_adapter_t *adp, ...) -{ - - return (0); -} - -static int -bcmfb_diag(video_adapter_t *adp, int level) -{ - - return (0); -} - -static int -bcmfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (0); -} - -static int -bcmfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (0); -} - -static int -bcmfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - - return (0); -} - -static int -bcmfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - - return (0); -} - -static int -bcmfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) -{ - struct video_adapter_softc *sc; - int row; - int col; - int i, j, k; - uint8_t *addr; - u_char *p; - uint8_t fg, bg, color; - uint16_t rgb; - - sc = (struct video_adapter_softc *)adp; - - if (sc->fb_addr == 0) - return (0); - - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - p = sc->font + c*BCMFB_FONT_HEIGHT; - addr = (uint8_t *)sc->fb_addr - + (row + sc->ymargin)*(sc->stride) - + (sc->depth/8) * (col + sc->xmargin); - - fg = a & 0xf ; - bg = (a >> 4) & 0xf; - - for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { - for (j = 0, k = 7; j < 8; j++, k--) { - if ((p[i] & (1 << k)) == 0) - color = bg; - else - color = fg; - - switch (sc->depth) { - case 32: - addr[4*j+0] = bcmfb_palette[color].r; - addr[4*j+1] = bcmfb_palette[color].g; - addr[4*j+2] = bcmfb_palette[color].b; - addr[4*j+3] = bcmfb_palette[color].a; - break; - case 24: - addr[3*j] = bcmfb_palette[color].r; - addr[3*j+1] = bcmfb_palette[color].g; - addr[3*j+2] = bcmfb_palette[color].b; - break; - case 16: - rgb = (bcmfb_palette[color].r >> 3) << 11; - rgb |= (bcmfb_palette[color].g >> 2) << 5; - rgb |= (bcmfb_palette[color].b >> 3); - addr[2*j] = rgb & 0xff; - addr[2*j + 1] = (rgb >> 8) & 0xff; - default: - /* Not supported yet */ - break; - } - } - - addr += (sc->stride); - } - - return (0); -} - -static int -bcmfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) -{ - int i; - - for (i = 0; i < len; i++) - bcmfb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); - - return (0); -} - -static int -bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, - uint32_t pixel_mask, int size, int width) -{ - - return (0); -} - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t bcmdummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Tue Dec 17 15:11:24 2013 (r259516) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Tue Dec 17 15:23:47 2013 (r259517) @@ -3,6 +3,7 @@ arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc arm/broadcom/bcm2835/bcm2835_dma.c standard arm/broadcom/bcm2835/bcm2835_fb.c optional sc +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Dec 17 15:11:24 2013 (r259516) +++ head/sys/arm/conf/RPI-B Tue Dec 17 15:23:47 2013 (r259517) @@ -66,7 +66,7 @@ device pl011 device pty # Comment following lines for boot console on serial port -device sc +device vt device kbdmux options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 15:34:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B84B586; Tue, 17 Dec 2013 15:34:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 164841F6F; Tue, 17 Dec 2013 15:34:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFYcqY025703; Tue, 17 Dec 2013 15:34:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFYcVb025701; Tue, 17 Dec 2013 15:34:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312171534.rBHFYcVb025701@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 17 Dec 2013 15:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259518 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 15:34:39 -0000 Author: ray Date: Tue Dec 17 15:34:38 2013 New Revision: 259518 URL: http://svnweb.freebsd.org/changeset/base/259518 Log: Fix copyright and some style(9) things. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:23:47 2013 (r259517) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:34:38 2013 (r259518) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -99,13 +103,14 @@ struct bcmsc_softc { static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); -static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); +static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, + int err); static void bcm_fb_init(void *arg) { - struct bcmsc_softc *sc = arg; - volatile struct bcm_fb_config* fb_config = sc->fb_config; + volatile struct bcm_fb_config *fb_config; + struct bcmsc_softc *sc; struct fb_info *info; phandle_t node; pcell_t cell; @@ -113,6 +118,8 @@ bcm_fb_init(void *arg) device_t fbd; int err = 0; + sc = arg; + fb_config = sc->fb_config; node = ofw_bus_get_node(sc->dev); fb_config->xres = 0; @@ -153,23 +160,25 @@ bcm_fb_init(void *arg) BUS_DMASYNC_POSTREAD); if (fb_config->base != 0) { - device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb_config->xres, fb_config->yres, fb_config->vxres, fb_config->vyres, fb_config->xoffset, fb_config->yoffset, fb_config->bpp); - device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", + device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", fb_config->pitch, fb_config->base, fb_config->screen_size); - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); + info = malloc(sizeof(struct fb_info), M_DEVBUF, + M_WAITOK | M_ZERO); info->fb_name = device_get_nameunit(sc->dev); - info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, + fb_config->screen_size); info->fb_pbase = fb_config->base; info->fb_size = fb_config->screen_size; info->fb_bpp = info->fb_depth = fb_config->bpp; @@ -179,7 +188,8 @@ bcm_fb_init(void *arg) sc->info = info; - fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + fbd = device_add_child(sc->dev, "fbd", + device_get_unit(sc->dev)); if (fbd == NULL) { device_printf(sc->dev, "Failed to add fbd child\n"); return; @@ -244,8 +254,8 @@ bcm_fb_attach(device_t dev) goto fail; } - /* - * We have to wait until interrupts are enabled. + /* + * We have to wait until interrupts are enabled. * Mailbox relies on it to get data from VideoCore */ sc->init_hook.ich_func = bcm_fb_init; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 16:45:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCA74D38; Tue, 17 Dec 2013 16:45:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A899D15EA; Tue, 17 Dec 2013 16:45:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHGjJq0051446; Tue, 17 Dec 2013 16:45:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHGjJNv051445; Tue, 17 Dec 2013 16:45:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312171645.rBHGjJNv051445@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 17 Dec 2013 16:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259520 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 16:45:19 -0000 Author: ae Date: Tue Dec 17 16:45:19 2013 New Revision: 259520 URL: http://svnweb.freebsd.org/changeset/base/259520 Log: Fix copy/paste typo. MFC after: 1 week Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Dec 17 16:10:59 2013 (r259519) +++ head/sys/kern/kern_jail.c Tue Dec 17 16:45:19 2013 (r259520) @@ -3047,7 +3047,7 @@ prison_restrict_ip6(struct prison *pr, s ii++; continue; } - switch (ij >= ppr->pr_ip4s ? -1 : + switch (ij >= ppr->pr_ip6s ? -1 : qcmp_v6(&pr->pr_ip6[ii], &ppr->pr_ip6[ij])) { case -1: bcopy(pr->pr_ip6 + ii + 1, pr->pr_ip6 + ii, From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 17:28:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D42B29C8; Tue, 17 Dec 2013 17:28:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFC6F18F5; Tue, 17 Dec 2013 17:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHHS2s7066417; Tue, 17 Dec 2013 17:28:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHHS2KH066416; Tue, 17 Dec 2013 17:28:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171728.rBHHS2KH066416@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 17:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259521 - head/sys/fs/fifofs 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.17 Precedence: list List-Id: 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, 17 Dec 2013 17:28:02 -0000 Author: kib Date: Tue Dec 17 17:28:02 2013 New Revision: 259521 URL: http://svnweb.freebsd.org/changeset/base/259521 Log: Do not allow O_EXEC opens for fifo, return EINVAL. Besides not making sense, open(O_EXEC) for fifo creates fifoinfo with zero readers and writers counts, which causes premature free of pipes. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/fifofs/fifo_vnops.c Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Tue Dec 17 16:45:19 2013 (r259520) +++ head/sys/fs/fifofs/fifo_vnops.c Tue Dec 17 17:28:02 2013 (r259521) @@ -143,7 +143,7 @@ fifo_open(ap) fp = ap->a_fp; td = ap->a_td; ASSERT_VOP_ELOCKED(vp, "fifo_open"); - if (fp == NULL) + if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { error = pipe_named_ctor(&fpipe, td); From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 17:31:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91B26C1F; Tue, 17 Dec 2013 17:31:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCB0197F; Tue, 17 Dec 2013 17:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHHVGxV069204; Tue, 17 Dec 2013 17:31:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHHVG7g069202; Tue, 17 Dec 2013 17:31:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171731.rBHHVG7g069202@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 17:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259522 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 17:31:16 -0000 Author: kib Date: Tue Dec 17 17:31:16 2013 New Revision: 259522 URL: http://svnweb.freebsd.org/changeset/base/259522 Log: If vn_open_vnode() succeeded in opening the vnode, but subsequent advisory lock cannot be obtained, prevent double-close of the vnode in vn_close() called from the fdrop(), by resetting file' f_ops methods. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Dec 17 17:28:02 2013 (r259521) +++ head/sys/kern/vfs_vnops.c Tue Dec 17 17:31:16 2013 (r259522) @@ -313,6 +313,9 @@ vn_open_vnode(struct vnode *vp, int fmod vn_lock(vp, lock_flags | LK_RETRY); (void)VOP_CLOSE(vp, fmode, cred, td); vn_finished_write(mp); + /* Prevent second close from fdrop()->vn_close(). */ + if (fp != NULL) + fp->f_ops= &badfileops; return (error); } fp->f_flag |= FHASLOCK; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 17:55:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8137A27; Tue, 17 Dec 2013 17:55:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1FC1C7F; Tue, 17 Dec 2013 17:55:15 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75E16B972; Tue, 17 Dec 2013 12:55:14 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu Date: Tue, 17 Dec 2013 12:20:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312131231.04749.jhb@freebsd.org> <86k3f4kjk8.fsf@nine.des.no> In-Reply-To: <86k3f4kjk8.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201312171220.47075.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 12:55:14 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 17:55:15 -0000 On Monday, December 16, 2013 8:32:39 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > Dag-Erling Sm=C3=B8rgrav writes: > > > John Baldwin writes: > > > > LINT64 is yet another kernel config covered by 'make tinderbox', > > > > but not by the periodic tinderbox. It is probably worth adding to > > > > the periodic tinderbox (someday it'd be nice if the two > > > > tinderboxes built the same set of things). > > > Some day it would be nice if people talked to me directly instead of > > > sniping from the sidelines. > > Ah, but when people have raised this exact issue before (that tcbuild > > and 'make tinderbox' build different things), you have blown them off > > repeatedly. >=20 > I have no idea what tcbuild is. I meant it as the name of your scripts (probably have ports-mgmt/tinderbox = on=20 the brain too much). > I blow people off when they complain that the tinderbox doesn't work > exactly like 'make tinderbox' because it's not intended to. I just want it to build the same things and report errors when they are=20 broken. In that sense they should both do the same thing. > > > Oh, and 'make tinderbox' should die. > > No, it is very developer friendly as it Just Works(tm) as a single > > command from an existing source tree checkout. >=20 > We already had 'make universe'. >=20 > The story behind 'make tinderbox' is that Alfred threw a fit over a > tinderbox breakage and insisted, despite being provided with ample proof > to the contrary, that my tinderbox was a black box which nobody knew how > worked and nobody could reproduce and that tinderbox reports were > therefore worthless. He then proceeded to implement 'make tinderbox' > purely to piss me off. It serves no other purpose and needs to die. Ah, a bit touchy I see. While that might have been Alfred's initial motivation, the points still remain that: 1) 'make tinderbox' Just Works as a single command from an existing source tree checkout. I don't have to track down some other thing from some other SVN tree to checkout and configure. It's also easy to reproduce a single failed build step in the same tree by doing 'make buildkernel' etc. so I can fix an issue that pops up and do quick turnaround testing and do a final 'make tinderbox' to make sure all is still well. 2) 'make tinderbox' provides a summary of what failed. 'make universe' does not. You have to go check all the log files by hand to see if anything failed. That is less helpful. It definitely serves a useful purpose for many developers, and I for one don't sit and cackle maniacally while rubbing my hands each time I invoke it because I think that somehow my doing so is pissing you off. > > It also happens to build more of the tree than the periodic tinderbox > > (by building more kernel configs, albeit doing quite a bit of > > duplicate work for platforms like arm in the process). >=20 > That's simply not true. The tinderbox builds exactly the same kernels > as 'make tinderbox' if they're present. The issue here is that a bug in > the source tree prevents some of these kernel configurations from being > generated, hence the tinderbox cannot build them. Ah, I thought at one point it only built GENERIC and LINT type configs, but presumably that has changed? As long as they build the same things I'm happy. I just want to avoid running into unrelated breakages when I do a 'make tinderbox' on a patched tree (the unrelated breakage thing is what I recently ran into with LINT64). =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 17:55:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEC33A25; Tue, 17 Dec 2013 17:55:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85DAD1C7E; Tue, 17 Dec 2013 17:55:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 71F14B939; Tue, 17 Dec 2013 12:55:10 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Date: Tue, 17 Dec 2013 11:41:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> In-Reply-To: <201312150411.rBF4Bhtg018852@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312171141.49251.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 12:55:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 17:55:11 -0000 On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > Author: mjg > Date: Sun Dec 15 04:11:43 2013 > New Revision: 259407 > URL: http://svnweb.freebsd.org/changeset/base/259407 > > Log: > proc exit: don't take PROC_LOCK while freeing rlimits > > Code wishing to check rlimits of some process should check whether it > is exiting first, which current consumers do. Does this measurably reduce contention? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 18:17:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 782DD703; Tue, 17 Dec 2013 18:17:52 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 704331E7A; Tue, 17 Dec 2013 18:17:51 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x12so6317427wgg.28 for ; Tue, 17 Dec 2013 10:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=s8/o5uo+Boh4UNDRAoKGJ1uI2MhNw2KUlj8/5A/dcuk=; b=slQuDv5S9eW5Nr+ju5hTGNurn0P5LV4aCWZF0ZzGeOKl47XwLBWjY2UPO/zlLgsSwk uYscEfE1HLLBYSn0P2Uenf2EbvPj2T1XHwLAoCPwjvvLpMI7i/+uZd5lrc+8MEQLGhAK flYTk6iWkuiUVDq/JDHlVtCQwWVNtmdEO5jiIECSvNA1lFUIn571Yi/vLzELcIrJb3rv MiYmY/1frXvBcz7Y+XImnq+jviML9f6CsHSXZPkhac+xdECXA3qS/6cJcKCfKKkgYKIV SjdoBb9dTZPD4xJToWrFBJR4LdPMU4wmJhVmZWWwQbH+gV4b8unQeE6YdN2VlMVzcTK2 0zQA== X-Received: by 10.180.101.197 with SMTP id fi5mr4429469wib.46.1387304269796; Tue, 17 Dec 2013 10:17:49 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id z2sm18631879wiy.11.2013.12.17.10.17.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 10:17:48 -0800 (PST) Date: Tue, 17 Dec 2013 19:17:45 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131217181745.GB7535@dft-labs.eu> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201312171141.49251.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 18:17:52 -0000 On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > Author: mjg > > Date: Sun Dec 15 04:11:43 2013 > > New Revision: 259407 > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > Log: > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > Code wishing to check rlimits of some process should check whether it > > is exiting first, which current consumers do. > > Does this measurably reduce contention? > No, this is just a cosmetic change I did while doing some other work with rlimits. It would use some more cosmetic work (e.g. no reason not to lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that later unless this kind of stuff is unwanted. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 18:30:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 995A5B3F; Tue, 17 Dec 2013 18:30:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85FC81FAA; Tue, 17 Dec 2013 18:30:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHIUbIQ090500; Tue, 17 Dec 2013 18:30:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHIUbCi090499; Tue, 17 Dec 2013 18:30:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312171830.rBHIUbCi090499@svn.freebsd.org> From: Ed Maste Date: Tue, 17 Dec 2013 18:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259523 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 18:30:37 -0000 Author: emaste Date: Tue Dec 17 18:30:37 2013 New Revision: 259523 URL: http://svnweb.freebsd.org/changeset/base/259523 Log: Require a C++11 compiler to build LLDB In practice the old test (using MK_CLANG_IS_CC) is similar, but COMPILER_FEATURES provides the information we actually want to test. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Dec 17 17:31:16 2013 (r259522) +++ head/share/mk/bsd.own.mk Tue Dec 17 18:30:37 2013 (r259523) @@ -552,10 +552,6 @@ MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no .endif -.if ${MK_CLANG_IS_CC} == "no" -MK_LLDB:= no -.endif - .if defined(NO_TESTS) # This should be handled above along the handling of all other NO_* options. # However, the above is broken when WITH_*=yes are passed to make(1) as @@ -650,6 +646,10 @@ MK_${var}:= no .endif .endfor +.if !${COMPILER_FEATURES:Mc++11} +MK_LLDB:= no +.endif + .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 19:36:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F12F1F5; Tue, 17 Dec 2013 19:36:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14ACF1443; Tue, 17 Dec 2013 19:36:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DF18FB97B; Tue, 17 Dec 2013 14:36:46 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Date: Tue, 17 Dec 2013 14:34:01 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> In-Reply-To: <20131217181745.GB7535@dft-labs.eu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312171434.01345.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 14:36:47 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 17 Dec 2013 19:36:48 -0000 On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: > On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > > Author: mjg > > > Date: Sun Dec 15 04:11:43 2013 > > > New Revision: 259407 > > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > > > Log: > > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > > > Code wishing to check rlimits of some process should check whether it > > > is exiting first, which current consumers do. > > > > Does this measurably reduce contention? > > > > No, this is just a cosmetic change I did while doing some other work > with rlimits. > > It would use some more cosmetic work (e.g. no reason not to > lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that > later unless this kind of stuff is unwanted. I find it useful to leave the locking in place so it is clear that p_limit is always written to with the lock held. If we ever got a static analyzer that understood locking rules then leaving this locking in would reduce false positives. When I first did locking for fields in struct proc I did it by hand based on grepping the source tree for all uses of a field and ensuring they were locked. I think it might be more confusing later on for another reader to see unlocked access and then have to think about why that is safe. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 20:53:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A77051DE; Tue, 17 Dec 2013 20:53:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9399D1AC1; Tue, 17 Dec 2013 20:53:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHKrNZq041762; Tue, 17 Dec 2013 20:53:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHKrNWB041760; Tue, 17 Dec 2013 20:53:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172053.rBHKrNWB041760@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 20:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259525 - in head/contrib/gcc: . config/rs6000 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.17 Precedence: list List-Id: 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, 17 Dec 2013 20:53:23 -0000 Author: pfg Date: Tue Dec 17 20:53:22 2013 New Revision: 259525 URL: http://svnweb.freebsd.org/changeset/base/259525 Log: gcc: fix ICE in rs600 when using -fno-trapping-math. Solves GCC-PR target/30485 Obtained from: gcc 4.3 (rev. 120902; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/rs6000/rs6000.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 18:44:46 2013 (r259524) +++ head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 20:53:22 2013 (r259525) @@ -399,6 +399,12 @@ (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b for CPUs that have PTA_CX16 set. +2007-01-18 Josh Conner (r120902) + + PR target/30485 + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add + support for UNLE, UNLT, UNGE, and UNGT. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 18:44:46 2013 (r259524) +++ head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 20:53:22 2013 (r259525) @@ -11738,10 +11738,18 @@ rs6000_emit_vector_compare (enum rtx_cod try_again = true; break; case NE: - /* Treat A != B as ~(A==B). */ + case UNLE: + case UNLT: + case UNGE: + case UNGT: + /* Invert condition and try again. + e.g., A != B becomes ~(A==B). */ { + enum rtx_code rev_code; enum insn_code nor_code; - rtx eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1, + + rev_code = reverse_condition_maybe_unordered (rcode); + rtx eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 21:39:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5ECA08F6; Tue, 17 Dec 2013 21:39:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49F5D1F84; Tue, 17 Dec 2013 21:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHLdfdj057235; Tue, 17 Dec 2013 21:39:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHLdf4Z057234; Tue, 17 Dec 2013 21:39:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172139.rBHLdf4Z057234@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 21:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259526 - head/contrib/gcc/config/rs6000 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.17 Precedence: list List-Id: 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, 17 Dec 2013 21:39:41 -0000 Author: pfg Date: Tue Dec 17 21:39:40 2013 New Revision: 259526 URL: http://svnweb.freebsd.org/changeset/base/259526 Log: gcc: fix ICE in rs600 when using -fno-trapping-math. Solve build issue with previous change. Obtained from: gcc 4.3 (rev. 120902; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/config/rs6000/rs6000.c Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 20:53:22 2013 (r259525) +++ head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 21:39:40 2013 (r259526) @@ -11747,10 +11747,11 @@ rs6000_emit_vector_compare (enum rtx_cod { enum rtx_code rev_code; enum insn_code nor_code; + rtx eq_rtx; rev_code = reverse_condition_maybe_unordered (rcode); - rtx eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, - dest_mode); + eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, + dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; gcc_assert (nor_code != CODE_FOR_nothing); From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 21:41:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4856AA4A; Tue, 17 Dec 2013 21:41:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A40C1FD3; Tue, 17 Dec 2013 21:41:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHLfNFW059840; Tue, 17 Dec 2013 21:41:23 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHLfNKa059838; Tue, 17 Dec 2013 21:41:23 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312172141.rBHLfNKa059838@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 17 Dec 2013 21:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259527 - head/sys/dev/cxgbe/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.17 Precedence: list List-Id: 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, 17 Dec 2013 21:41:24 -0000 Author: np Date: Tue Dec 17 21:41:23 2013 New Revision: 259527 URL: http://svnweb.freebsd.org/changeset/base/259527 Log: Do not create a hardware IPv6 server if the listen address is not in6addr_any and is not in the CLIP table either. This fixes a reported TOE+IPv6 NULL-dereference panic in do_pass_open_rpl(). While here, stop creating hardware servers for any loopback address. It's just a waste of server tids. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Dec 17 21:39:40 2013 (r259526) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Dec 17 21:41:23 2013 (r259527) @@ -203,6 +203,17 @@ alloc_lctx(struct adapter *sc, struct in return (NULL); } + if (inp->inp_vflag & INP_IPV6 && + !IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) { + struct tom_data *td = sc->tom_softc; + + lctx->ce = hold_lip(td, &inp->in6p_laddr); + if (lctx->ce == NULL) { + free(lctx, M_CXGBE); + return (NULL); + } + } + lctx->ctrlq = &sc->sge.ctrlq[pi->port_id]; lctx->ofld_rxq = &sc->sge.ofld_rxq[pi->first_ofld_rxq]; refcount_init(&lctx->refcount, 1); @@ -219,6 +230,7 @@ static int free_lctx(struct adapter *sc, struct listen_ctx *lctx) { struct inpcb *inp = lctx->inp; + struct tom_data *td = sc->tom_softc; INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, @@ -230,6 +242,8 @@ free_lctx(struct adapter *sc, struct lis CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p", __func__, lctx->stid, lctx, lctx->inp); + if (lctx->ce) + release_lip(td, lctx->ce); free_stid(sc, lctx); free(lctx, M_CXGBE); @@ -495,6 +509,12 @@ t4_listen_start(struct toedev *tod, stru INP_WLOCK_ASSERT(inp); + /* Don't start a hardware listener for any loopback address. */ + if (inp->inp_vflag & INP_IPV6 && IN6_IS_ADDR_LOOPBACK(&inp->in6p_laddr)) + return (0); + if (!(inp->inp_vflag & INP_IPV6) && + IN_LOOPBACK(ntohl(inp->inp_laddr.s_addr))) + return (0); #if 0 ADAPTER_LOCK(sc); if (IS_BUSY(sc)) { Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Dec 17 21:39:40 2013 (r259526) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Dec 17 21:41:23 2013 (r259527) @@ -176,6 +176,7 @@ struct listen_ctx { struct inpcb *inp; /* listening socket's inp */ struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; + struct clip_entry *ce; TAILQ_HEAD(, synq_entry) synq; }; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 22:16:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B2C6429; Tue, 17 Dec 2013 22:16:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAC1B1281; Tue, 17 Dec 2013 22:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHMGRwd072382; Tue, 17 Dec 2013 22:16:27 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHMGRLM072381; Tue, 17 Dec 2013 22:16:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312172216.rBHMGRLM072381@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 17 Dec 2013 22:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259528 - 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.17 Precedence: list List-Id: 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, 17 Dec 2013 22:16:28 -0000 Author: melifaro Date: Tue Dec 17 22:16:27 2013 New Revision: 259528 URL: http://svnweb.freebsd.org/changeset/base/259528 Log: Simplify contiguous mask checking. Suggested by: glebius MFC after: 2 weeks Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Tue Dec 17 21:41:23 2013 (r259527) +++ head/sys/net/radix.c Tue Dec 17 22:16:27 2013 (r259528) @@ -484,13 +484,13 @@ on1: struct radix_node * rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip) { - caddr_t netmask = (caddr_t)n_arg; - register struct radix_node *x; - register caddr_t cp, cplim; - register int b = 0, mlen, j; + unsigned char *netmask = n_arg; + unsigned char *cp, *cplim; + struct radix_node *x; + int b = 0, mlen, j; int maskduplicated, isnormal; struct radix_node *saved_x; - char addmask_key[RADIX_MAX_KEY_LEN]; + unsigned char addmask_key[RADIX_MAX_KEY_LEN]; if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN) mlen = RADIX_MAX_KEY_LEN; @@ -532,20 +532,18 @@ rn_addmask(void *n_arg, struct radix_nod * Calculate index of mask, and check for normalcy. * First find the first byte with a 0 bit, then if there are * more bits left (remember we already trimmed the trailing 0's), - * the pattern must be one of those in normal_chars[], or we have + * the bits should be contiguous, otherwise we have got * a non-contiguous mask. */ +#define CONTIG(_c) (((~(_c) + 1) & (_c)) == (unsigned char)(~(_c) + 1)) cplim = netmask + mlen; isnormal = 1; for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;) cp++; if (cp != cplim) { - static char normal_chars[] = { - 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; - for (j = 0x80; (j & *cp) != 0; j >>= 1) b++; - if (*cp != normal_chars[b] || cp != (cplim - 1)) + if (!CONTIG(*cp) || cp != (cplim - 1)) isnormal = 0; } b += (cp - netmask) << 3; From owner-svn-src-head@FreeBSD.ORG Tue Dec 17 23:31:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55C36EB5; Tue, 17 Dec 2013 23:31:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36099183A; Tue, 17 Dec 2013 23:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHNVr6F001433; Tue, 17 Dec 2013 23:31:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHNVpTW001421; Tue, 17 Dec 2013 23:31:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172331.rBHNVpTW001421@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 23:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259529 - in head/contrib/gcc: . cp 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.17 Precedence: list List-Id: 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, 17 Dec 2013 23:31:53 -0000 Author: pfg Date: Tue Dec 17 23:31:51 2013 New Revision: 259529 URL: http://svnweb.freebsd.org/changeset/base/259529 Log: gcc: small merges from upstream Solves GCC issues: PR middle-end/32602 PR middle-end/32603 Updates the to documentation and processing improvement. Obtained from: gcc 4.3 (rev. 119427, 126278, 126422; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/calls.c head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/method.c head/contrib/gcc/cp/parser.c head/contrib/gcc/doc/cppopts.texi head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 23:31:51 2013 (r259529) @@ -45,6 +45,20 @@ * flags.h (force_align_functions_log): Delete. * toplev.c (force_align_functions_log): Delete. +2007-07-06 Josh Conner (r126422) + + PR middle-end/32602 + PR middle-end/32603 + * calls.c (store_one_arg): Handle arguments which are partially + on the stack when detecting argument overlap. + +2007-07-03 Eric Christopher (r126278) + + * doc/cppopts.texi: Add conflicting option note to -dM. + * doc/invoke.texi: Add note about possible conflicts with + -E for -dCHARS and note that -dM will not produce + any results if there is no machine dependent reorg. + 2007-06-28 Geoffrey Keating (r126088) * doc/invoke.texi (C++ Dialect Options): Document Modified: head/contrib/gcc/calls.c ============================================================================== --- head/contrib/gcc/calls.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/calls.c Tue Dec 17 23:31:51 2013 (r259529) @@ -4297,6 +4297,7 @@ store_one_arg (struct arg_data *arg, rtx /* expand_call should ensure this. */ gcc_assert (!arg->locate.offset.var + && arg->locate.size.var == 0 && GET_CODE (size_rtx) == CONST_INT); if (arg->locate.offset.constant > i) @@ -4306,7 +4307,21 @@ store_one_arg (struct arg_data *arg, rtx } else if (arg->locate.offset.constant < i) { - if (i < arg->locate.offset.constant + INTVAL (size_rtx)) + /* Use arg->locate.size.constant instead of size_rtx + because we only care about the part of the argument + on the stack. */ + if (i < (arg->locate.offset.constant + + arg->locate.size.constant)) + sibcall_failure = 1; + } + else + { + /* Even though they appear to be at the same location, + if part of the outgoing argument is in registers, + they aren't really at the same location. Check for + this by making sure that the incoming size is the + same as the outgoing size. */ + if (arg->locate.size.constant != INTVAL (size_rtx)) sibcall_failure = 1; } } Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 17 23:31:51 2013 (r259529) @@ -62,6 +62,18 @@ * semantics.c (finish_unary_op_expr): Warn only if result overflowed and operands did not. +2006-12-01 Geoffrey Keating (r119427) + + * decl.c (poplevel): Check DECL_INITIAL invariant. + (duplicate_decls): Preserve DECL_INITIAL when eliminating + a new definition in favour of an old declaration. + (start_preparsed_function): Define and document value of + DECL_INITIAL before and after routine. + (finish_function): Check DECL_INITIAL invariant. + * parser.c + (cp_parser_function_definition_from_specifiers_and_declarator): + Skip duplicate function definitions. + 2006-10-31 Geoffrey Keating (r118360) * name-lookup.c (get_anonymous_namespace_name): New. Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/decl.c Tue Dec 17 23:31:51 2013 (r259529) @@ -758,7 +758,12 @@ poplevel (int keep, int reverse, int fun leave_scope (); if (functionbody) - DECL_INITIAL (current_function_decl) = block; + { + /* The current function is being defined, so its DECL_INITIAL + should be error_mark_node. */ + gcc_assert (DECL_INITIAL (current_function_decl) == error_mark_node); + DECL_INITIAL (current_function_decl) = block; + } else if (block) current_binding_level->blocks = chainon (current_binding_level->blocks, block); @@ -1635,13 +1640,15 @@ duplicate_decls (tree newdecl, tree oldd } /* If the new declaration is a definition, update the file and - line information on the declaration. */ + line information on the declaration, and also make + the old declaration the same definition. */ if (DECL_INITIAL (old_result) == NULL_TREE && DECL_INITIAL (new_result) != NULL_TREE) { DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (old_result) = DECL_SOURCE_LOCATION (newdecl); + DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) DECL_ARGUMENTS (old_result) = DECL_ARGUMENTS (new_result); @@ -10509,7 +10516,13 @@ check_function_type (tree decl, tree cur For C++, we must first check whether that datum makes any sense. For example, "class A local_a(1,2);" means that variable local_a is an aggregate of type A, which should have a constructor - applied to it with the argument list [1, 2]. */ + applied to it with the argument list [1, 2]. + + On entry, DECL_INITIAL (decl1) should be NULL_TREE or error_mark_node, + or may be a BLOCK if the function has been defined previously + in this translation unit. On exit, DECL_INITIAL (decl1) will be + error_mark_node if the function has never been defined, or + a BLOCK if the function has been defined somewhere. */ void start_preparsed_function (tree decl1, tree attrs, int flags) @@ -10638,24 +10651,6 @@ start_preparsed_function (tree decl1, tr cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl); } - /* Initialize RTL machinery. We cannot do this until - CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this - even when processing a template; this is how we get - CFUN set up, and our per-function variables initialized. - FIXME factor out the non-RTL stuff. */ - bl = current_binding_level; - allocate_struct_function (decl1); - current_binding_level = bl; - - /* Even though we're inside a function body, we still don't want to - call expand_expr to calculate the size of a variable-sized array. - We haven't necessarily assigned RTL to all variables yet, so it's - not safe to try to expand expressions involving them. */ - cfun->x_dont_save_pending_sizes_p = 1; - - /* Start the statement-tree, start the tree now. */ - DECL_SAVED_TREE (decl1) = push_stmt_list (); - /* Let the user know we're compiling this function. */ announce_function (decl1); @@ -10701,9 +10696,33 @@ start_preparsed_function (tree decl1, tr maybe_apply_pragma_weak (decl1); } - /* Reset these in case the call to pushdecl changed them. */ + /* Reset this in case the call to pushdecl changed it. */ current_function_decl = decl1; - cfun->decl = decl1; + + gcc_assert (DECL_INITIAL (decl1)); + + /* This function may already have been parsed, in which case just + return; our caller will skip over the body without parsing. */ + if (DECL_INITIAL (decl1) != error_mark_node) + return; + + /* Initialize RTL machinery. We cannot do this until + CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this + even when processing a template; this is how we get + CFUN set up, and our per-function variables initialized. + FIXME factor out the non-RTL stuff. */ + bl = current_binding_level; + allocate_struct_function (decl1); + current_binding_level = bl; + + /* Even though we're inside a function body, we still don't want to + call expand_expr to calculate the size of a variable-sized array. + We haven't necessarily assigned RTL to all variables yet, so it's + not safe to try to expand expressions involving them. */ + cfun->x_dont_save_pending_sizes_p = 1; + + /* Start the statement-tree, start the tree now. */ + DECL_SAVED_TREE (decl1) = push_stmt_list (); /* If we are (erroneously) defining a function that we have already defined before, wipe out what we knew before. */ @@ -11212,6 +11231,10 @@ finish_function (int flags) which then got a warning when stored in a ptr-to-function variable. */ gcc_assert (building_stmt_tree ()); + /* The current function is being defined, so its DECL_INITIAL should + be set, and unless there's a multiple definition, it should be + error_mark_node. */ + gcc_assert (DECL_INITIAL (fndecl) == error_mark_node); /* For a cloned function, we've already got all the code we need; there's no need to add any extra bits. */ Modified: head/contrib/gcc/cp/method.c ============================================================================== --- head/contrib/gcc/cp/method.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/method.c Tue Dec 17 23:31:51 2013 (r259529) @@ -407,10 +407,6 @@ use_thunk (tree thunk_fndecl, bool emit_ } } - /* The back-end expects DECL_INITIAL to contain a BLOCK, so we - create one. */ - DECL_INITIAL (thunk_fndecl) = make_node (BLOCK); - /* Set up cloned argument trees for the thunk. */ t = NULL_TREE; for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a)) @@ -424,17 +420,23 @@ use_thunk (tree thunk_fndecl, bool emit_ } a = nreverse (t); DECL_ARGUMENTS (thunk_fndecl) = a; - BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a; if (this_adjusting && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) { const char *fnname; + tree fn_block; + current_function_decl = thunk_fndecl; DECL_RESULT (thunk_fndecl) = build_decl (RESULT_DECL, 0, integer_type_node); fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0); + /* The back-end expects DECL_INITIAL to contain a BLOCK, so we + create one. */ + fn_block = make_node (BLOCK); + BLOCK_VARS (fn_block) = a; + DECL_INITIAL (thunk_fndecl) = fn_block; init_function_start (thunk_fndecl); current_function_is_thunk = 1; assemble_start_function (thunk_fndecl, fnname); Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/parser.c Tue Dec 17 23:31:51 2013 (r259529) @@ -15637,6 +15637,16 @@ cp_parser_function_definition_from_speci cp_parser_skip_to_end_of_block_or_statement (parser); fn = error_mark_node; } + else if (DECL_INITIAL (current_function_decl) != error_mark_node) + { + /* Seen already, skip it. An error message has already been output. */ + cp_parser_skip_to_end_of_block_or_statement (parser); + fn = current_function_decl; + current_function_decl = NULL_TREE; + /* If this is a function from a class, pop the nested class. */ + if (current_class_name) + pop_nested_class (); + } else fn = cp_parser_function_definition_after_declarator (parser, /*inline_p=*/false); Modified: head/contrib/gcc/doc/cppopts.texi ============================================================================== --- head/contrib/gcc/doc/cppopts.texi Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/doc/cppopts.texi Tue Dec 17 23:31:51 2013 (r259529) @@ -645,6 +645,10 @@ touch foo.h; cpp -dM foo.h @noindent will show all the predefined macros. +If you use @option{-dM} without the @option{-E} option, @option{-dM} is +interpreted as a synonym for @option{-fdump-rtl-mach}. +@xref{Debugging Options, , ,gcc}. + @item D @opindex dD Like @samp{M} except in two respects: it does @emph{not} include the Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/doc/invoke.texi Tue Dec 17 23:31:51 2013 (r259529) @@ -3675,7 +3675,9 @@ Says to make debugging dumps during comp compiler. The file names for most of the dumps are made by appending a pass number and a word to the @var{dumpname}. @var{dumpname} is generated from the name of the output file, if explicitly specified and it is not -an executable, otherwise it is the basename of the source file. +an executable, otherwise it is the basename of the source file. These +switches may have different effects when @option{-E} is used for +preprocessing. Most debug dumps can be enabled either passing a letter to the @option{-d} option, or with a long @option{-fdump-rtl} switch; here are the possible @@ -3810,7 +3812,7 @@ Dump after modulo scheduling, to @file{@ @opindex dM @opindex fdump-rtl-mach Dump after performing the machine dependent reorganization pass, to -@file{@var{file}.155r.mach}. +@file{@var{file}.155r.mach} if that pass exists. @item -dn @itemx -fdump-rtl-rnreg From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 00:10:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BACE3A59; Wed, 18 Dec 2013 00:10:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A73A51ABA; Wed, 18 Dec 2013 00:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI0AUhd015279; Wed, 18 Dec 2013 00:10:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI0AUIa015278; Wed, 18 Dec 2013 00:10:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312180010.rBI0AUIa015278@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 00:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259531 - head/contrib/gcc 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.17 Precedence: list List-Id: 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, 18 Dec 2013 00:10:30 -0000 Author: pfg Date: Wed Dec 18 00:10:30 2013 New Revision: 259531 URL: http://svnweb.freebsd.org/changeset/base/259531 Log: gcc: point to our address for bug reports. As recommended by the FSF in gcc/version.c : "If you distribute a modified version of GCC, please change this to refer to a document giving instructions for reporting bugs to you, not us." MFC after: 2 weeks Modified: head/contrib/gcc/version.c Modified: head/contrib/gcc/version.c ============================================================================== --- head/contrib/gcc/version.c Wed Dec 18 00:07:52 2013 (r259530) +++ head/contrib/gcc/version.c Wed Dec 18 00:10:30 2013 (r259531) @@ -18,7 +18,7 @@ forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ -const char bug_report_url[] = ""; +const char bug_report_url[] = ""; /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 00:14:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 312E4D87; Wed, 18 Dec 2013 00:14:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D73C1B28; Wed, 18 Dec 2013 00:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI0EwNa018066; Wed, 18 Dec 2013 00:14:58 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI0Ewd9018065; Wed, 18 Dec 2013 00:14:58 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312180014.rBI0Ewd9018065@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 18 Dec 2013 00:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259532 - head/sys/dev/vt 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.17 Precedence: list List-Id: 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, 18 Dec 2013 00:14:59 -0000 Author: ray Date: Wed Dec 18 00:14:58 2013 New Revision: 259532 URL: http://svnweb.freebsd.org/changeset/base/259532 Log: Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_altgr is not zero. Submitted by: andreast Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Dec 18 00:10:30 2013 (r259531) +++ head/sys/dev/vt/vt_core.c Wed Dec 18 00:14:58 2013 (r259532) @@ -113,6 +113,7 @@ const struct terminal_class vt_termclass int sc_txtmouse_no_retrace_wait; static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "Newcons parameters"); +VT_SYSCTL_INT(enable_altgr, 0, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "Newcons debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); @@ -404,6 +405,8 @@ vt_processkey(keyboard_t *kbd, struct vt if (c & RELKEY) { switch (c & ~RELKEY) { case (SPCLKEY | RALT): + if (vt_enable_altgr != 0) + break; case (SPCLKEY | LALT): vd->vd_kbstate &= ~ALKED; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 00:21:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D5BBA1; Wed, 18 Dec 2013 00:21:28 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A96471CB6; Wed, 18 Dec 2013 00:21:27 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id u57so6951000wes.32 for ; Tue, 17 Dec 2013 16:21:25 -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:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=EsSL5CE/6wIsGFRn6Vg5Lqm9qIRJ2A0sDi5X0sLsEqY=; b=07ZIxmSJ9LfegDFZOqnkPRNnPsdB69LIIM6rmilTiKbQdZwY/nL/brfiFHm6eV1k53 AqcNyDHr9nOYGmY3MKZakR2DDntBFOqViE3L6oaZM6HUtAQACTW1Fsu/Jv1P3hT5pSmr Q4dMWQrPV3an8hWiCk6AjvnpIwFFPrDLFTvGN0ZY3y5mfRrc6cTGRPUmho/deOHyHvVU howsvLBLt/hNRkvgBr8UI6PMFtP4ILs+DB5OmvDFpGv07RYcyDcd9RdnD67jyGtGqNBx oqxdVJNfVhyKUYFVaufMdpN9R5tyVmQa2yq31NcdRsANgQAGmqZluGNgblQ74FkCsI6Y lPdw== X-Received: by 10.194.78.179 with SMTP id c19mr666849wjx.84.1387326085512; Tue, 17 Dec 2013 16:21:25 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id cx3sm55827949wib.0.2013.12.17.16.21.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 16:21:24 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 18 Dec 2013 01:21:22 +0100 From: Baptiste Daroussin To: Aleksandr Rybalko Subject: Re: svn commit: r259532 - head/sys/dev/vt Message-ID: <20131218002122.GP99753@ithaqua.etoilebsd.net> References: <201312180014.rBI0Ewd9018065@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WOTjKnJ88wpJKlWH" Content-Disposition: inline In-Reply-To: <201312180014.rBI0Ewd9018065@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 00:21:28 -0000 --WOTjKnJ88wpJKlWH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2013 at 12:14:58AM +0000, Aleksandr Rybalko wrote: > Author: ray > Date: Wed Dec 18 00:14:58 2013 > New Revision: 259532 > URL: http://svnweb.freebsd.org/changeset/base/259532 >=20 > Log: > Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_= altgr is > not zero. > =20 > Submitted by: andreast > Sponsored by: The FreeBSD Foundation altgr support should probably be 1 by default in that case, many keyboards = need that key by default. Example on french keyboard it is used for: #{[|`\^@]} Without those, very hard to hack or just use a console :) regards, Bapt --WOTjKnJ88wpJKlWH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlKw6oIACgkQ8kTtMUmk6ExK/gCfby1wucALC3n9U6eL0YosATD6 tBgAoIcAQ35aCf7h/ernPqFKNYI0PLyz =6JRG -----END PGP SIGNATURE----- --WOTjKnJ88wpJKlWH-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 00:22:00 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14D401F7; Wed, 18 Dec 2013 00:22:00 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id BC9C61CBA; Wed, 18 Dec 2013 00:21:59 +0000 (UTC) Received: from rnote.ddteam.net (7-17-135-95.pool.ukrtel.net [95.135.17.7]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id E59C9C4958; Wed, 18 Dec 2013 02:21:57 +0200 (EET) Date: Wed, 18 Dec 2013 02:21:56 +0200 From: Aleksandr Rybalko To: Andreas Tobler Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-Id: <20131218022156.ed5c6a17.ray@freebsd.org> In-Reply-To: <52A79A82.7050801@FreeBSD.org> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tijl Coosemans , src-committers@FreeBSD.org, Aleksandr Rybalko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 00:22:00 -0000 On Tue, 10 Dec 2013 23:49:38 +0100 Andreas Tobler wrote: > On 10.12.13 14:43, Tijl Coosemans wrote: > > On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: > >> That keyboards have no Shift key for that? :) > >> I will be glad to apply your changes, but I have to know how it > >> should be controlled. > >> > >> RU and UA PC keyboards have same 3 symbols '2', '"', '@' > >> To get '2' i have to press only '2' > >> To get '@' I have to press Shift+'2' > >> To get '"' I have to switch to UA or RU and press Shift+'2' > >> > >> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary > >> lang switch. Which commonly mapped to one of Alt. Right? > >> So R-Alt+Shift+'2'? > > > > https://en.wikipedia.org/wiki/AltGr > > Thanks Tijl! > > To get the @ I have to press AltGr + '2'. > There are combinations where I have to press AltGr+Shift. e.g to get > the 'broken bar, ¦', AltGr+Shift+'7'. > > Andreas > Hello Andreas and Tijl! Since I think not a whole world have AltGr key (read as "not most keyboards on the Earth") :) Think it is OK to use R.Alt as an Alt by default, and enable AltGr with sysctl kern.vt.enable_altgr. Committed at r259532. Any other opinions are welcomed! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 00:24:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDD1B352; Wed, 18 Dec 2013 00:24:21 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89F5B1CD1; Wed, 18 Dec 2013 00:24:20 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id z2so4561978wiv.1 for ; Tue, 17 Dec 2013 16:24:19 -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:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ATAfrc+0+xoQ+MgY5ZJu3/yOK9j9+dkDLMMG/VejID8=; b=NV8Rkok+MkNyxco9kdnkGZGOMcHXsKoXLxgyHzzHUFRSG5TPo5b0tuozumaavrSx8X dF1DOiohbAfqtp4o63N/4J8MI7L6Tw2/ch55XhDzhC95p/oloBva5tpup60dUdC3IKrN Zp6PEAx12TJ7zD5Ct8vScqDG+dCXJr8zLZcprjDAIC4XtPi5FJetNGb1pkVY8FhY7db4 +1d5EXLl/3ac5Xsh7VRy7NDUGCciTIGLpVhGixM7OhUl1Uzm0DPzkUcyOxxgb2HpIHNk +ErzkK0ftMlFYhlwQP0LpnLhEaXpO/iJRWxHgwWA9FYrngUThyJnrBtJVXCjJqW9KwRN EqFw== X-Received: by 10.194.240.129 with SMTP id wa1mr22000963wjc.31.1387326258946; Tue, 17 Dec 2013 16:24:18 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id fj8sm55861876wib.1.2013.12.17.16.24.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 16:24:17 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 18 Dec 2013 01:24:16 +0100 From: Baptiste Daroussin To: Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-ID: <20131218002415.GQ99753@ithaqua.etoilebsd.net> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R4+lwT0Y15rLnKR0" Content-Disposition: inline In-Reply-To: <20131218022156.ed5c6a17.ray@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 00:24:21 -0000 --R4+lwT0Y15rLnKR0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: > On Tue, 10 Dec 2013 23:49:38 +0100 > Andreas Tobler wrote: >=20 > > On 10.12.13 14:43, Tijl Coosemans wrote: > > > On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: > > >> That keyboards have no Shift key for that? :) > > >> I will be glad to apply your changes, but I have to know how it > > >> should be controlled. > > >> > > >> RU and UA PC keyboards have same 3 symbols '2', '"', '@' > > >> To get '2' i have to press only '2' > > >> To get '@' I have to press Shift+'2' > > >> To get '"' I have to switch to UA or RU and press Shift+'2' > > >> > > >> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary > > >> lang switch. Which commonly mapped to one of Alt. Right? > > >> So R-Alt+Shift+'2'? > > >=20 > > > https://en.wikipedia.org/wiki/AltGr > >=20 > > Thanks Tijl! > >=20 > > To get the @ I have to press AltGr + '2'. > > There are combinations where I have to press AltGr+Shift. e.g to get > > the 'broken bar, =A6', AltGr+Shift+'7'. > >=20 > > Andreas > >=20 >=20 > Hello Andreas and Tijl! >=20 > Since I think not a whole world have AltGr key (read as "not most > keyboards on the Earth") :) > Think it is OK to use R.Alt as an Alt by default, and enable AltGr with > sysctl kern.vt.enable_altgr. >=20 I tend to disagree with you, lots of keyboards mapping are concerned here. Bapt --R4+lwT0Y15rLnKR0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlKw6y8ACgkQ8kTtMUmk6Ex2iACeKYIJzFJoSzjcXO1VAx5fKp2T sIIAn3c9eWHcR/Cq1cvi6QMWd1n5BWaN =YsiB -----END PGP SIGNATURE----- --R4+lwT0Y15rLnKR0-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 01:41:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A2BC771; Wed, 18 Dec 2013 01:41:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 254341263; Wed, 18 Dec 2013 01:41:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI1fq6u049559; Wed, 18 Dec 2013 01:41:52 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI1fqme049557; Wed, 18 Dec 2013 01:41:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312180141.rBI1fqme049557@svn.freebsd.org> From: Mark Johnston Date: Wed, 18 Dec 2013 01:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259535 - in head/sys: cddl/contrib/opensolaris/uts/intel/dtrace 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.17 Precedence: list List-Id: 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, 18 Dec 2013 01:41:53 -0000 Author: markj Date: Wed Dec 18 01:41:52 2013 New Revision: 259535 URL: http://svnweb.freebsd.org/changeset/base/259535 Log: The fasttrap fork handler is responsible for removing tracepoints in the child process that were inherited from its parent. However, this should not be done in the case of a vfork, since the fork handler ends up removing the tracepoints from the shared vm space, and userland DTrace probes in the parent will no longer fire as a result. Now the child of a vfork may trigger userland DTrace probes enabled in its parent, so modify the fasttrap probe handler to handle this case and handle the child process in the same way that it would handle the traced process. In particular, if once traces function foo() in a process that vforks, and the child calls foo(), fasttrap will treat this call as having come from the parent. This is the behaviour of the upstream code. While here, add #ifdef guards to some code that isn't present upstream. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/kern/kern_fork.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 18 01:27:30 2013 (r259534) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 18 01:41:52 2013 (r259535) @@ -1001,6 +1001,9 @@ int fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; +#if !defined(sun) + proc_t *pp; +#endif uintptr_t pc = rp->r_rip - 1; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1036,24 +1039,32 @@ fasttrap_pid_probe(struct reg *rp) curthread->t_dtrace_regv = 0; #endif -#if defined(sun) /* * Treat a child created by a call to vfork(2) as if it were its * parent. We know that there's only one thread of control in such a * process: this one. */ +#if defined(sun) while (p->p_flag & SVFORK) { p = p->p_parent; } -#endif - PROC_LOCK(p); - _PHOLD(p); pid = p->p_pid; -#if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#else + pp = p; + sx_slock(&proctree_lock); + while (pp->p_vmspace == pp->p_pptr->p_vmspace) + pp = pp->p_pptr; + pid = pp->p_pid; + sx_sunlock(&proctree_lock); + pp = NULL; + + PROC_LOCK(p); + _PHOLD(p); #endif + bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; /* @@ -1073,9 +1084,10 @@ fasttrap_pid_probe(struct reg *rp) if (tp == NULL) { #if defined(sun) mutex_exit(pid_mtx); -#endif +#else _PRELE(p); PROC_UNLOCK(p); +#endif return (-1); } @@ -1197,9 +1209,10 @@ fasttrap_pid_probe(struct reg *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; - PROC_UNLOCK(p); #if defined(sun) mutex_exit(pid_mtx); +#else + PROC_UNLOCK(p); #endif tp = &tp_local; @@ -1749,7 +1762,7 @@ fasttrap_pid_probe(struct reg *rp) #if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { #else - if (uwrite(curproc, scratch, i, addr)) { + if (uwrite(p, scratch, i, addr)) { #endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; @@ -1808,10 +1821,12 @@ done: rp->r_rip = new_pc; +#if !defined(sun) PROC_LOCK(p); proc_write_regs(curthread, rp); _PRELE(p); PROC_UNLOCK(p); +#endif return (0); } Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 18 01:27:30 2013 (r259534) +++ head/sys/kern/kern_fork.c Wed Dec 18 01:41:52 2013 (r259535) @@ -676,12 +676,12 @@ do_fork(struct thread *td, int flags, st #ifdef KDTRACE_HOOKS /* - * Tell the DTrace fasttrap provider about the new process - * if it has registered an interest. We have to do this only after - * p_state is PRS_NORMAL since the fasttrap module will use pfind() - * later on. + * Tell the DTrace fasttrap provider about the new process so that any + * tracepoints inherited from the parent can be removed. We have to do + * this only after p_state is PRS_NORMAL since the fasttrap module will + * use pfind() later on. */ - if (dtrace_fasttrap_fork) + if ((flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 03:58:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AE8E415; Wed, 18 Dec 2013 03:58:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66A521E9E; Wed, 18 Dec 2013 03:58:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI3wq1R098238; Wed, 18 Dec 2013 03:58:52 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI3wpHX098235; Wed, 18 Dec 2013 03:58:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312180358.rBI3wpHX098235@svn.freebsd.org> From: Neel Natu Date: Wed, 18 Dec 2013 03:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259537 - in head: lib/libvmmapi usr.sbin/bhyve 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.17 Precedence: list List-Id: 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, 18 Dec 2013 03:58:52 -0000 Author: neel Date: Wed Dec 18 03:58:51 2013 New Revision: 259537 URL: http://svnweb.freebsd.org/changeset/base/259537 Log: Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to 'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively. It should now be clear that these functions operate on passthru devices. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:51:04 2013 (r259536) +++ head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:58:51 2013 (r259537) @@ -563,8 +563,8 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in } int -vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - uint64_t addr, uint64_t msg, int numvec) +vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + uint64_t addr, uint64_t msg, int numvec) { struct vm_pptdev_msi pptmsi; @@ -581,8 +581,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu } int -vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) +vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct vm_pptdev_msix pptmsix; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:51:04 2013 (r259536) +++ head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:58:51 2013 (r259537) @@ -82,10 +82,11 @@ int vm_assign_pptdev(struct vmctx *ctx, int vm_unassign_pptdev(struct vmctx *ctx, int bus, int slot, int func); int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); -int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - uint64_t addr, uint64_t msg, int numvec); -int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); +int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, uint64_t addr, uint64_t msg, int numvec); +int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, int idx, uint64_t addr, uint64_t msg, + uint32_t vector_control); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Wed Dec 18 03:51:04 2013 (r259536) +++ head/usr.sbin/bhyve/pci_passthru.c Wed Dec 18 03:58:51 2013 (r259537) @@ -345,12 +345,10 @@ msix_table_write(struct vmctx *ctx, int /* If the entry is masked, don't set it up */ if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 || (vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { - error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, - sc->psc_sel.pc_func, - index, entry->addr, - entry->msg_data, - entry->vector_control); + error = vm_setup_pptdev_msix(ctx, vcpu, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func, index, entry->addr, + entry->msg_data, entry->vector_control); } } } @@ -652,12 +650,12 @@ passthru_cfgwrite(struct vmctx *ctx, int if (msicap_access(sc, coff)) { msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val); - error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus, + error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.addr, pi->pi_msi.msg_data, pi->pi_msi.maxmsgnum); if (error != 0) { - printf("vm_setup_msi returned error %d\r\n", errno); + printf("vm_setup_pptdev_msi error %d\r\n", errno); exit(1); } return (0); @@ -668,7 +666,7 @@ passthru_cfgwrite(struct vmctx *ctx, int if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_msix(ctx, vcpu, + error = vm_setup_pptdev_msix(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, i, pi->pi_msix.table[i].addr, @@ -676,8 +674,8 @@ passthru_cfgwrite(struct vmctx *ctx, int pi->pi_msix.table[i].vector_control); if (error) { - printf("vm_setup_msix error %d\r\n", - errno); + printf("vm_setup_pptdev_msix error " + "%d\r\n", errno); exit(1); } } From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 04:36:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFE70D0F; Wed, 18 Dec 2013 04:36:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C59E1146; Wed, 18 Dec 2013 04:36:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4aZcd012692; Wed, 18 Dec 2013 04:36:35 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4aZHW012691; Wed, 18 Dec 2013 04:36:35 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312180436.rBI4aZHW012691@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 04:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259538 - head/sys/dev/netmap 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.17 Precedence: list List-Id: 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, 18 Dec 2013 04:36:35 -0000 Author: glebius Date: Wed Dec 18 04:36:35 2013 New Revision: 259538 URL: http://svnweb.freebsd.org/changeset/base/259538 Log: Fix build. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Dec 18 03:58:51 2013 (r259537) +++ head/sys/dev/netmap/netmap.c Wed Dec 18 04:36:35 2013 (r259538) @@ -151,6 +151,7 @@ ports attached to the switch) #include /* bus_dmamap_* */ #include #include +#include /* reduce conditional code */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 04:44:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E5C8EEF; Wed, 18 Dec 2013 04:44:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF24F11C0; Wed, 18 Dec 2013 04:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4icqZ015943; Wed, 18 Dec 2013 04:44:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4icNi015942; Wed, 18 Dec 2013 04:44:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312180444.rBI4icNi015942@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 04:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259539 - head/lib/libstand 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.17 Precedence: list List-Id: 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, 18 Dec 2013 04:44:39 -0000 Author: marcel Date: Wed Dec 18 04:44:38 2013 New Revision: 259539 URL: http://svnweb.freebsd.org/changeset/base/259539 Log: Support long filenames. Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Wed Dec 18 04:36:35 2013 (r259538) +++ head/lib/libstand/dosfs.c Wed Dec 18 04:44:38 2013 (r259539) @@ -381,21 +381,32 @@ dos_readdir(struct open_file *fd, struct if (dd.de.name[0] == 0xe5) continue; - /* Skip volume labels */ - if (dd.de.attr & FA_LABEL) - continue; - - if ((dd.de.attr & FA_MASK) == FA_XDE) { - if (dd.xde.seq & 0x40) - chk = dd.xde.chk; - else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) - continue; - x = dd.xde.seq & ~0x40; - if (x < 1 || x > 20) { - x = 0; + /* Check if directory entry is volume label */ + if (dd.de.attr & FA_LABEL) { + /* + * If volume label set, check if the current entry is + * extended entry (FA_XDE) for long file names. + */ + if ((dd.de.attr & FA_MASK) == FA_XDE) { + /* + * Read through all following extended entries + * to get the long file name. 0x40 marks the + * last entry containing part of long file name. + */ + if (dd.xde.seq & 0x40) + chk = dd.xde.chk; + else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) + continue; + x = dd.xde.seq & ~0x40; + if (x < 1 || x > 20) { + x = 0; + continue; + } + cp_xdnm(fn, &dd.xde); + } else { + /* skip only volume label entries */ continue; } - cp_xdnm(fn, &dd.xde); } else { if (xdn == 1) { x = 0; From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 04:52:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBAA81D5; Wed, 18 Dec 2013 04:52:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7C651237; Wed, 18 Dec 2013 04:52:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4qUo2019170; Wed, 18 Dec 2013 04:52:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4qURt019169; Wed, 18 Dec 2013 04:52:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312180452.rBI4qURt019169@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 04:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259540 - head/lib/libstand 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.17 Precedence: list List-Id: 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, 18 Dec 2013 04:52:30 -0000 Author: marcel Date: Wed Dec 18 04:52:30 2013 New Revision: 259540 URL: http://svnweb.freebsd.org/changeset/base/259540 Log: Clear f_rabuf after freeing the memory it points to. This prevents a possible double free. Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/close.c Modified: head/lib/libstand/close.c ============================================================================== --- head/lib/libstand/close.c Wed Dec 18 04:44:38 2013 (r259539) +++ head/lib/libstand/close.c Wed Dec 18 04:52:30 2013 (r259540) @@ -75,8 +75,10 @@ close(int fd) errno = EBADF; return (-1); } - if (f->f_rabuf != NULL) + if (f->f_rabuf != NULL) { free(f->f_rabuf); + f->f_rabuf = NULL; + } if (!(f->f_flags & F_RAW) && f->f_ops) err1 = (f->f_ops->fo_close)(f); if (!(f->f_flags & F_NODEV) && f->f_dev) From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 06:24:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E278134; Wed, 18 Dec 2013 06:24:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 200151907; Wed, 18 Dec 2013 06:24:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI6OMDC051610; Wed, 18 Dec 2013 06:24:22 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI6OMc2051603; Wed, 18 Dec 2013 06:24:22 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312180624.rBI6OMc2051603@svn.freebsd.org> From: Neel Natu Date: Wed, 18 Dec 2013 06:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259542 - head/sys/amd64/vmm/intel 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.17 Precedence: list List-Id: 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, 18 Dec 2013 06:24:23 -0000 Author: neel Date: Wed Dec 18 06:24:21 2013 New Revision: 259542 URL: http://svnweb.freebsd.org/changeset/base/259542 Log: Use vmcs_read() and vmcs_write() in preference to vmread() and vmwrite() respectively. The vmcs_xxx() functions provide inline error checking of all accesses to the VMCS. Modified: head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx_genassym.c Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmcs.c Wed Dec 18 06:24:21 2013 (r259542) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include "vmm_host.h" -#include "vmcs.h" #include "vmx_cpufunc.h" +#include "vmcs.h" #include "ept.h" #include "vmx.h" @@ -454,19 +454,6 @@ done: return (error); } -uint64_t -vmcs_read(uint32_t encoding) -{ - int error; - uint64_t val; - - error = vmread(encoding, &val); - if (error != 0) - panic("vmcs_read(%u) error %d", encoding, error); - - return (val); -} - #ifdef DDB extern int vmxon_enabled[]; Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmcs.h Wed Dec 18 06:24:21 2013 (r259542) @@ -58,7 +58,26 @@ int vmcs_getdesc(struct vmcs *vmcs, int struct seg_desc *desc); int vmcs_setdesc(struct vmcs *vmcs, int ident, struct seg_desc *desc); -uint64_t vmcs_read(uint32_t encoding); + +static __inline uint64_t +vmcs_read(uint32_t encoding) +{ + int error; + uint64_t val; + + error = vmread(encoding, &val); + KASSERT(error == 0, ("vmcs_read(%u) error %d", encoding, error)); + return (val); +} + +static __inline void +vmcs_write(uint32_t encoding, uint64_t val) +{ + int error; + + error = vmwrite(encoding, val); + KASSERT(error == 0, ("vmcs_write(%u) error %d", encoding, error)); +} #define vmexit_instruction_length() vmcs_read(VMCS_EXIT_INSTRUCTION_LENGTH) #define vmcs_guest_rip() vmcs_read(VMCS_GUEST_RIP) Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmx.c Wed Dec 18 06:24:21 2013 (r259542) @@ -324,9 +324,8 @@ vmx_setjmp_trace(struct vmx *vmx, int vc VCPU_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", vmx_setjmp_rc2str(rc), rc); - host_rsp = host_rip = ~0; - vmread(VMCS_HOST_RIP, &host_rip); - vmread(VMCS_HOST_RSP, &host_rsp); + host_rip = vmcs_read(VMCS_HOST_RIP); + host_rsp = vmcs_read(VMCS_HOST_RSP); VCPU_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp %#lx", host_rip, host_rsp); @@ -909,10 +908,10 @@ vmx_astpending_trace(struct vmx *vmx, in #endif } -static int +static void vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu) { - int error, lastcpu; + int lastcpu; struct vmxstate *vmxstate; struct invvpid_desc invvpid_desc = { 0 }; @@ -920,24 +919,14 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i lastcpu = vmxstate->lastcpu; vmxstate->lastcpu = curcpu; - if (lastcpu == curcpu) { - error = 0; - goto done; - } + if (lastcpu == curcpu) + return; vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1); - error = vmwrite(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); - if (error != 0) - goto done; + vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); + vmcs_write(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); + vmcs_write(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); /* * If we are using VPIDs then invalidate all mappings tagged with 'vpid' @@ -958,18 +947,6 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i invvpid_desc.vpid = vmxstate->vpid; invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); } -done: - return (error); -} - -static void -vm_exit_update_rip(struct vm_exit *vmexit) -{ - int error; - - error = vmwrite(VMCS_GUEST_RIP, vmexit->rip + vmexit->inst_length); - if (error) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); } /* @@ -980,66 +957,45 @@ CTASSERT((PROCBASED_CTLS_ONE_SETTING & P static void __inline vmx_set_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_set_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static int vmx_inject_nmi(struct vmx *vmx, int vcpu) { - int error; uint64_t info, interruptibility; /* Bail out if no NMI requested */ if (!vm_nmi_pending(vmx->vm, vcpu)) return (0); - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_nmi: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & nmi_blocking_bits) goto nmiblocked; @@ -1049,10 +1005,7 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu */ info = VMCS_INTERRUPTION_INFO_NMI | VMCS_INTERRUPTION_INFO_VALID; info |= IDT_NMI; - - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_nmi: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); @@ -1074,7 +1027,7 @@ nmiblocked: static void vmx_inject_interrupts(struct vmx *vmx, int vcpu) { - int error, vector; + int vector; uint64_t info, rflags, interruptibility; const int HWINTR_BLOCKED = VMCS_INTERRUPTIBILITY_STI_BLOCKING | @@ -1087,9 +1040,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * VM entry but the actual entry into guest mode was aborted * because of a pending AST. */ - error = vmread(VMCS_ENTRY_INTR_INFO, &info); - if (error) - panic("vmx_inject_interrupts: vmread(intrinfo) %d", error); + info = vmcs_read(VMCS_ENTRY_INTR_INFO); if (info & VMCS_INTERRUPTION_INFO_VALID) return; @@ -1108,27 +1059,18 @@ vmx_inject_interrupts(struct vmx *vmx, i panic("vmx_inject_interrupts: invalid vector %d\n", vector); /* Check RFLAGS.IF and the interruptibility state of the guest */ - error = vmread(VMCS_GUEST_RFLAGS, &rflags); - if (error) - panic("vmx_inject_interrupts: vmread(rflags) %d", error); - + rflags = vmcs_read(VMCS_GUEST_RFLAGS); if ((rflags & PSL_I) == 0) goto cantinject; - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_interrupts: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & HWINTR_BLOCKED) goto cantinject; /* Inject the interrupt */ info = VMCS_INTERRUPTION_INFO_HW_INTR | VMCS_INTERRUPTION_INFO_VALID; info |= vector; - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_interrupts: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); /* Update the Local APIC ISR */ lapic_intr_accepted(vmx->vm, vcpu, vector); @@ -1150,7 +1092,7 @@ cantinject: static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { - int error, cr, vmcs_guest_cr, vmcs_shadow_cr; + int cr, vmcs_guest_cr, vmcs_shadow_cr; uint64_t crval, regval, ones_mask, zeros_mask; const struct vmxctx *vmxctx; @@ -1165,7 +1107,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmxctx = &vmx->ctx[vcpu]; /* - * We must use vmwrite() directly here because vmcs_setreg() will + * We must use vmcs_write() directly here because vmcs_setreg() will * call vmclear(vmcs) as a side-effect which we certainly don't want. */ switch ((exitqual >> 8) & 0xf) { @@ -1182,11 +1124,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i regval = vmxctx->guest_rbx; break; case 4: - error = vmread(VMCS_GUEST_RSP, ®val); - if (error) { - panic("vmx_emulate_cr_access: " - "error %d reading guest rsp", error); - } + regval = vmcs_read(VMCS_GUEST_RSP); break; case 5: regval = vmxctx->guest_rbp; @@ -1234,20 +1172,11 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmcs_guest_cr = VMCS_GUEST_CR4; vmcs_shadow_cr = VMCS_CR4_SHADOW; } - - error = vmwrite(vmcs_shadow_cr, regval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d shadow", - error, cr); - } + vmcs_write(vmcs_shadow_cr, regval); crval = regval | ones_mask; crval &= ~zeros_mask; - error = vmwrite(vmcs_guest_cr, crval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d", - error, cr); - } + vmcs_write(vmcs_guest_cr, crval); if (cr == 0 && regval & CR0_PG) { uint64_t efer, entry_ctls; @@ -1257,29 +1186,13 @@ vmx_emulate_cr_access(struct vmx *vmx, i * the "IA-32e mode guest" bit in VM-entry control must be * equal. */ - error = vmread(VMCS_GUEST_IA32_EFER, &efer); - if (error) { - panic("vmx_emulate_cr_access: error %d efer read", - error); - } + efer = vmcs_read(VMCS_GUEST_IA32_EFER); if (efer & EFER_LME) { efer |= EFER_LMA; - error = vmwrite(VMCS_GUEST_IA32_EFER, efer); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " efer write", error); - } - error = vmread(VMCS_ENTRY_CTLS, &entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls read", error); - } + vmcs_write(VMCS_GUEST_IA32_EFER, efer); + entry_ctls = vmcs_read(VMCS_ENTRY_CTLS); entry_ctls |= VM_ENTRY_GUEST_LMA; - error = vmwrite(VMCS_ENTRY_CTLS, entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls write", error); - } + vmcs_write(VMCS_ENTRY_CTLS, entry_ctls); } } @@ -1336,7 +1249,7 @@ vmx_exit_process(struct vmx *vmx, int vc struct vmcs *vmcs; struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; - uint64_t qual, gpa, rflags; + uint64_t qual, gpa; bool retu; handled = 0; @@ -1365,12 +1278,13 @@ vmx_exit_process(struct vmx *vmx, int vc idtvec_info = vmcs_idt_vectoring_info(); if (idtvec_info & VMCS_IDT_VEC_VALID) { idtvec_info &= ~(1 << 12); /* clear undefined bit */ - vmwrite(VMCS_ENTRY_INTR_INFO, idtvec_info); + vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { idtvec_err = vmcs_idt_vectoring_err(); - vmwrite(VMCS_ENTRY_EXCEPTION_ERROR, idtvec_err); + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, + idtvec_err); } - vmwrite(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); + vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); } default: break; @@ -1419,10 +1333,8 @@ vmx_exit_process(struct vmx *vmx, int vc break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); - if ((error = vmread(VMCS_GUEST_RFLAGS, &rflags)) != 0) - panic("vmx_exit_process: vmread(rflags) %d", error); vmexit->exitcode = VM_EXITCODE_HLT; - vmexit->u.hlt.rflags = rflags; + vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -1509,9 +1421,9 @@ vmx_exit_process(struct vmx *vmx, int vc * the one we just processed. Therefore we update the * guest rip in the VMCS and in 'vmexit'. */ - vm_exit_update_rip(vmexit); vmexit->rip += vmexit->inst_length; vmexit->inst_length = 0; + vmcs_write(VMCS_GUEST_RIP, vmexit->rip); } else { if (vmexit->exitcode == VM_EXITCODE_BOGUS) { /* @@ -1533,7 +1445,7 @@ vmx_exit_process(struct vmx *vmx, int vc static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap) { - int error, vie, rc, handled, astpending; + int vie, rc, handled, astpending; uint32_t exit_reason; struct vmx *vmx; struct vmxctx *vmxctx; @@ -1566,14 +1478,9 @@ vmx_run(void *arg, int vcpu, register_t * If the life of a virtual machine was spent entirely in the context * of a single process we could do this once in vmcs_set_defaults(). */ - if ((error = vmwrite(VMCS_HOST_CR3, rcr3())) != 0) - panic("vmx_run: error %d writing to VMCS_HOST_CR3", error); - - if ((error = vmwrite(VMCS_GUEST_RIP, rip)) != 0) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); - - if ((error = vmx_set_pcpu_defaults(vmx, vcpu)) != 0) - panic("vmx_run: error %d setting up pcpu defaults", error); + vmcs_write(VMCS_HOST_CR3, rcr3()); + vmcs_write(VMCS_GUEST_RIP, rip); + vmx_set_pcpu_defaults(vmx, vcpu); do { vmx_inject_interrupts(vmx, vcpu); Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Wed Dec 18 06:24:21 2013 (r259542) @@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include "vmx.h" #include "vmx_cpufunc.h" +#include "vmx.h" ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop)); ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 07:23:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB4F9B4F; Wed, 18 Dec 2013 07:23:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D45F1EDB; Wed, 18 Dec 2013 07:23:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7Ng9I072890; Wed, 18 Dec 2013 07:23:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7Nguj072889; Wed, 18 Dec 2013 07:23:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201312180723.rBI7Nguj072889@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Dec 2013 07:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259543 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 07:23:42 -0000 Author: yongari Date: Wed Dec 18 07:23:42 2013 New Revision: 259543 URL: http://svnweb.freebsd.org/changeset/base/259543 Log: Failed m_devget(9) indicates lack of free mbuf cluster. Update if_iqdrops counter for that case since the received frame is ok. While here, simplify updating counter logic. Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Dec 18 06:24:21 2013 (r259542) +++ head/sys/dev/ae/if_ae.c Wed Dec 18 07:23:42 2013 (r259543) @@ -135,7 +135,7 @@ static void ae_mac_config(ae_softc_t *sc static int ae_intr(void *arg); static void ae_int_task(void *arg, int pending); static void ae_tx_intr(ae_softc_t *sc); -static int ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); static void ae_rx_intr(ae_softc_t *sc); static void ae_watchdog(ae_softc_t *sc); static void ae_tick(void *arg); @@ -1884,7 +1884,7 @@ ae_tx_intr(ae_softc_t *sc) BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } -static int +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) { struct ifnet *ifp; @@ -1903,12 +1903,15 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) size = le16toh(rxd->len) - ETHER_CRC_LEN; if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { if_printf(ifp, "Runt frame received."); - return (EIO); + ifp->if_ierrors++; + return; } m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL); - if (m == NULL) - return (ENOBUFS); + if (m == NULL) { + ifp->if_iqdrops++; + return; + } if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (flags & AE_RXD_HAS_VLAN) != 0) { @@ -1916,14 +1919,13 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) m->m_flags |= M_VLANTAG; } + ifp->if_ipackets++; /* * Pass it through. */ AE_UNLOCK(sc); (*ifp->if_input)(ifp, m); AE_LOCK(sc); - - return (0); } static void @@ -1932,7 +1934,7 @@ ae_rx_intr(ae_softc_t *sc) ae_rxd_t *rxd; struct ifnet *ifp; uint16_t flags; - int count, error; + int count; KASSERT(sc != NULL, ("[ae, %d]: sc is NULL!", __LINE__)); @@ -1960,17 +1962,10 @@ ae_rx_intr(ae_softc_t *sc) */ sc->rxd_cur = (sc->rxd_cur + 1) % AE_RXD_COUNT_DEFAULT; - if ((flags & AE_RXD_SUCCESS) == 0) { - ifp->if_ierrors++; - continue; - } - error = ae_rxeof(sc, rxd); - if (error != 0) { + if ((flags & AE_RXD_SUCCESS) != 0) + ae_rxeof(sc, rxd); + else ifp->if_ierrors++; - continue; - } else { - ifp->if_ipackets++; - } } if (count > 0) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 07:34:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FAC11E1; Wed, 18 Dec 2013 07:34:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9191FC7; Wed, 18 Dec 2013 07:34:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7YwcQ076594; Wed, 18 Dec 2013 07:34:58 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7YvQY076592; Wed, 18 Dec 2013 07:34:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180734.rBI7YvQY076592@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 07:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259544 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 07:34:58 -0000 Author: kevlo Date: Wed Dec 18 07:34:57 2013 New Revision: 259544 URL: http://svnweb.freebsd.org/changeset/base/259544 Log: Add support to IQ calibration. Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:23:42 2013 (r259543) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:34:57 2013 (r259544) @@ -345,6 +345,7 @@ static int run_write(struct run_softc *, static int run_write_region_1(struct run_softc *, uint16_t, const uint8_t *, int); static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, int); +static int run_efuse_read(struct run_softc *, uint16_t, uint16_t *, int); static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_rt2870_rf_write(struct run_softc *, uint32_t); @@ -391,6 +392,7 @@ static int run_raw_xmit(struct ieee80211 const struct ieee80211_bpf_params *); static void run_start(struct ifnet *); static int run_ioctl(struct ifnet *, u_long, caddr_t); +static void run_iq_calib(struct run_softc *, u_int); static void run_set_agc(struct run_softc *, uint8_t); static void run_select_chan_group(struct run_softc *, int); static void run_set_rx_antenna(struct run_softc *, int); @@ -436,6 +438,28 @@ static void run_init_locked(struct run_s static void run_stop(void *); static void run_delay(struct run_softc *, u_int); +static const struct rt2860_rate { + uint8_t rate; + uint8_t mcs; + enum ieee80211_phytype phy; + uint8_t ctl_ridx; + uint16_t sp_ack_dur; + uint16_t lp_ack_dur; +} rt2860_rates[] = { + { 2, 0, IEEE80211_T_DS, 0, 314, 314 }, + { 4, 1, IEEE80211_T_DS, 1, 258, 162 }, + { 11, 2, IEEE80211_T_DS, 2, 223, 127 }, + { 22, 3, IEEE80211_T_DS, 3, 213, 117 }, + { 12, 0, IEEE80211_T_OFDM, 4, 60, 60 }, + { 18, 1, IEEE80211_T_OFDM, 4, 52, 52 }, + { 24, 2, IEEE80211_T_OFDM, 6, 48, 48 }, + { 36, 3, IEEE80211_T_OFDM, 6, 44, 44 }, + { 48, 4, IEEE80211_T_OFDM, 8, 44, 44 }, + { 72, 5, IEEE80211_T_OFDM, 8, 40, 40 }, + { 96, 6, IEEE80211_T_OFDM, 8, 40, 40 }, + { 108, 7, IEEE80211_T_OFDM, 8, 40, 40 } +}; + static const struct { uint16_t reg; uint32_t val; @@ -1249,9 +1273,8 @@ run_set_region_4(struct run_softc *sc, u return (error); } -/* Read 16-bit from eFUSE ROM (RT3070 only.) */ static int -run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) +run_efuse_read(struct run_softc *sc, uint16_t addr, uint16_t *val, int count) { uint32_t tmp; uint16_t reg; @@ -1260,7 +1283,8 @@ run_efuse_read_2(struct run_softc *sc, u if ((error = run_read(sc, RT3070_EFUSE_CTRL, &tmp)) != 0) return (error); - addr *= 2; + if (count == 2) + addr *= 2; /*- * Read one 16-byte block into registers EFUSE_DATA[0-3]: * DATA0: F E D C @@ -1290,10 +1314,23 @@ run_efuse_read_2(struct run_softc *sc, u if ((error = run_read(sc, reg, &tmp)) != 0) return (error); - *val = (addr & 2) ? tmp >> 16 : tmp & 0xffff; + if (count == 2) + *val = (addr & 2) ? tmp >> 16 : tmp & 0xffff; + else { + tmp >>= (8 *(addr & 0x3)); + memmove(val, &tmp, sizeof(*val)); + } return (0); } + +/* Read 16-bit from eFUSE ROM (RT3070 only.) */ +static int +run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) +{ + return (run_efuse_read(sc, addr, val, 2)); +} + static int run_eeprom_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) { @@ -3600,6 +3637,107 @@ run_ioctl(struct ifnet *ifp, u_long cmd, } static void +run_iq_calib(struct run_softc *sc, u_int chan) +{ + uint16_t val; + + /* Tx0 IQ gain. */ + run_bbp_write(sc, 158, 0x2c); + if (chan <= 14) + run_efuse_read(sc, RT5390_EEPROM_IQ_GAIN_CAL_TX0_2GHZ, &val, 1); + else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx0 IQ phase. */ + run_bbp_write(sc, 158, 0x2d); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_PHASE_CAL_TX0_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx1 IQ gain. */ + run_bbp_write(sc, 158, 0x4a); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_GAIN_CAL_TX1_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx1 IQ phase. */ + run_bbp_write(sc, 158, 0x4b); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_PHASE_CAL_TX1_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* RF IQ compensation control. */ + run_bbp_write(sc, 158, 0x04); + run_efuse_read(sc, RT5390_EEPROM_RF_IQ_COMPENSATION_CTL, + &val, 1); + run_bbp_write(sc, 159, val & 0xff); + + /* RF IQ imbalance compensation control. */ + run_bbp_write(sc, 158, 0x03); + run_efuse_read(sc, + RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL, &val, 1); + run_bbp_write(sc, 159, val & 0xff); +} + +static void run_set_agc(struct run_softc *sc, uint8_t agc) { uint8_t bbp; @@ -4333,6 +4471,10 @@ run_set_chan(struct run_softc *sc, struc run_delay(sc, 10); + /* Perform IQ calibrations. */ + if (sc->mac_ver >= 0x5392) + run_iq_calib(sc, chan); + return (0); } Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:23:42 2013 (r259543) +++ head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:34:57 2013 (r259544) @@ -905,31 +905,32 @@ struct rt2860_rxwi { #define RT2860_EEPROM_BBP_BASE 0x78 #define RT3071_EEPROM_RF_BASE 0x82 +/* + * EEPROM IQ calibration. + */ +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_2GHZ 0x130 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_2GHZ 0x131 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_2GHZ 0x133 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_2GHZ 0x134 +#define RT5390_EEPROM_RF_IQ_COMPENSATION_CTL 0x13c +#define RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL 0x13d +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5GHZ 0x144 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5GHZ 0x145 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5GHZ 0x146 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5GHZ 0x147 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5GHZ 0x148 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5GHZ 0x149 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5GHZ 0x14a +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5GHZ 0x14b +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5GHZ 0x14c +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5GHZ 0x14d +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5GHZ 0x14e +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5GHZ 0x14f + #define RT2860_RIDX_CCK1 0 #define RT2860_RIDX_CCK11 3 #define RT2860_RIDX_OFDM6 4 #define RT2860_RIDX_MAX 12 -static const struct rt2860_rate { - uint8_t rate; - uint8_t mcs; - enum ieee80211_phytype phy; - uint8_t ctl_ridx; - uint16_t sp_ack_dur; - uint16_t lp_ack_dur; -} rt2860_rates[] = { - { 2, 0, IEEE80211_T_DS, 0, 314, 314 }, - { 4, 1, IEEE80211_T_DS, 1, 258, 162 }, - { 11, 2, IEEE80211_T_DS, 2, 223, 127 }, - { 22, 3, IEEE80211_T_DS, 3, 213, 117 }, - { 12, 0, IEEE80211_T_OFDM, 4, 60, 60 }, - { 18, 1, IEEE80211_T_OFDM, 4, 52, 52 }, - { 24, 2, IEEE80211_T_OFDM, 6, 48, 48 }, - { 36, 3, IEEE80211_T_OFDM, 6, 44, 44 }, - { 48, 4, IEEE80211_T_OFDM, 8, 44, 44 }, - { 72, 5, IEEE80211_T_OFDM, 8, 40, 40 }, - { 96, 6, IEEE80211_T_OFDM, 8, 40, 40 }, - { 108, 7, IEEE80211_T_OFDM, 8, 40, 40 } -}; /* * EEPROM access macro. From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 07:47:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D43A4916; Wed, 18 Dec 2013 07:47:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C03F010D2; Wed, 18 Dec 2013 07:47:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7loZt080430; Wed, 18 Dec 2013 07:47:50 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7loWH080429; Wed, 18 Dec 2013 07:47:50 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180747.rBI7loWH080429@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 07:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259545 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 07:47:50 -0000 Author: kevlo Date: Wed Dec 18 07:47:50 2013 New Revision: 259545 URL: http://svnweb.freebsd.org/changeset/base/259545 Log: Fix typo in comment. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:34:57 2013 (r259544) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:47:50 2013 (r259545) @@ -4471,7 +4471,7 @@ run_set_chan(struct run_softc *sc, struc run_delay(sc, 10); - /* Perform IQ calibrations. */ + /* Perform IQ calibration. */ if (sc->mac_ver >= 0x5392) run_iq_calib(sc, chan); From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 08:39:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EF6D678; Wed, 18 Dec 2013 08:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4634B15CD; Wed, 18 Dec 2013 08:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI8dDhW098211; Wed, 18 Dec 2013 08:39:13 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI8dCT3098208; Wed, 18 Dec 2013 08:39:12 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180839.rBI8dCT3098208@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 08:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259546 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 08:39:13 -0000 Author: kevlo Date: Wed Dec 18 08:39:12 2013 New Revision: 259546 URL: http://svnweb.freebsd.org/changeset/base/259546 Log: Fix style: add tab after #define. Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:47:50 2013 (r259545) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:39:12 2013 (r259546) @@ -70,14 +70,14 @@ __FBSDID("$FreeBSD$"); #include #include "usbdevs.h" -#define USB_DEBUG_VAR run_debug +#define USB_DEBUG_VAR run_debug #include #include #include #ifdef USB_DEBUG -#define RUN_DEBUG +#define RUN_DEBUG #endif #ifdef RUN_DEBUG @@ -87,17 +87,17 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, "run debug level"); #endif -#define IEEE80211_HAS_ADDR4(wh) \ +#define IEEE80211_HAS_ADDR4(wh) \ (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) /* * Because of LOR in run_key_delete(), use atomic instead. * '& RUN_CMDQ_MASQ' is to loop cmdq[]. */ -#define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) +#define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) static const STRUCT_USB_HOST_ID run_devs[] = { -#define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } +#define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), RUN_DEV(ABOCOM, RT3070), @@ -4772,8 +4772,8 @@ run_enable_tsf_sync(struct run_softc *sc static void run_enable_mrr(struct run_softc *sc) { -#define CCK(mcs) (mcs) -#define OFDM(mcs) (1 << 3 | (mcs)) +#define CCK(mcs) (mcs) +#define OFDM(mcs) (1 << 3 | (mcs)) run_write(sc, RT2860_LG_FBK_CFG0, OFDM(6) << 28 | /* 54->48 */ OFDM(5) << 24 | /* 48->36 */ Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:47:50 2013 (r259545) +++ head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 08:39:12 2013 (r259546) @@ -22,689 +22,687 @@ #ifndef _IF_RUNREG_H_ #define _IF_RUNREG_H_ -#define RT2860_CONFIG_NO 1 -#define RT2860_IFACE_INDEX 0 +#define RT2860_CONFIG_NO 1 +#define RT2860_IFACE_INDEX 0 -#define RT3070_OPT_14 0x0114 +#define RT3070_OPT_14 0x0114 /* SCH/DMA registers */ -#define RT2860_INT_STATUS 0x0200 -#define RT2860_INT_MASK 0x0204 -#define RT2860_WPDMA_GLO_CFG 0x0208 -#define RT2860_WPDMA_RST_IDX 0x020c -#define RT2860_DELAY_INT_CFG 0x0210 -#define RT2860_WMM_AIFSN_CFG 0x0214 -#define RT2860_WMM_CWMIN_CFG 0x0218 -#define RT2860_WMM_CWMAX_CFG 0x021c -#define RT2860_WMM_TXOP0_CFG 0x0220 -#define RT2860_WMM_TXOP1_CFG 0x0224 -#define RT2860_GPIO_CTRL 0x0228 -#define RT2860_MCU_CMD_REG 0x022c -#define RT2860_TX_BASE_PTR(qid) (0x0230 + (qid) * 16) -#define RT2860_TX_MAX_CNT(qid) (0x0234 + (qid) * 16) -#define RT2860_TX_CTX_IDX(qid) (0x0238 + (qid) * 16) -#define RT2860_TX_DTX_IDX(qid) (0x023c + (qid) * 16) -#define RT2860_RX_BASE_PTR 0x0290 -#define RT2860_RX_MAX_CNT 0x0294 -#define RT2860_RX_CALC_IDX 0x0298 -#define RT2860_FS_DRX_IDX 0x029c -#define RT2860_USB_DMA_CFG 0x02a0 /* RT2870 only */ -#define RT2860_US_CYC_CNT 0x02a4 +#define RT2860_INT_STATUS 0x0200 +#define RT2860_INT_MASK 0x0204 +#define RT2860_WPDMA_GLO_CFG 0x0208 +#define RT2860_WPDMA_RST_IDX 0x020c +#define RT2860_DELAY_INT_CFG 0x0210 +#define RT2860_WMM_AIFSN_CFG 0x0214 +#define RT2860_WMM_CWMIN_CFG 0x0218 +#define RT2860_WMM_CWMAX_CFG 0x021c +#define RT2860_WMM_TXOP0_CFG 0x0220 +#define RT2860_WMM_TXOP1_CFG 0x0224 +#define RT2860_GPIO_CTRL 0x0228 +#define RT2860_MCU_CMD_REG 0x022c +#define RT2860_TX_BASE_PTR(qid) (0x0230 + (qid) * 16) +#define RT2860_TX_MAX_CNT(qid) (0x0234 + (qid) * 16) +#define RT2860_TX_CTX_IDX(qid) (0x0238 + (qid) * 16) +#define RT2860_TX_DTX_IDX(qid) (0x023c + (qid) * 16) +#define RT2860_RX_BASE_PTR 0x0290 +#define RT2860_RX_MAX_CNT 0x0294 +#define RT2860_RX_CALC_IDX 0x0298 +#define RT2860_FS_DRX_IDX 0x029c +#define RT2860_USB_DMA_CFG 0x02a0 /* RT2870 only */ +#define RT2860_US_CYC_CNT 0x02a4 /* PBF registers */ -#define RT2860_SYS_CTRL 0x0400 -#define RT2860_HOST_CMD 0x0404 -#define RT2860_PBF_CFG 0x0408 -#define RT2860_MAX_PCNT 0x040c -#define RT2860_BUF_CTRL 0x0410 -#define RT2860_MCU_INT_STA 0x0414 -#define RT2860_MCU_INT_ENA 0x0418 -#define RT2860_TXQ_IO(qid) (0x041c + (qid) * 4) -#define RT2860_RX0Q_IO 0x0424 -#define RT2860_BCN_OFFSET0 0x042c -#define RT2860_BCN_OFFSET1 0x0430 -#define RT2860_TXRXQ_STA 0x0434 -#define RT2860_TXRXQ_PCNT 0x0438 -#define RT2860_PBF_DBG 0x043c -#define RT2860_CAP_CTRL 0x0440 +#define RT2860_SYS_CTRL 0x0400 +#define RT2860_HOST_CMD 0x0404 +#define RT2860_PBF_CFG 0x0408 +#define RT2860_MAX_PCNT 0x040c +#define RT2860_BUF_CTRL 0x0410 +#define RT2860_MCU_INT_STA 0x0414 +#define RT2860_MCU_INT_ENA 0x0418 +#define RT2860_TXQ_IO(qid) (0x041c + (qid) * 4) +#define RT2860_RX0Q_IO 0x0424 +#define RT2860_BCN_OFFSET0 0x042c +#define RT2860_BCN_OFFSET1 0x0430 +#define RT2860_TXRXQ_STA 0x0434 +#define RT2860_TXRXQ_PCNT 0x0438 +#define RT2860_PBF_DBG 0x043c +#define RT2860_CAP_CTRL 0x0440 /* RT3070 registers */ -#define RT3070_RF_CSR_CFG 0x0500 -#define RT3070_EFUSE_CTRL 0x0580 -#define RT3070_EFUSE_DATA0 0x0590 -#define RT3070_EFUSE_DATA1 0x0594 -#define RT3070_EFUSE_DATA2 0x0598 -#define RT3070_EFUSE_DATA3 0x059c -#define RT3070_LDO_CFG0 0x05d4 -#define RT3070_GPIO_SWITCH 0x05dc +#define RT3070_RF_CSR_CFG 0x0500 +#define RT3070_EFUSE_CTRL 0x0580 +#define RT3070_EFUSE_DATA0 0x0590 +#define RT3070_EFUSE_DATA1 0x0594 +#define RT3070_EFUSE_DATA2 0x0598 +#define RT3070_EFUSE_DATA3 0x059c +#define RT3070_LDO_CFG0 0x05d4 +#define RT3070_GPIO_SWITCH 0x05dc /* RT5592 registers */ -#define RT5592_DEBUG_INDEX 0x05e8 +#define RT5592_DEBUG_INDEX 0x05e8 /* MAC registers */ -#define RT2860_ASIC_VER_ID 0x1000 -#define RT2860_MAC_SYS_CTRL 0x1004 -#define RT2860_MAC_ADDR_DW0 0x1008 -#define RT2860_MAC_ADDR_DW1 0x100c -#define RT2860_MAC_BSSID_DW0 0x1010 -#define RT2860_MAC_BSSID_DW1 0x1014 -#define RT2860_MAX_LEN_CFG 0x1018 -#define RT2860_BBP_CSR_CFG 0x101c -#define RT2860_RF_CSR_CFG0 0x1020 -#define RT2860_RF_CSR_CFG1 0x1024 -#define RT2860_RF_CSR_CFG2 0x1028 -#define RT2860_LED_CFG 0x102c +#define RT2860_ASIC_VER_ID 0x1000 +#define RT2860_MAC_SYS_CTRL 0x1004 +#define RT2860_MAC_ADDR_DW0 0x1008 +#define RT2860_MAC_ADDR_DW1 0x100c +#define RT2860_MAC_BSSID_DW0 0x1010 +#define RT2860_MAC_BSSID_DW1 0x1014 +#define RT2860_MAX_LEN_CFG 0x1018 +#define RT2860_BBP_CSR_CFG 0x101c +#define RT2860_RF_CSR_CFG0 0x1020 +#define RT2860_RF_CSR_CFG1 0x1024 +#define RT2860_RF_CSR_CFG2 0x1028 +#define RT2860_LED_CFG 0x102c /* undocumented registers */ -#define RT2860_DEBUG 0x10f4 +#define RT2860_DEBUG 0x10f4 /* MAC Timing control registers */ -#define RT2860_XIFS_TIME_CFG 0x1100 -#define RT2860_BKOFF_SLOT_CFG 0x1104 -#define RT2860_NAV_TIME_CFG 0x1108 -#define RT2860_CH_TIME_CFG 0x110c -#define RT2860_PBF_LIFE_TIMER 0x1110 -#define RT2860_BCN_TIME_CFG 0x1114 -#define RT2860_TBTT_SYNC_CFG 0x1118 -#define RT2860_TSF_TIMER_DW0 0x111c -#define RT2860_TSF_TIMER_DW1 0x1120 -#define RT2860_TBTT_TIMER 0x1124 -#define RT2860_INT_TIMER_CFG 0x1128 -#define RT2860_INT_TIMER_EN 0x112c -#define RT2860_CH_IDLE_TIME 0x1130 +#define RT2860_XIFS_TIME_CFG 0x1100 +#define RT2860_BKOFF_SLOT_CFG 0x1104 +#define RT2860_NAV_TIME_CFG 0x1108 +#define RT2860_CH_TIME_CFG 0x110c +#define RT2860_PBF_LIFE_TIMER 0x1110 +#define RT2860_BCN_TIME_CFG 0x1114 +#define RT2860_TBTT_SYNC_CFG 0x1118 +#define RT2860_TSF_TIMER_DW0 0x111c +#define RT2860_TSF_TIMER_DW1 0x1120 +#define RT2860_TBTT_TIMER 0x1124 +#define RT2860_INT_TIMER_CFG 0x1128 +#define RT2860_INT_TIMER_EN 0x112c +#define RT2860_CH_IDLE_TIME 0x1130 /* MAC Power Save configuration registers */ -#define RT2860_MAC_STATUS_REG 0x1200 -#define RT2860_PWR_PIN_CFG 0x1204 -#define RT2860_AUTO_WAKEUP_CFG 0x1208 +#define RT2860_MAC_STATUS_REG 0x1200 +#define RT2860_PWR_PIN_CFG 0x1204 +#define RT2860_AUTO_WAKEUP_CFG 0x1208 /* MAC TX configuration registers */ -#define RT2860_EDCA_AC_CFG(aci) (0x1300 + (aci) * 4) -#define RT2860_EDCA_TID_AC_MAP 0x1310 -#define RT2860_TX_PWR_CFG(ridx) (0x1314 + (ridx) * 4) -#define RT2860_TX_PIN_CFG 0x1328 -#define RT2860_TX_BAND_CFG 0x132c -#define RT2860_TX_SW_CFG0 0x1330 -#define RT2860_TX_SW_CFG1 0x1334 -#define RT2860_TX_SW_CFG2 0x1338 -#define RT2860_TXOP_THRES_CFG 0x133c -#define RT2860_TXOP_CTRL_CFG 0x1340 -#define RT2860_TX_RTS_CFG 0x1344 -#define RT2860_TX_TIMEOUT_CFG 0x1348 -#define RT2860_TX_RTY_CFG 0x134c -#define RT2860_TX_LINK_CFG 0x1350 -#define RT2860_HT_FBK_CFG0 0x1354 -#define RT2860_HT_FBK_CFG1 0x1358 -#define RT2860_LG_FBK_CFG0 0x135c -#define RT2860_LG_FBK_CFG1 0x1360 -#define RT2860_CCK_PROT_CFG 0x1364 -#define RT2860_OFDM_PROT_CFG 0x1368 -#define RT2860_MM20_PROT_CFG 0x136c -#define RT2860_MM40_PROT_CFG 0x1370 -#define RT2860_GF20_PROT_CFG 0x1374 -#define RT2860_GF40_PROT_CFG 0x1378 -#define RT2860_EXP_CTS_TIME 0x137c -#define RT2860_EXP_ACK_TIME 0x1380 +#define RT2860_EDCA_AC_CFG(aci) (0x1300 + (aci) * 4) +#define RT2860_EDCA_TID_AC_MAP 0x1310 +#define RT2860_TX_PWR_CFG(ridx) (0x1314 + (ridx) * 4) +#define RT2860_TX_PIN_CFG 0x1328 +#define RT2860_TX_BAND_CFG 0x132c +#define RT2860_TX_SW_CFG0 0x1330 +#define RT2860_TX_SW_CFG1 0x1334 +#define RT2860_TX_SW_CFG2 0x1338 +#define RT2860_TXOP_THRES_CFG 0x133c +#define RT2860_TXOP_CTRL_CFG 0x1340 +#define RT2860_TX_RTS_CFG 0x1344 +#define RT2860_TX_TIMEOUT_CFG 0x1348 +#define RT2860_TX_RTY_CFG 0x134c +#define RT2860_TX_LINK_CFG 0x1350 +#define RT2860_HT_FBK_CFG0 0x1354 +#define RT2860_HT_FBK_CFG1 0x1358 +#define RT2860_LG_FBK_CFG0 0x135c +#define RT2860_LG_FBK_CFG1 0x1360 +#define RT2860_CCK_PROT_CFG 0x1364 +#define RT2860_OFDM_PROT_CFG 0x1368 +#define RT2860_MM20_PROT_CFG 0x136c +#define RT2860_MM40_PROT_CFG 0x1370 +#define RT2860_GF20_PROT_CFG 0x1374 +#define RT2860_GF40_PROT_CFG 0x1378 +#define RT2860_EXP_CTS_TIME 0x137c +#define RT2860_EXP_ACK_TIME 0x1380 /* MAC RX configuration registers */ -#define RT2860_RX_FILTR_CFG 0x1400 -#define RT2860_AUTO_RSP_CFG 0x1404 -#define RT2860_LEGACY_BASIC_RATE 0x1408 -#define RT2860_HT_BASIC_RATE 0x140c -#define RT2860_HT_CTRL_CFG 0x1410 -#define RT2860_SIFS_COST_CFG 0x1414 -#define RT2860_RX_PARSER_CFG 0x1418 +#define RT2860_RX_FILTR_CFG 0x1400 +#define RT2860_AUTO_RSP_CFG 0x1404 +#define RT2860_LEGACY_BASIC_RATE 0x1408 +#define RT2860_HT_BASIC_RATE 0x140c +#define RT2860_HT_CTRL_CFG 0x1410 +#define RT2860_SIFS_COST_CFG 0x1414 +#define RT2860_RX_PARSER_CFG 0x1418 /* MAC Security configuration registers */ -#define RT2860_TX_SEC_CNT0 0x1500 -#define RT2860_RX_SEC_CNT0 0x1504 -#define RT2860_CCMP_FC_MUTE 0x1508 +#define RT2860_TX_SEC_CNT0 0x1500 +#define RT2860_RX_SEC_CNT0 0x1504 +#define RT2860_CCMP_FC_MUTE 0x1508 /* MAC HCCA/PSMP configuration registers */ -#define RT2860_TXOP_HLDR_ADDR0 0x1600 -#define RT2860_TXOP_HLDR_ADDR1 0x1604 -#define RT2860_TXOP_HLDR_ET 0x1608 -#define RT2860_QOS_CFPOLL_RA_DW0 0x160c -#define RT2860_QOS_CFPOLL_A1_DW1 0x1610 -#define RT2860_QOS_CFPOLL_QC 0x1614 +#define RT2860_TXOP_HLDR_ADDR0 0x1600 +#define RT2860_TXOP_HLDR_ADDR1 0x1604 +#define RT2860_TXOP_HLDR_ET 0x1608 +#define RT2860_QOS_CFPOLL_RA_DW0 0x160c +#define RT2860_QOS_CFPOLL_A1_DW1 0x1610 +#define RT2860_QOS_CFPOLL_QC 0x1614 /* MAC Statistics Counters */ -#define RT2860_RX_STA_CNT0 0x1700 -#define RT2860_RX_STA_CNT1 0x1704 -#define RT2860_RX_STA_CNT2 0x1708 -#define RT2860_TX_STA_CNT0 0x170c -#define RT2860_TX_STA_CNT1 0x1710 -#define RT2860_TX_STA_CNT2 0x1714 -#define RT2860_TX_STAT_FIFO 0x1718 +#define RT2860_RX_STA_CNT0 0x1700 +#define RT2860_RX_STA_CNT1 0x1704 +#define RT2860_RX_STA_CNT2 0x1708 +#define RT2860_TX_STA_CNT0 0x170c +#define RT2860_TX_STA_CNT1 0x1710 +#define RT2860_TX_STA_CNT2 0x1714 +#define RT2860_TX_STAT_FIFO 0x1718 /* RX WCID search table */ -#define RT2860_WCID_ENTRY(wcid) (0x1800 + (wcid) * 8) +#define RT2860_WCID_ENTRY(wcid) (0x1800 + (wcid) * 8) -#define RT2860_FW_BASE 0x2000 -#define RT2870_FW_BASE 0x3000 +#define RT2860_FW_BASE 0x2000 +#define RT2870_FW_BASE 0x3000 /* Pair-wise key table */ -#define RT2860_PKEY(wcid) (0x4000 + (wcid) * 32) +#define RT2860_PKEY(wcid) (0x4000 + (wcid) * 32) /* IV/EIV table */ -#define RT2860_IVEIV(wcid) (0x6000 + (wcid) * 8) +#define RT2860_IVEIV(wcid) (0x6000 + (wcid) * 8) /* WCID attribute table */ -#define RT2860_WCID_ATTR(wcid) (0x6800 + (wcid) * 4) +#define RT2860_WCID_ATTR(wcid) (0x6800 + (wcid) * 4) /* Shared Key Table */ -#define RT2860_SKEY(vap, kidx) (0x6c00 + (vap) * 128 + (kidx) * 32) +#define RT2860_SKEY(vap, kidx) (0x6c00 + (vap) * 128 + (kidx) * 32) /* Shared Key Mode */ -#define RT2860_SKEY_MODE_0_7 0x7000 -#define RT2860_SKEY_MODE_8_15 0x7004 -#define RT2860_SKEY_MODE_16_23 0x7008 -#define RT2860_SKEY_MODE_24_31 0x700c +#define RT2860_SKEY_MODE_0_7 0x7000 +#define RT2860_SKEY_MODE_8_15 0x7004 +#define RT2860_SKEY_MODE_16_23 0x7008 +#define RT2860_SKEY_MODE_24_31 0x700c /* Shared Memory between MCU and host */ -#define RT2860_H2M_MAILBOX 0x7010 -#define RT2860_H2M_MAILBOX_CID 0x7014 -#define RT2860_H2M_MAILBOX_STATUS 0x701c -#define RT2860_H2M_INTSRC 0x7024 -#define RT2860_H2M_BBPAGENT 0x7028 -#define RT2860_BCN_BASE(vap) (0x7800 + (vap) * 512) +#define RT2860_H2M_MAILBOX 0x7010 +#define RT2860_H2M_MAILBOX_CID 0x7014 +#define RT2860_H2M_MAILBOX_STATUS 0x701c +#define RT2860_H2M_INTSRC 0x7024 +#define RT2860_H2M_BBPAGENT 0x7028 +#define RT2860_BCN_BASE(vap) (0x7800 + (vap) * 512) /* possible flags for register RT2860_PCI_EECTRL */ -#define RT2860_C (1 << 0) -#define RT2860_S (1 << 1) -#define RT2860_D (1 << 2) -#define RT2860_SHIFT_D 2 -#define RT2860_Q (1 << 3) -#define RT2860_SHIFT_Q 3 +#define RT2860_C (1 << 0) +#define RT2860_S (1 << 1) +#define RT2860_D (1 << 2) +#define RT2860_SHIFT_D 2 +#define RT2860_Q (1 << 3) +#define RT2860_SHIFT_Q 3 /* possible flags for registers INT_STATUS/INT_MASK */ -#define RT2860_TX_COHERENT (1 << 17) -#define RT2860_RX_COHERENT (1 << 16) -#define RT2860_MAC_INT_4 (1 << 15) -#define RT2860_MAC_INT_3 (1 << 14) -#define RT2860_MAC_INT_2 (1 << 13) -#define RT2860_MAC_INT_1 (1 << 12) -#define RT2860_MAC_INT_0 (1 << 11) -#define RT2860_TX_RX_COHERENT (1 << 10) -#define RT2860_MCU_CMD_INT (1 << 9) -#define RT2860_TX_DONE_INT5 (1 << 8) -#define RT2860_TX_DONE_INT4 (1 << 7) -#define RT2860_TX_DONE_INT3 (1 << 6) -#define RT2860_TX_DONE_INT2 (1 << 5) -#define RT2860_TX_DONE_INT1 (1 << 4) -#define RT2860_TX_DONE_INT0 (1 << 3) -#define RT2860_RX_DONE_INT (1 << 2) -#define RT2860_TX_DLY_INT (1 << 1) -#define RT2860_RX_DLY_INT (1 << 0) +#define RT2860_TX_COHERENT (1 << 17) +#define RT2860_RX_COHERENT (1 << 16) +#define RT2860_MAC_INT_4 (1 << 15) +#define RT2860_MAC_INT_3 (1 << 14) +#define RT2860_MAC_INT_2 (1 << 13) +#define RT2860_MAC_INT_1 (1 << 12) +#define RT2860_MAC_INT_0 (1 << 11) +#define RT2860_TX_RX_COHERENT (1 << 10) +#define RT2860_MCU_CMD_INT (1 << 9) +#define RT2860_TX_DONE_INT5 (1 << 8) +#define RT2860_TX_DONE_INT4 (1 << 7) +#define RT2860_TX_DONE_INT3 (1 << 6) +#define RT2860_TX_DONE_INT2 (1 << 5) +#define RT2860_TX_DONE_INT1 (1 << 4) +#define RT2860_TX_DONE_INT0 (1 << 3) +#define RT2860_RX_DONE_INT (1 << 2) +#define RT2860_TX_DLY_INT (1 << 1) +#define RT2860_RX_DLY_INT (1 << 0) /* possible flags for register WPDMA_GLO_CFG */ -#define RT2860_HDR_SEG_LEN_SHIFT 8 -#define RT2860_BIG_ENDIAN (1 << 7) -#define RT2860_TX_WB_DDONE (1 << 6) -#define RT2860_WPDMA_BT_SIZE_SHIFT 4 -#define RT2860_WPDMA_BT_SIZE16 0 -#define RT2860_WPDMA_BT_SIZE32 1 -#define RT2860_WPDMA_BT_SIZE64 2 -#define RT2860_WPDMA_BT_SIZE128 3 -#define RT2860_RX_DMA_BUSY (1 << 3) -#define RT2860_RX_DMA_EN (1 << 2) -#define RT2860_TX_DMA_BUSY (1 << 1) -#define RT2860_TX_DMA_EN (1 << 0) +#define RT2860_HDR_SEG_LEN_SHIFT 8 +#define RT2860_BIG_ENDIAN (1 << 7) +#define RT2860_TX_WB_DDONE (1 << 6) +#define RT2860_WPDMA_BT_SIZE_SHIFT 4 +#define RT2860_WPDMA_BT_SIZE16 0 +#define RT2860_WPDMA_BT_SIZE32 1 +#define RT2860_WPDMA_BT_SIZE64 2 +#define RT2860_WPDMA_BT_SIZE128 3 +#define RT2860_RX_DMA_BUSY (1 << 3) +#define RT2860_RX_DMA_EN (1 << 2) +#define RT2860_TX_DMA_BUSY (1 << 1) +#define RT2860_TX_DMA_EN (1 << 0) /* possible flags for register DELAY_INT_CFG */ -#define RT2860_TXDLY_INT_EN (1U << 31) -#define RT2860_TXMAX_PINT_SHIFT 24 -#define RT2860_TXMAX_PTIME_SHIFT 16 -#define RT2860_RXDLY_INT_EN (1 << 15) -#define RT2860_RXMAX_PINT_SHIFT 8 -#define RT2860_RXMAX_PTIME_SHIFT 0 +#define RT2860_TXDLY_INT_EN (1U << 31) +#define RT2860_TXMAX_PINT_SHIFT 24 +#define RT2860_TXMAX_PTIME_SHIFT 16 +#define RT2860_RXDLY_INT_EN (1 << 15) +#define RT2860_RXMAX_PINT_SHIFT 8 +#define RT2860_RXMAX_PTIME_SHIFT 0 /* possible flags for register GPIO_CTRL */ -#define RT2860_GPIO_D_SHIFT 8 -#define RT2860_GPIO_O_SHIFT 0 +#define RT2860_GPIO_D_SHIFT 8 +#define RT2860_GPIO_O_SHIFT 0 /* possible flags for register USB_DMA_CFG */ -#define RT2860_USB_TX_BUSY (1U << 31) -#define RT2860_USB_RX_BUSY (1 << 30) -#define RT2860_USB_EPOUT_VLD_SHIFT 24 -#define RT2860_USB_TX_EN (1 << 23) -#define RT2860_USB_RX_EN (1 << 22) -#define RT2860_USB_RX_AGG_EN (1 << 21) -#define RT2860_USB_TXOP_HALT (1 << 20) -#define RT2860_USB_TX_CLEAR (1 << 19) -#define RT2860_USB_PHY_WD_EN (1 << 16) -#define RT2860_USB_PHY_MAN_RST (1 << 15) -#define RT2860_USB_RX_AGG_LMT(x) ((x) << 8) /* in unit of 1KB */ -#define RT2860_USB_RX_AGG_TO(x) ((x) & 0xff) /* in unit of 33ns */ +#define RT2860_USB_TX_BUSY (1U << 31) +#define RT2860_USB_RX_BUSY (1 << 30) +#define RT2860_USB_EPOUT_VLD_SHIFT 24 +#define RT2860_USB_TX_EN (1 << 23) +#define RT2860_USB_RX_EN (1 << 22) +#define RT2860_USB_RX_AGG_EN (1 << 21) +#define RT2860_USB_TXOP_HALT (1 << 20) +#define RT2860_USB_TX_CLEAR (1 << 19) +#define RT2860_USB_PHY_WD_EN (1 << 16) +#define RT2860_USB_PHY_MAN_RST (1 << 15) +#define RT2860_USB_RX_AGG_LMT(x) ((x) << 8) /* in unit of 1KB */ +#define RT2860_USB_RX_AGG_TO(x) ((x) & 0xff) /* in unit of 33ns */ /* possible flags for register US_CYC_CNT */ -#define RT2860_TEST_EN (1 << 24) -#define RT2860_TEST_SEL_SHIFT 16 -#define RT2860_BT_MODE_EN (1 << 8) -#define RT2860_US_CYC_CNT_SHIFT 0 +#define RT2860_TEST_EN (1 << 24) +#define RT2860_TEST_SEL_SHIFT 16 +#define RT2860_BT_MODE_EN (1 << 8) +#define RT2860_US_CYC_CNT_SHIFT 0 /* possible flags for register SYS_CTRL */ -#define RT2860_HST_PM_SEL (1 << 16) -#define RT2860_CAP_MODE (1 << 14) -#define RT2860_PME_OEN (1 << 13) -#define RT2860_CLKSELECT (1 << 12) -#define RT2860_PBF_CLK_EN (1 << 11) -#define RT2860_MAC_CLK_EN (1 << 10) -#define RT2860_DMA_CLK_EN (1 << 9) -#define RT2860_MCU_READY (1 << 7) -#define RT2860_ASY_RESET (1 << 4) -#define RT2860_PBF_RESET (1 << 3) -#define RT2860_MAC_RESET (1 << 2) -#define RT2860_DMA_RESET (1 << 1) -#define RT2860_MCU_RESET (1 << 0) +#define RT2860_HST_PM_SEL (1 << 16) +#define RT2860_CAP_MODE (1 << 14) +#define RT2860_PME_OEN (1 << 13) +#define RT2860_CLKSELECT (1 << 12) +#define RT2860_PBF_CLK_EN (1 << 11) +#define RT2860_MAC_CLK_EN (1 << 10) +#define RT2860_DMA_CLK_EN (1 << 9) +#define RT2860_MCU_READY (1 << 7) +#define RT2860_ASY_RESET (1 << 4) +#define RT2860_PBF_RESET (1 << 3) +#define RT2860_MAC_RESET (1 << 2) +#define RT2860_DMA_RESET (1 << 1) +#define RT2860_MCU_RESET (1 << 0) /* possible values for register HOST_CMD */ -#define RT2860_MCU_CMD_SLEEP 0x30 -#define RT2860_MCU_CMD_WAKEUP 0x31 -#define RT2860_MCU_CMD_LEDS 0x50 -#define RT2860_MCU_CMD_LED_RSSI 0x51 -#define RT2860_MCU_CMD_LED1 0x52 -#define RT2860_MCU_CMD_LED2 0x53 -#define RT2860_MCU_CMD_LED3 0x54 -#define RT2860_MCU_CMD_RFRESET 0x72 -#define RT2860_MCU_CMD_ANTSEL 0x73 -#define RT2860_MCU_CMD_BBP 0x80 -#define RT2860_MCU_CMD_PSLEVEL 0x83 +#define RT2860_MCU_CMD_SLEEP 0x30 +#define RT2860_MCU_CMD_WAKEUP 0x31 +#define RT2860_MCU_CMD_LEDS 0x50 +#define RT2860_MCU_CMD_LED_RSSI 0x51 +#define RT2860_MCU_CMD_LED1 0x52 +#define RT2860_MCU_CMD_LED2 0x53 +#define RT2860_MCU_CMD_LED3 0x54 +#define RT2860_MCU_CMD_RFRESET 0x72 +#define RT2860_MCU_CMD_ANTSEL 0x73 +#define RT2860_MCU_CMD_BBP 0x80 +#define RT2860_MCU_CMD_PSLEVEL 0x83 /* possible flags for register PBF_CFG */ -#define RT2860_TX1Q_NUM_SHIFT 21 -#define RT2860_TX2Q_NUM_SHIFT 16 -#define RT2860_NULL0_MODE (1 << 15) -#define RT2860_NULL1_MODE (1 << 14) -#define RT2860_RX_DROP_MODE (1 << 13) -#define RT2860_TX0Q_MANUAL (1 << 12) -#define RT2860_TX1Q_MANUAL (1 << 11) -#define RT2860_TX2Q_MANUAL (1 << 10) -#define RT2860_RX0Q_MANUAL (1 << 9) -#define RT2860_HCCA_EN (1 << 8) -#define RT2860_TX0Q_EN (1 << 4) -#define RT2860_TX1Q_EN (1 << 3) -#define RT2860_TX2Q_EN (1 << 2) -#define RT2860_RX0Q_EN (1 << 1) +#define RT2860_TX1Q_NUM_SHIFT 21 +#define RT2860_TX2Q_NUM_SHIFT 16 +#define RT2860_NULL0_MODE (1 << 15) +#define RT2860_NULL1_MODE (1 << 14) +#define RT2860_RX_DROP_MODE (1 << 13) +#define RT2860_TX0Q_MANUAL (1 << 12) +#define RT2860_TX1Q_MANUAL (1 << 11) +#define RT2860_TX2Q_MANUAL (1 << 10) +#define RT2860_RX0Q_MANUAL (1 << 9) +#define RT2860_HCCA_EN (1 << 8) +#define RT2860_TX0Q_EN (1 << 4) +#define RT2860_TX1Q_EN (1 << 3) +#define RT2860_TX2Q_EN (1 << 2) +#define RT2860_RX0Q_EN (1 << 1) /* possible flags for register BUF_CTRL */ -#define RT2860_WRITE_TXQ(qid) (1 << (11 - (qid))) -#define RT2860_NULL0_KICK (1 << 7) -#define RT2860_NULL1_KICK (1 << 6) -#define RT2860_BUF_RESET (1 << 5) -#define RT2860_READ_TXQ(qid) (1 << (3 - (qid)) -#define RT2860_READ_RX0Q (1 << 0) +#define RT2860_WRITE_TXQ(qid) (1 << (11 - (qid))) +#define RT2860_NULL0_KICK (1 << 7) +#define RT2860_NULL1_KICK (1 << 6) +#define RT2860_BUF_RESET (1 << 5) +#define RT2860_READ_TXQ(qid) (1 << (3 - (qid)) +#define RT2860_READ_RX0Q (1 << 0) /* possible flags for registers MCU_INT_STA/MCU_INT_ENA */ -#define RT2860_MCU_MAC_INT_8 (1 << 24) -#define RT2860_MCU_MAC_INT_7 (1 << 23) -#define RT2860_MCU_MAC_INT_6 (1 << 22) -#define RT2860_MCU_MAC_INT_4 (1 << 20) -#define RT2860_MCU_MAC_INT_3 (1 << 19) -#define RT2860_MCU_MAC_INT_2 (1 << 18) -#define RT2860_MCU_MAC_INT_1 (1 << 17) -#define RT2860_MCU_MAC_INT_0 (1 << 16) -#define RT2860_DTX0_INT (1 << 11) -#define RT2860_DTX1_INT (1 << 10) -#define RT2860_DTX2_INT (1 << 9) -#define RT2860_DRX0_INT (1 << 8) -#define RT2860_HCMD_INT (1 << 7) -#define RT2860_N0TX_INT (1 << 6) -#define RT2860_N1TX_INT (1 << 5) -#define RT2860_BCNTX_INT (1 << 4) -#define RT2860_MTX0_INT (1 << 3) -#define RT2860_MTX1_INT (1 << 2) -#define RT2860_MTX2_INT (1 << 1) -#define RT2860_MRX0_INT (1 << 0) +#define RT2860_MCU_MAC_INT_8 (1 << 24) +#define RT2860_MCU_MAC_INT_7 (1 << 23) +#define RT2860_MCU_MAC_INT_6 (1 << 22) +#define RT2860_MCU_MAC_INT_4 (1 << 20) +#define RT2860_MCU_MAC_INT_3 (1 << 19) +#define RT2860_MCU_MAC_INT_2 (1 << 18) +#define RT2860_MCU_MAC_INT_1 (1 << 17) +#define RT2860_MCU_MAC_INT_0 (1 << 16) +#define RT2860_DTX0_INT (1 << 11) +#define RT2860_DTX1_INT (1 << 10) +#define RT2860_DTX2_INT (1 << 9) +#define RT2860_DRX0_INT (1 << 8) +#define RT2860_HCMD_INT (1 << 7) +#define RT2860_N0TX_INT (1 << 6) +#define RT2860_N1TX_INT (1 << 5) +#define RT2860_BCNTX_INT (1 << 4) +#define RT2860_MTX0_INT (1 << 3) +#define RT2860_MTX1_INT (1 << 2) +#define RT2860_MTX2_INT (1 << 1) +#define RT2860_MRX0_INT (1 << 0) /* possible flags for register TXRXQ_PCNT */ -#define RT2860_RX0Q_PCNT_MASK 0xff000000 -#define RT2860_TX2Q_PCNT_MASK 0x00ff0000 -#define RT2860_TX1Q_PCNT_MASK 0x0000ff00 -#define RT2860_TX0Q_PCNT_MASK 0x000000ff +#define RT2860_RX0Q_PCNT_MASK 0xff000000 +#define RT2860_TX2Q_PCNT_MASK 0x00ff0000 +#define RT2860_TX1Q_PCNT_MASK 0x0000ff00 +#define RT2860_TX0Q_PCNT_MASK 0x000000ff /* possible flags for register CAP_CTRL */ -#define RT2860_CAP_ADC_FEQ (1U << 31) -#define RT2860_CAP_START (1 << 30) -#define RT2860_MAN_TRIG (1 << 29) -#define RT2860_TRIG_OFFSET_SHIFT 16 -#define RT2860_START_ADDR_SHIFT 0 +#define RT2860_CAP_ADC_FEQ (1U << 31) +#define RT2860_CAP_START (1 << 30) +#define RT2860_MAN_TRIG (1 << 29) +#define RT2860_TRIG_OFFSET_SHIFT 16 +#define RT2860_START_ADDR_SHIFT 0 /* possible flags for register RF_CSR_CFG */ -#define RT3070_RF_KICK (1 << 17) -#define RT3070_RF_WRITE (1 << 16) +#define RT3070_RF_KICK (1 << 17) +#define RT3070_RF_WRITE (1 << 16) /* possible flags for register EFUSE_CTRL */ -#define RT3070_SEL_EFUSE (1U << 31) -#define RT3070_EFSROM_KICK (1 << 30) -#define RT3070_EFSROM_AIN_MASK 0x03ff0000 -#define RT3070_EFSROM_AIN_SHIFT 16 -#define RT3070_EFSROM_MODE_MASK 0x000000c0 -#define RT3070_EFUSE_AOUT_MASK 0x0000003f +#define RT3070_SEL_EFUSE (1U << 31) +#define RT3070_EFSROM_KICK (1 << 30) +#define RT3070_EFSROM_AIN_MASK 0x03ff0000 +#define RT3070_EFSROM_AIN_SHIFT 16 +#define RT3070_EFSROM_MODE_MASK 0x000000c0 +#define RT3070_EFUSE_AOUT_MASK 0x0000003f /* possible flag for register DEBUG_INDEX */ -#define RT5592_SEL_XTAL (1U << 31) +#define RT5592_SEL_XTAL (1U << 31) /* possible flags for register MAC_SYS_CTRL */ -#define RT2860_RX_TS_EN (1 << 7) -#define RT2860_WLAN_HALT_EN (1 << 6) -#define RT2860_PBF_LOOP_EN (1 << 5) -#define RT2860_CONT_TX_TEST (1 << 4) -#define RT2860_MAC_RX_EN (1 << 3) -#define RT2860_MAC_TX_EN (1 << 2) -#define RT2860_BBP_HRST (1 << 1) -#define RT2860_MAC_SRST (1 << 0) +#define RT2860_RX_TS_EN (1 << 7) +#define RT2860_WLAN_HALT_EN (1 << 6) +#define RT2860_PBF_LOOP_EN (1 << 5) +#define RT2860_CONT_TX_TEST (1 << 4) +#define RT2860_MAC_RX_EN (1 << 3) +#define RT2860_MAC_TX_EN (1 << 2) +#define RT2860_BBP_HRST (1 << 1) +#define RT2860_MAC_SRST (1 << 0) /* possible flags for register MAC_BSSID_DW1 */ -#define RT2860_MULTI_BCN_NUM_SHIFT 18 -#define RT2860_MULTI_BSSID_MODE_SHIFT 16 +#define RT2860_MULTI_BCN_NUM_SHIFT 18 +#define RT2860_MULTI_BSSID_MODE_SHIFT 16 /* possible flags for register MAX_LEN_CFG */ -#define RT2860_MIN_MPDU_LEN_SHIFT 16 -#define RT2860_MAX_PSDU_LEN_SHIFT 12 -#define RT2860_MAX_PSDU_LEN8K 0 -#define RT2860_MAX_PSDU_LEN16K 1 -#define RT2860_MAX_PSDU_LEN32K 2 -#define RT2860_MAX_PSDU_LEN64K 3 -#define RT2860_MAX_MPDU_LEN_SHIFT 0 +#define RT2860_MIN_MPDU_LEN_SHIFT 16 +#define RT2860_MAX_PSDU_LEN_SHIFT 12 +#define RT2860_MAX_PSDU_LEN8K 0 +#define RT2860_MAX_PSDU_LEN16K 1 +#define RT2860_MAX_PSDU_LEN32K 2 +#define RT2860_MAX_PSDU_LEN64K 3 +#define RT2860_MAX_MPDU_LEN_SHIFT 0 /* possible flags for registers BBP_CSR_CFG/H2M_BBPAGENT */ -#define RT2860_BBP_RW_PARALLEL (1 << 19) -#define RT2860_BBP_PAR_DUR_112_5 (1 << 18) -#define RT2860_BBP_CSR_KICK (1 << 17) -#define RT2860_BBP_CSR_READ (1 << 16) -#define RT2860_BBP_ADDR_SHIFT 8 -#define RT2860_BBP_DATA_SHIFT 0 +#define RT2860_BBP_RW_PARALLEL (1 << 19) +#define RT2860_BBP_PAR_DUR_112_5 (1 << 18) +#define RT2860_BBP_CSR_KICK (1 << 17) +#define RT2860_BBP_CSR_READ (1 << 16) +#define RT2860_BBP_ADDR_SHIFT 8 +#define RT2860_BBP_DATA_SHIFT 0 /* possible flags for register RF_CSR_CFG0 */ -#define RT2860_RF_REG_CTRL (1U << 31) -#define RT2860_RF_LE_SEL1 (1 << 30) -#define RT2860_RF_LE_STBY (1 << 29) -#define RT2860_RF_REG_WIDTH_SHIFT 24 -#define RT2860_RF_REG_0_SHIFT 0 +#define RT2860_RF_REG_CTRL (1U << 31) +#define RT2860_RF_LE_SEL1 (1 << 30) +#define RT2860_RF_LE_STBY (1 << 29) +#define RT2860_RF_REG_WIDTH_SHIFT 24 +#define RT2860_RF_REG_0_SHIFT 0 /* possible flags for register RF_CSR_CFG1 */ -#define RT2860_RF_DUR_5 (1 << 24) -#define RT2860_RF_REG_1_SHIFT 0 +#define RT2860_RF_DUR_5 (1 << 24) +#define RT2860_RF_REG_1_SHIFT 0 /* possible flags for register LED_CFG */ -#define RT2860_LED_POL (1 << 30) -#define RT2860_Y_LED_MODE_SHIFT 28 -#define RT2860_G_LED_MODE_SHIFT 26 -#define RT2860_R_LED_MODE_SHIFT 24 -#define RT2860_LED_MODE_OFF 0 -#define RT2860_LED_MODE_BLINK_TX 1 -#define RT2860_LED_MODE_SLOW_BLINK 2 -#define RT2860_LED_MODE_ON 3 -#define RT2860_SLOW_BLK_TIME_SHIFT 16 -#define RT2860_LED_OFF_TIME_SHIFT 8 -#define RT2860_LED_ON_TIME_SHIFT 0 +#define RT2860_LED_POL (1 << 30) +#define RT2860_Y_LED_MODE_SHIFT 28 +#define RT2860_G_LED_MODE_SHIFT 26 +#define RT2860_R_LED_MODE_SHIFT 24 +#define RT2860_LED_MODE_OFF 0 +#define RT2860_LED_MODE_BLINK_TX 1 +#define RT2860_LED_MODE_SLOW_BLINK 2 +#define RT2860_LED_MODE_ON 3 +#define RT2860_SLOW_BLK_TIME_SHIFT 16 +#define RT2860_LED_OFF_TIME_SHIFT 8 +#define RT2860_LED_ON_TIME_SHIFT 0 /* possible flags for register XIFS_TIME_CFG */ -#define RT2860_BB_RXEND_EN (1 << 29) -#define RT2860_EIFS_TIME_SHIFT 20 -#define RT2860_OFDM_XIFS_TIME_SHIFT 16 -#define RT2860_OFDM_SIFS_TIME_SHIFT 8 -#define RT2860_CCK_SIFS_TIME_SHIFT 0 +#define RT2860_BB_RXEND_EN (1 << 29) +#define RT2860_EIFS_TIME_SHIFT 20 +#define RT2860_OFDM_XIFS_TIME_SHIFT 16 +#define RT2860_OFDM_SIFS_TIME_SHIFT 8 +#define RT2860_CCK_SIFS_TIME_SHIFT 0 /* possible flags for register BKOFF_SLOT_CFG */ -#define RT2860_CC_DELAY_TIME_SHIFT 8 -#define RT2860_SLOT_TIME 0 +#define RT2860_CC_DELAY_TIME_SHIFT 8 +#define RT2860_SLOT_TIME 0 /* possible flags for register NAV_TIME_CFG */ -#define RT2860_NAV_UPD (1U << 31) -#define RT2860_NAV_UPD_VAL_SHIFT 16 -#define RT2860_NAV_CLR_EN (1 << 15) -#define RT2860_NAV_TIMER_SHIFT 0 +#define RT2860_NAV_UPD (1U << 31) +#define RT2860_NAV_UPD_VAL_SHIFT 16 +#define RT2860_NAV_CLR_EN (1 << 15) +#define RT2860_NAV_TIMER_SHIFT 0 /* possible flags for register CH_TIME_CFG */ -#define RT2860_EIFS_AS_CH_BUSY (1 << 4) -#define RT2860_NAV_AS_CH_BUSY (1 << 3) -#define RT2860_RX_AS_CH_BUSY (1 << 2) -#define RT2860_TX_AS_CH_BUSY (1 << 1) -#define RT2860_CH_STA_TIMER_EN (1 << 0) +#define RT2860_EIFS_AS_CH_BUSY (1 << 4) +#define RT2860_NAV_AS_CH_BUSY (1 << 3) +#define RT2860_RX_AS_CH_BUSY (1 << 2) +#define RT2860_TX_AS_CH_BUSY (1 << 1) +#define RT2860_CH_STA_TIMER_EN (1 << 0) /* possible values for register BCN_TIME_CFG */ -#define RT2860_TSF_INS_COMP_SHIFT 24 -#define RT2860_BCN_TX_EN (1 << 20) -#define RT2860_TBTT_TIMER_EN (1 << 19) -#define RT2860_TSF_SYNC_MODE_SHIFT 17 -#define RT2860_TSF_SYNC_MODE_DIS 0 -#define RT2860_TSF_SYNC_MODE_STA 1 -#define RT2860_TSF_SYNC_MODE_IBSS 2 -#define RT2860_TSF_SYNC_MODE_HOSTAP 3 -#define RT2860_TSF_TIMER_EN (1 << 16) -#define RT2860_BCN_INTVAL_SHIFT 0 +#define RT2860_TSF_INS_COMP_SHIFT 24 +#define RT2860_BCN_TX_EN (1 << 20) +#define RT2860_TBTT_TIMER_EN (1 << 19) +#define RT2860_TSF_SYNC_MODE_SHIFT 17 +#define RT2860_TSF_SYNC_MODE_DIS 0 +#define RT2860_TSF_SYNC_MODE_STA 1 +#define RT2860_TSF_SYNC_MODE_IBSS 2 +#define RT2860_TSF_SYNC_MODE_HOSTAP 3 +#define RT2860_TSF_TIMER_EN (1 << 16) +#define RT2860_BCN_INTVAL_SHIFT 0 /* possible flags for register TBTT_SYNC_CFG */ -#define RT2860_BCN_CWMIN_SHIFT 20 -#define RT2860_BCN_AIFSN_SHIFT 16 -#define RT2860_BCN_EXP_WIN_SHIFT 8 -#define RT2860_TBTT_ADJUST_SHIFT 0 +#define RT2860_BCN_CWMIN_SHIFT 20 +#define RT2860_BCN_AIFSN_SHIFT 16 +#define RT2860_BCN_EXP_WIN_SHIFT 8 +#define RT2860_TBTT_ADJUST_SHIFT 0 /* possible flags for register INT_TIMER_CFG */ -#define RT2860_GP_TIMER_SHIFT 16 -#define RT2860_PRE_TBTT_TIMER_SHIFT 0 +#define RT2860_GP_TIMER_SHIFT 16 +#define RT2860_PRE_TBTT_TIMER_SHIFT 0 /* possible flags for register INT_TIMER_EN */ -#define RT2860_GP_TIMER_EN (1 << 1) -#define RT2860_PRE_TBTT_INT_EN (1 << 0) +#define RT2860_GP_TIMER_EN (1 << 1) +#define RT2860_PRE_TBTT_INT_EN (1 << 0) /* possible flags for register MAC_STATUS_REG */ -#define RT2860_RX_STATUS_BUSY (1 << 1) -#define RT2860_TX_STATUS_BUSY (1 << 0) +#define RT2860_RX_STATUS_BUSY (1 << 1) +#define RT2860_TX_STATUS_BUSY (1 << 0) /* possible flags for register PWR_PIN_CFG */ -#define RT2860_IO_ADDA_PD (1 << 3) -#define RT2860_IO_PLL_PD (1 << 2) -#define RT2860_IO_RA_PE (1 << 1) -#define RT2860_IO_RF_PE (1 << 0) +#define RT2860_IO_ADDA_PD (1 << 3) +#define RT2860_IO_PLL_PD (1 << 2) +#define RT2860_IO_RA_PE (1 << 1) +#define RT2860_IO_RF_PE (1 << 0) /* possible flags for register AUTO_WAKEUP_CFG */ -#define RT2860_AUTO_WAKEUP_EN (1 << 15) -#define RT2860_SLEEP_TBTT_NUM_SHIFT 8 -#define RT2860_WAKEUP_LEAD_TIME_SHIFT 0 +#define RT2860_AUTO_WAKEUP_EN (1 << 15) +#define RT2860_SLEEP_TBTT_NUM_SHIFT 8 +#define RT2860_WAKEUP_LEAD_TIME_SHIFT 0 /* possible flags for register TX_PIN_CFG */ -#define RT2860_TRSW_POL (1 << 19) -#define RT2860_TRSW_EN (1 << 18) -#define RT2860_RFTR_POL (1 << 17) -#define RT2860_RFTR_EN (1 << 16) -#define RT2860_LNA_PE_G1_POL (1 << 15) -#define RT2860_LNA_PE_A1_POL (1 << 14) -#define RT2860_LNA_PE_G0_POL (1 << 13) -#define RT2860_LNA_PE_A0_POL (1 << 12) -#define RT2860_LNA_PE_G1_EN (1 << 11) -#define RT2860_LNA_PE_A1_EN (1 << 10) -#define RT2860_LNA_PE1_EN (RT2860_LNA_PE_A1_EN | RT2860_LNA_PE_G1_EN) -#define RT2860_LNA_PE_G0_EN (1 << 9) -#define RT2860_LNA_PE_A0_EN (1 << 8) -#define RT2860_LNA_PE0_EN (RT2860_LNA_PE_A0_EN | RT2860_LNA_PE_G0_EN) -#define RT2860_PA_PE_G1_POL (1 << 7) -#define RT2860_PA_PE_A1_POL (1 << 6) -#define RT2860_PA_PE_G0_POL (1 << 5) -#define RT2860_PA_PE_A0_POL (1 << 4) -#define RT2860_PA_PE_G1_EN (1 << 3) -#define RT2860_PA_PE_A1_EN (1 << 2) -#define RT2860_PA_PE_G0_EN (1 << 1) -#define RT2860_PA_PE_A0_EN (1 << 0) +#define RT2860_TRSW_POL (1 << 19) +#define RT2860_TRSW_EN (1 << 18) +#define RT2860_RFTR_POL (1 << 17) +#define RT2860_RFTR_EN (1 << 16) +#define RT2860_LNA_PE_G1_POL (1 << 15) +#define RT2860_LNA_PE_A1_POL (1 << 14) +#define RT2860_LNA_PE_G0_POL (1 << 13) +#define RT2860_LNA_PE_A0_POL (1 << 12) +#define RT2860_LNA_PE_G1_EN (1 << 11) +#define RT2860_LNA_PE_A1_EN (1 << 10) +#define RT2860_LNA_PE1_EN (RT2860_LNA_PE_A1_EN | RT2860_LNA_PE_G1_EN) +#define RT2860_LNA_PE_G0_EN (1 << 9) +#define RT2860_LNA_PE_A0_EN (1 << 8) +#define RT2860_LNA_PE0_EN (RT2860_LNA_PE_A0_EN | RT2860_LNA_PE_G0_EN) +#define RT2860_PA_PE_G1_POL (1 << 7) +#define RT2860_PA_PE_A1_POL (1 << 6) +#define RT2860_PA_PE_G0_POL (1 << 5) +#define RT2860_PA_PE_A0_POL (1 << 4) +#define RT2860_PA_PE_G1_EN (1 << 3) +#define RT2860_PA_PE_A1_EN (1 << 2) +#define RT2860_PA_PE_G0_EN (1 << 1) +#define RT2860_PA_PE_A0_EN (1 << 0) /* possible flags for register TX_BAND_CFG */ -#define RT2860_5G_BAND_SEL_N (1 << 2) -#define RT2860_5G_BAND_SEL_P (1 << 1) -#define RT2860_TX_BAND_SEL (1 << 0) +#define RT2860_5G_BAND_SEL_N (1 << 2) +#define RT2860_5G_BAND_SEL_P (1 << 1) +#define RT2860_TX_BAND_SEL (1 << 0) /* possible flags for register TX_SW_CFG0 */ -#define RT2860_DLY_RFTR_EN_SHIFT 24 -#define RT2860_DLY_TRSW_EN_SHIFT 16 -#define RT2860_DLY_PAPE_EN_SHIFT 8 -#define RT2860_DLY_TXPE_EN_SHIFT 0 +#define RT2860_DLY_RFTR_EN_SHIFT 24 +#define RT2860_DLY_TRSW_EN_SHIFT 16 +#define RT2860_DLY_PAPE_EN_SHIFT 8 +#define RT2860_DLY_TXPE_EN_SHIFT 0 /* possible flags for register TX_SW_CFG1 */ -#define RT2860_DLY_RFTR_DIS_SHIFT 16 -#define RT2860_DLY_TRSW_DIS_SHIFT 8 -#define RT2860_DLY_PAPE_DIS SHIFT 0 +#define RT2860_DLY_RFTR_DIS_SHIFT 16 +#define RT2860_DLY_TRSW_DIS_SHIFT 8 +#define RT2860_DLY_PAPE_DIS SHIFT 0 /* possible flags for register TX_SW_CFG2 */ -#define RT2860_DLY_LNA_EN_SHIFT 24 -#define RT2860_DLY_LNA_DIS_SHIFT 16 -#define RT2860_DLY_DAC_EN_SHIFT 8 -#define RT2860_DLY_DAC_DIS_SHIFT 0 +#define RT2860_DLY_LNA_EN_SHIFT 24 +#define RT2860_DLY_LNA_DIS_SHIFT 16 +#define RT2860_DLY_DAC_EN_SHIFT 8 +#define RT2860_DLY_DAC_DIS_SHIFT 0 /* possible flags for register TXOP_THRES_CFG */ -#define RT2860_TXOP_REM_THRES_SHIFT 24 -#define RT2860_CF_END_THRES_SHIFT 16 -#define RT2860_RDG_IN_THRES 8 -#define RT2860_RDG_OUT_THRES 0 +#define RT2860_TXOP_REM_THRES_SHIFT 24 +#define RT2860_CF_END_THRES_SHIFT 16 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 08:53:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78EE5D51; Wed, 18 Dec 2013 08:53:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 658EE1703; Wed, 18 Dec 2013 08:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI8rfFR004806; Wed, 18 Dec 2013 08:53:41 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI8rfJD004805; Wed, 18 Dec 2013 08:53:41 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180853.rBI8rfJD004805@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 08:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259547 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 08:53:41 -0000 Author: kevlo Date: Wed Dec 18 08:53:40 2013 New Revision: 259547 URL: http://svnweb.freebsd.org/changeset/base/259547 Log: Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write() is uint8_t. Spotted by: yongari Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:39:12 2013 (r259546) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:53:40 2013 (r259547) @@ -3659,7 +3659,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx0 IQ phase. */ run_bbp_write(sc, 158, 0x2d); @@ -3680,7 +3680,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx1 IQ gain. */ run_bbp_write(sc, 158, 0x4a); @@ -3701,7 +3701,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx1 IQ phase. */ run_bbp_write(sc, 158, 0x4b); @@ -3722,19 +3722,19 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* RF IQ compensation control. */ run_bbp_write(sc, 158, 0x04); run_efuse_read(sc, RT5390_EEPROM_RF_IQ_COMPENSATION_CTL, &val, 1); - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* RF IQ imbalance compensation control. */ run_bbp_write(sc, 158, 0x03); run_efuse_read(sc, RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL, &val, 1); - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); } static void From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 12:18:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CB56D; Wed, 18 Dec 2013 12:18:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31D361890; Wed, 18 Dec 2013 12:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICIIIP079335; Wed, 18 Dec 2013 12:18:18 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICIIC3079334; Wed, 18 Dec 2013 12:18:18 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201312181218.rBICIIC3079334@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 18 Dec 2013 12:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259548 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 12:18:18 -0000 Author: ru Date: Wed Dec 18 12:18:17 2013 New Revision: 259548 URL: http://svnweb.freebsd.org/changeset/base/259548 Log: shm_open(2): Fixed the history information. While here, sort xrefs. Reviewed by: jhb Modified: head/lib/libc/sys/shm_open.2 Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Wed Dec 18 08:53:40 2013 (r259547) +++ head/lib/libc/sys/shm_open.2 Wed Dec 18 12:18:17 2013 (r259548) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2007 +.Dd December 18, 2013 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -253,8 +253,8 @@ requires write permission to the shared .El .Sh SEE ALSO .Xr close 2 , -.Xr ftruncate 2 , .Xr fstat 2 , +.Xr ftruncate 2 , .Xr mmap 2 , .Xr munmap 2 .Sh STANDARDS @@ -273,7 +273,7 @@ functions first appeared in .Fx 4.3 . The functions were reimplemented as system calls using shared memory objects directly rather than files in -.Fx 7.0 . +.Fx 8.0 . .Sh AUTHORS .An Garrett A. Wollman Aq wollman@FreeBSD.org (C library support and this manual page) From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 12:50:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0CC7E44; Wed, 18 Dec 2013 12:50:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A070B1B5D; Wed, 18 Dec 2013 12:50:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICoiNh091809; Wed, 18 Dec 2013 12:50:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICoi48091807; Wed, 18 Dec 2013 12:50:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312181250.rBICoi48091807@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 12:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259549 - in head/sys: kern 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.17 Precedence: list List-Id: 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, 18 Dec 2013 12:50:44 -0000 Author: glebius Date: Wed Dec 18 12:50:43 2013 New Revision: 259549 URL: http://svnweb.freebsd.org/changeset/base/259549 Log: - Rename tty_makedev() into tty_makedevf() and make it capable to fail and return error. - Use make_dev_p() in tty_makedevf() instead of make_dev_cred(). - Always pass MAKEDEV_CHECKNAME flag. - Optionally pass MAKEDEV_REF flag. - Provide macro for compatibility with old API. This fixes races with simultaneous creation and desctruction of ttys, and makes it possible to call tty_makedevf() from device cloners. A race in tty_watermarks() still exist, since the latter drops lock for M_WAITOK allocation. This will be addressed in separate commit. Reviewed by: kib Sponsored by: Nginx, Inc. Modified: head/sys/kern/tty.c head/sys/sys/tty.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Dec 18 12:18:17 2013 (r259548) +++ head/sys/kern/tty.c Wed Dec 18 12:50:43 2013 (r259549) @@ -289,7 +289,7 @@ ttydev_open(struct cdev *dev, int oflags goto done; ttydisc_open(tp); - tty_watermarks(tp); + tty_watermarks(tp); /* XXXGL: drops lock */ } /* Wait for Carrier Detect. */ @@ -1174,16 +1174,18 @@ SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTY * the user. */ -void -tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +int +tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) { va_list ap; - struct cdev *dev; + struct cdev *dev, *init, *lock, *cua, *cinit, *clock; const char *prefix = "tty"; char name[SPECNAMELEN - 3]; /* for "tty" and "cua". */ uid_t uid; gid_t gid; mode_t mode; + int error; /* Remove "tty" prefix from devices like PTY's. */ if (tp->t_flags & TF_NOPREFIX) @@ -1205,57 +1207,92 @@ tty_makedev(struct tty *tp, struct ucred mode = S_IRUSR|S_IWUSR|S_IWGRP; } + flags = flags & TTYMK_CLONING ? MAKEDEV_REF : 0; + flags |= MAKEDEV_CHECKNAME; + /* Master call-in device. */ - dev = make_dev_cred(&ttydev_cdevsw, 0, cred, - uid, gid, mode, "%s%s", prefix, name); + error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, + "%s%s", prefix, name); + if (error) + return (error); dev->si_drv1 = tp; wakeup(&dev->si_drv1); tp->t_dev = dev; + init = lock = cua = cinit = clock = NULL; + /* Slave call-in devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_INIT, cred, - uid, gid, mode, "%s%s.init", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_in; - - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_LOCK, cred, - uid, gid, mode, "%s%s.lock", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_in; + error = make_dev_p(flags, &init, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.init", prefix, name); + if (error) + goto fail; + dev_depends(dev, init); + dev2unit(init) = TTYUNIT_INIT; + init->si_drv1 = tp; + wakeup(&init->si_drv1); + init->si_drv2 = &tp->t_termios_init_in; + + error = make_dev_p(flags, &lock, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.lock", prefix, name); + if (error) + goto fail; + dev_depends(dev, lock); + dev2unit(lock) = TTYUNIT_LOCK; + lock->si_drv1 = tp; + wakeup(&lock->si_drv1); + lock->si_drv2 = &tp->t_termios_lock_in; } /* Call-out devices. */ if (tp->t_flags & TF_CALLOUT) { - dev = make_dev_cred(&ttydev_cdevsw, TTYUNIT_CALLOUT, cred, + error = make_dev_p(flags, &cua, &ttydev_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); + if (error) + goto fail; + dev_depends(dev, cua); + dev2unit(cua) = TTYUNIT_CALLOUT; + cua->si_drv1 = tp; + wakeup(&cua->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_INIT, cred, + error = make_dev_p(flags, &cinit, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_out; + if (error) + goto fail; + dev_depends(dev, cinit); + dev2unit(cinit) = TTYUNIT_CALLOUT | TTYUNIT_INIT; + cinit->si_drv1 = tp; + wakeup(&cinit->si_drv1); + cinit->si_drv2 = &tp->t_termios_init_out; - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_LOCK, cred, + error = make_dev_p(flags, &clock, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_out; + if (error) + goto fail; + dev_depends(dev, clock); + dev2unit(clock) = TTYUNIT_CALLOUT | TTYUNIT_LOCK; + clock->si_drv1 = tp; + wakeup(&clock->si_drv1); + clock->si_drv2 = &tp->t_termios_lock_out; } } + + return (0); + +fail: + destroy_dev(dev); + if (init) + destroy_dev(init); + if (lock) + destroy_dev(lock); + if (cinit) + destroy_dev(cinit); + if (clock) + destroy_dev(clock); + + return (error); } /* Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Wed Dec 18 12:18:17 2013 (r259548) +++ head/sys/sys/tty.h Wed Dec 18 12:50:43 2013 (r259549) @@ -171,8 +171,11 @@ void tty_rel_gone(struct tty *tp); #define tty_getlock(tp) ((tp)->t_mtx) /* Device node creation. */ -void tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) - __printflike(3, 4); +int tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) __printflike(4, 5); +#define TTYMK_CLONING 0x1 +#define tty_makedev(tp, cred, fmt, ...) \ + (void )tty_makedevf((tp), (cred), 0, (fmt), ## __VA_ARGS__) #define tty_makealias(tp,fmt,...) \ make_dev_alias((tp)->t_dev, fmt, ## __VA_ARGS__) From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 12:53:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49121FE7; Wed, 18 Dec 2013 12:53:25 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0825F1C82; Wed, 18 Dec 2013 12:53:24 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 27BED7CC8; Wed, 18 Dec 2013 12:53:24 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id F187730E3A; Wed, 18 Dec 2013 13:53:24 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312131231.04749.jhb@freebsd.org> <86k3f4kjk8.fsf@nine.des.no> <201312171220.47075.jhb@freebsd.org> Date: Wed, 18 Dec 2013 13:53:24 +0100 In-Reply-To: <201312171220.47075.jhb@freebsd.org> (John Baldwin's message of "Tue, 17 Dec 2013 12:20:46 -0500") Message-ID: <86eh5agw1n.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 12:53:25 -0000 John Baldwin writes: > 1) 'make tinderbox' Just Works as a single command from an existing source > tree checkout. [...] > > 2) 'make tinderbox' provides a summary of what failed. 'make universe' > does not. [...] So remove all the .if !defined(DOING_TINDERBOX) code the tinderbox target, and 'make universe' will do what you want without confusing people. > Ah, I thought at one point it only built GENERIC and LINT type configs, > but presumably that has changed? That changed a long time ago. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 12:53:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF7651C0; Wed, 18 Dec 2013 12:53:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEF2B1C8A; Wed, 18 Dec 2013 12:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICrmCM092676; Wed, 18 Dec 2013 12:53:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICrm5W092675; Wed, 18 Dec 2013 12:53:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312181253.rBICrm5W092675@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 12:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259550 - head/sys/dev/nmdm 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.17 Precedence: list List-Id: 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, 18 Dec 2013 12:53:49 -0000 Author: glebius Date: Wed Dec 18 12:53:48 2013 New Revision: 259550 URL: http://svnweb.freebsd.org/changeset/base/259550 Log: Make nmdm(4) destroy devices when both sides of a pair are disconnected. This makes it possible to kldunload nmdm.ko when there are no users of it. Reviewed by: kib Sponsored by: Nginx, Inc. Modified: head/sys/dev/nmdm/nmdm.c Modified: head/sys/dev/nmdm/nmdm.c ============================================================================== --- head/sys/dev/nmdm/nmdm.c Wed Dec 18 12:50:43 2013 (r259549) +++ head/sys/dev/nmdm/nmdm.c Wed Dec 18 12:53:48 2013 (r259550) @@ -58,6 +58,8 @@ static tsw_inwakeup_t nmdm_outwakeup; static tsw_outwakeup_t nmdm_inwakeup; static tsw_param_t nmdm_param; static tsw_modem_t nmdm_modem; +static tsw_close_t nmdm_close; +static tsw_free_t nmdm_free; static struct ttydevsw nmdm_class = { .tsw_flags = TF_NOPREFIX, @@ -65,6 +67,8 @@ static struct ttydevsw nmdm_class = { .tsw_outwakeup = nmdm_outwakeup, .tsw_param = nmdm_param, .tsw_modem = nmdm_modem, + .tsw_close = nmdm_close, + .tsw_free = nmdm_free, }; static void nmdm_task_tty(void *, int); @@ -94,47 +98,68 @@ struct nmdmsoftc { static int nmdm_count = 0; -static struct nmdmsoftc * -nmdm_alloc(unsigned long unit) +static void +nmdm_close(struct tty *tp) { - struct nmdmsoftc *ns; - struct tty *tp; - - atomic_add_int(&nmdm_count, 1); + struct nmdmpart *np; + struct nmdmpart *onp; + struct tty *otp; + + np = tty_softc(tp); + onp = np->np_other; + otp = onp->np_tty; - ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK|M_ZERO); - mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); + /* If second part is opened, do not destroy ourselves. */ + if (tty_opened(otp)) + return; - /* Hook the pairs together. */ - ns->ns_part1.np_pair = ns; - ns->ns_part1.np_other = &ns->ns_part2; - TASK_INIT(&ns->ns_part1.np_task, 0, nmdm_task_tty, &ns->ns_part1); - callout_init_mtx(&ns->ns_part1.np_callout, &ns->ns_mtx, 0); + /* Shut down self. */ + tty_rel_gone(tp); - ns->ns_part2.np_pair = ns; - ns->ns_part2.np_other = &ns->ns_part1; - TASK_INIT(&ns->ns_part2.np_task, 0, nmdm_task_tty, &ns->ns_part2); - callout_init_mtx(&ns->ns_part2.np_callout, &ns->ns_mtx, 0); + /* Shut down second part. */ + tty_lock(tp); + onp = np->np_other; + if (onp == NULL) + return; + otp = onp->np_tty; + tty_rel_gone(otp); + tty_lock(tp); +} - /* Create device nodes. */ - tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1, - &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luA", unit); +static void +nmdm_free(void *softc) +{ + struct nmdmpart *np = (struct nmdmpart *)softc; + struct nmdmsoftc *ns = np->np_pair; - tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2, - &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luB", unit); + callout_drain(&np->np_callout); + taskqueue_drain(taskqueue_swi, &np->np_task); - return (ns); + /* + * The function is called on both parts simultaneously. We serialize + * with help of ns_mtx. The first invocation should return and + * delegate freeing of resources to the second. + */ + mtx_lock(&ns->ns_mtx); + if (np->np_other != NULL) { + np->np_other->np_other = NULL; + mtx_unlock(&ns->ns_mtx); + return; + } + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + atomic_subtract_int(&nmdm_count, 1); } static void nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen, struct cdev **dev) { + struct nmdmsoftc *ns; + struct tty *tp; unsigned long unit; char *end; - struct nmdmsoftc *ns; + int error; if (*dev != NULL) return; @@ -149,13 +174,50 @@ nmdm_clone(void *arg, struct ucred *cred if ((end[0] != 'A' && end[0] != 'B') || end[1] != '\0') return; - /* XXX: pass privileges? */ - ns = nmdm_alloc(unit); + ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK | M_ZERO); + mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); + + /* Hook the pairs together. */ + ns->ns_part1.np_pair = ns; + ns->ns_part1.np_other = &ns->ns_part2; + TASK_INIT(&ns->ns_part1.np_task, 0, nmdm_task_tty, &ns->ns_part1); + callout_init_mtx(&ns->ns_part1.np_callout, &ns->ns_mtx, 0); + + ns->ns_part2.np_pair = ns; + ns->ns_part2.np_other = &ns->ns_part1; + TASK_INIT(&ns->ns_part2.np_task, 0, nmdm_task_tty, &ns->ns_part2); + callout_init_mtx(&ns->ns_part2.np_callout, &ns->ns_mtx, 0); + + /* Create device nodes. */ + tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1, + &ns->ns_mtx); + error = tty_makedevf(tp, NULL, end[0] == 'A' ? TTYMK_CLONING : 0, + "nmdm%luA", unit); + if (error) { + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + return; + } + + tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2, + &ns->ns_mtx); + error = tty_makedevf(tp, NULL, end[0] == 'B' ? TTYMK_CLONING : 0, + "nmdm%luB", unit); + if (error) { + mtx_lock(&ns->ns_mtx); + /* see nmdm_free() */ + ns->ns_part1.np_other = NULL; + atomic_add_int(&nmdm_count, 1); + tty_rel_gone(ns->ns_part1.np_tty); + return; + } if (end[0] == 'A') *dev = ns->ns_part1.np_tty->t_dev; else *dev = ns->ns_part2.np_tty->t_dev; + + atomic_add_int(&nmdm_count, 1); } static void @@ -187,6 +249,10 @@ nmdm_task_tty(void *arg, int pending __u tp = np->np_tty; tty_lock(tp); + if (tty_gone(tp)) { + tty_unlock(tp); + return; + } otp = np->np_other->np_tty; KASSERT(otp != NULL, ("NULL otp in nmdmstart")); @@ -203,6 +269,12 @@ nmdm_task_tty(void *arg, int pending __u } } + /* This may happen when we are in detach process. */ + if (tty_gone(otp)) { + tty_unlock(otp); + return; + } + while (ttydisc_rint_poll(otp) > 0) { if (np->np_rate && !np->np_quota) break; From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 13:27:24 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52393CF6; Wed, 18 Dec 2013 13:27:24 +0000 (UTC) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCDF41EEB; Wed, 18 Dec 2013 13:27:23 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0834F4000F; Wed, 18 Dec 2013 14:27:21 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id F15644000B; Wed, 18 Dec 2013 14:27:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 676F940009; Wed, 18 Dec 2013 14:27:19 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3dkxpb1Pdpz8jLB; Wed, 18 Dec 2013 14:27:19 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id AvcBSofTW5WN; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 3dkxpX5780z8jL9; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from tifa.daemonic.se (tifa.daemonic.se [10.32.0.6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3dkxpX4ZwXz9CwV; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 4DE552281D; Wed, 18 Dec 2013 14:27:14 +0100 (CET) Message-ID: <52B1A2B2.6010102@daemonic.se> Date: Wed, 18 Dec 2013 14:27:14 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> <20131218002415.GQ99753@ithaqua.etoilebsd.net> In-Reply-To: <20131218002415.GQ99753@ithaqua.etoilebsd.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Aleksandr Rybalko , Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 13:27:24 -0000 On 12/18/13 01:24, Baptiste Daroussin wrote: > On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: >> On Tue, 10 Dec 2013 23:49:38 +0100 >> Andreas Tobler wrote: >> >>> On 10.12.13 14:43, Tijl Coosemans wrote: >>>> On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: >>>>> That keyboards have no Shift key for that? :) >>>>> I will be glad to apply your changes, but I have to know how it >>>>> should be controlled. >>>>> >>>>> RU and UA PC keyboards have same 3 symbols '2', '"', '@' >>>>> To get '2' i have to press only '2' >>>>> To get '@' I have to press Shift+'2' >>>>> To get '"' I have to switch to UA or RU and press Shift+'2' >>>>> >>>>> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary >>>>> lang switch. Which commonly mapped to one of Alt. Right? >>>>> So R-Alt+Shift+'2'? >>>> >>>> https://en.wikipedia.org/wiki/AltGr >>> >>> Thanks Tijl! >>> >>> To get the @ I have to press AltGr + '2'. >>> There are combinations where I have to press AltGr+Shift. e.g to get >>> the 'broken bar, ¦', AltGr+Shift+'7'. >>> >>> Andreas >>> >> >> Hello Andreas and Tijl! >> >> Since I think not a whole world have AltGr key (read as "not most >> keyboards on the Earth") :) >> Think it is OK to use R.Alt as an Alt by default, and enable AltGr with >> sysctl kern.vt.enable_altgr. >> > I tend to disagree with you, lots of keyboards mapping are concerned here. > alt-gr is there on most, if not all, western european keyboard layouts, and probably more layouts than that. Have a look at http://en.wikipedia.org/wiki/AltGr_key for instance. Regards! -- Niclas From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 14:53:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF2B530B; Wed, 18 Dec 2013 14:53:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA31B14E7; Wed, 18 Dec 2013 14:53:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIErcT3037474; Wed, 18 Dec 2013 14:53:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIEranx037463; Wed, 18 Dec 2013 14:53:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312181453.rBIEranx037463@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 14:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/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.17 Precedence: list List-Id: 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, 18 Dec 2013 14:53:38 -0000 Author: pfg Date: Wed Dec 18 14:53:36 2013 New Revision: 259555 URL: http://svnweb.freebsd.org/changeset/base/259555 Log: gcc: add Apple compatible -Wnewline-eof GCC 4.2 and previous have always warned about "No newline at end of file". Upstream GCC removed the warning completely but Apple made it an optional warning. Adopt it for compatibility with older GCC and clang. While here, add comment to complement r258712. Obtained from: Apple Inc. (Apple GCC 4.2 - 5531) MFC after: 1 week Added: head/contrib/gcclibs/libcpp/ChangeLog.apple Modified: head/contrib/gcc/c-opts.c head/contrib/gcc/c.opt head/contrib/gcc/doc/invoke.texi head/contrib/gcclibs/libcpp/charset.c head/contrib/gcclibs/libcpp/include/cpplib.h head/contrib/gcclibs/libcpp/init.c head/contrib/gcclibs/libcpp/lex.c Modified: head/contrib/gcc/c-opts.c ============================================================================== --- head/contrib/gcc/c-opts.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/c-opts.c Wed Dec 18 14:53:36 2013 (r259555) @@ -487,6 +487,12 @@ c_common_handle_option (size_t scode, co cpp_opts->warn_multichar = value; break; + /* APPLE LOCAL begin -Wnewline-eof */ + case OPT_Wnewline_eof: + cpp_opts->warn_newline_at_eof = value; + break; + /* APPLE LOCAL end -Wnewline-eof */ + case OPT_Wnormalized_: if (!value || (arg && strcasecmp (arg, "none") == 0)) cpp_opts->warn_normalize = normalized_none; Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/c.opt Wed Dec 18 14:53:36 2013 (r259555) @@ -292,6 +292,12 @@ Wnested-externs C ObjC Var(warn_nested_externs) Warn about \"extern\" declarations not at file scope +; APPLE LOCAL begin -Wnewline-eof +Wnewline-eof +C ObjC C++ ObjC++ +Warn about files missing a newline at the end of the file +; APPLE LOCAL end -Wnewline-eof + Wnon-template-friend C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warn when non-templatized friend functions are declared within a template Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/doc/invoke.texi Wed Dec 18 14:53:36 2013 (r259555) @@ -169,6 +169,8 @@ in the following sections. -trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol -fallow-single-precision -fcond-mismatch -flax-vector-conversions @gol -fsigned-bitfields -fsigned-char @gol +@c APPLE LOCAL -Wnewline-eof 2001-08-23 --sts ** +-Wnewline-eof (Apple compatible) @gol -funsigned-bitfields -funsigned-char} @item C++ Language Options @@ -2082,6 +2084,12 @@ Inhibit all warning messages. @opindex Wno-import Inhibit warning messages about the use of @samp{#import}. +@c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts ** +@item -Wnewline-eof +@opindex Wnewline-eof +Warn about files missing a newline at the end of the file. (FreeBSD ONLY) +@c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts ** + @item -Wchar-subscripts @opindex Wchar-subscripts Warn if an array subscript has type @code{char}. This is a common cause Added: head/contrib/gcclibs/libcpp/ChangeLog.apple ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcclibs/libcpp/ChangeLog.apple Wed Dec 18 14:53:36 2013 (r259555) @@ -0,0 +1,9 @@ +2008-08-04 Bill Wendling + + Radar 6121572 + * charset.c (_cpp_convert_input): Don't read to.text[-1]. + +2005-02-17 Devang Patel + + Radar 3958387 + * libcpp/lex.c (_cpp_get_fresh_line): Check warn_newline_at_eof. Modified: head/contrib/gcclibs/libcpp/charset.c ============================================================================== --- head/contrib/gcclibs/libcpp/charset.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/charset.c Wed Dec 18 14:53:36 2013 (r259555) @@ -1628,6 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ + /* APPLE LOCAL don't access to.text[-1] radar 6121572 */ if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else Modified: head/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- head/contrib/gcclibs/libcpp/include/cpplib.h Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/include/cpplib.h Wed Dec 18 14:53:36 2013 (r259555) @@ -320,6 +320,11 @@ struct cpp_options /* Nonzero means warn if there are any trigraphs. */ unsigned char warn_trigraphs; + /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */ + /* Nonzero means warn if no newline at end of file. */ + unsigned char warn_newline_at_eof; + /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */ + /* Nonzero means warn about multicharacter charconsts. */ unsigned char warn_multichar; Modified: head/contrib/gcclibs/libcpp/init.c ============================================================================== --- head/contrib/gcclibs/libcpp/init.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/init.c Wed Dec 18 14:53:36 2013 (r259555) @@ -146,6 +146,10 @@ cpp_create_reader (enum c_lang lang, has pfile = XCNEW (cpp_reader); cpp_set_lang (pfile, lang); + /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */ + /* Suppress warnings about missing newlines at ends of files. */ + CPP_OPTION (pfile, warn_newline_at_eof) = 0; + /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */ CPP_OPTION (pfile, warn_multichar) = 1; CPP_OPTION (pfile, discard_comments) = 1; CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1; Modified: head/contrib/gcclibs/libcpp/lex.c ============================================================================== --- head/contrib/gcclibs/libcpp/lex.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/lex.c Wed Dec 18 14:53:36 2013 (r259555) @@ -854,6 +854,14 @@ _cpp_get_fresh_line (cpp_reader *pfile) { /* Clip to buffer size. */ buffer->next_line = buffer->rlimit; + /* APPLE LOCAL begin suppress no newline warning. */ + if ( CPP_OPTION (pfile, warn_newline_at_eof)) + { + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, + CPP_BUF_COLUMN (buffer, buffer->cur), + "no newline at end of file"); + } + /* APPLE LOCAL end suppress no newline warning. */ } return_at_eof = buffer->return_at_eof; From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 15:27:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B999D9F; Wed, 18 Dec 2013 15:27:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57A531760; Wed, 18 Dec 2013 15:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIFRncP049266; Wed, 18 Dec 2013 15:27:49 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIFRn7u049265; Wed, 18 Dec 2013 15:27:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312181527.rBIFRn7u049265@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 15:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259558 - head/contrib/gcc/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.17 Precedence: list List-Id: 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, 18 Dec 2013 15:27:49 -0000 Author: pfg Date: Wed Dec 18 15:27:48 2013 New Revision: 259558 URL: http://svnweb.freebsd.org/changeset/base/259558 Log: gcc: add Apple compatible -Wnewline-eof Fix document: "Apple compatible" suits better the origin. MFC after: 1 week Modified: head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Wed Dec 18 15:13:30 2013 (r259557) +++ head/contrib/gcc/doc/invoke.texi Wed Dec 18 15:27:48 2013 (r259558) @@ -2087,7 +2087,7 @@ Inhibit warning messages about the use o @c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts ** @item -Wnewline-eof @opindex Wnewline-eof -Warn about files missing a newline at the end of the file. (FreeBSD ONLY) +Warn about files missing a newline at the end of the file. (Apple compatible) @c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts ** @item -Wchar-subscripts From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 15:42:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 83B2F3FE; Wed, 18 Dec 2013 15:42:53 +0000 (UTC) Date: Wed, 18 Dec 2013 15:42:53 +0000 From: Alexey Dokuchaev To: "Pedro F. Giffuni" Subject: Re: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/include Message-ID: <20131218154253.GA18580@FreeBSD.org> References: <201312181453.rBIEranx037463@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181453.rBIEranx037463@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 15:42:53 -0000 On Wed, Dec 18, 2013 at 02:53:36PM +0000, Pedro F. Giffuni wrote: > New Revision: 259555 > URL: http://svnweb.freebsd.org/changeset/base/259555 > > Log: > gcc: add Apple compatible -Wnewline-eof > > GCC 4.2 and previous have always warned about > "No newline at end of file". > > Upstream GCC removed the warning completely but > Apple made it an optional warning. Adopt it for > compatibility with older GCC and clang. As someone who hates files that lack newline at EOF, I could never understand why they (upstream) removed this warning. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 17:03:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59611443; Wed, 18 Dec 2013 17:03:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B7D71FD9; Wed, 18 Dec 2013 17:03:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIH3i6Z085124; Wed, 18 Dec 2013 17:03:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIH3iEb085123; Wed, 18 Dec 2013 17:03:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312181703.rBIH3iEb085123@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 17:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259561 - head/lib/libstand 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.17 Precedence: list List-Id: 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, 18 Dec 2013 17:03:44 -0000 Author: marcel Date: Wed Dec 18 17:03:43 2013 New Revision: 259561 URL: http://svnweb.freebsd.org/changeset/base/259561 Log: Fix an inappropriate free of a non-dynamic value. While here, make the code more naive and robust: 1. When setting ev_value, also always set ev_flags appropriately 2. Always check ev_value and ev_flags before calling free. Both the value and the EV_DYNAMIC property can come directly from the consumers of the environment functionality, so it's good to be careful. And since this code is typically not looked at for long periods of time, it's good to have it be a little "dumb-looking". Trigger case for the bug: env_setenv("foo", 0, "1", NULL, NULL); env_setenv("foo", 0, "2", NULL, NULL); Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/environment.c Modified: head/lib/libstand/environment.c ============================================================================== --- head/lib/libstand/environment.c Wed Dec 18 16:14:35 2013 (r259560) +++ head/lib/libstand/environment.c Wed Dec 18 17:03:43 2013 (r259561) @@ -75,7 +75,14 @@ env_setenv(const char *name, int flags, * for one already. */ if ((ev->ev_sethook != NULL) && !(flags & EV_NOHOOK)) - return(ev->ev_sethook(ev, flags, value)); + return (ev->ev_sethook(ev, flags, value)); + + /* If there is data in the variable, discard it. */ + if (ev->ev_value != NULL && (ev->ev_flags & EV_DYNAMIC) != 0) + free(ev->ev_value); + ev->ev_value = NULL; + ev->ev_flags &= ~EV_DYNAMIC; + } else { /* @@ -84,6 +91,7 @@ env_setenv(const char *name, int flags, ev = malloc(sizeof(struct env_var)); ev->ev_name = strdup(name); ev->ev_value = NULL; + ev->ev_flags = 0; /* hooks can only be set when the variable is instantiated */ ev->ev_sethook = sethook; ev->ev_unsethook = unsethook; @@ -117,21 +125,16 @@ env_setenv(const char *name, int flags, } } } - - /* If there is data in the variable, discard it */ - if (ev->ev_value != NULL) - free(ev->ev_value); /* If we have a new value, use it */ if (flags & EV_VOLATILE) { ev->ev_value = strdup(value); + ev->ev_flags |= EV_DYNAMIC; } else { ev->ev_value = (char *)value; + ev->ev_flags |= flags & EV_DYNAMIC; } - /* Keep the flag components that are relevant */ - ev->ev_flags = flags & (EV_DYNAMIC); - return(0); } @@ -201,7 +204,7 @@ env_discard(struct env_var *ev) if (environ == ev) environ = ev->ev_next; free(ev->ev_name); - if (ev->ev_flags & EV_DYNAMIC) + if (ev->ev_value != NULL && (ev->ev_flags & EV_DYNAMIC) != 0) free(ev->ev_value); free(ev); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 18:25:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DABC07D5; Wed, 18 Dec 2013 18:25:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAAF516A8; Wed, 18 Dec 2013 18:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIIPRqd014516; Wed, 18 Dec 2013 18:25:27 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIIPR25014515; Wed, 18 Dec 2013 18:25:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312181825.rBIIPR25014515@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 18:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259562 - head/usr.bin/netstat 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.17 Precedence: list List-Id: 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, 18 Dec 2013 18:25:27 -0000 Author: melifaro Date: Wed Dec 18 18:25:27 2013 New Revision: 259562 URL: http://svnweb.freebsd.org/changeset/base/259562 Log: Switch netstat -rn to use standard API for retrieving list of routes instead of peeking inside in-kernel radix via kget. This permits us to change kernel structures without breaking userland. Additionally, this change provide more reliable and faster output. `Refs` and `Use` fields available in IPv4 by default (and via -W for other families) were removed. `Refs` is radix-specific thing which is not informative for users. `Use` field value is handy sometimes, but a) current API does not support it and b) I'm not sure we will support per-rte pcpu counters in near future. Old method of retrieving data is still supported (either by defining NewTree=0 or running netstat with -A). However, Refs/Use fields are hidden. Sponsored by: Yandex LLC MFC after: 4 weeks PR: kern/167204 Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Dec 18 17:03:43 2013 (r259561) +++ head/usr.bin/netstat/route.c Wed Dec 18 18:25:27 2013 (r259562) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -113,13 +114,20 @@ typedef union { static sa_u pt_u; +struct ifmap_entry { + char ifname[IFNAMSIZ]; +}; + +static struct ifmap_entry *ifmap; +static int ifmap_size; + int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; struct radix_node_head **rt_tables; -int NewTree = 0; +int NewTree = 1; struct timespec uptime; @@ -129,7 +137,7 @@ static void size_cols_tree(struct radix_ static void size_cols_rtentry(struct rtentry *rt); static void p_tree(struct radix_node *); static void p_rtnode(void); -static void ntreestuff(void); +static void ntreestuff(int fibnum, int af); static void np_rtentry(struct rt_msghdr *); static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, @@ -175,7 +183,7 @@ routepr(u_long rtree, int fibnum) printf("\n"); if (Aflag == 0 && NewTree) - ntreestuff(); + ntreestuff(fibnum, af); else { if (rtree == 0) { printf("rt_tables: symbol not in namelist\n"); @@ -288,7 +296,7 @@ static int wid_if; static int wid_expire; static void -size_cols(int ef __unused, struct radix_node *rn) +size_cols(int ef, struct radix_node *rn) { wid_dst = WID_DST_DEFAULT(ef); wid_gw = WID_GW_DEFAULT(ef); @@ -299,7 +307,7 @@ size_cols(int ef __unused, struct radix_ wid_if = WID_IF_DEFAULT(ef); wid_expire = 6; - if (Wflag) + if (Wflag && rn != NULL) size_cols_tree(rn); } @@ -397,27 +405,14 @@ pr_rthdr(int af1) if (Aflag) printf("%-8.8s ","Address"); - if (af1 == AF_INET || Wflag) { - if (Wflag) { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_mtu, wid_mtu, "Mtu", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } else { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } + if (Wflag) { + printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*s\n", + wid_dst, wid_dst, "Destination", + wid_gw, wid_gw, "Gateway", + wid_flags, wid_flags, "Flags", + wid_mtu, wid_mtu, "Mtu", + wid_if, wid_if, "Netif", + wid_expire, "Expire"); } else { printf("%-*.*s %-*.*s %-*.*s %*.*s %*s\n", wid_dst, wid_dst, "Destination", @@ -522,20 +517,61 @@ p_rtnode(void) } static void -ntreestuff(void) +ntreestuff(int fibnum, int af) { size_t needed; - int mib[6]; + int mib[7]; char *buf, *next, *lim; struct rt_msghdr *rtm; + struct sockaddr *sa; + int fam = 0, ifindex = 0, size; + + struct ifaddrs *ifap, *ifa; + struct sockaddr_dl *sdl; + + /* + * Retrieve interface list at first + * since we need #ifindex -> if_xname match + */ + if (getifaddrs(&ifap) != 0) + err(EX_OSERR, "getifaddrs"); + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + ifindex = sdl->sdl_index; + + if (ifindex >= ifmap_size) { + size = roundup(ifindex + 1, 32) * + sizeof(struct ifmap_entry); + if ((ifmap = realloc(ifmap, size)) == NULL) + errx(2, "realloc(%d) failed", size); + memset(&ifmap[ifmap_size], 0, + size - ifmap_size * + sizeof(struct ifmap_entry)); + + ifmap_size = roundup(ifindex + 1, 32); + } + + if (*ifmap[ifindex].ifname != '\0') + continue; + + strlcpy(ifmap[ifindex].ifname, ifa->ifa_name, IFNAMSIZ); + } + + freeifaddrs(ifap); mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; - mib[3] = 0; + mib[3] = af; mib[4] = NET_RT_DUMP; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { + mib[6] = fibnum; + if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { err(1, "sysctl: net.route.0.0.dump estimate"); } @@ -548,6 +584,16 @@ ntreestuff(void) lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; + /* + * Peek inside header to determine AF + */ + sa = (struct sockaddr *)(rtm + 1); + if (fam != sa->sa_family) { + fam = sa->sa_family; + size_cols(fam, NULL); + pr_family(fam); + pr_rthdr(fam); + } np_rtentry(rtm); } } @@ -556,38 +602,52 @@ static void np_rtentry(struct rt_msghdr *rtm) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); -#ifdef notdef - static int masks_done, banner_printed; -#endif - static int old_af; - int af1 = 0, interesting = RTF_UP | RTF_GATEWAY | RTF_HOST; + char buffer[128]; + char prettyname[128]; + sa_u addr, mask, gw; + unsigned int l; + +#define GETSA(_s, _f) { \ + bzero(&(_s), sizeof(_s)); \ + if (rtm->rtm_addrs & _f) { \ + l = roundup(sa->sa_len, sizeof(long)); \ + memcpy(&(_s), sa, (l > sizeof(_s)) ? sizeof(_s) : l); \ + sa = (struct sockaddr *)((char *)sa + l); \ + } \ +} + + GETSA(addr, RTA_DST); + GETSA(gw, RTA_GATEWAY); + GETSA(mask, RTA_NETMASK); + p_sockaddr(&addr.u_sa, &mask.u_sa, rtm->rtm_flags, wid_dst); + p_sockaddr(&gw.u_sa, NULL, RTF_HOST, wid_gw); -#ifdef notdef - /* for the moment, netmasks are skipped over */ - if (!banner_printed) { - printf("Netmasks:\n"); - banner_printed = 1; - } - if (masks_done == 0) { - if (rtm->rtm_addrs != RTA_DST ) { - masks_done = 1; - af1 = sa->sa_family; - } - } else -#endif - af1 = sa->sa_family; - if (af1 != old_af) { - pr_family(af1); - old_af = af1; + snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); + p_flags(rtm->rtm_flags, buffer); + if (Wflag) { + if (rtm->rtm_rmx.rmx_mtu != 0) + printf("%*lu ", wid_mtu, rtm->rtm_rmx.rmx_mtu); + else + printf("%*s ", wid_mtu, ""); } - if (rtm->rtm_addrs == RTA_DST) - p_sockaddr(sa, NULL, 0, 36); - else { - p_sockaddr(sa, NULL, rtm->rtm_flags, 16); - sa = (struct sockaddr *)(SA_SIZE(sa) + (char *)sa); - p_sockaddr(sa, NULL, 0, 18); + + memset(prettyname, 0, sizeof(prettyname)); + if (rtm->rtm_index < ifmap_size) { + strlcpy(prettyname, ifmap[rtm->rtm_index].ifname, + sizeof(prettyname)); + if (*prettyname == '\0') + strlcpy(prettyname, "---", sizeof(prettyname)); } - p_flags(rtm->rtm_flags & interesting, "%-6.6s "); + + printf("%*.*s", wid_if, wid_if, prettyname); + if (rtm->rtm_rmx.rmx_expire) { + time_t expire_time; + + if ((expire_time = + rtm->rtm_rmx.rmx_expire - uptime.tv_sec) > 0) + printf(" %*d", wid_expire, (int)expire_time); + } + putchar('\n'); } @@ -775,8 +835,10 @@ p_rtentry(struct rtentry *rt) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); if (addr.u_sa.sa_family == AF_INET || Wflag) { +#if 0 printf("%*d %*lu ", wid_refs, rt->rt_refcnt, wid_use, rt->rt_use); +#endif if (Wflag) { if (rt->rt_rmx.rmx_mtu != 0) printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu); From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 18:45:14 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83B85D10; Wed, 18 Dec 2013 18:45:14 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42ABC181B; Wed, 18 Dec 2013 18:45:13 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBIIjCYO024231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Dec 2013 10:45:13 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBIIjCST024230; Wed, 18 Dec 2013 10:45:12 -0800 (PST) (envelope-from jmg) Date: Wed, 18 Dec 2013 10:45:12 -0800 From: John-Mark Gurney To: "Alexander V. Chernikov" Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131218184512.GM99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181825.rBIIPR25014515@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 18 Dec 2013 10:45:13 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 18:45:14 -0000 Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > Author: melifaro > Date: Wed Dec 18 18:25:27 2013 > New Revision: 259562 > URL: http://svnweb.freebsd.org/changeset/base/259562 > > Log: > Switch netstat -rn to use standard API for retrieving list of routes > instead of peeking inside in-kernel radix via kget. > This permits us to change kernel structures without breaking userland. > Additionally, this change provide more reliable and faster output. > > `Refs` and `Use` fields available in IPv4 by default (and via -W > for other families) were removed. `Refs` is radix-specific thing > which is not informative for users. `Use` field value is handy sometimes, > but a) current API does not support it and b) I'm not sure we will > support per-rte pcpu counters in near future. > > Old method of retrieving data is still supported (either by defining > NewTree=0 or running netstat with -A). However, Refs/Use fields are > hidden. > > Sponsored by: Yandex LLC > MFC after: 4 weeks > PR: kern/167204 How will this impact the use of netstat -rn -M vmcore -N kernel ? Will this change make it not usable, or will you still automatically use it when they are specified? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 18:56:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1E3B409 for ; Wed, 18 Dec 2013 18:56:50 +0000 (UTC) Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com [98.139.212.165]) by mx1.freebsd.org (Postfix) with SMTP id 90ED818DD for ; Wed, 18 Dec 2013 18:56:50 +0000 (UTC) Received: from [98.139.212.151] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:11 -0000 Received: from [98.139.211.203] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:10 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:10 -0000 X-Yahoo-Newman-Id: 964958.65046.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Im98BsAVM1l4k1Fv4aZZcI7Uyu1V3v0mgRzHi58CxzGEZtC 9PTOiy6g3U4_4NdiFFxIIP1di88VHpjtQFEIrWBn5ncnCvYgT28Pcp4XSUJV TcBtSzp9IABJw16I6SAkKglcJ5KJKCeb_hY6BIhRwMUEm4X1qVrBD1dgJS1a nAVc92WmSq_tZ_32gOIyMMJKHs4rNGCKpmy2cWznFyJMYRvCME1BJXho2zMq AV91JCKzyEURKoL_TN.SycCWV.DweTJvu9a_.FM02mDY6bLLQ6yoLUMSinn8 PJ98ps.rx.EDmKYXHriZbHcdOHpgKnB5YDwlo48g8e3zwgAwIGKQgjViqYkP Rq5EkfISMTcM7eInQVLuTT33Si6PrpeRs10ijQRyAqrFoL5zvq2aRgoxMkO3 wWbuxNm8uDje15DBWJs2dk8TFUs4AqG0LKuF29zuapEQZEthzSDJ32L9HtRe lqlqH2lMyr9VvSevFDvk2CdxRLLC6W9NOxhhVTLCcbPiaB3mOGKGRSDXzSpm MRex4zgFRtiAWkd1jD4E3bzC0kgGVoC8JENyyhRREBa8aPwMcWKJnHtkF6ni c5_IhMnmkMiM0aCJGQ6tBhgYeCudGITuFT7MXOPkRNo1hdyhKnQEmyjE50_n nwmL1_wPlnMTAt8DKO14Yqs.Mdlz0mKQe8BLNHlz6JRPLpF8szxRZDojrwIp H4ZO3ZPoXvgE2T00iSmFkS4F.r6hV9_QZ90D2gpdnItjg X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp212.mail.bf1.yahoo.com with SMTP; 18 Dec 2013 10:51:05 -0800 PST Message-ID: <52B1EE95.3030104@FreeBSD.org> Date: Wed, 18 Dec 2013 13:51:01 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/include References: <201312181453.rBIEranx037463@svn.freebsd.org> <20131218154253.GA18580@FreeBSD.org> In-Reply-To: <20131218154253.GA18580@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 18:56:51 -0000 On 18.12.2013 10:42, Alexey Dokuchaev wrote: > On Wed, Dec 18, 2013 at 02:53:36PM +0000, Pedro F. Giffuni wrote: >> New Revision: 259555 >> URL: http://svnweb.freebsd.org/changeset/base/259555 >> >> Log: >> gcc: add Apple compatible -Wnewline-eof >> >> GCC 4.2 and previous have always warned about >> "No newline at end of file". >> >> Upstream GCC removed the warning completely but >> Apple made it an optional warning. Adopt it for >> compatibility with older GCC and clang. > As someone who hates files that lack newline at EOF, I could never understand > why they (upstream) removed this warning. > > ./danfe The main discussion took place here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14331 FWIW, I like the warning too. Cheers, Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 19:23:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDCB6E2F; Wed, 18 Dec 2013 19:23:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F57F1B3B; Wed, 18 Dec 2013 19:23:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIJN6QW036156; Wed, 18 Dec 2013 19:23:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIJN5v0036152; Wed, 18 Dec 2013 19:23:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312181923.rBIJN5v0036152@svn.freebsd.org> From: Xin LI Date: Wed, 18 Dec 2013 19:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259564 - in head: share/man/man4 sys/dev/arcmsr 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.17 Precedence: list List-Id: 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, 18 Dec 2013 19:23:06 -0000 Author: delphij Date: Wed Dec 18 19:23:05 2013 New Revision: 259564 URL: http://svnweb.freebsd.org/changeset/base/259564 Log: Commit 1/2: update arcmsr(4) to 1.20.00.29 in order to add support of ARC-1883 SAS 12Gb/s RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Wed Dec 18 19:07:29 2013 (r259563) +++ head/share/man/man4/arcmsr.4 Wed Dec 18 19:23:05 2013 (r259564) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2013 +.Dd December 18, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -143,6 +143,8 @@ ARC-1681 ARC-1880 .It ARC-1882 +.It +ARC-1883 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:07:29 2013 (r259563) +++ head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:23:05 2013 (r259564) @@ -75,6 +75,7 @@ ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs +** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ****************************************************************************************** */ @@ -146,7 +147,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.29 2013-12-18" #include /* ************************************************************************** @@ -1438,7 +1439,7 @@ static u_int32_t arcmsr_Read_iop_rqbuffe u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1533,7 +1534,7 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *iop_data; int32_t allxfer_len=0; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1785,7 +1786,7 @@ static void arcmsr_hbd_message_isr(struc */ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1794,14 +1795,12 @@ static void arcmsr_hba_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_doorbell); - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_doorbell, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } } @@ -1811,7 +1810,7 @@ static void arcmsr_hba_doorbell_isr(stru */ static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1820,15 +1819,15 @@ static void arcmsr_hbc_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell); - CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } } @@ -1838,7 +1837,7 @@ static void arcmsr_hbc_doorbell_isr(stru */ static void arcmsr_hbd_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_Doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1847,22 +1846,22 @@ static void arcmsr_hbd_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_Doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; - if(outbound_Doorbell) - CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_Doorbell); /* clear doorbell interrupt */ - while( outbound_Doorbell & ARCMSR_HBDMU_F0_DOORBELL_CAUSE ) { - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; + if(doorbell_status) + CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + while( doorbell_status & ARCMSR_HBDMU_F0_DOORBELL_CAUSE ) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbd_message_isr(acb); /* messenger of "driver to iop commands" */ } - outbound_Doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; - if(outbound_Doorbell) - CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_Doorbell); /* clear doorbell interrupt */ + doorbell_status = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; + if(doorbell_status) + CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ } } /* @@ -1932,9 +1931,7 @@ static void arcmsr_hbc_postqueue_isr(str ***************************************************************************** */ bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); - - while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { - + do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; @@ -1944,7 +1941,7 @@ static void arcmsr_hbc_postqueue_isr(str CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; } - } /*drain reply FIFO*/ + } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); } /* ********************************************************************** @@ -2082,11 +2079,14 @@ static void arcmsr_handle_hbc_isr( struc ** check outbound intstatus ********************************************* */ - host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); + host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & + (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR); if(!host_interrupt_status) { /*it must be share irq*/ return; } + do { /* MU doorbell interrupts*/ if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { arcmsr_hbc_doorbell_isr(acb); @@ -2095,6 +2095,8 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } + host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); } /* ********************************************************************** @@ -2882,7 +2884,9 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + if(acb->adapter_bus_speed == ACB_BUS_SPEED_12G) + cpi->base_transfer_speed = 1200000; + else if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) cpi->base_transfer_speed = 600000; else cpi->base_transfer_speed = 300000; @@ -2980,7 +2984,9 @@ static void arcmsr_action(struct cam_sim cts->transport = XPORT_SAS; sas = &cts->xport_specific.sas; sas->valid = CTS_SAS_VALID_SPEED; - if((acb->vendor_device_id == PCIDevVenIDARC1880) || + if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + sas->bitrate = 1200000; + else if((acb->vendor_device_id == PCIDevVenIDARC1880) || (acb->vendor_device_id == PCIDevVenIDARC1214)) sas->bitrate = 600000; else if(acb->vendor_device_id == PCIDevVenIDARC1680) @@ -3948,12 +3954,16 @@ static u_int32_t arcmsr_initialize(devic vendor_dev_id = pci_get_devid(dev); acb->vendor_device_id = vendor_dev_id; + acb->sub_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); switch (vendor_dev_id) { case PCIDevVenIDARC1880: case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: { acb->adapter_type = ACB_ADAPTER_TYPE_C; + if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + acb->adapter_bus_speed = ACB_BUS_SPEED_12G; + else acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } @@ -4286,7 +4296,7 @@ static int arcmsr_attach(device_t dev) * Create device queue of SIM(s) * (MAX_START_JOB - 1) : * max_sim_transactions */ - devq = cam_simq_alloc(ARCMSR_MAX_START_JOB); + devq = cam_simq_alloc(acb->maxOutstanding); if(devq == NULL) { arcmsr_free_resource(acb); bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres); @@ -4360,6 +4370,7 @@ static int arcmsr_attach(device_t dev) static int arcmsr_probe(device_t dev) { u_int32_t id; + u_int16_t sub_device_id; static char buf[256]; char x_type[]={"unknown"}; char *type; @@ -4368,6 +4379,7 @@ static int arcmsr_probe(device_t dev) if (pci_get_vendor(dev) != PCI_VENDOR_ID_ARECA) { return (ENXIO); } + sub_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); switch(id = pci_get_devid(dev)) { case PCIDevVenIDARC1110: case PCIDevVenIDARC1200: @@ -4400,6 +4412,9 @@ static int arcmsr_probe(device_t dev) case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: + if (sub_device_id == ARECA_SUB_DEV_ID_1883) + type = "SAS 12G"; + else type = "SAS 6G"; break; case PCIDevVenIDARC1214: Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:07:29 2013 (r259563) +++ head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:23:05 2013 (r259564) @@ -118,6 +118,7 @@ #define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1883 0x1883 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ @@ -1136,16 +1137,16 @@ struct AdapterControlBlock { u_int32_t phyadd_low; u_int32_t phyadd_high; }B; - } srb_phyaddr; + }srb_phyaddr; // unsigned long srb_phyaddr; /* Offset is used in making arc cdb physical to virtual calculations */ u_int32_t outbound_int_enable; struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ - u_int8_t adapter_index; /* */ + u_int8_t adapter_index; u_int8_t irq; - u_int16_t acb_flags; /* */ + u_int16_t acb_flags; struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ @@ -1183,6 +1184,7 @@ struct AdapterControlBlock { u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; u_int32_t maxOutstanding; + u_int16_t sub_device_id; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 19:25:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 158A6FB5; Wed, 18 Dec 2013 19:25:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 012D81B6A; Wed, 18 Dec 2013 19:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIJPerI036471; Wed, 18 Dec 2013 19:25:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIJPeN3036469; Wed, 18 Dec 2013 19:25:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312181925.rBIJPeN3036469@svn.freebsd.org> From: Xin LI Date: Wed, 18 Dec 2013 19:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259565 - head/sys/dev/arcmsr 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.17 Precedence: list List-Id: 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, 18 Dec 2013 19:25:41 -0000 Author: delphij Date: Wed Dec 18 19:25:40 2013 New Revision: 259565 URL: http://svnweb.freebsd.org/changeset/base/259565 Log: Commit 2/2: vendor whitespace changes to the driver. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:23:05 2013 (r259564) +++ head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:25:40 2013 (r259565) @@ -1934,13 +1934,13 @@ static void arcmsr_hbc_postqueue_isr(str do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); - throttling++; - if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + throttling++; + if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; - } + } } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); } /* @@ -2087,14 +2087,14 @@ static void arcmsr_handle_hbc_isr( struc return; } do { - /* MU doorbell interrupts*/ - if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { - arcmsr_hbc_doorbell_isr(acb); - } - /* MU post queue interrupts*/ - if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { - arcmsr_hbc_postqueue_isr(acb); - } + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbc_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbc_postqueue_isr(acb); + } host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); } @@ -3964,7 +3964,7 @@ static u_int32_t arcmsr_initialize(devic if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) acb->adapter_bus_speed = ACB_BUS_SPEED_12G; else - acb->adapter_bus_speed = ACB_BUS_SPEED_6G; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } break; @@ -4415,7 +4415,7 @@ static int arcmsr_probe(device_t dev) if (sub_device_id == ARECA_SUB_DEV_ID_1883) type = "SAS 12G"; else - type = "SAS 6G"; + type = "SAS 6G"; break; case PCIDevVenIDARC1214: type = "SATA 6G"; Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:23:05 2013 (r259564) +++ head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:25:40 2013 (r259565) @@ -34,23 +34,23 @@ ************************************************************************** * $FreeBSD$ */ -#define ARCMSR_SCSI_INITIATOR_ID 255 -#define ARCMSR_DEV_SECTOR_SIZE 512 -#define ARCMSR_MAX_XFER_SECTORS 4096 -#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ -#define ARCMSR_MAX_TARGETLUN 8 /*8*/ -#define ARCMSR_MAX_CHIPTYPE_NUM 4 -#define ARCMSR_MAX_OUTSTANDING_CMD 256 -#define ARCMSR_MAX_START_JOB 256 -#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 384 -#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ -#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ -#define ARCMSR_MAX_ADAPTER 4 -#define ARCMSR_RELEASE_SIMQ_LEVEL 230 -#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ -#define ARCMSR_MAX_HBD_POSTQUEUE 256 -#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ +#define ARCMSR_SCSI_INITIATOR_ID 255 +#define ARCMSR_DEV_SECTOR_SIZE 512 +#define ARCMSR_MAX_XFER_SECTORS 4096 +#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ +#define ARCMSR_MAX_TARGETLUN 8 /*8*/ +#define ARCMSR_MAX_CHIPTYPE_NUM 4 +#define ARCMSR_MAX_OUTSTANDING_CMD 256 +#define ARCMSR_MAX_START_JOB 256 +#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD +#define ARCMSR_MAX_FREESRB_NUM 384 +#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ +#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ +#define ARCMSR_MAX_ADAPTER 4 +#define ARCMSR_RELEASE_SIMQ_LEVEL 230 +#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_MAX_HBD_POSTQUEUE 256 +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -75,7 +75,7 @@ #define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l) #define ARCMSR_LOCK_TRY(l) mtx_trylock(l) #define arcmsr_htole32(x) htole32(x) - typedef struct mtx arcmsr_lock_t; + typedef struct mtx arcmsr_lock_t; #else #define ARCMSR_LOCK_INIT(l, s) simple_lock_init(l) #define ARCMSR_LOCK_DESTROY(l) @@ -91,7 +91,7 @@ ** ********************************************************************************** */ -#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ +#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ #define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ @@ -133,11 +133,11 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -149,7 +149,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -176,17 +176,17 @@ ** ********************************************************************************** */ -#define arcmsr_ccbsrb_ptr spriv_ptr0 -#define arcmsr_ccbacb_ptr spriv_ptr1 -#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) -#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) -#define get_min(x,y) ((x) < (y) ? (x) : (y)) -#define get_max(x,y) ((x) < (y) ? (y) : (x)) +#define arcmsr_ccbsrb_ptr spriv_ptr0 +#define arcmsr_ccbacb_ptr spriv_ptr1 +#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) +#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) +#define get_min(x,y) ((x) < (y) ? (x) : (y)) +#define get_max(x,y) ((x) < (y) ? (y) : (x)) /* ************************************************************************** ************************************************************************** */ -#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) +#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) #define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d) /* ********************************************************************************** @@ -210,17 +210,17 @@ struct CMD_MESSAGE_FIELD { /************************************************************************/ /************************************************************************/ -#define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001 -#define ARCMSR_IOP_ERROR_VENDORID 0x0002 -#define ARCMSR_IOP_ERROR_DEVICEID 0x0002 -#define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003 -#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004 -#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005 -#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006 -#define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007 -#define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008 -#define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009 -#define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A +#define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001 +#define ARCMSR_IOP_ERROR_VENDORID 0x0002 +#define ARCMSR_IOP_ERROR_DEVICEID 0x0002 +#define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003 +#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004 +#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005 +#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006 +#define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007 +#define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008 +#define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009 +#define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A /*DeviceType*/ #define ARECA_SATA_RAID 0x90000000 @@ -252,44 +252,44 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD) /* ARECA IOCTL ReturnCode */ -#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 -#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 -#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F -#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 +#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 +#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 +#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F +#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 /* ************************************************************************ ** SPEC. for Areca HBA adapter ************************************************************************ */ /* signature of set and get firmware config */ -#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 -#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 +#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 +#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 /* message code of inbound message register */ -#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 -#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 -#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 -#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 -#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 -#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 -#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 -#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 -#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 +#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 +#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 +#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 +#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 +#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 +#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 +#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 +#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 +#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 /* doorbell interrupt generator */ -#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 -#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 -#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 -#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 +#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 +#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 +#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 +#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 /* srb areca cdb flag */ -#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 -#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 +#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 +#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 /* outbound firmware ok */ -#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 +#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 -#define ARCMSR_ARC1680_BUS_RESET 0x00000003 +#define ARCMSR_ARC1680_BUS_RESET 0x00000003 /* ************************************************************************ ** SPEC. for Areca HBB adapter @@ -307,20 +307,20 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_IOP2DRV_CDB_DONE 0x00000004 #define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE 0x00000008 -#define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F +#define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F #define ARCMSR_DOORBELL_INT_CLEAR_PATTERN 0xFF00FFF0 #define ARCMSR_MESSAGE_INT_CLEAR_PATTERN 0xFF00FFF7 -#define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ #define ARCMSR_MESSAGE_FLUSH_CACHE 0x00050008 /* (ARCMSR_INBOUND_MESG0_FLUSH_CACHE<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008 -#define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008 -#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008 -#define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */ +#define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008 +#define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008 +#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008 +#define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */ #define ARCMSR_DRV2IOP_DATA_WRITE_OK 0x00000001 /* ioctl transfer */ #define ARCMSR_DRV2IOP_DATA_READ_OK 0x00000002 /* ioctl transfer */ @@ -329,13 +329,13 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_DRV2IOP_END_OF_INTERRUPT 0x00000010 /* */ /* data tunnel buffer between user space program and its firmware */ -#define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */ -#define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */ -#define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */ -#define ARCMSR_HBB_BASE0_OFFSET 0x00000010 -#define ARCMSR_HBB_BASE1_OFFSET 0x00000018 -#define ARCMSR_HBB_BASE0_LEN 0x00021000 -#define ARCMSR_HBB_BASE1_LEN 0x00010000 +#define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */ +#define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */ +#define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */ +#define ARCMSR_HBB_BASE0_OFFSET 0x00000010 +#define ARCMSR_HBB_BASE1_OFFSET 0x00000018 +#define ARCMSR_HBB_BASE0_LEN 0x00021000 +#define ARCMSR_HBB_BASE1_LEN 0x00010000 /* ************************************************************************ ** SPEC. for Areca HBC adapter @@ -383,64 +383,64 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR 0x00000004/*outbound DATA READ isr door bell clear*/ #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008/*outbound message 0 ready*/ #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR 0x00000008/*outbound message cmd isr door bell clear*/ -#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/ +#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/ #define ARCMSR_HBCMU_RESET_ADAPTER 0x00000024 -#define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080 +#define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080 /* ************************************************************************ ** SPEC. for Areca HBD adapter ************************************************************************ */ -#define ARCMSR_HBDMU_CHIP_ID 0x00004 +#define ARCMSR_HBDMU_CHIP_ID 0x00004 #define ARCMSR_HBDMU_CPU_MEMORY_CONFIGURATION 0x00008 -#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034 -#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200 +#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034 +#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200 #define ARCMSR_HBDMU_PCIE_F0_INTERRUPT_ENABLE 0x0020C -#define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400 -#define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404 -#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420 -#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424 -#define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460 -#define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480 +#define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400 +#define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404 +#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420 +#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424 +#define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460 +#define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480 #define ARCMSR_HBDMU_OUTBOUND_DOORBELL_ENABLE 0x00484 -#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000 -#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004 +#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000 +#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004 #define ARCMSR_HBDMU_INBOUND_LIST_WRITE_POINTER 0x01018 -#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060 +#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060 #define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_HIGH 0x01064 #define ARCMSR_HBDMU_OUTBOUND_LIST_COPY_POINTER 0x0106C #define ARCMSR_HBDMU_OUTBOUND_LIST_READ_POINTER 0x01070 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_CAUSE 0x01088 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_ENABLE 0x0108C -#define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000 -#define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100 -#define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200 +#define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000 +#define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100 +#define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200 -#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16 -#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20 +#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16 +#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20 /* Host Interrupt Mask */ -#define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */ -#define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */ +#define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */ +#define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */ /* Host Interrupt Status */ -#define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010 -#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000 -#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010 +#define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010 +#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000 +#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010 /* DoorBell*/ -#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001 -#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002 +#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001 +#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002 -#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001 -#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002 +#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001 +#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002 /*outbound message 0 ready*/ #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE 0x02000000 -#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003 +#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003 /*outbound message cmd isr door bell clear*/ #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR 0x02000000 @@ -450,7 +450,7 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001 /*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/ -#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 +#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 /* ********************************************************************* ** Message Unit structure @@ -458,28 +458,28 @@ struct CMD_MESSAGE_FIELD { */ struct HBA_MessageUnit { - u_int32_t resrved0[4]; /*0000 000F*/ - u_int32_t inbound_msgaddr0; /*0010 0013*/ - u_int32_t inbound_msgaddr1; /*0014 0017*/ - u_int32_t outbound_msgaddr0; /*0018 001B*/ - u_int32_t outbound_msgaddr1; /*001C 001F*/ - u_int32_t inbound_doorbell; /*0020 0023*/ - u_int32_t inbound_intstatus; /*0024 0027*/ - u_int32_t inbound_intmask; /*0028 002B*/ - u_int32_t outbound_doorbell; /*002C 002F*/ - u_int32_t outbound_intstatus; /*0030 0033*/ - u_int32_t outbound_intmask; /*0034 0037*/ - u_int32_t reserved1[2]; /*0038 003F*/ - u_int32_t inbound_queueport; /*0040 0043*/ - u_int32_t outbound_queueport; /*0044 0047*/ - u_int32_t reserved2[2]; /*0048 004F*/ - u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/ - u_int32_t reserved4[128]; /*0800 09FF 128*/ - u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/ - u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/ - u_int32_t reserved5[32]; /*0E80 0EFF 32*/ - u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/ - u_int32_t reserved6[32]; /*0F80 0FFF 32*/ + u_int32_t resrved0[4]; /*0000 000F*/ + u_int32_t inbound_msgaddr0; /*0010 0013*/ + u_int32_t inbound_msgaddr1; /*0014 0017*/ + u_int32_t outbound_msgaddr0; /*0018 001B*/ + u_int32_t outbound_msgaddr1; /*001C 001F*/ + u_int32_t inbound_doorbell; /*0020 0023*/ + u_int32_t inbound_intstatus; /*0024 0027*/ + u_int32_t inbound_intmask; /*0028 002B*/ + u_int32_t outbound_doorbell; /*002C 002F*/ + u_int32_t outbound_intstatus; /*0030 0033*/ + u_int32_t outbound_intmask; /*0034 0037*/ + u_int32_t reserved1[2]; /*0038 003F*/ + u_int32_t inbound_queueport; /*0040 0043*/ + u_int32_t outbound_queueport; /*0044 0047*/ + u_int32_t reserved2[2]; /*0048 004F*/ + u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/ + u_int32_t reserved4[128]; /*0800 09FF 128*/ + u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/ + u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/ + u_int32_t reserved5[32]; /*0E80 0EFF 32*/ + u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/ + u_int32_t reserved6[32]; /*0F80 0FFF 32*/ }; /* ********************************************************************* @@ -488,11 +488,11 @@ struct HBA_MessageUnit */ struct HBB_DOORBELL { - u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */ - u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */ - u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */ - u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */ - u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */ + u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */ + u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */ + u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */ + u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */ + u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */ }; /* ********************************************************************* @@ -501,11 +501,11 @@ struct HBB_DOORBELL */ struct HBB_RWBUFFER { - u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */ - u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */ - u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */ - u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/ - u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */ + u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */ + u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */ + u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */ + u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/ + u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */ }; /* ********************************************************************* @@ -514,10 +514,10 @@ struct HBB_RWBUFFER */ struct HBB_MessageUnit { - u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */ - u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */ - int32_t postq_index; /* post queue index */ - int32_t doneq_index; /* done queue index */ + u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */ + u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */ + int32_t postq_index; /* post queue index */ + int32_t doneq_index; /* done queue index */ struct HBB_DOORBELL *hbb_doorbell; struct HBB_RWBUFFER *hbb_rwbuffer; }; @@ -531,71 +531,71 @@ struct HBC_MessageUnit { u_int32_t message_unit_status; /*0000 0003*/ u_int32_t slave_error_attribute; /*0004 0007*/ u_int32_t slave_error_address; /*0008 000B*/ - u_int32_t posted_outbound_doorbell; /*000C 000F*/ + u_int32_t posted_outbound_doorbell; /*000C 000F*/ u_int32_t master_error_attribute; /*0010 0013*/ - u_int32_t master_error_address_low; /*0014 0017*/ - u_int32_t master_error_address_high; /*0018 001B*/ + u_int32_t master_error_address_low; /*0014 0017*/ + u_int32_t master_error_address_high; /*0018 001B*/ u_int32_t hcb_size; /*001C 001F size of the PCIe window used for HCB_Mode accesses*/ - u_int32_t inbound_doorbell; /*0020 0023*/ - u_int32_t diagnostic_rw_data; /*0024 0027*/ - u_int32_t diagnostic_rw_address_low; /*0028 002B*/ - u_int32_t diagnostic_rw_address_high; /*002C 002F*/ - u_int32_t host_int_status; /*0030 0033 host interrupt status*/ - u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ - u_int32_t dcr_data; /*0038 003B*/ - u_int32_t dcr_address; /*003C 003F*/ - u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ - u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ - u_int32_t hcb_pci_address_low; /*0048 004B*/ - u_int32_t hcb_pci_address_high; /*004C 004F*/ - u_int32_t iop_int_status; /*0050 0053*/ - u_int32_t iop_int_mask; /*0054 0057*/ - u_int32_t iop_inbound_queue_port; /*0058 005B*/ - u_int32_t iop_outbound_queue_port; /*005C 005F*/ - u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/ - u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/ - u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/ - u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/ - u_int32_t inbound_doorbell_clear; /*0070 0073*/ - u_int32_t i2o_message_unit_control; /*0074 0077*/ - u_int32_t last_used_message_source_address_low; /*0078 007B*/ - u_int32_t last_used_message_source_address_high; /*007C 007F*/ - u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/ - u_int32_t message_dest_address_index; /*0090 0093*/ - u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ - u_int32_t utility_A_int_counter_timer; /*0098 009B*/ - u_int32_t outbound_doorbell; /*009C 009F*/ - u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ - u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/ - u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/ - u_int32_t reserved0; /*00AC 00AF*/ - u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ - u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ - u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ - u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ - u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ - u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ - u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ - u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ - u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ - u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ - u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ - u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ - u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/ - u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/ - u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/ - u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/ - u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/ - u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/ - u_int32_t host_diagnostic; /*00F8 00FB*/ - u_int32_t write_sequence; /*00FC 00FF*/ - u_int32_t reserved1[34]; /*0100 0187*/ - u_int32_t reserved2[1950]; /*0188 1FFF*/ - u_int32_t message_wbuffer[32]; /*2000 207F*/ - u_int32_t reserved3[32]; /*2080 20FF*/ - u_int32_t message_rbuffer[32]; /*2100 217F*/ - u_int32_t reserved4[32]; /*2180 21FF*/ - u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ + u_int32_t inbound_doorbell; /*0020 0023*/ + u_int32_t diagnostic_rw_data; /*0024 0027*/ + u_int32_t diagnostic_rw_address_low; /*0028 002B*/ + u_int32_t diagnostic_rw_address_high; /*002C 002F*/ + u_int32_t host_int_status; /*0030 0033 host interrupt status*/ + u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ + u_int32_t dcr_data; /*0038 003B*/ + u_int32_t dcr_address; /*003C 003F*/ + u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ + u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ + u_int32_t hcb_pci_address_low; /*0048 004B*/ + u_int32_t hcb_pci_address_high; /*004C 004F*/ + u_int32_t iop_int_status; /*0050 0053*/ + u_int32_t iop_int_mask; /*0054 0057*/ + u_int32_t iop_inbound_queue_port; /*0058 005B*/ + u_int32_t iop_outbound_queue_port; /*005C 005F*/ + u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/ + u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/ + u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/ + u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/ + u_int32_t inbound_doorbell_clear; /*0070 0073*/ + u_int32_t i2o_message_unit_control; /*0074 0077*/ + u_int32_t last_used_message_source_address_low; /*0078 007B*/ + u_int32_t last_used_message_source_address_high; /*007C 007F*/ + u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/ + u_int32_t message_dest_address_index; /*0090 0093*/ + u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ + u_int32_t utility_A_int_counter_timer; /*0098 009B*/ + u_int32_t outbound_doorbell; /*009C 009F*/ + u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ + u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/ + u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/ + u_int32_t reserved0; /*00AC 00AF*/ + u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ + u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ + u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ + u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ + u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ + u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ + u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ + u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ + u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ + u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ + u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ + u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ + u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/ + u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/ + u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/ + u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/ + u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/ + u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/ + u_int32_t host_diagnostic; /*00F8 00FB*/ + u_int32_t write_sequence; /*00FC 00FF*/ + u_int32_t reserved1[34]; /*0100 0187*/ + u_int32_t reserved2[1950]; /*0188 1FFF*/ + u_int32_t message_wbuffer[32]; /*2000 207F*/ + u_int32_t reserved3[32]; /*2080 20FF*/ + u_int32_t message_rbuffer[32]; /*2100 217F*/ + u_int32_t reserved4[32]; /*2180 21FF*/ + u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ }; /* ********************************************************************* @@ -617,46 +617,46 @@ struct OutBound_SRB { struct HBD_MessageUnit { uint32_t reserved0; uint32_t chip_id; //0x0004 - uint32_t cpu_mem_config; //0x0008 - uint32_t reserved1[10]; //0x000C + uint32_t cpu_mem_config; //0x0008 + uint32_t reserved1[10]; //0x000C uint32_t i2o_host_interrupt_mask; //0x0034 - uint32_t reserved2[114]; //0x0038 - uint32_t host_int_status; //0x0200 - uint32_t host_int_enable; //0x0204 - uint32_t reserved3[1]; //0x0208 - uint32_t pcief0_int_enable; //0x020C - uint32_t reserved4[124]; //0x0210 - uint32_t inbound_msgaddr0; //0x0400 - uint32_t inbound_msgaddr1; //0x0404 - uint32_t reserved5[6]; //0x0408 - uint32_t outbound_msgaddr0; //0x0420 - uint32_t outbound_msgaddr1; //0x0424 - uint32_t reserved6[14]; //0x0428 - uint32_t inbound_doorbell; //0x0460 - uint32_t reserved7[7]; //0x0464 - uint32_t outbound_doorbell; //0x0480 + uint32_t reserved2[114]; //0x0038 + uint32_t host_int_status; //0x0200 + uint32_t host_int_enable; //0x0204 + uint32_t reserved3[1]; //0x0208 + uint32_t pcief0_int_enable; //0x020C + uint32_t reserved4[124]; //0x0210 + uint32_t inbound_msgaddr0; //0x0400 + uint32_t inbound_msgaddr1; //0x0404 + uint32_t reserved5[6]; //0x0408 + uint32_t outbound_msgaddr0; //0x0420 + uint32_t outbound_msgaddr1; //0x0424 + uint32_t reserved6[14]; //0x0428 + uint32_t inbound_doorbell; //0x0460 + uint32_t reserved7[7]; //0x0464 + uint32_t outbound_doorbell; //0x0480 uint32_t outbound_doorbell_enable; //0x0484 uint32_t reserved8[734]; //0x0488 - uint32_t inboundlist_base_low; //0x1000 - uint32_t inboundlist_base_high; //0x1004 - uint32_t reserved9[4]; //0x1008 + uint32_t inboundlist_base_low; //0x1000 + uint32_t inboundlist_base_high; //0x1004 + uint32_t reserved9[4]; //0x1008 uint32_t inboundlist_write_pointer; //0x1018 uint32_t inboundlist_read_pointer; //0x101C uint32_t reserved10[16]; //0x1020 - uint32_t outboundlist_base_low; //0x1060 + uint32_t outboundlist_base_low; //0x1060 uint32_t outboundlist_base_high; //0x1064 - uint32_t reserved11; //0x1068 + uint32_t reserved11; //0x1068 uint32_t outboundlist_copy_pointer; //0x106C uint32_t outboundlist_read_pointer; //0x1070 0x1072 - uint32_t reserved12[5]; //0x1074 + uint32_t reserved12[5]; //0x1074 uint32_t outboundlist_interrupt_cause; //0x1088 uint32_t outboundlist_interrupt_enable; //0x108C uint32_t reserved13[988]; //0x1090 - uint32_t message_wbuffer[32]; //0x2000 + uint32_t message_wbuffer[32]; //0x2000 uint32_t reserved14[32]; //0x2080 - uint32_t message_rbuffer[32]; //0x2100 + uint32_t message_rbuffer[32]; //0x2100 uint32_t reserved15[32]; //0x2180 - uint32_t msgcode_rwbuffer[256]; //0x2200 + uint32_t msgcode_rwbuffer[256]; //0x2200 }; struct HBD_MessageUnit0 { @@ -675,10 +675,10 @@ struct HBD_MessageUnit0 { struct MessageUnit_UNION { union { - struct HBA_MessageUnit hbamu; - struct HBB_MessageUnit hbbmu; - struct HBC_MessageUnit hbcmu; - struct HBD_MessageUnit0 hbdmu; + struct HBA_MessageUnit hbamu; + struct HBB_MessageUnit hbbmu; + struct HBC_MessageUnit hbcmu; + struct HBD_MessageUnit0 hbdmu; } muu; }; /* @@ -686,7 +686,7 @@ struct MessageUnit_UNION ** structure for holding DMA address data ************************************************************* */ -#define IS_SG64_ADDR 0x01000000 /* bit24 */ +#define IS_SG64_ADDR 0x01000000 /* bit24 */ /* ************************************************************************************************ ** ARECA FIRMWARE SPEC @@ -695,10 +695,10 @@ struct MessageUnit_UNION ** (All In/Out is in IOP331's view) ** 1. Message 0 --> InitThread message and retrun code ** 2. Doorbell is used for RS-232 emulation -** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK) -** bit1 -- data out has been read (DRIVER DATA READ OK) -** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK) -** bit1 -- data in has been read (IOP331 DATA READ OK) +** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK) +** bit1 -- data out has been read (DRIVER DATA READ OK) +** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK) +** bit1 -- data in has been read (IOP331 DATA READ OK) ** 3. Index Memory Usage ** offset 0xf00 : for RS232 out (request buffer) ** offset 0xe00 : for RS232 in (scratch buffer) @@ -711,66 +711,66 @@ struct MessageUnit_UNION ** 5. PostQ ** All SCSI Command must be sent through postQ: ** (inbound queue port) Request frame must be 32 bytes aligned -** # bit27--bit31 => flag for post ccb -** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb -** bit31 : 0 : 256 bytes frame -** 1 : 512 bytes frame -** bit30 : 0 : normal request -** 1 : BIOS request -** bit29 : reserved -** bit28 : reserved -** bit27 : reserved +** # bit27--bit31 => flag for post ccb +** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb +** bit31 : 0 : 256 bytes frame +** 1 : 512 bytes frame +** bit30 : 0 : normal request +** 1 : BIOS request +** bit29 : reserved +** bit28 : reserved +** bit27 : reserved ** ------------------------------------------------------------------------------- ** (outbount queue port) Request reply -** # bit27--bit31 => flag for reply -** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb -** bit31 : must be 0 (for this type of reply) -** bit30 : reserved for BIOS handshake -** bit29 : reserved -** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData -** 1 : Error, error code in AdapStatus/DevStatus/SenseData -** bit27 : reserved +** # bit27--bit31 => flag for reply +** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb +** bit31 : must be 0 (for this type of reply) +** bit30 : reserved for BIOS handshake +** bit29 : reserved +** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData +** 1 : Error, error code in AdapStatus/DevStatus/SenseData +** bit27 : reserved ** 6. BIOS request ** All BIOS request is the same with request from PostQ ** Except : ** Request frame is sent from configuration space -** offset: 0x78 : Request Frame (bit30 == 1) -** offset: 0x18 : writeonly to generate IRQ to IOP331 +** offset: 0x78 : Request Frame (bit30 == 1) +** offset: 0x18 : writeonly to generate IRQ to IOP331 ** Completion of request: -** (bit30 == 0, bit28==err flag) +** (bit30 == 0, bit28==err flag) ** 7. Definition of SGL entry (structure) ** 8. Message1 Out - Diag Status Code (????) ** 9. Message0 message code : ** 0x00 : NOP ** 0x01 : Get Config ->offset 0xa00 :for outbound message code msgcode_rwbuffer (IOP331 send to driver) -** Signature 0x87974060(4) -** Request len 0x00000200(4) -** numbers of queue 0x00000100(4) -** SDRAM Size 0x00000100(4)-->256 MB -** IDE Channels 0x00000008(4) -** vendor 40 bytes char -** model 8 bytes char -** FirmVer 16 bytes char -** Device Map 16 bytes char +** Signature 0x87974060(4) +** Request len 0x00000200(4) +** numbers of queue 0x00000100(4) +** SDRAM Size 0x00000100(4)-->256 MB +** IDE Channels 0x00000008(4) +** vendor 40 bytes char +** model 8 bytes char +** FirmVer 16 bytes char +** Device Map 16 bytes char ** ** FirmwareVersion DWORD <== Added for checking of new firmware capability ** 0x02 : Set Config ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331) -** Signature 0x87974063(4) -** UPPER32 of Request Frame (4)-->Driver Only +** Signature 0x87974063(4) +** UPPER32 of Request Frame (4)-->Driver Only ** 0x03 : Reset (Abort all queued Command) ** 0x04 : Stop Background Activity ** 0x05 : Flush Cache ** 0x06 : Start Background Activity (re-start if background is halted) ** 0x07 : Check If Host Command Pending (Novell May Need This Function) ** 0x08 : Set controller time ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver to IOP331) -** byte 0 : 0xaa <-- signature -** byte 1 : 0x55 <-- signature -** byte 2 : year (04) -** byte 3 : month (1..12) -** byte 4 : date (1..31) -** byte 5 : hour (0..23) -** byte 6 : minute (0..59) -** byte 7 : second (0..59) +** byte 0 : 0xaa <-- signature +** byte 1 : 0x55 <-- signature +** byte 2 : year (04) +** byte 3 : month (1..12) +** byte 4 : date (1..31) +** byte 5 : hour (0..23) +** byte 6 : minute (0..59) +** byte 7 : second (0..59) ** ********************************************************************************* ** Porting Of LSI2108/2116 Based PCIE SAS/6G host raid adapter ** ==> Difference from IOP348 @@ -789,33 +789,33 @@ struct MessageUnit_UNION ** b. Message0: message code ** 0x00 : NOP ** 0x01 : Get Config ->offset 0xB8 :for outbound message code msgcode_rwbuffer (IOP send to driver) -** Signature 0x87974060(4) -** Request len 0x00000200(4) -** numbers of queue 0x00000100(4) -** SDRAM Size 0x00000100(4)-->256 MB -** IDE Channels 0x00000008(4) -** vendor 40 bytes char -** model 8 bytes char -** FirmVer 16 bytes char -** Device Map 16 bytes char -** cfgVersion ULONG <== Added for checking of new firmware capability +** Signature 0x87974060(4) +** Request len 0x00000200(4) +** numbers of queue 0x00000100(4) +** SDRAM Size 0x00000100(4)-->256 MB +** IDE Channels 0x00000008(4) +** vendor 40 bytes char +** model 8 bytes char +** FirmVer 16 bytes char +** Device Map 16 bytes char +** cfgVersion ULONG <== Added for checking of new firmware capability ** 0x02 : Set Config ->offset 0xB0 :for inbound message code msgcode_rwbuffer (driver send to IOP) -** Signature 0x87974063(4) -** UPPER32 of Request Frame (4)-->Driver Only +** Signature 0x87974063(4) +** UPPER32 of Request Frame (4)-->Driver Only ** 0x03 : Reset (Abort all queued Command) ** 0x04 : Stop Background Activity ** 0x05 : Flush Cache ** 0x06 : Start Background Activity (re-start if background is halted) ** 0x07 : Check If Host Command Pending (Novell May Need This Function) ** 0x08 : Set controller time ->offset 0xB0 : for inbound message code msgcode_rwbuffer (driver to IOP) -** byte 0 : 0xaa <-- signature -** byte 1 : 0x55 <-- signature -** byte 2 : year (04) -** byte 3 : month (1..12) -** byte 4 : date (1..31) -** byte 5 : hour (0..23) -** byte 6 : minute (0..59) -** byte 7 : second (0..59) +** byte 0 : 0xaa <-- signature +** byte 1 : 0x55 <-- signature +** byte 2 : year (04) +** byte 3 : month (1..12) +** byte 4 : date (1..31) +** byte 5 : hour (0..23) +** byte 6 : minute (0..59) +** byte 7 : second (0..59) ** ** <2> Doorbell Register is used for RS-232 emulation ** different clear register @@ -908,21 +908,21 @@ struct MessageUnit_UNION */ /* size 8 bytes */ /* 32bit Scatter-Gather list */ -struct SG32ENTRY { /* length bit 24 == 0 */ - u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ - u_int32_t address; +struct SG32ENTRY { /* length bit 24 == 0 */ + u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ + u_int32_t address; }; /* size 12 bytes */ /* 64bit Scatter-Gather list */ -struct SG64ENTRY { /* length bit 24 == 1 */ - u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ - u_int32_t address; - u_int32_t addresshigh; +struct SG64ENTRY { /* length bit 24 == 1 */ + u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ + u_int32_t address; + u_int32_t addresshigh; }; struct SGENTRY_UNION { union { - struct SG32ENTRY sg32entry; /* 30h Scatter gather address */ - struct SG64ENTRY sg64entry; /* 30h */ + struct SG32ENTRY sg32entry; /* 30h Scatter gather address */ + struct SG64ENTRY sg64entry; /* 30h */ }u; }; /* @@ -932,14 +932,14 @@ struct SGENTRY_UNION { */ struct QBUFFER { u_int32_t data_len; - u_int8_t data[124]; + u_int8_t data[124]; }; /* ********************************** */ typedef struct PHYS_ADDR64 { - u_int32_t phyadd_low; - u_int32_t phyadd_high; + u_int32_t phyadd_low; + u_int32_t phyadd_high; }PHYSADDR64; /* ************************************************************************************************ @@ -959,11 +959,11 @@ struct FIRMWARE_INFO { u_int32_t ide_channels; /*4,16-19*/ char vendor[40]; /*5,20-59*/ char model[8]; /*15,60-67*/ - char firmware_ver[16]; /*17,68-83*/ + char firmware_ver[16]; /*17,68-83*/ char device_map[16]; /*21,84-99*/ - u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ - char cfgSerial[16]; /*26,104-119*/ - u_int32_t cfgPicStatus; /*30,120-123*/ + u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ + char cfgSerial[16]; /*26,104-119*/ + u_int32_t cfgPicStatus; /*30,120-123*/ }; /* (A) For cfgVersion in FIRMWARE_INFO ** if low BYTE (byte#0) >= 3 (version 3) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 19:56:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17A0E712; Wed, 18 Dec 2013 19:56:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E10B21E98; Wed, 18 Dec 2013 19:55:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DC7E7B94A; Wed, 18 Dec 2013 14:55:57 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu Date: Wed, 18 Dec 2013 12:00:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312171220.47075.jhb@freebsd.org> <86eh5agw1n.fsf@nine.des.no> In-Reply-To: <86eh5agw1n.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201312181200.04327.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Dec 2013 14:55:58 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 19:56:00 -0000 On Wednesday, December 18, 2013 7:53:24 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > 1) 'make tinderbox' Just Works as a single command from an existing sou= rce > > tree checkout. [...] > > > > 2) 'make tinderbox' provides a summary of what failed. 'make universe' > > does not. [...] >=20 > So remove all the .if !defined(DOING_TINDERBOX) code the tinderbox > target, and 'make universe' will do what you want without confusing > people. At this point 'make tinderbox' is hardcoded into my muscle memory, but there may be someone who wants 'make universe' to do what it does still (phk added it in its current form on purpose). I'm hesitant to change 'make universe', but am fine with having the two variants of the same thing live side by sid= e. > > Ah, I thought at one point it only built GENERIC and LINT type configs, > > but presumably that has changed? >=20 > That changed a long time ago. Ok, I'm happy then. I agree that we should revisit how LINT is done and probably move it to OBJDIR instead of its current location. It should probably also depend on makeLINT explicitly. =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 20:04:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C9EBB35; Wed, 18 Dec 2013 20:04:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E247E1F50; Wed, 18 Dec 2013 20:04:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIK45DR050482; Wed, 18 Dec 2013 20:04:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIK45fb050478; Wed, 18 Dec 2013 20:04:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312182004.rBIK45fb050478@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 20:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259566 - head/usr.bin/netstat 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.17 Precedence: list List-Id: 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, 18 Dec 2013 20:04:06 -0000 Author: melifaro Date: Wed Dec 18 20:04:04 2013 New Revision: 259566 URL: http://svnweb.freebsd.org/changeset/base/259566 Log: Restore corefiles handling via kvm(3). Found by: John-Mark Gurney MFC after: 4 weeks Modified: head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/main.c Wed Dec 18 20:04:04 2013 (r259566) @@ -319,6 +319,7 @@ int gflag; /* show group (multicast) ro int hflag; /* show counters in human readable format */ int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ +int Mflag; /* read statistics from core */ int mflag; /* show memory stats */ int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ @@ -424,6 +425,7 @@ main(int argc, char *argv[]) Lflag = 1; break; case 'M': + Mflag = 1; memf = optarg; break; case 'm': Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/netstat.h Wed Dec 18 20:04:04 2013 (r259566) @@ -40,6 +40,7 @@ extern int gflag; /* show group (multica extern int hflag; /* show counters in human readable format */ extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ +extern int Mflag; /* read statistics from core */ extern int mflag; /* show memory stats */ extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/route.c Wed Dec 18 20:04:04 2013 (r259566) @@ -182,7 +182,7 @@ routepr(u_long rtree, int fibnum) printf(" (fib: %d)", fibnum); printf("\n"); - if (Aflag == 0 && NewTree) + if (Aflag == 0 && Mflag == 0 && NewTree) ntreestuff(fibnum, af); else { if (rtree == 0) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 20:08:18 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 705FCE19; Wed, 18 Dec 2013 20:08:18 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 316801F94; Wed, 18 Dec 2013 20:08:18 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1VtJb0-000Dh6-Jp; Wed, 18 Dec 2013 20:03:38 +0400 Message-ID: <52B2009E.1060905@FreeBSD.org> Date: Thu, 19 Dec 2013 00:07:58 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130728 Thunderbird/17.0.7 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r259562 - head/usr.bin/netstat References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> In-Reply-To: <20131218184512.GM99167@funkthat.com> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 20:08:18 -0000 On 18.12.2013 22:45, John-Mark Gurney wrote: > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: >> Author: melifaro >> Date: Wed Dec 18 18:25:27 2013 >> New Revision: 259562 >> URL: http://svnweb.freebsd.org/changeset/base/259562 >> >> Log: >> Switch netstat -rn to use standard API for retrieving list of routes >> instead of peeking inside in-kernel radix via kget. >> This permits us to change kernel structures without breaking userland. >> Additionally, this change provide more reliable and faster output. >> >> `Refs` and `Use` fields available in IPv4 by default (and via -W >> for other families) were removed. `Refs` is radix-specific thing >> which is not informative for users. `Use` field value is handy sometimes, >> but a) current API does not support it and b) I'm not sure we will >> support per-rte pcpu counters in near future. >> >> Old method of retrieving data is still supported (either by defining >> NewTree=0 or running netstat with -A). However, Refs/Use fields are >> hidden. >> >> Sponsored by: Yandex LLC >> MFC after: 4 weeks >> PR: kern/167204 > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > this change make it not usable, or will you still automatically use Well. It will probably break in (maybe, near) future. > it when they are specified? However, it should work now (fixed in r259566). > From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 20:17:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EADC818A; Wed, 18 Dec 2013 20:17:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D66211025; Wed, 18 Dec 2013 20:17:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIKH5dP054860; Wed, 18 Dec 2013 20:17:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIKH5v2054858; Wed, 18 Dec 2013 20:17:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312182017.rBIKH5v2054858@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 20:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259568 - in head: sbin/ipfw 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.17 Precedence: list List-Id: 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, 18 Dec 2013 20:17:06 -0000 Author: melifaro Date: Wed Dec 18 20:17:05 2013 New Revision: 259568 URL: http://svnweb.freebsd.org/changeset/base/259568 Log: Add net.inet.ip.fw.dyn_keep_states sysctl which re-links dynamic states to default rule instead of flushing on rule deletion. This can be useful while performing ruleset reload (think about `atomic` reload via changing sets). Currently it is turned off by default. MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Dec 18 20:11:01 2013 (r259567) +++ head/sbin/ipfw/ipfw.8 Wed Dec 18 20:17:05 2013 (r259568) @@ -2933,6 +2933,11 @@ and must be strictly lower than 5 seconds, the period of repetition of keepalives. The firewall enforces that. +.It Va net.inet.ip.fw.dyn_keep_states: No 0 +Keep dynamic states on rule/set deletion. +States are relinked to default rule (65535). +This can be handly for ruleset reload. +Turned off by default. .It Va net.inet.ip.fw.enable : No 1 Enables the firewall. Setting this variable to 0 lets you run your machine without Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Dec 18 20:11:01 2013 (r259567) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Dec 18 20:17:05 2013 (r259568) @@ -106,7 +106,8 @@ __FBSDID("$FreeBSD$"); * * Each dynamic rule holds a pointer to the parent ipfw rule so * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. XXX we should make them survive. + * the parent rule is deleted. This can be changed by dyn_keep_states + * sysctl. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple @@ -141,6 +142,10 @@ static VNET_DEFINE(uma_zone_t, ipfw_dyn_ #define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) #define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) + +static VNET_DEFINE(int, dyn_keep_states); +#define V_dyn_keep_states VNET(dyn_keep_states) + /* * Timeouts for various events in handing dynamic rules. */ @@ -234,6 +239,9 @@ SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AU SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, "Enable keepalives for dyn. rules"); +SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, + CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, + "Do not flush dynamic states on rule deletion"); SYSEND @@ -307,6 +315,7 @@ print_dyn_rule_flags(struct ipfw_flow_id print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) /* * Lookup a dynamic rule, locked version. @@ -1100,6 +1109,20 @@ check_dyn_rules(struct ip_fw_chain *chai if ((TIME_LEQ(q->expire, time_uptime)) || ((rule != NULL) && (q->rule == rule)) || ((set != RESVD_SET) && (q->rule->set == set))) { + if (TIME_LE(time_uptime, q->expire) && + q->dyn_type == O_KEEP_STATE && + V_dyn_keep_states != 0) { + /* + * Do not delete state if + * it is not expired and + * dyn_keep_states is ON. + * However we need to re-link it + * to any other stable rule + */ + q->rule = chain->default_rule; + NEXT_RULE(); + } + /* Unlink q from current list */ q_next = q->next; if (q == V_ipfw_dyn_v[i].head) From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 20:37:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0F9C6EA; Wed, 18 Dec 2013 20:37:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 815791174; Wed, 18 Dec 2013 20:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIKbohM061913; Wed, 18 Dec 2013 20:37:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIKboeV061912; Wed, 18 Dec 2013 20:37:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312182037.rBIKboeV061912@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 18 Dec 2013 20:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259569 - 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.17 Precedence: list List-Id: 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, 18 Dec 2013 20:37:50 -0000 Author: np Date: Wed Dec 18 20:37:49 2013 New Revision: 259569 URL: http://svnweb.freebsd.org/changeset/base/259569 Log: cxgbe.4: Belated update to the man page to reflect T5 support. MFC after: 1 day Modified: head/share/man/man4/cxgbe.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Wed Dec 18 20:17:05 2013 (r259568) +++ head/share/man/man4/cxgbe.4 Wed Dec 18 20:37:49 2013 (r259569) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012, Chelsio Inc +.\" Copyright (c) 2011-2013, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd December 18, 2013 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,13 +50,14 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent t4fw_cfg_load="YES" +t5fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 (T4) ASIC. +the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,11 +66,50 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp +Note that ports of T5 cards are named cxl and attach to a t5nex parent device +(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). +Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. +The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and +dev.cxgbe for T4 cards. + +.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC +(ports will be named cxl): +.Pp +.Bl -bullet -compact +.It +Chelsio T580-CR +.It +Chelsio T580-LP-CR +.It +Chelsio T580-LP-SO-CR +.It +Chelsio T560-CR +.It +Chelsio T540-CR +.It +Chelsio T540-LP-CR +.It +Chelsio T522-CR +.It +Chelsio T520-LL-CR +.It +Chelsio T520-CR +.It +Chelsio T520-SO +.It +Chelsio T520-BT +.It +Chelsio T504-BT +.El +.Pp +The +.Nm driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: .Pp .Bl -bullet -compact @@ -139,8 +179,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. -Different cxgbe interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx sysctl. +Different interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -149,8 +189,8 @@ and the index selects a value from this The default value is -1 for both 10Gb and 1Gb ports, which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -161,16 +201,16 @@ software queuing. See .Xr ifnet 9 . The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -231,6 +271,10 @@ The .Nm device driver first appeared in .Fx 9.0 . +Support for T5 cards first appeared in +.Fx 9.2 +and +.Fx 10.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:13:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 525E7BA1; Wed, 18 Dec 2013 21:13:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6BD1530; Wed, 18 Dec 2013 21:13:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILDpYZ075973; Wed, 18 Dec 2013 21:13:51 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILDpeM075972; Wed, 18 Dec 2013 21:13:51 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312182113.rBILDpeM075972@svn.freebsd.org> From: Devin Teske Date: Wed, 18 Dec 2013 21:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259570 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:13:51 -0000 Author: dteske Date: Wed Dec 18 21:13:50 2013 New Revision: 259570 URL: http://svnweb.freebsd.org/changeset/base/259570 Log: Fix "[: -eq: argument expected" error introduced by SVN r256343. The code should not have used DIALOG_CANCEL because dialog.subr wasn't included to define it. The effect of the error was that you could not cancel the partition dialog. Discovered by checking bsdinstall_log for something else. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 20:37:49 2013 (r259569) +++ head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:13:50 2013 (r259570) @@ -124,8 +124,7 @@ exec 3>&1 PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ --title "Partitioning" \ --menu "How would you like to partition your disk?" \ - 0 0 0 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + 0 0 0 2>&1 1>&3` || exit 1 exec 3>&- case "$PARTMODE" in From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:16:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AEE5E8F; Wed, 18 Dec 2013 21:16:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06B7C1589; Wed, 18 Dec 2013 21:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILGvR0076499; Wed, 18 Dec 2013 21:16:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILGvSV076498; Wed, 18 Dec 2013 21:16:57 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312182116.rBILGvSV076498@svn.freebsd.org> From: Devin Teske Date: Wed, 18 Dec 2013 21:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259572 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:16:58 -0000 Author: dteske Date: Wed Dec 18 21:16:57 2013 New Revision: 259572 URL: http://svnweb.freebsd.org/changeset/base/259572 Log: In bsdinstall_log, it's rather confusing to see the following sequence: DEBUG: Running installation step: hostname rm: /tmp/bsdinstall_etc/fstab: No such file or directory The two lines are unrelated, and the rm is spurious. Let's add `-f' to that rm(1) so it doesn't confuse us when debugging an install. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:14:43 2013 (r259571) +++ head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:16:57 2013 (r259572) @@ -103,7 +103,7 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then export BSDINSTALL_DISTSITE fi -rm $PATH_FSTAB +rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:14:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D713FCF5; Wed, 18 Dec 2013 21:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C209B153F; Wed, 18 Dec 2013 21:14:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILEhSa076165; Wed, 18 Dec 2013 21:14:43 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILEhOW076164; Wed, 18 Dec 2013 21:14:43 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182114.rBILEhOW076164@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259571 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:14:43 -0000 Author: rodrigc Date: Wed Dec 18 21:14:43 2013 New Revision: 259571 URL: http://svnweb.freebsd.org/changeset/base/259571 Log: Add SVN revision numbers for Mellanox updates. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:13:50 2013 (r259570) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:14:43 2013 (r259571) @@ -254,10 +254,10 @@ The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. - The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been updated to the same version as supplied by Linux version 3.7 - The Mellanox Infiniband driver has been updated to firmware + The Mellanox Infiniband driver has been updated to firmware version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added for dynamically loading kernel modules for Infiniband core (ibcore) and From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:23:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6647323; Wed, 18 Dec 2013 21:23:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B21B01628; Wed, 18 Dec 2013 21:23:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILNG40079645; Wed, 18 Dec 2013 21:23:16 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILNGC6079644; Wed, 18 Dec 2013 21:23:16 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182123.rBILNGC6079644@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259574 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:23:16 -0000 Author: rodrigc Date: Wed Dec 18 21:23:16 2013 New Revision: 259574 URL: http://svnweb.freebsd.org/changeset/base/259574 Log: Indent. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:22:16 2013 (r259573) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:23:16 2013 (r259574) @@ -255,7 +255,8 @@ experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. - The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + The Open Fabrics Enterprise Distribution (OFED) and + OFED Infiniband core has been updated to the same version as supplied by Linux version 3.7 The Mellanox Infiniband driver has been updated to firmware From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:22:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44FBE1FE; Wed, 18 Dec 2013 21:22:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30FA51619; Wed, 18 Dec 2013 21:22:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILMHiA079507; Wed, 18 Dec 2013 21:22:17 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILMHlU079506; Wed, 18 Dec 2013 21:22:17 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182122.rBILMHlU079506@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259573 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:22:17 -0000 Author: rodrigc Date: Wed Dec 18 21:22:16 2013 New Revision: 259573 URL: http://svnweb.freebsd.org/changeset/base/259573 Log: Add SVN revision numbers for Chelsio updates. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:16:57 2013 (r259572) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:22:16 2013 (r259573) @@ -248,10 +248,11 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. - The &man.cxgbe.4; driver has been updated to support + The &man.cxgbe.4; driver has been updated to support 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. - The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + The iw_cxgbe driver has been added. This is an + experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 21:45:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD9F9E02; Wed, 18 Dec 2013 21:45:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8DD81857; Wed, 18 Dec 2013 21:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILjk3K086954; Wed, 18 Dec 2013 21:45:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILjkZH086953; Wed, 18 Dec 2013 21:45:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312182145.rBILjkZH086953@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 18 Dec 2013 21:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259576 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.17 Precedence: list List-Id: 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, 18 Dec 2013 21:45:46 -0000 Author: pjd Date: Wed Dec 18 21:45:46 2013 New Revision: 259576 URL: http://svnweb.freebsd.org/changeset/base/259576 Log: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 illumos/illumos-gate@bb411a08b05466bfe0c7095b6373bbc1587e259a MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Dec 18 21:29:23 2013 (r259575) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Dec 18 21:45:46 2013 (r259576) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 22:40:10 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6686D660; Wed, 18 Dec 2013 22:40:10 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C51801E32; Wed, 18 Dec 2013 22:40:08 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBIMdotP004057; Wed, 18 Dec 2013 23:39:55 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B22436.2040401@FreeBSD.org> Date: Wed, 18 Dec 2013 23:39:50 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Baptiste Daroussin , Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> <20131218002415.GQ99753@ithaqua.etoilebsd.net> In-Reply-To: <20131218002415.GQ99753@ithaqua.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 22:40:10 -0000 On 18.12.13 01:24, Baptiste Daroussin wrote: > On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: >> On Tue, 10 Dec 2013 23:49:38 +0100 >> Andreas Tobler wrote: >> >>> On 10.12.13 14:43, Tijl Coosemans wrote: >>>> On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: >>>>> That keyboards have no Shift key for that? :) >>>>> I will be glad to apply your changes, but I have to know how it >>>>> should be controlled. >>>>> >>>>> RU and UA PC keyboards have same 3 symbols '2', '"', '@' >>>>> To get '2' i have to press only '2' >>>>> To get '@' I have to press Shift+'2' >>>>> To get '"' I have to switch to UA or RU and press Shift+'2' >>>>> >>>>> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary >>>>> lang switch. Which commonly mapped to one of Alt. Right? >>>>> So R-Alt+Shift+'2'? >>>> >>>> https://en.wikipedia.org/wiki/AltGr >>> >>> Thanks Tijl! >>> >>> To get the @ I have to press AltGr + '2'. >>> There are combinations where I have to press AltGr+Shift. e.g to get >>> the 'broken bar, ¦', AltGr+Shift+'7'. >>> >>> Andreas >>> >> >> Hello Andreas and Tijl! >> >> Since I think not a whole world have AltGr key (read as "not most >> keyboards on the Earth") :) >> Think it is OK to use R.Alt as an Alt by default, and enable AltGr with >> sysctl kern.vt.enable_altgr. >> > I tend to disagree with you, lots of keyboards mapping are concerned here. Hi Aleksandr, It is at least a step forward. But I do not like it. Don't get me wrong, I think we have to be very careful when it comes to keyboard mapping. A status quo should be kept, the one from syscons. Looking back the past 20 years of Linux and FreeBSD experience I always had to touch the keyboards section to make it fit my needs. A nasty hurdle, in the beginning it was ok, but after the sixth time adjusting the native language keyboard it gets boring. And I guess it is not only me. In the meantime I would not need a swiss keyboard anymore, I more or less know the native mapping out of my mind :) I do not yet understand the fine keyboard details from syscons but I think we have to keep and adapt them to vt. My two Rp. Thanks for your time! Andreas From owner-svn-src-head@FreeBSD.ORG Wed Dec 18 22:38:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F416576; Wed, 18 Dec 2013 22:38:45 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64A011E25; Wed, 18 Dec 2013 22:38:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5F69CB980; Wed, 18 Dec 2013 17:38:44 -0500 (EST) From: John Baldwin To: "Alexander V. Chernikov" Subject: Re: svn commit: r259562 - head/usr.bin/netstat Date: Wed, 18 Dec 2013 16:40:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> In-Reply-To: <52B2009E.1060905@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312181640.52147.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Dec 2013 17:38:44 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 18 Dec 2013 22:38:45 -0000 On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > On 18.12.2013 22:45, John-Mark Gurney wrote: > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > >> Author: melifaro > >> Date: Wed Dec 18 18:25:27 2013 > >> New Revision: 259562 > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > >> > >> Log: > >> Switch netstat -rn to use standard API for retrieving list of routes > >> instead of peeking inside in-kernel radix via kget. > >> This permits us to change kernel structures without breaking userland. > >> Additionally, this change provide more reliable and faster output. > >> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > >> for other families) were removed. `Refs` is radix-specific thing > >> which is not informative for users. `Use` field value is handy sometimes, > >> but a) current API does not support it and b) I'm not sure we will > >> support per-rte pcpu counters in near future. > >> > >> Old method of retrieving data is still supported (either by defining > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > >> hidden. > >> > >> Sponsored by: Yandex LLC > >> MFC after: 4 weeks > >> PR: kern/167204 > > > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > > this change make it not usable, or will you still automatically use > Well. It will probably break in (maybe, near) future. Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's fine if kvm mode is fragile and requires the binary to be in sync with the kernel and is only used for crash dumps, but it is very useful to extract all sorts of info out of a crash dump. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 00:28:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDC88C18; Thu, 19 Dec 2013 00:28:31 +0000 (UTC) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3ECC1661; Thu, 19 Dec 2013 00:28:30 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id q58so381024wes.5 for ; Wed, 18 Dec 2013 16:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=W7wX8G0cPGr2JtsbOTuWciK8uBdy8YtcL3FrK+MsFgE=; b=Ei+5OaPvgxPski0rsgZkvGajstEi2k6Ll2kWWjR/meX7Q2bP8Gn65ody2KdvSEij60 jZNJ3whJ202PABvtqPc1wuGF9ZGalpSAulZAv9jIMVFQUeIbYR6bJOXrSbTucoF4p4ss BnFmAfVCKwkNCI4iY2Vsl6e9k0JOcZbVjNzF6+U6j4NDxAaPVAw5a1zqPTVEinvm6kLK bcSEe9uMrOjs9gsl1oWf4rU5eegqiP0jKVlpggzFjNzBIRS8U/li1/d2LT99Lh/sE3Dj ROGBCw6nxffPyJ5X/hyQEFolLGKnRJezfFsKtBRvJtFQ6pz8GE8rxGHnhhOXqscPd76C seFg== X-Received: by 10.180.188.141 with SMTP id ga13mr165787wic.55.1387412909265; Wed, 18 Dec 2013 16:28:29 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id el8sm7805995wic.8.2013.12.18.16.28.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 16:28:28 -0800 (PST) Date: Thu, 19 Dec 2013 01:28:24 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131219002824.GA5664@dft-labs.eu> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201312171434.01345.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 00:28:32 -0000 On Tue, Dec 17, 2013 at 02:34:01PM -0500, John Baldwin wrote: > On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: > > On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > > > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > > > Author: mjg > > > > Date: Sun Dec 15 04:11:43 2013 > > > > New Revision: 259407 > > > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > > > > > Log: > > > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > > > > > Code wishing to check rlimits of some process should check whether it > > > > is exiting first, which current consumers do. > > > > > > Does this measurably reduce contention? > > > > > > > No, this is just a cosmetic change I did while doing some other work > > with rlimits. > > > > It would use some more cosmetic work (e.g. no reason not to > > lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that > > later unless this kind of stuff is unwanted. > Sorry for late reply, was pondering moving this code to after the moment the process is removed from allproc. > I find it useful to leave the locking in place so it is clear that p_limit is > always written to with the lock held. If we ever got a static analyzer that > understood locking rules then leaving this locking in would reduce false > positives. When I first did locking for fields in struct proc I did it by > hand based on grepping the source tree for all uses of a field and ensuring > they were locked. I think it might be more confusing later on for another > reader to see unlocked access and then have to think about why that is safe. > I would argue such a tool should support marking given unlocled access as ok. Few lines earlier we already have code modifying proc without locks: if ((vtmp = p->p_textvp) != NULL) { p->p_textvp = NULL; vrele(vtmp); } Despite replacing the pointer with NULL first it still races with anything accessing the field as vref (if any) may be executed after vrele. As such, I would expect the reader to conclude that accessing these fields is not valid at this point. That being said, instead of reverting the change (which would leave other field with similar issue in place) I propose adding the following: --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -220,6 +220,12 @@ exit1(struct thread *td, int rv) p->p_xstat = rv; /* Let event handler change exit status */ PROC_UNLOCK(p); + + /* + * Some fields below are freed without having the proc locked, check + * for P_WEXIT before accessing to make sure it is safe. + */ + Which should make it clear. But again, this is a cosmetic change and I have no strong opinion either way. If you are still unconvinced I'm happy to revert it later. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 00:51:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30166638; Thu, 19 Dec 2013 00:51:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8221850; Thu, 19 Dec 2013 00:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ0pmKF055327; Thu, 19 Dec 2013 00:51:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ0pmFc055325; Thu, 19 Dec 2013 00:51:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312190051.rBJ0pmFc055325@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 19 Dec 2013 00:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259580 - in head: contrib/tcpdump usr.bin/kdump 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.17 Precedence: list List-Id: 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, 19 Dec 2013 00:51:49 -0000 Author: pjd Date: Thu Dec 19 00:51:48 2013 New Revision: 259580 URL: http://svnweb.freebsd.org/changeset/base/259580 Log: If we cannot connect to casperd we don't enter sandbox, but if we can connect to casperd, but we cannot access the service we need we exit with an error. This should not happen and just indicates some configuration error which should be fixed, so we force the user to do it by failing. Discussed with: emaste Modified: head/contrib/tcpdump/tcpdump.c head/usr.bin/kdump/kdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Wed Dec 18 23:39:42 2013 (r259579) +++ head/contrib/tcpdump/tcpdump.c Thu Dec 19 00:51:48 2013 (r259580) @@ -710,24 +710,16 @@ capdns_setup(void) capdnsloc = cap_service_open(capcas, "system.dns"); /* Casper capability no longer needed. */ cap_close(capcas); - if (capdnsloc == NULL) { - warning("unable to open system.dns service"); - return (NULL); - } + if (capdnsloc == NULL) + error("unable to open system.dns service"); /* Limit system.dns to reverse DNS lookups. */ types[0] = "ADDR"; - if (cap_dns_type_limit(capdnsloc, types, 1) < 0) { - warning("unable to limit access to system.dns service"); - cap_close(capdnsloc); - return (NULL); - } + if (cap_dns_type_limit(capdnsloc, types, 1) < 0) + error("unable to limit access to system.dns service"); families[0] = AF_INET; families[1] = AF_INET6; - if (cap_dns_family_limit(capdnsloc, families, 2) < 0) { - warning("unable to limit access to system.dns service"); - cap_close(capdnsloc); - return (NULL); - } + if (cap_dns_family_limit(capdnsloc, families, 2) < 0) + error("unable to limit access to system.dns service"); return (capdnsloc); } Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Wed Dec 18 23:39:42 2013 (r259579) +++ head/usr.bin/kdump/kdump.c Thu Dec 19 00:51:48 2013 (r259580) @@ -215,7 +215,7 @@ cappwdgrp_setup(cap_channel_t **cappwdp, capcas = cap_init(); if (capcas == NULL) { warn("unable to contact casperd"); - return (NULL); + return (-1); } cappwdloc = cap_service_open(capcas, "system.pwd"); capgrploc = cap_service_open(capcas, "system.grp"); @@ -226,40 +226,26 @@ cappwdgrp_setup(cap_channel_t **cappwdp, warn("unable to open system.pwd service"); if (capgrploc == NULL) warn("unable to open system.grp service"); - goto fail; + exit(1); } /* Limit system.pwd to only getpwuid() function and pw_name field. */ cmds[0] = "getpwuid"; - if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) { - warn("unable to limit access to system.pwd service"); - goto fail; - } + if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) + err(1, "unable to limit system.pwd service"); fields[0] = "pw_name"; - if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) { - warn("unable to limit access to system.pwd service"); - goto fail; - } + if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) + err(1, "unable to limit system.pwd service"); /* Limit system.grp to only getgrgid() function and gr_name field. */ cmds[0] = "getgrgid"; - if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) { - warn("unable to limit access to system.grp service"); - goto fail; - } + if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) + err(1, "unable to limit system.grp service"); fields[0] = "gr_name"; - if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) { - warn("unable to limit access to system.grp service"); - goto fail; - } + if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) + err(1, "unable to limit system.grp service"); *cappwdp = cappwdloc; *capgrpp = capgrploc; return (0); -fail: - if (capgrploc == NULL) - cap_close(cappwdloc); - if (capgrploc == NULL) - cap_close(capgrploc); - return (-1); } #endif /* HAVE_LIBCAPSICUM */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 00:53:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE56B788; Thu, 19 Dec 2013 00:53:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAC68185B; Thu, 19 Dec 2013 00:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ0rBLr055523; Thu, 19 Dec 2013 00:53:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ0rBRQ055522; Thu, 19 Dec 2013 00:53:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312190053.rBJ0rBRQ055522@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 19 Dec 2013 00:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259581 - head/etc/defaults 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.17 Precedence: list List-Id: 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, 19 Dec 2013 00:53:11 -0000 Author: pjd Date: Thu Dec 19 00:53:11 2013 New Revision: 259581 URL: http://svnweb.freebsd.org/changeset/base/259581 Log: Make the world a bit more secure place (hopefully) and turn the casperd on by default. Sponsored by: The FreeBSD Foundation Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 19 00:51:48 2013 (r259580) +++ head/etc/defaults/rc.conf Thu Dec 19 00:53:11 2013 (r259581) @@ -658,7 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off -casperd_enable="NO" # casperd(8) daemon +casperd_enable="YES" # casperd(8) daemon ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 03:21:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4912F1C2; Thu, 19 Dec 2013 03:21:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD9012C6; Thu, 19 Dec 2013 03:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ3LsbK012482; Thu, 19 Dec 2013 03:21:54 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ3Lscd012481; Thu, 19 Dec 2013 03:21:54 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312190321.rBJ3Lscd012481@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 19 Dec 2013 03:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259586 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 19 Dec 2013 03:21:54 -0000 Author: rodrigc Date: Thu Dec 19 03:21:53 2013 New Revision: 259586 URL: http://svnweb.freebsd.org/changeset/base/259586 Log: Add entry for bhyve. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 02:45:29 2013 (r259585) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 03:21:53 2013 (r259586) @@ -120,6 +120,11 @@ Kernel Changes + The BSD Hypervisor, &man.bhyve.8; is included + with &os;. &man.bhyve.8; requires Intel CPUs with VT-x and Extended Page Table (EPT) + support. These features are on all Nehalem models and beyond + (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 03:48:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 074A774C; Thu, 19 Dec 2013 03:48:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB9761491; Thu, 19 Dec 2013 03:48:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ3maei020351; Thu, 19 Dec 2013 03:48:36 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ3magP020349; Thu, 19 Dec 2013 03:48:36 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312190348.rBJ3magP020349@svn.freebsd.org> From: Mark Johnston Date: Thu, 19 Dec 2013 03:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259587 - 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.17 Precedence: list List-Id: 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, 19 Dec 2013 03:48:37 -0000 Author: markj Date: Thu Dec 19 03:48:36 2013 New Revision: 259587 URL: http://svnweb.freebsd.org/changeset/base/259587 Log: Invoke the kld_* event handlers from linker_load_file() and linker_unload_file() rather than kern_kldload() and kern_kldunload(). This ensures that the handlers are invoked for files that are loaded/unloaded automatically as dependencies. Previously, they were only invoked for files loaded by a user. As a side effect, the kld_load and kld_unload handlers are now invoked with the kernel linker lock exclusively held. Reported by: avg Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Dec 19 03:21:53 2013 (r259586) +++ head/sys/kern/kern_linker.c Thu Dec 19 03:48:36 2013 (r259587) @@ -434,6 +434,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -609,6 +610,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -690,6 +697,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1033,10 +1044,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; - - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_load, lf); - sx_sunlock(&kld_sx); + sx_xunlock(&kld_sx); done: CURVNET_RESTORE(); @@ -1066,9 +1074,6 @@ int kern_kldunload(struct thread *td, int fileid, int flags) { linker_file_t lf; - char *filename = NULL; - caddr_t address; - size_t size; int error = 0; if ((error = securelevel_gt(td->td_ucred, 0)) != 0) @@ -1083,10 +1088,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload_try, lf, &error); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1094,11 +1096,6 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { - /* Save data needed for the kld_unload callbacks. */ - filename = strdup(lf->filename, M_TEMP); - address = lf->address; - size = lf->size; - lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1106,14 +1103,7 @@ kern_kldunload(struct thread *td, int fi } } else error = ENOENT; - - if (error == 0) { - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_unload, filename, address, size); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); - free(filename, M_TEMP); + sx_xunlock(&kld_sx); CURVNET_RESTORE(); return (error); From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 04:55:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADC569B; Thu, 19 Dec 2013 04:55:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 995C21892; Thu, 19 Dec 2013 04:55:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ4tZjg045034; Thu, 19 Dec 2013 04:55:35 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ4tZlq045033; Thu, 19 Dec 2013 04:55:35 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312190455.rBJ4tZlq045033@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 19 Dec 2013 04:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259588 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 19 Dec 2013 04:55:35 -0000 Author: rodrigc Date: Thu Dec 19 04:55:35 2013 New Revision: 259588 URL: http://svnweb.freebsd.org/changeset/base/259588 Log: Add item for pkg(8). Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 03:48:36 2013 (r259587) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 04:55:35 2013 (r259588) @@ -538,18 +538,10 @@ Ports/Packages Collection Infrastructure - The &man.pkg.create.1; utility now supports - . When this option is specified and a - package tarball exists, it will not be overwritten. This is - useful when multiple packages are saved with several consecutive - runs of &man.pkg.create.1; with the - options. - - The pkg_sign and pkg_check utilities for cryptographically - signing &os; packages have been removed. They were only useful - for packages compressed using &man.gzip.1;; however - &man.bzip2.1; compression has been the norm for some time - now. + The pkg_add, pkg_create, pkg_delete, pkg_info, + pkg_updating, and pkg_version utilities have been removed. + &man.pkg.8; must now be used to install binary packages. &man.pkg.8; + is the next generation &os; package manager, also referred to as "pkgng". From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 05:22:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E34E7585; Thu, 19 Dec 2013 05:22:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDF411A48; Thu, 19 Dec 2013 05:22:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5MmNT055770; Thu, 19 Dec 2013 05:22:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5Mmf7055769; Thu, 19 Dec 2013 05:22:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312190522.rBJ5Mmf7055769@svn.freebsd.org> From: Glen Barber Date: Thu, 19 Dec 2013 05:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259589 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: 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, 19 Dec 2013 05:22:49 -0000 Author: gjb Date: Thu Dec 19 05:22:48 2013 New Revision: 259589 URL: http://svnweb.freebsd.org/changeset/base/259589 Log: Fix doc build. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 04:55:35 2013 (r259588) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 05:22:48 2013 (r259589) @@ -540,7 +540,7 @@ The pkg_add, pkg_create, pkg_delete, pkg_info, pkg_updating, and pkg_version utilities have been removed. - &man.pkg.8; must now be used to install binary packages. &man.pkg.8; + &man.pkg.7; must now be used to install binary packages. &man.pkg.7; is the next generation &os; package manager, also referred to as "pkgng". From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 05:23:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70E226CB; Thu, 19 Dec 2013 05:23:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4317C1A4F; Thu, 19 Dec 2013 05:23:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5NBT4055858; Thu, 19 Dec 2013 05:23:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5NA5f055856; Thu, 19 Dec 2013 05:23:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312190523.rBJ5NA5f055856@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 19 Dec 2013 05:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259590 - head/lib/libstand 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.17 Precedence: list List-Id: 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, 19 Dec 2013 05:23:11 -0000 Author: marcel Date: Thu Dec 19 05:23:10 2013 New Revision: 259590 URL: http://svnweb.freebsd.org/changeset/base/259590 Log: Fix readdir for the root directory on a FAT32 file system. The root directory is like any subdirectory and as such needs to use a real cluster number. To this end, keep a DE structure for the root in the DOS_FS structure and populate it accordingly. While here: o allow consecutive path separators by skipping them all. o add missing $FreeBSD$ keyword to dosfs.h. Modified: head/lib/libstand/dosfs.c head/lib/libstand/dosfs.h Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Thu Dec 19 05:22:48 2013 (r259589) +++ head/lib/libstand/dosfs.c Thu Dec 19 05:23:10 2013 (r259590) @@ -162,6 +162,14 @@ dos_mount(DOS_FS *fs, struct open_file * (void)dosunmount(fs); return(err); } + fs->root = dot[0]; + fs->root.name[0] = ' '; + if (fs->fatsz == 32) { + fs->root.clus[0] = fs->rdcl & 0xff; + fs->root.clus[1] = (fs->rdcl >> 8) & 0xff; + fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; + fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; + } return 0; } @@ -494,10 +502,12 @@ namede(DOS_FS *fs, const char *path, DOS int err; err = 0; - de = dot; - if (*path == '/') - path++; + de = &fs->root; while (*path) { + while (*path == '/') + path++; + if (*path == '\0') + break; if (!(s = strchr(path, '/'))) s = strchr(path, 0); if ((n = s - path) > 255) @@ -509,8 +519,6 @@ namede(DOS_FS *fs, const char *path, DOS return ENOTDIR; if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) return err; - if (*path == '/') - path++; } *dep = de; return 0; Modified: head/lib/libstand/dosfs.h ============================================================================== --- head/lib/libstand/dosfs.h Thu Dec 19 05:22:48 2013 (r259589) +++ head/lib/libstand/dosfs.h Thu Dec 19 05:23:10 2013 (r259590) @@ -23,6 +23,8 @@ * 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 DOSIO_H @@ -108,6 +110,7 @@ typedef struct { u_int lsndta; /* start of data area */ u_int fatsz; /* FAT entry size */ u_int xclus; /* maximum cluster number */ + DOS_DE root; } DOS_FS; typedef struct { From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 05:28:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADA3F869; Thu, 19 Dec 2013 05:28:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99A0D1A78; Thu, 19 Dec 2013 05:28:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5Shjp056451; Thu, 19 Dec 2013 05:28:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5Shm0056450; Thu, 19 Dec 2013 05:28:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312190528.rBJ5Shm0056450@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 19 Dec 2013 05:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259591 - head/sys/boot/ia64/efi 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.17 Precedence: list List-Id: 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, 19 Dec 2013 05:28:43 -0000 Author: marcel Date: Thu Dec 19 05:28:43 2013 New Revision: 259591 URL: http://svnweb.freebsd.org/changeset/base/259591 Log: Bump the loader version to 3.2 after various dosfs fixes (in particular). Modified: head/sys/boot/ia64/efi/version Modified: head/sys/boot/ia64/efi/version ============================================================================== --- head/sys/boot/ia64/efi/version Thu Dec 19 05:23:10 2013 (r259590) +++ head/sys/boot/ia64/efi/version Thu Dec 19 05:28:43 2013 (r259591) @@ -3,6 +3,7 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +3.2: Various fixes to libstand, in particular dosfs. 3.1: Add the about, reboot and pbvm commands. I-cache coherency is maintained. 3.0: Add support for PBVM. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 06:08:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2E40476; Thu, 19 Dec 2013 06:08:21 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 834E61E1D; Thu, 19 Dec 2013 06:08:21 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id rBJ68KUJ019462 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 19 Dec 2013 00:08:20 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Thu, 19 Dec 2013 00:08:19 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Thu, 19 Dec 2013 06:08:18 +0000 Message-ID: <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> <52AF78B6.20706@freebsd.org> In-Reply-To: <52AF78B6.20706@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-19_03:2013-12-18,2013-12-19,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 19 Dec 2013 06:08:21 -0000 On Dec 16, 2013, at 2:03 PM, Nathan Whitehorn wrote: > On 12/16/13 15:55, Teske, Devin wrote: >> On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: >>=20 >>> On 12/16/13 15:48, Teske, Devin wrote: >>>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>>>=20 >>>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>>>=20 >>>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>>> Author: dteske >>>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>>> New Revision: 259479 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/259479 >>>>>>>=20 >>>>>>> Log: >>>>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>>>> Discussed on: -current, -stable >>>>>>> MFC after: 3 days >>>>>>>=20 >>>>>>> Modified: >>>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>=20 >>>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 20= 13 (r259478) >>>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 20= 13 (r259479) >>>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILU= RE >>>>>>> # We're all done unless we should go on for boot pool >>>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>>> Uh -- what is all of this? Why are we disabling kernel functions dep= ending on what the root filesystem is? Please don't MFC this. >>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org= /pipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILCq= %2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c= 5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org= /pipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILCq= %2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e= 3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>>>=20 >>>>> NB: Happy to rip it out... but want something in-reply to those threa= ds (pretty please). >>>> Basically... the logic is... >>>>=20 >>>> The ZFS pool is built on vdevs of a specific name. The names that are = used >>>> should remain the same. Adding this to the loader.conf ensures that th= e names >>>> that the pool(s) was/were built upon do not change. >>>>=20 >>>> This goes beyond just a swap partition I imagine. For example... copyi= ng the >>>> data to a new drive using a duplicator. I'm sure there are other cases= too. >>> Thanks for the explanation! I wonder if we should just turn off the dis= k ident stuff by default globally -- it was causing problems for me as well= without ZFS root. >> As I was making the commit to zfsboot... the very thought had occurred t= o me. >>=20 >> I'm happy to rip this out in favor of a new global default. The end-resu= lt is that >> what Johan experienced won't be repeated. >>=20 >> I think there's an urgency to get something to solve this into 10. >=20 > Yeah, I can see that. Let me bring this up on -CURRENT, with a short time= out, and see what the options are. Any updates on this? --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 06:20:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37172671; Thu, 19 Dec 2013 06:20:20 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9ED61EB9; Thu, 19 Dec 2013 06:20:19 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBJ6K8R2059052; Thu, 19 Dec 2013 08:20:08 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBJ6K8R2059052 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBJ6K8F9059051; Thu, 19 Dec 2013 08:20:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 19 Dec 2013 08:20:08 +0200 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131219062008.GK59496@kib.kiev.ua> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> <20131219002824.GA5664@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bk/e7+bhc7oa9AZn" Content-Disposition: inline In-Reply-To: <20131219002824.GA5664@dft-labs.eu> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 06:20:20 -0000 --Bk/e7+bhc7oa9AZn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 19, 2013 at 01:28:24AM +0100, Mateusz Guzik wrote: > That being said, instead of reverting the change (which would leave other= field > with similar issue in place) I propose adding the following: > --- a/sys/kern/kern_exit.c > +++ b/sys/kern/kern_exit.c > @@ -220,6 +220,12 @@ exit1(struct thread *td, int rv) > =20 > p->p_xstat =3D rv; /* Let event handler change exit status= */ > PROC_UNLOCK(p); > + > + /* > + * Some fields below are freed without having the proc locked, ch= eck > + * for P_WEXIT before accessing to make sure it is safe. > + */ > + >=20 > Which should make it clear. >=20 > But again, this is a cosmetic change and I have no strong opinion either > way. If you are still unconvinced I'm happy to revert it later. I think adding a comment is fine, but besides the comment you propose for describing what does the code do in the exit path, it is more important to put the same comment into the struct proc description. In other words, fields should be annotated to indicate which accesses require gating on exiting state. I think something similar should be done for the execing state. The kern_proc.c sysctls are already full of this knowledge, and since you are making it explicit in one case, doing the full pass makes sense. --Bk/e7+bhc7oa9AZn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSspAXAAoJEJDCuSvBvK1BqegQAKXPuyActrnrqIkjsZeswJmx 8l3IifWy8jdi37fAoPHba43TsysQk0AMIAgeUyERmM4nMOYBNUd2GlOkXLP7ixF2 2JXFNbJpPq672WrF+RvfyHUx+JtcDAQ3e76gElDrJnXBOvw7hR+oHSqJcLBQP14V 7DkCjYRV70XQxYgCeqyLdv1H5oMke6skfcrgMATarmmqt0XCgnKzAVbgnLK8QbJe 8dY4HvlofvVZRaCg6JiiurbFxT8Treg5vgNpdRS0sBP0YwF55TpQKvynnHARRhsW 8GsFCDI8sz7INXLNnb3xSq3gcu9VUBnk9l8UlWa8PKxga/CqrQupdLPuN7whRRUE sET38I/1znKhWixuFdk/Cc1Jhc36gJGUXGfy7tfexisZ+7+PTQ7ceyTIXf9nSfUj 7kMV5RHU4oIH0nbmQjI3nyTQajYv2qmyRriWaHGoyuid/3UO1uj5B2WrHn3FBdRa HJ7okbFLDznEhwxU2So7AKZYBCPCrGRoekZj/2TiPa9OMBC4y01akSYXOrSFs7gQ tGF3V498D0rhZO+n9PFMx4YOmH2zMjivmqOB2IdLQOXA6Q8CWp4nzCpObSp3pn3A nqLy71lasdyWTxmIRyylPtsTUEHmaMhVhvKTjUgcTE5Te1SP1bsBkRJdCSHX+Rzc 4Q6iWJSMOA+7znVC+lEL =pjGQ -----END PGP SIGNATURE----- --Bk/e7+bhc7oa9AZn-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 06:41:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60351A3E; Thu, 19 Dec 2013 06:41:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3354C1031; Thu, 19 Dec 2013 06:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ6fVJE084190; Thu, 19 Dec 2013 06:41:31 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ6fVC4084189; Thu, 19 Dec 2013 06:41:31 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312190641.rBJ6fVC4084189@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Dec 2013 06:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259597 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 19 Dec 2013 06:41:31 -0000 Author: dteske Date: Thu Dec 19 06:41:30 2013 New Revision: 259597 URL: http://svnweb.freebsd.org/changeset/base/259597 Log: Fix a regression that occurred with SVN revisions 259474 and 259476 where installation to 3-4+ (depending on vdev type) vdevs would result in odd error messages where the zpool `create' command appeared to repeat itself (an artifact of printf when you supply too many arguments -- caused by neglecting to properly quote the multi-word expansion of $*vdevs when creating the pool(s)). Example error below (taken from bsdinstall_log): DEBUG: zfs_create_boot: Creating root pool... DEBUG: zfs_create_boot: zpool create -o altroot=/mnt -m none -f "zroot" \ ada0p3.nop ada1p3.nopzpool create ada2p3.nop "ada3p3.nop" DEBUG: zfs_create_boot: retval=1 cannot open 'ada1p3.nopzpool': no such GEOM provider Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:39:48 2013 (r259596) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:41:30 2013 (r259597) @@ -979,7 +979,8 @@ zfs_create_boot() bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "$bootpool_options" "$bootpool_name" \ - $bootpool_vdevtype $boot_vdevs || return $FAILURE + "$bootpool_vdevtype" "$boot_vdevs" || + return $FAILURE f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE @@ -1048,7 +1049,8 @@ zfs_create_boot() f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ - "$zroot_name" $zroot_vdevtype $zroot_vdevs + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE # Customize the zroot a bit... local option From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 06:43:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E547B9C; Thu, 19 Dec 2013 06:43:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3741044; Thu, 19 Dec 2013 06:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ6hqJa084466; Thu, 19 Dec 2013 06:43:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ6hqWH084465; Thu, 19 Dec 2013 06:43:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312190643.rBJ6hqWH084465@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Dec 2013 06:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259598 - head/usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 19 Dec 2013 06:43:53 -0000 Author: dteske Date: Thu Dec 19 06:43:52 2013 New Revision: 259598 URL: http://svnweb.freebsd.org/changeset/base/259598 Log: When using a bootpool, set the cachefile property so that it gets imported automatically upon reboot to the newly installed system. MFC after: 1 day Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:41:30 2013 (r259597) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:43:52 2013 (r259598) @@ -1152,7 +1152,7 @@ zfs_create_boot() fi # While this is apparently not needed, it seems to help MBR - f_dprintf "$funcname: Configuring zpool.cache..." + f_dprintf "$funcname: Configuring zpool.cache for zroot..." f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ @@ -1174,6 +1174,12 @@ zfs_create_boot() # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS + # Set cachefile for boot pool so it auto-imports at system start + f_dprintf "$funcname: Configuring zpool.cache for boot pool..." + f_eval_catch $funcname zpool "$ZPOOL_SET" \ + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$bootpool_name" || return $FAILURE + # Some additional geli(8) requirements for loader.conf(5) for option in \ 'zpool_cache_load=\"YES\"' \ From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 09:01:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29592700; Thu, 19 Dec 2013 09:01:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15EB71B05; Thu, 19 Dec 2013 09:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ91kgA036882; Thu, 19 Dec 2013 09:01:46 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ91ko3036881; Thu, 19 Dec 2013 09:01:46 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201312190901.rBJ91ko3036881@svn.freebsd.org> From: Stefan Esser Date: Thu, 19 Dec 2013 09:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259609 - 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.17 Precedence: list List-Id: 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, 19 Dec 2013 09:01:47 -0000 Author: se Date: Thu Dec 19 09:01:46 2013 New Revision: 259609 URL: http://svnweb.freebsd.org/changeset/base/259609 Log: Fix overflow for timeout values of more than 68 years, which is the maximum covered by sbintime (LONG_MAX seconds). Some programs use timeout values in excess of 1000 years. The conversion to sbintime caused wrap-around on overflow, which resulted in short or negative timeout values. This caused long delays on sockets opened by affected programs (e.g. OpenSSH). Kernels compiled without -fno-strict-overflow were not affected, apparently because the compiler tested the sign of the timeout value before performing the multiplication that lead to overflow. When the -fno-strict-overflow option was added to CFLAGS, this optimization was disabled and the test was performed on the result of the multiplication. Negative products were caught and resulted in EINVAL being returned, but wrap-around to positive values just shortened the timeout value to the residue of the result that could be represented by sbintime. The fix is to cap the timeout values at the maximum that can be represented by sbintime, which is 2^31 - 1 seconds or more than 68 years. After this change, the kernel can be compiled with -fno-strict-overflow with no ill effects. MFC after: 3 days Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) static __inline sbintime_t timer2sbintime(intptr_t data) { - + if (data > LLONG_MAX / SBT_1MS) + return LLONG_MAX; return (SBT_1MS * data); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 11:16:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB35E528; Thu, 19 Dec 2013 11:16:17 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 31D0014ED; Thu, 19 Dec 2013 11:16:17 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E34D1421EEA; Thu, 19 Dec 2013 21:49:42 +1100 (EST) Date: Thu, 19 Dec 2013 21:49:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser Subject: Re: svn commit: r259609 - head/sys/kern In-Reply-To: <201312190901.rBJ91ko3036881@svn.freebsd.org> Message-ID: <20131219204903.V24189@besplex.bde.org> References: <201312190901.rBJ91ko3036881@svn.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=HZAtEE08 c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=YOrjK_Anl_cA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=2ZRwf33eRQXAlThll-8A:9 a=ffKMsPN5J7qry5RI:21 a=ykkCnlJT-72suRuO:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 11:16:18 -0000 On Thu, 19 Dec 2013, Stefan Esser wrote: > Log: > Fix overflow for timeout values of more than 68 years, which is the maximum > covered by sbintime (LONG_MAX seconds). Not LONG_MAX seconds, but INT32_MAX seconds. LONG_MAX seconds is about 2**32 times larger on 64-bit arches. sbintimes and their complexity give many more possibilities for overflow. I thought that the new overflow bugs and some old ones were already fixed. > Some programs use timeout values in excess of 1000 years. The conversion > to sbintime caused wrap-around on overflow, which resulted in short or > negative timeout values. This caused long delays on sockets opened by > affected programs (e.g. OpenSSH). > > Kernels compiled without -fno-strict-overflow were not affected, apparently > because the compiler tested the sign of the timeout value before performing > the multiplication that lead to overflow. I think it just gave a garbage value that was accidentally less harmful. > When the -fno-strict-overflow option was added to CFLAGS, this optimization > was disabled and the test was performed on the result of the multiplication. > Negative products were caught and resulted in EINVAL being returned, but > wrap-around to positive values just shortened the timeout value to the > residue of the result that could be represented by sbintime. This shows one reason why -fno-strict-overflow shouldn't be used. It just wastes time to give different undefined behaviour with undocumented details. > The fix is to cap the timeout values at the maximum that can be represented > by sbintime, which is 2^31 - 1 seconds or more than 68 years. 2^31 - 1 is a correct spelling of INT32_MAX, unlike LONG_MAX. > After this change, the kernel can be compiled with -fno-strict-overflow > with no ill effects. > Modified: head/sys/kern/kern_event.c > ============================================================================== > --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) > +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) > @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) > static __inline sbintime_t > timer2sbintime(intptr_t data) > { > - > + if (data > LLONG_MAX / SBT_1MS) > + return LLONG_MAX; > return (SBT_1MS * data); > } This has the following style bugs: - it removes the empty line after the (null) declarations - it is missing parentheses around the return value - it uses the long long abomination This has the following type errors: - using the long long abomination is not just a style bug. sbintime_t has type int64_t, not long long. The overflow check will break if long long becomes longer than int64_t - returning LLONG_MAX is usually just a style bug. When long long is longer than int64_t, the return value will overflow, but the implementation-defined behaviour for this is usually to convert it to the correct value. INT64_MAX is a dangerous default maximum timeout. You can't even add the minimum sbintime_t of 2**-32 seconds to this without overflowing. Old timeout code used the following method to reduce the problem of overflowing timeouts: For alarm() and setitimer(), limit the timeout to 100 million seconds (3.17 years) and return EINVAL if it is too large. This works with 32-bit time_t until about 2035. POSIX doesn't allow this. Clamping the time to 100 million seconds isn't allowed either, since the residual time can be seen from applications. Note that 64-bit time_t has little effect on this problem. Uses wishing to overflow the kernel simply ask for a timeout in a timeval of INT64_MAX seconds plus 999999 seconds so that adding just 1 microseconds to it overflow. With seconds in sbintime_t instead of in time_t, overflow occurs much sooner. This is quite broken now: - the limit of 100000000 used to be enforced in itimerfix(), but this was removed in connection with implementing POSIX realtime timers without even breaking the documentaion to match or touching PR(s) about the POSIX non-conformance of the limit. - setitimer() mostly uses sbintimes now, so the old limit is irrelevant and enforcing it in itimerfix() would break the new sbintime code and presumably the not so new realtime timers code. The sbintime code uses a modified limit that is also not allowed by POSIX. This limit is of course undocumented. It is INT32_MAX / 2, so that there is plenty of room for expansion. This is what the above should use, modulo the conformance bug. EINVAL is returned when this limit is exceeded. - select() and poll() were more careful and seem to be correct now. The timeout in poll() is limited to INT_MAX milliseconds, so it fits in sbintime_t. Except this assumes that int is 32 bits. select() limits the timeout to INT32_MAX seconds so that it is representable as an sbintime_t and then does a further overflow check involving INT64_MAX. When overflow would occur, it sets asbt to -1, which I think means an infinite timeout. I don't like this. -1 is a tiny amount less than 0, not near plus infinity. - nanosleep() used to be less careful than select() and poll(), but seems to have been fixed. For some reason, it uses a mixture of the above methods. It limits sleep times to INT32_MAX / 2 seconds but repeats the sleep as necessary so as not to return an error. The logic for this is subtle and I haven't checked it. davide@ has patches related to fixing this, but none seem to have been committed yet, except some old ones that gave some of the above overflow checking. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 11:57:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED07253A; Thu, 19 Dec 2013 11:57:38 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5F917FA; Thu, 19 Dec 2013 11:57:37 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBJBvZIB069553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Dec 2013 15:57:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBJBvZY9069552; Thu, 19 Dec 2013 15:57:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Dec 2013 15:57:35 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131219115735.GN29088@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> <201312181640.52147.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181640.52147.jhb@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 11:57:39 -0000 On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: J> > On 18.12.2013 22:45, John-Mark Gurney wrote: J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: J> > >> Author: melifaro J> > >> Date: Wed Dec 18 18:25:27 2013 J> > >> New Revision: 259562 J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 J> > >> J> > >> Log: J> > >> Switch netstat -rn to use standard API for retrieving list of routes J> > >> instead of peeking inside in-kernel radix via kget. J> > >> This permits us to change kernel structures without breaking userland. J> > >> Additionally, this change provide more reliable and faster output. J> > >> J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W J> > >> for other families) were removed. `Refs` is radix-specific thing J> > >> which is not informative for users. `Use` field value is handy sometimes, J> > >> but a) current API does not support it and b) I'm not sure we will J> > >> support per-rte pcpu counters in near future. J> > >> J> > >> Old method of retrieving data is still supported (either by defining J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are J> > >> hidden. J> > >> J> > >> Sponsored by: Yandex LLC J> > >> MFC after: 4 weeks J> > >> PR: kern/167204 J> > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will J> > > this change make it not usable, or will you still automatically use J> > Well. It will probably break in (maybe, near) future. J> J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's J> fine if kvm mode is fragile and requires the binary to be in sync with the J> kernel and is only used for crash dumps, but it is very useful to extract J> all sorts of info out of a crash dump. The problem is that these tools (netstat, and some others) prevent us from improving the kernel network stack. We can't make improvements that are mergeable to stable/x branch, since the tools would be broken. Moreover any improvement in head/, requires from developer additional work in netstat code, which I must admit isn't a pleasure to work with. And any improvement in head adds additional incompatibility between newer kernel and older world, which is of course allowed in CURRENT, but still we'd prefer to reduce number of such events. I agree that usage of tools on vmcores is useful. But we all should agree that it has very limited use. Only kernel hackers and developers are expected to do this. However, speaking of myself, I was never interested in routing table from a vmcore neither interface statistics, when fixing a bug in networking stack, and I've fixed quite a lot of them. Still, I believe, that some developers find this useful. My suggestion is that all this code is deleted from src/usr.bin/netstat, and moved to src/tools, and we relax assertion that src/tools must be compatible with any kernel within the branch. So, any person who wants this functionality, needs to keep his src/tools in sync with kernel and compile a tool when he desires to dump routing table from a vmcore. Finally, when we remove all the kvm(3) usage from a tool, then we can remove the sugid bit from it, which would be a another fine point. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 12:00:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98C8575C; Thu, 19 Dec 2013 12:00:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8506A18A4; Thu, 19 Dec 2013 12:00:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJC0mG5001225; Thu, 19 Dec 2013 12:00:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJC0mXm001223; Thu, 19 Dec 2013 12:00:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201312191200.rBJC0mXm001223@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Dec 2013 12:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259612 - head/sys/dev/drm2/ttm 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.17 Precedence: list List-Id: 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, 19 Dec 2013 12:00:48 -0000 Author: avg Date: Thu Dec 19 12:00:48 2013 New Revision: 259612 URL: http://svnweb.freebsd.org/changeset/base/259612 Log: ttm_bo_vm_lookup_rb: actually make use of the red-black tree Previously the code would just iterate over the whole tree as if it were just a list. Without this change I would observe X server becoming more and more jerky over time. MFC after: 5 days Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Dec 19 10:28:54 2013 (r259611) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Dec 19 12:00:48 2013 (r259612) @@ -76,13 +76,16 @@ static struct ttm_buffer_object *ttm_bo_ struct ttm_buffer_object *bo; struct ttm_buffer_object *best_bo = NULL; - RB_FOREACH(bo, ttm_bo_device_buffer_objects, &bdev->addr_space_rb) { + bo = RB_ROOT(&bdev->addr_space_rb); + while (bo != NULL) { cur_offset = bo->vm_node->start; if (page_start >= cur_offset) { best_bo = bo; if (page_start == cur_offset) break; - } + bo = RB_RIGHT(bo, vm_rb); + } else + bo = RB_LEFT(bo, vm_rb); } if (unlikely(best_bo == NULL)) From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 15:31:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6455022B; Thu, 19 Dec 2013 15:31:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5037E1ADD; Thu, 19 Dec 2013 15:31:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJFVLR7083115; Thu, 19 Dec 2013 15:31:21 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJFVKRf083112; Thu, 19 Dec 2013 15:31:20 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312191531.rBJFVKRf083112@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 19 Dec 2013 15:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259615 - head/sys/dev/vt 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.17 Precedence: list List-Id: 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, 19 Dec 2013 15:31:21 -0000 Author: ray Date: Thu Dec 19 15:31:20 2013 New Revision: 259615 URL: http://svnweb.freebsd.org/changeset/base/259615 Log: Enable mouse support for terminal clients (like dialog(1)). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_sysmouse.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt.h Thu Dec 19 15:31:20 2013 (r259615) @@ -412,7 +412,7 @@ int vtfont_load(vfnt_t *f, struct vt_f /* Sysmouse. */ void sysmouse_process_event(mouse_info_t *mi); #ifndef SC_NO_CUTPASTE -void vt_mouse_event(int type, int x, int y, int event, int cnt); +void vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel); void vt_mouse_state(int show); #endif #define VT_MOUSE_SHOW 1 Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt_core.c Thu Dec 19 15:31:20 2013 (r259615) @@ -1120,8 +1120,68 @@ finish_vt_acq(struct vt_window *vw) } #ifndef SC_NO_CUTPASTE +static void +vt_mouse_terminput_button(struct vt_device *vd, int button) +{ + struct vt_window *vw; + struct vt_font *vf; + char mouseb[6] = "\x1B[M"; + int i, x, y; + + vw = vd->vd_curwindow; + vf = vw->vw_font; + + /* Translate to char position. */ + x = vd->vd_mx / vf->vf_width; + y = vd->vd_my / vf->vf_height; + /* Avoid overflow. */ + x = MIN(x, 255 - '!'); + y = MIN(y, 255 - '!'); + + mouseb[3] = ' ' + button; + mouseb[4] = '!' + x; + mouseb[5] = '!' + y; + + for (i = 0; i < sizeof(mouseb); i++ ) + terminal_input_char(vw->vw_terminal, mouseb[i]); +} + +static void +vt_mouse_terminput(struct vt_device *vd, int type, int x, int y, int event, + int cnt) +{ + + switch (type) { + case MOUSE_BUTTON_EVENT: + if (cnt > 0) { + /* Mouse button pressed. */ + if (event & MOUSE_BUTTON1DOWN) + vt_mouse_terminput_button(vd, 0); + if (event & MOUSE_BUTTON2DOWN) + vt_mouse_terminput_button(vd, 1); + if (event & MOUSE_BUTTON3DOWN) + vt_mouse_terminput_button(vd, 2); + } else { + /* Mouse button released. */ + vt_mouse_terminput_button(vd, 3); + } + break; +#ifdef notyet + case MOUSE_MOTION_EVENT: + if (mouse->u.data.z < 0) { + /* Scroll up. */ + sc_mouse_input_button(vd, 64); + } else if (mouse->u.data.z > 0) { + /* Scroll down. */ + sc_mouse_input_button(vd, 65); + } + break; +#endif + } +} + void -vt_mouse_event(int type, int x, int y, int event, int cnt) +vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel) { struct vt_device *vd; struct vt_window *vw; @@ -1146,6 +1206,9 @@ vt_mouse_event(int type, int x, int y, i * under mouse pointer when nothing changed. */ + if (mlevel > 0) + vt_mouse_terminput(vd, type, x, y, event, cnt); + switch (type) { case MOUSE_ACTION: case MOUSE_MOTION_EVENT: Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt_sysmouse.c Thu Dec 19 15:31:20 2013 (r259615) @@ -192,7 +192,8 @@ sysmouse_process_event(mouse_info_t *mi) #ifndef SC_NO_CUTPASTE mtx_unlock(&sysmouse_lock); - vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value); + vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value, + sysmouse_level); return; #endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 15:41:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE9B856; Thu, 19 Dec 2013 15:41:17 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4F61CC6; Thu, 19 Dec 2013 15:41:17 +0000 (UTC) Received: from [192.168.1.73] (254C556E.nat.pool.telekom.hu [37.76.85.110]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rBJFellg069324 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 07:41:08 -0800 (PST) (envelope-from julian@elischer.org) Message-ID: <52B3137A.4000805@elischer.org> Date: Thu, 19 Dec 2013 16:40:42 +0100 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John Baldwin , Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> In-Reply-To: <201312171434.01345.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 15:41:17 -0000 On 12/17/13, 8:34 PM, John Baldwin wrote: > On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: >> On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: >>> On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: >>>> Author: mjg >>>> Date: Sun Dec 15 04:11:43 2013 >>>> New Revision: 259407 >>>> URL: http://svnweb.freebsd.org/changeset/base/259407 >>>> >>>> Log: >>>> proc exit: don't take PROC_LOCK while freeing rlimits >>>> >>>> Code wishing to check rlimits of some process should check whether it >>>> is exiting first, which current consumers do. >>> Does this measurably reduce contention? >>> >> No, this is just a cosmetic change I did while doing some other work >> with rlimits. >> >> It would use some more cosmetic work (e.g. no reason not to >> lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that >> later unless this kind of stuff is unwanted. > I find it useful to leave the locking in place so it is clear that p_limit is > always written to with the lock held. If we ever got a static analyzer that > understood locking rules then leaving this locking in would reduce false > positives. When I first did locking for fields in struct proc I did it by > hand based on grepping the source tree for all uses of a field and ensuring > they were locked. I think it might be more confusing later on for another > reader to see unlocked access and then have to think about why that is safe. > leave the locks there but commented out with an explanatory comment. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 17:01:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CEE0642 for ; Thu, 19 Dec 2013 17:01:15 +0000 (UTC) Received: from nm31.bullet.mail.ir2.yahoo.com (nm31.bullet.mail.ir2.yahoo.com [212.82.96.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0331357 for ; Thu, 19 Dec 2013 17:01:13 +0000 (UTC) Received: from [212.82.98.125] by nm31.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 Received: from [46.228.39.95] by tm18.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 Received: from [127.0.0.1] by smtp132.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 X-Yahoo-Newman-Id: 678763.25012.bm@smtp132.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kt4LMN0VM1k7EeEP4RrEdMGKGubpuhRCMc5Uz10iIIYezvj G2kVjRv72BWBWB1.7tvGNWwNKTEboW4idJywY_TXUdxBi8ukAkOUU0cg9aSL QStw3m15Xc46fHc55yIuUHHe0ot6Mzg.8TND_uZShyqosn39SldT1ssjdxHB KBiJqRbzKr38Pi5OBkQ_5ns6K00yjJruMyZ3rvCoQggD.Ls42o1pDG8iyHDl Fzj9IWQQA5utxE43yDp5brQt0atQ5.Jan3V3FBb8Y2B2njpLZ6cqtUSJtXwI WGi564IuRJQMSU4sLedU5rTgGhGQtgfPTWbJo0kTuJLQBTTDWkZ8FYgI94l. lrxTVnmkjIfKdKOHjRFkpSOAlL1hJvecG3XcjWj32Z18ikwsmNF_s.CSOKcb mlhhsBKGqMxQYs10deyKq_AB5fZSFET0pSEkRntXo.u_m6LukJGWOYJDOgyO 45mfK5bs54Oz8F6j7Qm6n6L9Y.LVYVJv53b20xw9T6F2Y26lrvMSRwzk8mQE vqlilQyXOZBq_Hz2Ugd.rGhpAf60X3w-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.11] (se@84.154.112.54 with plain [188.125.69.59]) by smtp132.mail.ir2.yahoo.com with SMTP; 19 Dec 2013 17:01:02 +0000 UTC Message-ID: <52B32647.2030008@freebsd.org> Date: Thu, 19 Dec 2013 18:00:55 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Bruce Evans , Stefan Esser Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> In-Reply-To: <20131219204903.V24189@besplex.bde.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 17:01:15 -0000 Am 19.12.2013 11:49, schrieb Bruce Evans: > On Thu, 19 Dec 2013, Stefan Esser wrote: > >> Log: >> Fix overflow for timeout values of more than 68 years, which is the >> maximum >> covered by sbintime (LONG_MAX seconds). > > Not LONG_MAX seconds, but INT32_MAX seconds. LONG_MAX seconds is about > 2**32 > times larger on 64-bit arches. Hi Bruce, yes, you are of course correct ... The limit is 2^31-2^-32 seconds, to be exact ;-) This is represented by LONG_MAX in sbintime, which made me use that wrong constant in the commit message. > sbintimes and their complexity give many more possibilities for overflow. > I thought that the new overflow bugs and some old ones were already fixed. > >> Some programs use timeout values in excess of 1000 years. The conversion >> to sbintime caused wrap-around on overflow, which resulted in short or >> negative timeout values. This caused long delays on sockets opened by >> affected programs (e.g. OpenSSH). >> >> Kernels compiled without -fno-strict-overflow were not affected, >> apparently >> because the compiler tested the sign of the timeout value before >> performing >> the multiplication that lead to overflow. > > I think it just gave a garbage value that was accidentally less harmful. The result of the multiplication was performed modulo 2^64 due to the limited range of the operation. The result was then interpreted as a signed 64 bit 2s-complement number. The factor 2^32/1000 is 0x418937, which multiplied with a round decimal number over 1000*2^32 will result in "random" bit sequence in the resulting sbintime. Half the values will have been positive, and many will have corresponded to substantial timeout values, but some will have been very low, resulting in unexpectedly low timeouts. >> When the -fno-strict-overflow option was added to CFLAGS, this >> optimization >> was disabled and the test was performed on the result of the >> multiplication. >> Negative products were caught and resulted in EINVAL being returned, but >> wrap-around to positive values just shortened the timeout value to the >> residue of the result that could be represented by sbintime. > > This shows one reason why -fno-strict-overflow shouldn't be used. It just > wastes time to give different undefined behaviour with undocumented > details. Well, I thought so when I found the cause of the breakage (long delays opening TCP connections) that were the result of the compilation with -fno-strict-overflow. But I reconsidered, because a real bug in the code has been identied, this way. The bug existed, without being detected (because too short but non-zero timeout values were caught at the application layer, which just re-issued the call with the remaining time as timeout parameter). If applications didn't have to worry about short timeouts for other reasons, then this bug would have led to observable problems, even with -fno-strict-overflow. >> The fix is to cap the timeout values at the maximum that can be >> represented >> by sbintime, which is 2^31 - 1 seconds or more than 68 years. > > 2^31 - 1 is a correct spelling of INT32_MAX, unlike LONG_MAX. Yes, sbintime is defined in units of 2^-32 seconds, which makes the highest representable time exactly (2^31 - 2^-32) seconds. This value is represented by LLONG_MAX units of 2^32 seconds ... >> After this change, the kernel can be compiled with -fno-strict-overflow >> with no ill effects. > >> Modified: head/sys/kern/kern_event.c >> ============================================================================== >> >> --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) >> +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) >> @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) >> static __inline sbintime_t >> timer2sbintime(intptr_t data) >> { >> - >> + if (data > LLONG_MAX / SBT_1MS) >> + return LLONG_MAX; >> return (SBT_1MS * data); >> } > > This has the following style bugs: > - it removes the empty line after the (null) declarations > - it is missing parentheses around the return value > - it uses the long long abomination Ughh, I'll fix the style bugs ... It had taken me several hours over the last week to find this bug, and I committed the fix that worked on my system without making it compliant with FreeBSD style. Sorry for that ... > This has the following type errors: > - using the long long abomination is not just a style bug. sbintime_t has > type int64_t, not long long. The overflow check will break if long long > becomes longer than int64_t The definition of sbintime is int64_t on all architectures. If any architecture used a wider integer type for sbintime, the fix would just limit the maximum timeout to 68 years (instead of many magnitudes longer than the universe will last), which is still way beyond any sensible timeout value. And functions will have to check for too short timeouts to be robust, anyway. The functions in kern_timeout.c heavily depend on sbintime having at least 64 bits and perform calculations under the assumption, that no value above INT64_MAX can be passed as sbintime. So, even if there was a wider sbintime, the highest value supported was still represented by INT64_MAX. > - returning LLONG_MAX is usually just a style bug. When long long is > longer > than int64_t, the return value will overflow, but the > implementation-defined > behaviour for this is usually to convert it to the correct value. Yes, it was a silly mistake to use LLONG_MAX, even though it is identical to INT64_MAX on all architectures currently supported by FreeBSD. > INT64_MAX is a dangerous default maximum timeout. You can't even add the > minimum sbintime_t of 2**-32 seconds to this without overflowing. The function timer2sbintime is used in only two places in the kernel, one being filt_timerattach(), which caused the kernel breakage, the other with a constant timeout of 0. No further additions are ever performed on the value, so there is no risk of overflow. The function is declared "static inline", and will therefore not be called from outside of this source file. > Old timeout code used the following method to reduce the problem of > overflowing timeouts: > For alarm() and setitimer(), limit the timeout to 100 million seconds > (3.17 years) and return EINVAL if it is too large. This works with > 32-bit time_t until about 2035. POSIX doesn't allow this. Clamping > the time to 100 million seconds isn't allowed either, since the > residual time can be seen from applications. Note that 64-bit time_t > has little effect on this problem. Uses wishing to overflow the kernel > simply ask for a timeout in a timeval of INT64_MAX seconds plus 999999 > seconds so that adding just 1 microseconds to it overflow. With > seconds in sbintime_t instead of in time_t, overflow occurs much > sooner. The brokenness of the kernel compiled with -fno-strict-overflow was due to EINVAL being returned to callers of filt_timerattach(), which apparently did not check that return code (or at least endlessly retried with the same invalid timeout parameter). > This is quite broken now: > - the limit of 100000000 used to be enforced in itimerfix(), but this was > removed in connection with implementing POSIX realtime timers without > even breaking the documentaion to match or touching PR(s) about the > POSIX non-conformance of the limit. > - setitimer() mostly uses sbintimes now, so the old limit is irrelevant > and enforcing it in itimerfix() would break the new sbintime code and > presumably the not so new realtime timers code. The sbintime code > uses a modified limit that is also not allowed by POSIX. This limit is > of course undocumented. It is INT32_MAX / 2, so that there is plenty > of room for expansion. This is what the above should use, modulo the > conformance bug. EINVAL is returned when this limit is exceeded. Are you sure about the limit of INT32_MAX / 2 (i.e. 2^30 -1) seconds? My reading is that sbintime = INT64_MAX represents (2^31-2^-32) seconds, and that this value is correctly treated in the timeout code. It is possible to pass values of more than 2^31 seconds to setitimer() on architectures where time_t is defined as int64_t. There are no tests for overflow in tvtosbt() in /sys/sys/time.h. > - select() and poll() were more careful and seem to be correct now. > The timeout in poll() is limited to INT_MAX milliseconds, so it fits > in sbintime_t. Except this assumes that int is 32 bits. select() > limits the timeout to INT32_MAX seconds so that it is representable > as an sbintime_t and then does a further overflow check involving > INT64_MAX. When overflow would occur, it sets asbt to -1, which I > think means an infinite timeout. I don't like this. -1 is a tiny > amount less than 0, not near plus infinity. > - nanosleep() used to be less careful than select() and poll(), but seems > to have been fixed. For some reason, it uses a mixture of the above > methods. It limits sleep times to INT32_MAX / 2 seconds but repeats > the sleep as necessary so as not to return an error. The logic for > this is subtle and I haven't checked it. I just looked at nanosleep() and have to admit, that I do not fully understand its semantics. A tv_nsec value < 0 or > 10^9 results in EINVAL, while a negative tv_sec is silently treated as 0. If a timeout of 2^30 seconds or more is requested, the sleep time is limited to 2^30 - 1 seconds, but the difference is returned in the timespec value pointed to by the optional return value pointer (if present). That value may thus be non-zero, even if the function had returned 0 (indicating that the timeout has occured). At least for the case of tv_sec in the range of 2^30 to 2^31-1, the caller will assume that the full time has elapsed, while in fact only 2^30 seconds have passed and the call should be repeated with the remaining sleep time returned in rmtp ... > davide@ has patches related to fixing this, but none seem to have been > committed yet, except some old ones that gave some of the above overflow > checking. Thanks for the detailed information and sorry about the style violation. I'll fix it, if consensus is reached about the correct style. I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the missing empty line: static __inline sbintime_t timer2sbintime(intptr_t data) { if (data > INT64_MAX / SBT_1MS) return INT64_MAX; return (SBT_1MS * data); } If you can show evidence that a limit of INT64_MAX/2 is more appropriate (2^30 seconds or 34 years), the limit could be of course be reduced to that value. I could not find any code that would not tolerate INT64_MAX, though ... Regards, STefan From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 17:24:22 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AC18C63; Thu, 19 Dec 2013 17:24:22 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2111569; Thu, 19 Dec 2013 17:24:21 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBJHOKGn041823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 09:24:21 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBJHOKUL041822; Thu, 19 Dec 2013 09:24:20 -0800 (PST) (envelope-from jmg) Date: Thu, 19 Dec 2013 09:24:20 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131219172420.GS99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131219115735.GN29088@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 19 Dec 2013 09:24:21 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Alexander V. Chernikov" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 17:24:22 -0000 Gleb Smirnoff wrote this message on Thu, Dec 19, 2013 at 15:57 +0400: > On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: > J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > J> > On 18.12.2013 22:45, John-Mark Gurney wrote: > J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > J> > >> Author: melifaro > J> > >> Date: Wed Dec 18 18:25:27 2013 > J> > >> New Revision: 259562 > J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > J> > >> > J> > >> Log: > J> > >> Switch netstat -rn to use standard API for retrieving list of routes > J> > >> instead of peeking inside in-kernel radix via kget. > J> > >> This permits us to change kernel structures without breaking userland. > J> > >> Additionally, this change provide more reliable and faster output. > J> > >> > J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > J> > >> for other families) were removed. `Refs` is radix-specific thing > J> > >> which is not informative for users. `Use` field value is handy sometimes, > J> > >> but a) current API does not support it and b) I'm not sure we will > J> > >> support per-rte pcpu counters in near future. > J> > >> > J> > >> Old method of retrieving data is still supported (either by defining > J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > J> > >> hidden. > J> > >> > J> > >> Sponsored by: Yandex LLC > J> > >> MFC after: 4 weeks > J> > >> PR: kern/167204 > J> > > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > J> > > this change make it not usable, or will you still automatically use > J> > Well. It will probably break in (maybe, near) future. > J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's > J> fine if kvm mode is fragile and requires the binary to be in sync with the > J> kernel and is only used for crash dumps, but it is very useful to extract > J> all sorts of info out of a crash dump. > > The problem is that these tools (netstat, and some others) prevent us from > improving the kernel network stack. We can't make improvements that are > mergeable to stable/x branch, since the tools would be broken. Moreover > any improvement in head/, requires from developer additional work in netstat > code, which I must admit isn't a pleasure to work with. And any improvement > in head adds additional incompatibility between newer kernel and older world, > which is of course allowed in CURRENT, but still we'd prefer to reduce number > of such events. I've thought about this issue a bit, and I realized that w/ ctf (from dtrace) that we could make netstat and related tools be able to understand what fields are available, even w/ older/different kernels... It does mean we'd have to be careful not to repurpose struct names, but that shouldn't be too hard... I haven't been happy w/ reading raw structs, but w/ ctf, there would be "meaning" behind the data... We could even add a SYSCTL_ that prepends the data w/ the CTF data and the tool could support both methods... > I agree that usage of tools on vmcores is useful. But we all should agree that > it has very limited use. Only kernel hackers and developers are expected to > do this. However, speaking of myself, I was never interested in routing table > from a vmcore neither interface statistics, when fixing a bug in networking stack, > and I've fixed quite a lot of them. Still, I believe, that some developers find > this useful. > > My suggestion is that all this code is deleted from src/usr.bin/netstat, and > moved to src/tools, and we relax assertion that src/tools must be compatible > with any kernel within the branch. So, any person who wants this functionality, > needs to keep his src/tools in sync with kernel and compile a tool when he > desires to dump routing table from a vmcore. Having recently debugged a kernel issue, it was very nice that tools like dmesg could operate on a core... > Finally, when we remove all the kvm(3) usage from a tool, then we can remove > the sugid bit from it, which would be a another fine point. Which is a good thing, but shouldn't need to remove the kvm access.. We have dual kvm/sysctl access for most things in the kernel... Once a tool has completed sysctl access for all data it needs, why would it need the sgid bit? I will admit, I've never liked having dual access... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 18:27:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9356F370; Thu, 19 Dec 2013 18:27:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD1A1A4E; Thu, 19 Dec 2013 18:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJIRagN047332; Thu, 19 Dec 2013 18:27:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJIRWPc047314; Thu, 19 Dec 2013 18:27:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312191827.rBJIRWPc047314@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Dec 2013 18:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259619 - in head/contrib/gcc: . cp 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.17 Precedence: list List-Id: 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, 19 Dec 2013 18:27:36 -0000 Author: pfg Date: Thu Dec 19 18:27:32 2013 New Revision: 259619 URL: http://svnweb.freebsd.org/changeset/base/259619 Log: gcc: backport upstream fix for issue with C++'s placement new Fixes GCC libstdc++/29286 Obtained from: gcc 4.3 (rev. 125603, 125653; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/init.c head/contrib/gcc/doc/c-tree.texi head/contrib/gcc/expr.c head/contrib/gcc/gimple-low.c head/contrib/gcc/gimplify.c head/contrib/gcc/omp-low.c head/contrib/gcc/print-tree.c head/contrib/gcc/tree-gimple.c head/contrib/gcc/tree-inline.c head/contrib/gcc/tree-pretty-print.c head/contrib/gcc/tree-ssa-alias.c head/contrib/gcc/tree-ssa-dce.c head/contrib/gcc/tree-ssa-operands.c head/contrib/gcc/tree-ssa-structalias.c head/contrib/gcc/tree.def head/contrib/gcc/tree.h Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 18:27:32 2013 (r259619) @@ -65,6 +65,48 @@ fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. +2007-06-12 Ian Lance Taylor (r125653) + Daniel Berlin + + PR libstdc++/29286 + * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR. + * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define. + (CHANGE_DYNAMIC_TYPE_LOCATION): Define. + (DECL_NO_TBAA_P): Define. + (struct tree_decl_common): Add no_tbaa_flag field. + * tree-ssa-structalias.c (struct variable_info): Add + no_tbaa_pruning field. + (new_var_info): Initialize no_tbaa_pruning field. + (unify_nodes): Copy no_tbaa_pruning field. + (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR. + (dump_solution_for_var): Print no_tbaa_pruning flag. + (set_uids_in_ptset): Add no_tbaa_pruning parameter. Change all + callers. + (compute_tbaa_pruning): New static function. + (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes. + Call compute_tbaa_pruning. + * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers. + * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR. + * gimple-low.c (lower_stmt): Likewise. + * tree-gimple.c (is_gimple_stmt): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. + * tree-inline.c (estimate_num_insns_1): Likewise. + (copy_result_decl_to_var): Likewise. + * expr.c (expand_expr_real_1): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag. + * omp-low.c (omp_copy_decl_2): Likewise. + * print-tree.c (print_node): Print DECL_NO_TBAA_P flag. + * doc/c-tree.texi (Expression trees): Document + CHANGE_DYNAMIC_TYPE_EXPR. + +2007-06-09 Daniel Berlin (r125603) + + * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd + parameter, use it. + (find_what_p_points_to): Pass new parameter to set_uids_in_ptset. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:27:32 2013 (r259619) @@ -25,6 +25,12 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. +2007-06-12 Ian Lance Taylor (r125653) + + PR libstdc++/29286 + * init.c (avoid_placement_new_aliasing): New static function. + (build_new_1): Call it. + 2007-05-31 Daniel Berlin (r125239) * typeck.c (build_binary_op): Include types in error. Modified: head/contrib/gcc/cp/init.c ============================================================================== --- head/contrib/gcc/cp/init.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/cp/init.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,6 +1,7 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1564,6 +1565,55 @@ build_raw_new_expr (tree placement, tree return new_expr; } +/* Make sure that there are no aliasing issues with T, a placement new + expression applied to PLACEMENT, by recording the change in dynamic + type. If placement new is inlined, as it is with libstdc++, and if + the type of the placement new differs from the type of the + placement location itself, then alias analysis may think it is OK + to interchange writes to the location from before the placement new + and from after the placement new. We have to prevent type-based + alias analysis from applying. PLACEMENT may be NULL, which means + that we couldn't capture it in a temporary variable, in which case + we use a memory clobber. */ + +static tree +avoid_placement_new_aliasing (tree t, tree placement) +{ + tree type_change; + + if (processing_template_decl) + return t; + + /* If we are not using type based aliasing, we don't have to do + anything. */ + if (!flag_strict_aliasing) + return t; + + /* If we have a pointer and a location, record the change in dynamic + type. Otherwise we need a general memory clobber. */ + if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE + && placement != NULL_TREE + && TREE_CODE (TREE_TYPE (placement)) == POINTER_TYPE) + type_change = build_stmt (CHANGE_DYNAMIC_TYPE_EXPR, + TREE_TYPE (t), + placement); + else + { + /* Build a memory clobber. */ + type_change = build_stmt (ASM_EXPR, + build_string (0, ""), + NULL_TREE, + NULL_TREE, + tree_cons (NULL_TREE, + build_string (6, "memory"), + NULL_TREE)); + + ASM_VOLATILE_P (type_change) = 1; + } + + return build2 (COMPOUND_EXPR, TREE_TYPE (t), type_change, t); +} + /* Generate code for a new-expression, including calling the "operator new" function, initializing the object, and, if an exception occurs during construction, cleaning up. The arguments are as for @@ -1607,6 +1657,7 @@ build_new_1 (tree placement, tree type, beginning of the storage allocated for an array-new expression in order to store the number of elements. */ tree cookie_size = NULL_TREE; + tree placement_var; /* True if the function we are calling is a placement allocation function. */ bool placement_allocation_fn_p; @@ -1700,6 +1751,20 @@ build_new_1 (tree placement, tree type, alloc_fn = NULL_TREE; + /* If PLACEMENT is a simple pointer type, then copy it into + PLACEMENT_VAR. */ + if (processing_template_decl + || placement == NULL_TREE + || TREE_CHAIN (placement) != NULL_TREE + || TREE_CODE (TREE_TYPE (TREE_VALUE (placement))) != POINTER_TYPE) + placement_var = NULL_TREE; + else + { + placement_var = get_temp_regvar (TREE_TYPE (TREE_VALUE (placement)), + TREE_VALUE (placement)); + placement = tree_cons (NULL_TREE, placement_var, NULL_TREE); + } + /* Allocate the object. */ if (! placement && TYPE_FOR_JAVA (elt_type)) { @@ -1792,7 +1857,12 @@ build_new_1 (tree placement, tree type, /* In the simple case, we can stop now. */ pointer_type = build_pointer_type (type); if (!cookie_size && !is_initialized) - return build_nop (pointer_type, alloc_call); + { + rval = build_nop (pointer_type, alloc_call); + if (placement != NULL) + rval = avoid_placement_new_aliasing (rval, placement_var); + return rval; + } /* While we're working, use a pointer to the type we've actually allocated. Store the result of the call in a variable so that we @@ -2051,6 +2121,9 @@ build_new_1 (tree placement, tree type, /* A new-expression is never an lvalue. */ gcc_assert (!lvalue_p (rval)); + if (placement != NULL) + rval = avoid_placement_new_aliasing (rval, placement_var); + return rval; } Modified: head/contrib/gcc/doc/c-tree.texi ============================================================================== --- head/contrib/gcc/doc/c-tree.texi Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/doc/c-tree.texi Thu Dec 19 18:27:32 2013 (r259619) @@ -1916,6 +1916,7 @@ This macro returns the attributes on the @tindex TARGET_EXPR @tindex AGGR_INIT_EXPR @tindex VA_ARG_EXPR +@tindex CHANGE_DYNAMIC_TYPE_EXPR @tindex OMP_PARALLEL @tindex OMP_FOR @tindex OMP_SECTIONS @@ -2572,6 +2573,13 @@ mechanism. It represents expressions li Its @code{TREE_TYPE} yields the tree representation for @code{type} and its sole argument yields the representation for @code{ap}. +@item CHANGE_DYNAMIC_TYPE_EXPR +Indicates the special aliasing required by C++ placement new. It has +two operands: a type and a location. It means that the dynamic type +of the location is changing to be the specified type. The alias +analysis code takes this into account when doing type based alias +analysis. + @item OMP_PARALLEL Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/expr.c Thu Dec 19 18:27:32 2013 (r259619) @@ -8718,6 +8718,13 @@ expand_expr_real_1 (tree exp, rtx target /* Lowered by gimplify.c. */ gcc_unreachable (); + case CHANGE_DYNAMIC_TYPE_EXPR: + /* This is ignored at the RTL level. The tree level set + DECL_POINTER_ALIAS_SET of any variable to be 0, which is + overkill for the RTL layer but is all that we can + represent. */ + return const0_rtx; + case EXC_PTR_EXPR: return get_exception_pointer (cfun); Modified: head/contrib/gcc/gimple-low.c ============================================================================== --- head/contrib/gcc/gimple-low.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/gimple-low.c Thu Dec 19 18:27:32 2013 (r259619) @@ -243,6 +243,7 @@ lower_stmt (tree_stmt_iterator *tsi, str case GOTO_EXPR: case LABEL_EXPR: case SWITCH_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: case OMP_FOR: case OMP_SECTIONS: case OMP_SECTION: Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/gimplify.c Thu Dec 19 18:27:32 2013 (r259619) @@ -5748,6 +5748,11 @@ gimplify_expr (tree *expr_p, tree *pre_p ret = GS_ALL_DONE; break; + case CHANGE_DYNAMIC_TYPE_EXPR: + ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p), + pre_p, post_p, is_gimple_reg, fb_lvalue); + break; + case OBJ_TYPE_REF: { enum gimplify_status r0, r1; Modified: head/contrib/gcc/omp-low.c ============================================================================== --- head/contrib/gcc/omp-low.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/omp-low.c Thu Dec 19 18:27:32 2013 (r259619) @@ -518,6 +518,7 @@ omp_copy_decl_2 (tree var, tree name, tr TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (var); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (var); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (var); DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); DECL_IGNORED_P (copy) = DECL_IGNORED_P (var); TREE_USED (copy) = 1; Modified: head/contrib/gcc/print-tree.c ============================================================================== --- head/contrib/gcc/print-tree.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/print-tree.c Thu Dec 19 18:27:32 2013 (r259619) @@ -401,7 +401,9 @@ print_node (FILE *file, const char *pref if (DECL_VIRTUAL_P (node)) fputs (" virtual", file); if (DECL_PRESERVE_P (node)) - fputs (" preserve", file); + fputs (" preserve", file); + if (DECL_NO_TBAA_P (node)) + fputs (" no-tbaa", file); if (DECL_LANG_FLAG_0 (node)) fputs (" decl_0", file); if (DECL_LANG_FLAG_1 (node)) Modified: head/contrib/gcc/tree-gimple.c ============================================================================== --- head/contrib/gcc/tree-gimple.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-gimple.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,6 @@ /* Functions to analyze and validate GIMPLE trees. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Diego Novillo Rewritten by Jason Merrill @@ -215,6 +216,7 @@ is_gimple_stmt (tree t) case TRY_FINALLY_EXPR: case EH_FILTER_EXPR: case CATCH_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: case ASM_EXPR: case RESX_EXPR: case PHI_NODE: Modified: head/contrib/gcc/tree-inline.c ============================================================================== --- head/contrib/gcc/tree-inline.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-inline.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1649,6 +1649,11 @@ estimate_num_insns_1 (tree *tp, int *wal *walk_subtrees = 0; return NULL; + /* CHANGE_DYNAMIC_TYPE_EXPR explicitly expands to nothing. */ + case CHANGE_DYNAMIC_TYPE_EXPR: + *walk_subtrees = 0; + return NULL; + /* Try to estimate the cost of assignments. We have three cases to deal with: 1) Simple assignments to registers; @@ -2635,6 +2640,7 @@ copy_decl_to_var (tree decl, copy_body_d TREE_READONLY (copy) = TREE_READONLY (decl); TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); return copy_decl_for_dup_finish (id, decl, copy); } @@ -2661,6 +2667,7 @@ copy_result_decl_to_var (tree decl, copy { TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); } return copy_decl_for_dup_finish (id, decl, copy); Modified: head/contrib/gcc/tree-pretty-print.c ============================================================================== --- head/contrib/gcc/tree-pretty-print.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-pretty-print.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1443,6 +1443,17 @@ dump_generic_node (pretty_printer *buffe is_expr = false; break; + case CHANGE_DYNAMIC_TYPE_EXPR: + pp_string (buffer, "<<>>"); + is_expr = false; + break; + case LABEL_EXPR: op0 = TREE_OPERAND (node, 0); /* If this is for break or continue, don't bother printing it. */ Modified: head/contrib/gcc/tree-ssa-alias.c ============================================================================== --- head/contrib/gcc/tree-ssa-alias.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-alias.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,5 @@ /* Alias analysis for trees. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -1961,28 +1961,29 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG); - alias_stats.tbaa_queries++; - - /* If the alias sets don't conflict then MEM cannot alias VAR. */ - if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) + if (!DECL_NO_TBAA_P (ptr)) { - alias_stats.alias_noalias++; - alias_stats.tbaa_resolved++; - return false; - } + alias_stats.tbaa_queries++; - /* If var is a record or union type, ptr cannot point into var - unless there is some operation explicit address operation in the - program that can reference a field of the ptr's dereferenced - type. This also assumes that the types of both var and ptr are - contained within the compilation unit, and that there is no fancy - addressing arithmetic associated with any of the types - involved. */ + /* If the alias sets don't conflict then MEM cannot alias VAR. */ + if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) + { + alias_stats.alias_noalias++; + alias_stats.tbaa_resolved++; + return false; + } - if ((mem_alias_set != 0) && (var_alias_set != 0)) - { - tree ptr_type = TREE_TYPE (ptr); - tree var_type = TREE_TYPE (var); + /* If VAR is a record or union type, PTR cannot point into VAR + unless there is some explicit address operation in the + program that can reference a field of the type pointed-to by + PTR. This also assumes that the types of both VAR and PTR + are contained within the compilation unit, and that there is + no fancy addressing arithmetic associated with any of the + types involved. */ + if (mem_alias_set != 0 && var_alias_set != 0) + { + tree ptr_type = TREE_TYPE (ptr); + tree var_type = TREE_TYPE (var); /* The star count is -1 if the type at the end of the pointer_to chain is not a record or union type. */ @@ -1991,41 +1992,41 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem { int ptr_star_count = 0; - /* Ipa_type_escape_star_count_of_interesting_type is a little to - restrictive for the pointer type, need to allow pointers to - primitive types as long as those types cannot be pointers - to everything. */ - while (POINTER_TYPE_P (ptr_type)) - /* Strip the *'s off. */ - { - ptr_type = TREE_TYPE (ptr_type); - ptr_star_count++; - } - - /* There does not appear to be a better test to see if the - pointer type was one of the pointer to everything - types. */ + /* ipa_type_escape_star_count_of_interesting_type is a + little too restrictive for the pointer type, need to + allow pointers to primitive types as long as those + types cannot be pointers to everything. */ + while (POINTER_TYPE_P (ptr_type)) + { + /* Strip the *s off. */ + ptr_type = TREE_TYPE (ptr_type); + ptr_star_count++; + } - if (ptr_star_count > 0) - { - alias_stats.structnoaddress_queries++; - if (ipa_type_escape_field_does_not_clobber_p (var_type, - TREE_TYPE (ptr))) + /* There does not appear to be a better test to see if + the pointer type was one of the pointer to everything + types. */ + if (ptr_star_count > 0) + { + alias_stats.structnoaddress_queries++; + if (ipa_type_escape_field_does_not_clobber_p (var_type, + TREE_TYPE (ptr))) + { + alias_stats.structnoaddress_resolved++; + alias_stats.alias_noalias++; + return false; + } + } + else if (ptr_star_count == 0) { + /* If PTR_TYPE was not really a pointer to type, it cannot + alias. */ + alias_stats.structnoaddress_queries++; alias_stats.structnoaddress_resolved++; alias_stats.alias_noalias++; return false; } } - else if (ptr_star_count == 0) - { - /* If ptr_type was not really a pointer to type, it cannot - alias. */ - alias_stats.structnoaddress_queries++; - alias_stats.structnoaddress_resolved++; - alias_stats.alias_noalias++; - return false; - } } } Modified: head/contrib/gcc/tree-ssa-dce.c ============================================================================== --- head/contrib/gcc/tree-ssa-dce.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-dce.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,6 @@ /* Dead code elimination pass for the GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Ben Elliston and Andrew MacLeod Adapted to use control dependence by Steven Bosscher, SUSE Labs. @@ -307,6 +308,7 @@ mark_stmt_if_obviously_necessary (tree s case ASM_EXPR: case RESX_EXPR: case RETURN_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: mark_stmt_necessary (stmt, true); return; Modified: head/contrib/gcc/tree-ssa-operands.c ============================================================================== --- head/contrib/gcc/tree-ssa-operands.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-operands.c Thu Dec 19 18:27:32 2013 (r259619) @@ -2057,6 +2057,10 @@ get_expr_operands (tree stmt, tree *expr return; } + case CHANGE_DYNAMIC_TYPE_EXPR: + get_expr_operands (stmt, &CHANGE_DYNAMIC_TYPE_LOCATION (expr), opf_none); + return; + case BLOCK: case FUNCTION_DECL: case EXC_PTR_EXPR: Modified: head/contrib/gcc/tree-ssa-structalias.c ============================================================================== --- head/contrib/gcc/tree-ssa-structalias.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-structalias.c Thu Dec 19 18:27:32 2013 (r259619) @@ -251,6 +251,10 @@ struct variable_info /* True if this is a heap variable. */ unsigned int is_heap_var:1; + /* True if we may not use TBAA to prune references to this + variable. This is used for C++ placement new. */ + unsigned int no_tbaa_pruning : 1; + /* Points-to set for this variable. */ bitmap solution; @@ -368,6 +372,7 @@ static varinfo_t new_var_info (tree t, unsigned int id, const char *name) { varinfo_t ret = pool_alloc (variable_info_pool); + tree var; ret->id = id; ret->name = name; @@ -378,6 +383,12 @@ new_var_info (tree t, unsigned int id, c ret->is_special_var = false; ret->is_unknown_size_var = false; ret->has_union = false; + var = t; + if (TREE_CODE (var) == SSA_NAME) + var = SSA_NAME_VAR (var); + ret->no_tbaa_pruning = (DECL_P (var) + && POINTER_TYPE_P (TREE_TYPE (var)) + && DECL_NO_TBAA_P (var)); ret->solution = BITMAP_ALLOC (&pta_obstack); ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack); ret->next = NULL; @@ -1221,6 +1232,9 @@ unify_nodes (constraint_graph_t graph, u merge_graph_nodes (graph, to, from); merge_node_constraints (graph, to, from); + if (get_varinfo (from)->no_tbaa_pruning) + get_varinfo (to)->no_tbaa_pruning = true; + if (update_changed && TEST_BIT (changed, from)) { RESET_BIT (changed, from); @@ -3564,6 +3578,14 @@ find_func_aliases (tree origt) } } } + else if (TREE_CODE (t) == CHANGE_DYNAMIC_TYPE_EXPR) + { + unsigned int j; + + get_constraint_for (CHANGE_DYNAMIC_TYPE_LOCATION (t), &lhsc); + for (j = 0; VEC_iterate (ce_s, lhsc, j, c); ++j) + get_varinfo (c->var)->no_tbaa_pruning = true; + } /* After promoting variables and computing aliasing we will need to re-scan most statements. FIXME: Try to minimize the @@ -4250,7 +4272,10 @@ dump_solution_for_var (FILE *file, unsig { fprintf (file, "%s ", get_varinfo (i)->name); } - fprintf (file, "}\n"); + fprintf (file, "}"); + if (vi->no_tbaa_pruning) + fprintf (file, " no-tbaa-pruning"); + fprintf (file, "\n"); } } @@ -4422,10 +4447,15 @@ shared_bitmap_add (bitmap pt_vars) /* Set bits in INTO corresponding to the variable uids in solution set FROM, which came from variable PTR. For variables that are actually dereferenced, we also use type - based alias analysis to prune the points-to sets. */ + based alias analysis to prune the points-to sets. + IS_DEREFED is true if PTR was directly dereferenced, which we use to + help determine whether we are we are allowed to prune using TBAA. + If NO_TBAA_PRUNING is true, we do not perform any TBAA pruning of + the from set. */ static void -set_uids_in_ptset (tree ptr, bitmap into, bitmap from) +set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed, + bool no_tbaa_pruning) { unsigned int i; bitmap_iterator bi; @@ -4462,7 +4492,8 @@ set_uids_in_ptset (tree ptr, bitmap into if (sft) { var_alias_set = get_alias_set (sft); - if (!vi->directly_dereferenced + if (no_tbaa_pruning + || (!is_derefed && !vi->directly_dereferenced) || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (sft)); } @@ -4476,7 +4507,8 @@ set_uids_in_ptset (tree ptr, bitmap into else { var_alias_set = get_alias_set (vi->decl); - if (!vi->directly_dereferenced + if (no_tbaa_pruning + || (!is_derefed && !vi->directly_dereferenced) || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (vi->decl)); } @@ -4564,7 +4596,9 @@ find_what_p_points_to (tree p) return false; finished_solution = BITMAP_GGC_ALLOC (); - set_uids_in_ptset (vi->decl, finished_solution, vi->solution); + set_uids_in_ptset (vi->decl, finished_solution, vi->solution, + vi->directly_dereferenced, + vi->no_tbaa_pruning); result = shared_bitmap_lookup (finished_solution); if (!result) @@ -4913,6 +4947,142 @@ remove_preds_and_fake_succs (constraint_ bitmap_obstack_release (&predbitmap_obstack); } +/* Compute the set of variables we can't TBAA prune. */ + +static void +compute_tbaa_pruning (void) +{ + unsigned int size = VEC_length (varinfo_t, varmap); + unsigned int i; + bool any; + + changed_count = 0; + changed = sbitmap_alloc (size); + sbitmap_zero (changed); + + /* Mark all initial no_tbaa_pruning nodes as changed. */ + any = false; + for (i = 0; i < size; ++i) + { + varinfo_t ivi = get_varinfo (i); + + if (find (i) == i && ivi->no_tbaa_pruning) + { + any = true; + if ((graph->succs[i] && !bitmap_empty_p (graph->succs[i])) + || VEC_length (constraint_t, graph->complex[i]) > 0) + { + SET_BIT (changed, i); + ++changed_count; + } + } + } + + while (changed_count > 0) + { + struct topo_info *ti = init_topo_info (); + ++stats.iterations; + + bitmap_obstack_initialize (&iteration_obstack); + + compute_topo_order (graph, ti); + + while (VEC_length (unsigned, ti->topo_order) != 0) + { + bitmap_iterator bi; + + i = VEC_pop (unsigned, ti->topo_order); + + /* If this variable is not a representative, skip it. */ + if (find (i) != i) + continue; + + /* If the node has changed, we need to process the complex + constraints and outgoing edges again. */ + if (TEST_BIT (changed, i)) + { + unsigned int j; + constraint_t c; + VEC(constraint_t,heap) *complex = graph->complex[i]; + + RESET_BIT (changed, i); + --changed_count; + + /* Process the complex copy constraints. */ + for (j = 0; VEC_iterate (constraint_t, complex, j, c); ++j) + { + if (c->lhs.type == SCALAR && c->rhs.type == SCALAR) + { + varinfo_t lhsvi = get_varinfo (find (c->lhs.var)); + + if (!lhsvi->no_tbaa_pruning) + { + lhsvi->no_tbaa_pruning = true; + if (!TEST_BIT (changed, lhsvi->id)) + { + SET_BIT (changed, lhsvi->id); + ++changed_count; + } + } + } + } + + /* Propagate to all successors. */ + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i], 0, j, bi) + { + unsigned int to = find (j); + varinfo_t tovi = get_varinfo (to); + + /* Don't propagate to ourselves. */ + if (to == i) + continue; + + if (!tovi->no_tbaa_pruning) + { + tovi->no_tbaa_pruning = true; + if (!TEST_BIT (changed, to)) + { + SET_BIT (changed, to); + ++changed_count; + } + } + } + } + } + + free_topo_info (ti); + bitmap_obstack_release (&iteration_obstack); + } + + sbitmap_free (changed); + + if (any) + { + for (i = 0; i < size; ++i) + { + varinfo_t ivi = get_varinfo (i); + varinfo_t ivip = get_varinfo (find (i)); + + if (ivip->no_tbaa_pruning) + { + tree var = ivi->decl; + + if (TREE_CODE (var) == SSA_NAME) + var = SSA_NAME_VAR (var); + + if (POINTER_TYPE_P (TREE_TYPE (var))) + { + DECL_NO_TBAA_P (var) = 1; + + /* Tell the RTL layer that this pointer can alias + anything. */ + DECL_POINTER_ALIAS_SET (var) = 0; + } + } + } + } +} + /* Create points-to sets for the current function. See the comments at the start of the file for an algorithmic overview. */ @@ -4948,7 +5118,7 @@ compute_points_to_sets (struct alias_inf } } - for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) { tree stmt = bsi_stmt (bsi); @@ -4959,6 +5129,13 @@ compute_points_to_sets (struct alias_inf This is used when creating name tags and alias sets. */ update_alias_info (stmt, ai); + + /* The information in CHANGE_DYNAMIC_TYPE_EXPR nodes has now + been captured, and we can remove them. */ + if (TREE_CODE (stmt) == CHANGE_DYNAMIC_TYPE_EXPR) + bsi_remove (&bsi, true); + else + bsi_next (&bsi); } } @@ -4991,6 +5168,8 @@ compute_points_to_sets (struct alias_inf solve_graph (graph); + compute_tbaa_pruning (); + if (dump_file) dump_sa_points_to_info (dump_file); have_alias_info = true; Modified: head/contrib/gcc/tree.def ============================================================================== --- head/contrib/gcc/tree.def Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree.def Thu Dec 19 18:27:32 2013 (r259619) @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the tree codes used in GCC. Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -880,6 +880,15 @@ DEFTREECODE (CATCH_EXPR, "catch_expr", t expanding. */ DEFTREECODE (EH_FILTER_EXPR, "eh_filter_expr", tcc_statement, 2) +/* Indicates a change in the dynamic type of a memory location. This + has no value and generates no executable code. It is only used for + type based alias analysis. This is generated by C++ placement new. + CHANGE_DYNAMIC_TYPE_NEW_TYPE, the first operand, is the new type. + CHNAGE_DYNAMIC_TYPE_LOCATION, the second operand, is the location + whose type is being changed. */ +DEFTREECODE (CHANGE_DYNAMIC_TYPE_EXPR, "change_dynamic_type_expr", + tcc_statement, 2) + /* Node used for describing a property that is known at compile time. */ DEFTREECODE (SCEV_KNOWN, "scev_known", tcc_expression, 0) Modified: head/contrib/gcc/tree.h ============================================================================== --- head/contrib/gcc/tree.h Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree.h Thu Dec 19 18:27:32 2013 (r259619) @@ -1548,6 +1548,12 @@ struct tree_constructor GTY(()) #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1) #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE)) +/* CHANGE_DYNAMIC_TYPE_EXPR accessors. */ +#define CHANGE_DYNAMIC_TYPE_NEW_TYPE(NODE) \ + TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 0) +#define CHANGE_DYNAMIC_TYPE_LOCATION(NODE) \ + TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 1) + /* OBJ_TYPE_REF accessors. */ #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0) #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1) @@ -2538,6 +2544,11 @@ struct tree_struct_field_tag GTY(()) #define DECL_CALL_CLOBBERED(DECL) \ DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag +/* For a DECL with pointer type, this is set if Type Based Alias + Analysis should not be applied to this DECL. */ +#define DECL_NO_TBAA_P(DECL) \ + DECL_COMMON_CHECK (DECL)->decl_common.no_tbaa_flag + struct tree_decl_common GTY(()) { struct tree_decl_minimal common; @@ -2579,6 +2590,8 @@ struct tree_decl_common GTY(()) parm decl. */ unsigned gimple_reg_flag : 1; unsigned call_clobbered_flag : 1; + /* In a DECL with pointer type, set if no TBAA should be done. */ + unsigned no_tbaa_flag : 1; unsigned int align : 24; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 19:32:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CC3BFD1; Thu, 19 Dec 2013 19:32:04 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 133CA1167; Thu, 19 Dec 2013 19:32:02 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa03.fnfis.com (8.14.5/8.14.5) with ESMTP id rBJJW1kL009643 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 19 Dec 2013 13:32:01 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT05.FNFIS.com ([10.132.206.16]) with mapi id 14.03.0158.001; Thu, 19 Dec 2013 13:32:00 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7JpcUT6A Date: Thu, 19 Dec 2013 19:31:59 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> <52AF78B6.20706@freebsd.org> <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> In-Reply-To: <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <7F811FCEB0BA29448D3CC115A9058813@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-19_07:2013-12-19,2013-12-19,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 19 Dec 2013 19:32:04 -0000 On Dec 18, 2013, at 10:08 PM, Teske, Devin wrote: >=20 > On Dec 16, 2013, at 2:03 PM, Nathan Whitehorn wrote: >=20 >> On 12/16/13 15:55, Teske, Devin wrote: >>> On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: >>>=20 >>>> On 12/16/13 15:48, Teske, Devin wrote: >>>>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>>>>=20 >>>>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>>>>=20 >>>>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>>>> Author: dteske >>>>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>>>> New Revision: 259479 >>>>>>>> URL: http://svnweb.freebsd.org/changeset/base/259479 >>>>>>>>=20 >>>>>>>> Log: >>>>>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>>>>> Discussed on: -current, -stable >>>>>>>> MFC after: 3 days >>>>>>>>=20 >>>>>>>> Modified: >>>>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>>=20 >>>>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2= 013 (r259478) >>>>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2= 013 (r259479) >>>>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILU= RE >>>>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAIL= URE >>>>>>>> # We're all done unless we should go on for boot pool >>>>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>>>> Uh -- what is all of this? Why are we disabling kernel functions de= pending on what the root filesystem is? Please don't MFC this. >>>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.or= g/pipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILC= q%2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c= 5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.or= g/pipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILC= q%2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e= 3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>>>>=20 >>>>>> NB: Happy to rip it out... but want something in-reply to those thre= ads (pretty please). >>>>> Basically... the logic is... >>>>>=20 >>>>> The ZFS pool is built on vdevs of a specific name. The names that are= used >>>>> should remain the same. Adding this to the loader.conf ensures that t= he names >>>>> that the pool(s) was/were built upon do not change. >>>>>=20 >>>>> This goes beyond just a swap partition I imagine. For example... copy= ing the >>>>> data to a new drive using a duplicator. I'm sure there are other case= s too. >>>> Thanks for the explanation! I wonder if we should just turn off the di= sk ident stuff by default globally -- it was causing problems for me as wel= l without ZFS root. >>> As I was making the commit to zfsboot... the very thought had occurred = to me. >>>=20 >>> I'm happy to rip this out in favor of a new global default. The end-res= ult is that >>> what Johan experienced won't be repeated. >>>=20 >>> I think there's an urgency to get something to solve this into 10. >>=20 >> Yeah, I can see that. Let me bring this up on -CURRENT, with a short tim= eout, and see what the options are. >=20 > Any updates on this? As requested, I have held-back SVN r259479 from the merge process. However, as I'm sure RC3 is approaching, wanted to know if we should continue to look into changing the default (otherwise, we have r259479 available). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 20:19:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AAFCC92; Thu, 19 Dec 2013 20:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 163731553; Thu, 19 Dec 2013 20:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKJv7S088806; Thu, 19 Dec 2013 20:19:57 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKJvkI088804; Thu, 19 Dec 2013 20:19:57 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192019.rBJKJvkI088804@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259626 - head/contrib/tzdata 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.17 Precedence: list List-Id: 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, 19 Dec 2013 20:19:58 -0000 Author: edwin Date: Thu Dec 19 20:19:57 2013 New Revision: 259626 URL: http://svnweb.freebsd.org/changeset/base/259626 Log: MFV of r259624, tzdata2013i Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: head/contrib/tzdata/asia head/contrib/tzdata/northamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Dec 19 20:18:21 2013 (r259625) +++ head/contrib/tzdata/asia Thu Dec 19 20:19:57 2013 (r259626) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Thu Dec 19 20:18:21 2013 (r259625) +++ head/contrib/tzdata/northamerica Thu Dec 19 20:19:57 2013 (r259626) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 20:47:07 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE8BA8FD; Thu, 19 Dec 2013 20:47:07 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFEF175E; Thu, 19 Dec 2013 20:47:06 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBJKklVI054671; Thu, 19 Dec 2013 21:47:02 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B35B37.5070809@FreeBSD.org> Date: Thu, 19 Dec 2013 21:46:47 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Stefan Esser , Bruce Evans Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> In-Reply-To: <52B32647.2030008@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 20:47:08 -0000 On 19.12.13 18:00, Stefan Esser wrote: > I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the > missing empty line: > > static __inline sbintime_t > timer2sbintime(intptr_t data) > { > > if (data > INT64_MAX / SBT_1MS) > return INT64_MAX; > return (SBT_1MS * data); > } > > If you can show evidence that a limit of INT64_MAX/2 is more appropriate > (2^30 seconds or 34 years), the limit could be of course be reduced to > that value. > > I could not find any code that would not tolerate INT64_MAX, though ... Aehm, what about 32-bit systems where intptr_t == __int32_t? cc1: warnings being treated as errors /export/devel/fbsd/src/sys/kern/kern_event.c: In function 'timer2sbintime': /export/devel/fbsd/src/sys/kern/kern_event.c:529: warning: comparison is always false due to limited range of data type Andreas From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 21:16:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93F696EC for ; Thu, 19 Dec 2013 21:16:07 +0000 (UTC) Received: from nm10.bullet.mail.ir2.yahoo.com (nm10.bullet.mail.ir2.yahoo.com [212.82.96.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E331619FC for ; Thu, 19 Dec 2013 21:16:06 +0000 (UTC) Received: from [212.82.98.53] by nm10.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 Received: from [46.228.39.67] by tm6.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 Received: from [127.0.0.1] by smtp104.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 X-Yahoo-Newman-Id: 711372.81079.bm@smtp104.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 7aN3Mn4VM1keX5aDXr7VNkRUBScDk8.pf_IIEuMfCl7XShC 4ilJGLJ7fKbB8lntFGHoy5lzAEjlOjxqbeGI.96v4pIN5kJflooZPIiJ34rn S_xgDDNG0GiUzU0H7NO.mLTkQ5w4ZAihlGneb0FmXbXUCi7W9ljxxkyr_j_C FBo2f0c20tkgobljYR1feHUyIZmMngX6aQckGSalQVD7HFbltWqlda7os43y qu._zY9i8RQNYLO.9vcRLODzt7u4SA6rst2Yf8ZihwmN4gabmcpaapJ3tFnL s0Vvpv5LFI_2Kyqp.re6ZDP3D44.4hhh8XbG_D2Za470Ugm.5VPrStFShNlJ ROcnOi_us32YeC2XFA7Afaoi1bq74zAUl9RBSIVUcBnmT9K9PmD1dfL4g43p 37i6dPrBb7qSx2Fuywcw0wYw2fzURqZ8isuSUIPk8_FnN6Lyyz1THl4Edp01 7._ekJdYVQpEWkfUSP9JWZDyHXfueLMMzIZN1sHD_gdqDqkjsXGfnMDUX7NI aHPk_X3.T49eLE1CIDy.MJC0PdOWAeA-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.11] (se@84.154.112.54 with plain [188.125.69.59]) by smtp104.mail.ir2.yahoo.com with SMTP; 19 Dec 2013 21:16:01 +0000 UTC Message-ID: <52B3620A.8050603@freebsd.org> Date: Thu, 19 Dec 2013 22:15:54 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Andreas Tobler , Bruce Evans Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> <52B35B37.5070809@FreeBSD.org> In-Reply-To: <52B35B37.5070809@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 21:16:07 -0000 Am 19.12.2013 21:46, schrieb Andreas Tobler: > On 19.12.13 18:00, Stefan Esser wrote: > >> I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the >> missing empty line: >> >> static __inline sbintime_t >> timer2sbintime(intptr_t data) >> { >> >> if (data > INT64_MAX / SBT_1MS) >> return INT64_MAX; >> return (SBT_1MS * data); >> } >> >> If you can show evidence that a limit of INT64_MAX/2 is more appropriate >> (2^30 seconds or 34 years), the limit could be of course be reduced to >> that value. >> >> I could not find any code that would not tolerate INT64_MAX, though ... > > Aehm, what about 32-bit systems where intptr_t == __int32_t? > > cc1: warnings being treated as errors > /export/devel/fbsd/src/sys/kern/kern_event.c: In function 'timer2sbintime': > /export/devel/fbsd/src/sys/kern/kern_event.c:529: warning: comparison is > always false due to limited range of data type You are right, this needs to be fixed, too :( I see two possibilities: 1) Conditional compilation: There is no need to check an upper bound on ILP32 architectures. INT32_MAX seconds can be expressed as sbintime. Architectures where intptr_t has at least 48 bits will support the maximum time that can be expressed in sbintime and the comparison can be left as is for them. 2) Calculate the upper bound in such a way, that it is guaranteed to be lower than the highest value that can be expressed as intptr_t. This value is (INT32_MAX - 1) on 32 bit architectures, while it remains (INT64_MAX / SBT_1MS) on 64 bit architectures. I'm afraid that the warning emitted for 32 bit architectures will cause tinderbox build failures, but I haven't seen a failure message, yet. Should I back-out the commit that added the range check? As long as -fno-strict-overflow is not put back into CFLAGS, the test is not strictly required (only for the extremely unlikely case that a number > 1000 * MAX32_INT results in an extremely short remainder after multiplication with SBT_1MS modulo 32 ...). Regards, STefan NB: I should have known better and should have asked for a review of this change before it wa committed. Sorry for the inconvenience caused :( From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 21:31:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01ACF981; Thu, 19 Dec 2013 21:31:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D60411AFE; Thu, 19 Dec 2013 21:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJLVS8Q017206; Thu, 19 Dec 2013 21:31:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJLVSZr017205; Thu, 19 Dec 2013 21:31:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312192131.rBJLVSZr017205@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Dec 2013 21:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259632 - head/sys/rpc 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.17 Precedence: list List-Id: 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, 19 Dec 2013 21:31:29 -0000 Author: mav Date: Thu Dec 19 21:31:28 2013 New Revision: 259632 URL: http://svnweb.freebsd.org/changeset/base/259632 Log: Rework flow control for connection-oriented (TCP) RPC server. When processing receive buffer, write the amount of data, expected in present request record, into socket's so_rcv.sb_lowat to make stack aware about our needs. When processing following upcalls, ignore them until socket collect enough data to be read and processed in one turn. This change reduces number of context switches and other operations in RPC stack during large NFS writes (especially via non-Jumbo networks) by order of magnitude. After precessing current packet, take another look into the pending buffer to find out whether the next packet had been already received. If not, deactivate this port right there without making RPC code to push this port to another thread just to find that there is nothing. If the next packet is received partially, also deactivate the port, but also update socket's so_rcv.sb_lowat to not be woken up prematurely. This change additionally reduces number of context switches per NFS request about in half. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Thu Dec 19 21:03:08 2013 (r259631) +++ head/sys/rpc/svc_vc.c Thu Dec 19 21:31:28 2013 (r259632) @@ -381,15 +381,11 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st * We must re-test for new connections after taking * the lock to protect us in the case where a new * connection arrives after our call to accept fails - * with EWOULDBLOCK. The pool lock protects us from - * racing the upcall after our TAILQ_EMPTY() call - * returns false. + * with EWOULDBLOCK. */ ACCEPT_LOCK(); - mtx_lock(&xprt->xp_pool->sp_lock); if (TAILQ_EMPTY(&xprt->xp_socket->so_comp)) - xprt_inactive_locked(xprt); - mtx_unlock(&xprt->xp_pool->sp_lock); + xprt_inactive(xprt); ACCEPT_UNLOCK(); sx_xunlock(&xprt->xp_lock); return (FALSE); @@ -526,35 +522,14 @@ static enum xprt_stat svc_vc_stat(SVCXPRT *xprt) { struct cf_conn *cd; - struct mbuf *m; - size_t n; cd = (struct cf_conn *)(xprt->xp_p1); if (cd->strm_stat == XPRT_DIED) return (XPRT_DIED); - /* - * Return XPRT_MOREREQS if we have buffered data and we are - * mid-record or if we have enough data for a record - * marker. Since this is only a hint, we read mpending and - * resid outside the lock. We do need to take the lock if we - * have to traverse the mbuf chain. - */ - if (cd->mpending) { - if (cd->resid) - return (XPRT_MOREREQS); - n = 0; - sx_xlock(&xprt->xp_lock); - m = cd->mpending; - while (m && n < sizeof(uint32_t)) { - n += m->m_len; - m = m->m_next; - } - sx_xunlock(&xprt->xp_lock); - if (n >= sizeof(uint32_t)) - return (XPRT_MOREREQS); - } + if (cd->mreq != NULL && cd->resid == 0 && cd->eor) + return (XPRT_MOREREQS); if (soreadable(xprt->xp_socket)) return (XPRT_MOREREQS); @@ -575,6 +550,78 @@ svc_vc_backchannel_stat(SVCXPRT *xprt) return (XPRT_IDLE); } +/* + * If we have an mbuf chain in cd->mpending, try to parse a record from it, + * leaving the result in cd->mreq. If we don't have a complete record, leave + * the partial result in cd->mreq and try to read more from the socket. + */ +static void +svc_vc_process_pending(SVCXPRT *xprt) +{ + struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; + struct socket *so = xprt->xp_socket; + struct mbuf *m; + + /* + * If cd->resid is non-zero, we have part of the + * record already, otherwise we are expecting a record + * marker. + */ + if (!cd->resid && cd->mpending) { + /* + * See if there is enough data buffered to + * make up a record marker. Make sure we can + * handle the case where the record marker is + * split across more than one mbuf. + */ + size_t n = 0; + uint32_t header; + + m = cd->mpending; + while (n < sizeof(uint32_t) && m) { + n += m->m_len; + m = m->m_next; + } + if (n < sizeof(uint32_t)) { + so->so_rcv.sb_lowat = sizeof(uint32_t) - n; + return; + } + m_copydata(cd->mpending, 0, sizeof(header), + (char *)&header); + header = ntohl(header); + cd->eor = (header & 0x80000000) != 0; + cd->resid = header & 0x7fffffff; + m_adj(cd->mpending, sizeof(uint32_t)); + } + + /* + * Start pulling off mbufs from cd->mpending + * until we either have a complete record or + * we run out of data. We use m_split to pull + * data - it will pull as much as possible and + * split the last mbuf if necessary. + */ + while (cd->mpending && cd->resid) { + m = cd->mpending; + if (cd->mpending->m_next + || cd->mpending->m_len > cd->resid) + cd->mpending = m_split(cd->mpending, + cd->resid, M_WAITOK); + else + cd->mpending = NULL; + if (cd->mreq) + m_last(cd->mreq)->m_next = m; + else + cd->mreq = m; + while (m) { + cd->resid -= m->m_len; + m = m->m_next; + } + } + + so->so_rcv.sb_lowat = imax(1, imin(cd->resid, so->so_rcv.sb_hiwat / 2)); +} + static bool_t svc_vc_recv(SVCXPRT *xprt, struct rpc_msg *msg, struct sockaddr **addrp, struct mbuf **mp) @@ -582,6 +629,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; struct uio uio; struct mbuf *m; + struct socket* so = xprt->xp_socket; XDR xdrs; int error, rcvflag; @@ -592,99 +640,40 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms sx_xlock(&xprt->xp_lock); for (;;) { - /* - * If we have an mbuf chain in cd->mpending, try to parse a - * record from it, leaving the result in cd->mreq. If we don't - * have a complete record, leave the partial result in - * cd->mreq and try to read more from the socket. - */ - if (cd->mpending) { - /* - * If cd->resid is non-zero, we have part of the - * record already, otherwise we are expecting a record - * marker. - */ - if (!cd->resid) { - /* - * See if there is enough data buffered to - * make up a record marker. Make sure we can - * handle the case where the record marker is - * split across more than one mbuf. - */ - size_t n = 0; - uint32_t header; - - m = cd->mpending; - while (n < sizeof(uint32_t) && m) { - n += m->m_len; - m = m->m_next; - } - if (n < sizeof(uint32_t)) - goto readmore; - m_copydata(cd->mpending, 0, sizeof(header), - (char *)&header); - header = ntohl(header); - cd->eor = (header & 0x80000000) != 0; - cd->resid = header & 0x7fffffff; - m_adj(cd->mpending, sizeof(uint32_t)); - } - - /* - * Start pulling off mbufs from cd->mpending - * until we either have a complete record or - * we run out of data. We use m_split to pull - * data - it will pull as much as possible and - * split the last mbuf if necessary. - */ - while (cd->mpending && cd->resid) { - m = cd->mpending; - if (cd->mpending->m_next - || cd->mpending->m_len > cd->resid) - cd->mpending = m_split(cd->mpending, - cd->resid, M_WAITOK); - else - cd->mpending = NULL; - if (cd->mreq) - m_last(cd->mreq)->m_next = m; - else - cd->mreq = m; - while (m) { - cd->resid -= m->m_len; - m = m->m_next; - } + /* If we have no request ready, check pending queue. */ + while (cd->mpending && + (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) + svc_vc_process_pending(xprt); + + /* Process and return complete request in cd->mreq. */ + if (cd->mreq != NULL && cd->resid == 0 && cd->eor) { + + xdrmbuf_create(&xdrs, cd->mreq, XDR_DECODE); + cd->mreq = NULL; + + /* Check for next request in a pending queue. */ + svc_vc_process_pending(xprt); + if (cd->mreq == NULL || cd->resid != 0) { + SOCKBUF_LOCK(&so->so_rcv); + if (!soreadable(so)) + xprt_inactive(xprt); + SOCKBUF_UNLOCK(&so->so_rcv); } - /* - * If cd->resid is zero now, we have managed to - * receive a record fragment from the stream. Check - * for the end-of-record mark to see if we need more. - */ - if (cd->resid == 0) { - if (!cd->eor) - continue; - - /* - * Success - we have a complete record in - * cd->mreq. - */ - xdrmbuf_create(&xdrs, cd->mreq, XDR_DECODE); - cd->mreq = NULL; - sx_xunlock(&xprt->xp_lock); - - if (! xdr_callmsg(&xdrs, msg)) { - XDR_DESTROY(&xdrs); - return (FALSE); - } + sx_xunlock(&xprt->xp_lock); - *addrp = NULL; - *mp = xdrmbuf_getall(&xdrs); + if (! xdr_callmsg(&xdrs, msg)) { XDR_DESTROY(&xdrs); - - return (TRUE); + return (FALSE); } + + *addrp = NULL; + *mp = xdrmbuf_getall(&xdrs); + XDR_DESTROY(&xdrs); + + return (TRUE); } - readmore: /* * The socket upcall calls xprt_active() which will eventually * cause the server to call us here. We attempt to @@ -697,8 +686,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms uio.uio_td = curthread; m = NULL; rcvflag = MSG_DONTWAIT; - error = soreceive(xprt->xp_socket, NULL, &uio, &m, NULL, - &rcvflag); + error = soreceive(so, NULL, &uio, &m, NULL, &rcvflag); if (error == EWOULDBLOCK) { /* @@ -706,25 +694,23 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms * taking the lock to protect us in the case * where a new packet arrives on the socket * after our call to soreceive fails with - * EWOULDBLOCK. The pool lock protects us from - * racing the upcall after our soreadable() - * call returns false. + * EWOULDBLOCK. */ - mtx_lock(&xprt->xp_pool->sp_lock); - if (!soreadable(xprt->xp_socket)) - xprt_inactive_locked(xprt); - mtx_unlock(&xprt->xp_pool->sp_lock); + SOCKBUF_LOCK(&so->so_rcv); + if (!soreadable(so)) + xprt_inactive(xprt); + SOCKBUF_UNLOCK(&so->so_rcv); sx_xunlock(&xprt->xp_lock); return (FALSE); } if (error) { - SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); + SOCKBUF_LOCK(&so->so_rcv); if (xprt->xp_upcallset) { xprt->xp_upcallset = 0; - soupcall_clear(xprt->xp_socket, SO_RCV); + soupcall_clear(so, SO_RCV); } - SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); + SOCKBUF_UNLOCK(&so->so_rcv); xprt_inactive(xprt); cd->strm_stat = XPRT_DIED; sx_xunlock(&xprt->xp_lock); @@ -908,7 +894,8 @@ svc_vc_soupcall(struct socket *so, void { SVCXPRT *xprt = (SVCXPRT *) arg; - xprt_active(xprt); + if (soreadable(xprt->xp_socket)) + xprt_active(xprt); return (SU_OK); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 21:35:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BFCFCC8; Thu, 19 Dec 2013 21:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 086E41B2A; Thu, 19 Dec 2013 21:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJLZXlJ018294; Thu, 19 Dec 2013 21:35:33 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJLZX77018293; Thu, 19 Dec 2013 21:35:33 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201312192135.rBJLZX77018293@svn.freebsd.org> From: Stefan Esser Date: Thu, 19 Dec 2013 21:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259633 - 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.17 Precedence: list List-Id: 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, 19 Dec 2013 21:35:34 -0000 Author: se Date: Thu Dec 19 21:35:33 2013 New Revision: 259633 URL: http://svnweb.freebsd.org/changeset/base/259633 Log: Fix compilation on 32 bit architectures and use INT64_MAX instead of LONG_MAX for the upper bound check. Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 19 21:31:28 2013 (r259632) +++ head/sys/kern/kern_event.c Thu Dec 19 21:35:33 2013 (r259633) @@ -523,11 +523,14 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { - if (data > LLONG_MAX / SBT_1MS) - return LLONG_MAX; + +#ifdef __LP64__ + if (data > INT64_MAX / SBT_1MS) + return INT64_MAX; +#endif return (SBT_1MS * data); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 22:13:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E915153E; Thu, 19 Dec 2013 22:13:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D51831E89; Thu, 19 Dec 2013 22:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJMDCYC033047; Thu, 19 Dec 2013 22:13:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJMDCYZ033046; Thu, 19 Dec 2013 22:13:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312192213.rBJMDCYZ033046@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 19 Dec 2013 22:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259634 - head/sys/geom/mirror 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.17 Precedence: list List-Id: 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, 19 Dec 2013 22:13:13 -0000 Author: ae Date: Thu Dec 19 22:13:12 2013 New Revision: 259634 URL: http://svnweb.freebsd.org/changeset/base/259634 Log: Prevent users from deactivating the last component of a mirror. PR: 184985 MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 19 21:35:33 2013 (r259633) +++ head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 19 22:13:12 2013 (r259634) @@ -695,7 +695,7 @@ g_mirror_ctl_deactivate(struct gctl_req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -716,6 +716,7 @@ g_mirror_ctl_deactivate(struct gctl_req gctl_error(req, "No such device: %s.", name); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -728,6 +729,16 @@ g_mirror_ctl_deactivate(struct gctl_req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't deactivate the " + "last ACTIVE component %s.", + sc->sc_geom->name, name); + continue; + } + } disk->d_flags |= G_MIRROR_DISK_FLAG_INACTIVE; disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; g_mirror_update_metadata(disk); From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 22:27:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BD929F8; Thu, 19 Dec 2013 22:27:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0C51F68; Thu, 19 Dec 2013 22:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJMRTRO037102; Thu, 19 Dec 2013 22:27:29 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJMRS0O037097; Thu, 19 Dec 2013 22:27:28 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312192227.rBJMRS0O037097@svn.freebsd.org> From: Neel Natu Date: Thu, 19 Dec 2013 22:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259635 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: 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, 19 Dec 2013 22:27:29 -0000 Author: neel Date: Thu Dec 19 22:27:28 2013 New Revision: 259635 URL: http://svnweb.freebsd.org/changeset/base/259635 Log: Add an option to ignore accesses by the guest to unimplemented MSRs. Also, ignore a couple of SandyBridge uncore PMC MSRs that Centos 6.4 writes to during boot. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/xmsr.c head/usr.sbin/bhyve/xmsr.h Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/bhyve.8 Thu Dec 19 22:27:28 2013 (r259635) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehAHPW +.Op Fl aehwAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu @@ -229,6 +229,8 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. +.It Fl w +Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl h Print help message and exit. .It Ar vmname Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/bhyverun.c Thu Dec 19 22:27:28 2013 (r259635) @@ -87,6 +87,7 @@ static int guest_vmexit_on_hlt, guest_vm static int virtio_msix = 1; static int strictio; +static int strictmsr = 1; static int acpi; @@ -122,7 +123,7 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-S ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" @@ -137,7 +138,8 @@ usage(int code) " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -l: LPC device configuration\n" - " -m: memory size in MB\n", + " -m: memory size in MB\n" + " -w: ignore unimplemented MSRs\n", progname, (int)strlen(progname), ""); exit(code); @@ -310,20 +312,43 @@ vmexit_inout(struct vmctx *ctx, struct v static int vmexit_rdmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - fprintf(stderr, "vm exit rdmsr 0x%x, cpu %d\n", vme->u.msr.code, - *pvcpu); - return (VMEXIT_ABORT); + uint64_t val; + uint32_t eax, edx; + int error; + + val = 0; + error = emulate_rdmsr(ctx, *pvcpu, vme->u.msr.code, &val); + if (error != 0) { + fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", + vme->u.msr.code, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + + eax = val; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RAX, eax); + assert(error == 0); + + edx = val >> 32; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RDX, edx); + assert(error == 0); + + return (VMEXIT_CONTINUE); } static int vmexit_wrmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - int newcpu; - int retval = VMEXIT_CONTINUE; - - newcpu = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code,vme->u.msr.wval); + int error; - return (retval); + error = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code, vme->u.msr.wval); + if (error != 0) { + fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", + vme->u.msr.code, vme->u.msr.wval, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + return (VMEXIT_CONTINUE); } static int @@ -577,7 +602,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:S:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -636,6 +661,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'w': + strictmsr = 0; + break; case 'W': virtio_msix = 0; break; Modified: head/usr.sbin/bhyve/xmsr.c ============================================================================== --- head/usr.sbin/bhyve/xmsr.c Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/xmsr.c Thu Dec 19 22:27:28 2013 (r259635) @@ -43,6 +43,19 @@ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val) { - printf("Unknown WRMSR code %x, val %lx, cpu %d\n", code, val, vcpu); - exit(1); + switch (code) { + case 0xd04: /* Sandy Bridge uncore PMC MSRs */ + case 0xc24: + return (0); + default: + break; + } + return (-1); +} + +int +emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val) +{ + + return (-1); } Modified: head/usr.sbin/bhyve/xmsr.h ============================================================================== --- head/usr.sbin/bhyve/xmsr.h Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/xmsr.h Thu Dec 19 22:27:28 2013 (r259635) @@ -30,5 +30,6 @@ #define _XMSR_H_ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val); +int emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val); #endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 19 22:36:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F465CF4; Thu, 19 Dec 2013 22:36:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 566C51020; Thu, 19 Dec 2013 22:36:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 26C6AB94C; Thu, 19 Dec 2013 17:36:01 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Date: Thu, 19 Dec 2013 15:52:03 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> In-Reply-To: <20131219115735.GN29088@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312191552.04202.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 19 Dec 2013 17:36:01 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 19 Dec 2013 22:36:02 -0000 On Thursday, December 19, 2013 6:57:35 am Gleb Smirnoff wrote: > On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: > J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > J> > On 18.12.2013 22:45, John-Mark Gurney wrote: > J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > J> > >> Author: melifaro > J> > >> Date: Wed Dec 18 18:25:27 2013 > J> > >> New Revision: 259562 > J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > J> > >> > J> > >> Log: > J> > >> Switch netstat -rn to use standard API for retrieving list of routes > J> > >> instead of peeking inside in-kernel radix via kget. > J> > >> This permits us to change kernel structures without breaking userland. > J> > >> Additionally, this change provide more reliable and faster output. > J> > >> > J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > J> > >> for other families) were removed. `Refs` is radix-specific thing > J> > >> which is not informative for users. `Use` field value is handy sometimes, > J> > >> but a) current API does not support it and b) I'm not sure we will > J> > >> support per-rte pcpu counters in near future. > J> > >> > J> > >> Old method of retrieving data is still supported (either by defining > J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > J> > >> hidden. > J> > >> > J> > >> Sponsored by: Yandex LLC > J> > >> MFC after: 4 weeks > J> > >> PR: kern/167204 > J> > > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > J> > > this change make it not usable, or will you still automatically use > J> > Well. It will probably break in (maybe, near) future. > J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's > J> fine if kvm mode is fragile and requires the binary to be in sync with the > J> kernel and is only used for crash dumps, but it is very useful to extract > J> all sorts of info out of a crash dump. > > The problem is that these tools (netstat, and some others) prevent us from > improving the kernel network stack. We can't make improvements that are > mergeable to stable/x branch, since the tools would be broken. No, I explicitly said "it's fine if the kvm mode is fragile and requires the binary to be in sync and is only used for crash dumps". That means it's fine to merge changes as long as you merge the whole thing together. It also means you don't have to support all possible internal kernel ABIs in a branch. > Moreover > any improvement in head/, requires from developer additional work in netstat > code, which I must admit isn't a pleasure to work with. Well, yes, there all sorts of things like, say, documentation that one has to do beyond the original hacking in order to make a logical change more complete. Plus, if you think writing netstat stuff in C is bad, try writing the equivalent in kgdb scripts instead (which is what you'd need to do to provide equivalent functionality) > I agree that usage of tools on vmcores is useful. But we all should agree that > it has very limited use. Only kernel hackers and developers are expected to > do this. If users enable crashinfo then they all run this for each crash, so not just developers. Having worked in an environment with hundreds of crashes per day, having some post-processed output to dig through rather than firing up kgdb every time is quite valuable. > My suggestion is that all this code is deleted from src/usr.bin/netstat, and > moved to src/tools, and we relax assertion that src/tools must be compatible > with any kernel within the branch. So, any person who wants this functionality, > needs to keep his src/tools in sync with kernel and compile a tool when he > desires to dump routing table from a vmcore. That is mostly what I suggested in terms of not having the same ABI guarantees, but I still want crashinfo to provide a comprehensive set of details to developers so that users can just mail that file to a developer without having to be walked through intricate gdb gymnastics. > Finally, when we remove all the kvm(3) usage from a tool, then we can remove > the sugid bit from it, which would be a another fine point. That is 100% irrelevant to crash dumps. I only ask that the KVM mode needs to work for crash dumps. I am more than happy for all "live" access to use sysctls instead of kvm and to not need the set-gid bit as a result. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 00:17:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 926A37CD; Fri, 20 Dec 2013 00:17:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC58171C; Fri, 20 Dec 2013 00:17:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK0HS5b077628; Fri, 20 Dec 2013 00:17:28 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK0HR3T077621; Fri, 20 Dec 2013 00:17:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312200017.rBK0HR3T077621@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 20 Dec 2013 00:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259638 - head/usr.bin/netstat 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.17 Precedence: list List-Id: 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, 20 Dec 2013 00:17:28 -0000 Author: melifaro Date: Fri Dec 20 00:17:26 2013 New Revision: 259638 URL: http://svnweb.freebsd.org/changeset/base/259638 Log: Use more fine-grained kvm(3) symbol lookup: routing code retrieves only necessary symbols needed per subsystem. Main kvm(3) init is now delayed as much as possbile. This finally fixes performance issues reported in kern/167204. Some non-working code (ng_socket.ko symbol addresses calculation) removed. Some global variables eliminated. PR: kern/167204 MFC after: 4 weeks Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/mroute6.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/if.c Fri Dec 20 00:17:26 2013 (r259638) @@ -223,7 +223,7 @@ next_ifma(struct ifmaddrs *ifma, const c * Print a description of the network interfaces. */ void -intpr(int interval, void (*pfunc)(char *)) +intpr(int interval, void (*pfunc)(char *), int af) { struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/main.c Fri Dec 20 00:17:26 2013 (r259638) @@ -319,7 +319,6 @@ int gflag; /* show group (multicast) ro int hflag; /* show counters in human readable format */ int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ -int Mflag; /* read statistics from core */ int mflag; /* show memory stats */ int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ @@ -425,7 +424,6 @@ main(int argc, char *argv[]) Lflag = 1; break; case 'M': - Mflag = 1; memf = optarg; break; case 'm': @@ -554,40 +552,40 @@ main(int argc, char *argv[]) * used for the queries, which is slower. */ #endif - kread(0, NULL, 0); if (iflag && !sflag) { - intpr(interval, NULL); + intpr(interval, NULL, af); exit(0); } if (rflag) { if (sflag) - rt_stats(nl[N_RTSTAT].n_value, nl[N_RTTRASH].n_value); + rt_stats(); else - routepr(nl[N_RTREE].n_value, fib); + routepr(fib, af); exit(0); } + if (gflag) { if (sflag) { if (af == AF_INET || af == AF_UNSPEC) - mrt_stats(nl[N_MRTSTAT].n_value); + mrt_stats(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mrt6_stats(nl[N_MRT6STAT].n_value); + mrt6_stats(); #endif } else { if (af == AF_INET || af == AF_UNSPEC) - mroutepr(nl[N_MFCHASHTBL].n_value, - nl[N_MFCTABLESIZE].n_value, - nl[N_VIFTABLE].n_value); + mroutepr(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mroute6pr(nl[N_MF6CTABLE].n_value, - nl[N_MIF6TABLE].n_value); + mroute6pr(); #endif } exit(0); } + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (tp) { printproto(tp, tp->pr_name); exit(0); @@ -640,7 +638,7 @@ printproto(struct protox *tp, const char if (sflag) { if (iflag) { if (tp->pr_istats) - intpr(interval, tp->pr_istats); + intpr(interval, tp->pr_istats, af); else if (pflag) printf("%s: no per-interface stats routine\n", tp->pr_name); @@ -703,7 +701,23 @@ kvmd_init(void) return (-1); } - if (kvm_nlist(kvmd, nl) < 0) { + return (0); +} + +/* + * Resolve symbol list, return 0 on success. + */ +int +kresolve_list(struct nlist *_nl) +{ + + if ((kvmd == NULL) && (kvmd_init() != 0)) + return (-1); + + if (_nl[0].n_type != 0) + return (0); + + if (kvm_nlist(kvmd, _nl) < 0) { if (nlistf) errx(1, "%s: kvm_nlist: %s", nlistf, kvm_geterr(kvmd)); @@ -711,13 +725,6 @@ kvmd_init(void) errx(1, "kvm_nlist: %s", kvm_geterr(kvmd)); } - if (nl[0].n_type == 0) { - if (nlistf) - errx(1, "%s: no namelist", nlistf); - else - errx(1, "no namelist"); - } - return (0); } Modified: head/usr.bin/netstat/mroute.c ============================================================================== --- head/usr.bin/netstat/mroute.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/mroute.c Fri Dec 20 00:17:26 2013 (r259638) @@ -65,11 +65,26 @@ __FBSDID("$FreeBSD$"); #undef _KERNEL #include +#include #include #include #include #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MRTSTAT 0 + { .n_name = "_mrtstat" }, +#define N_MFCHASHTBL 1 + { .n_name = "_mfchashtbl" }, +#define N_VIFTABLE 2 + { .n_name = "_viftable" }, +#define N_MFCTABLESIZE 3 + { .n_name = "_mfctablesize" }, + { .n_name = NULL }, +}; static void print_bw_meter(struct bw_meter *, int *); static void print_mfc(struct mfc *, int, int *); @@ -193,11 +208,12 @@ print_mfc(struct mfc *m, int maxvif, int } void -mroutepr(u_long pmfchashtbl, u_long pmfctablesize, u_long pviftbl) +mroutepr() { struct vif viftable[MAXVIFS]; struct vif *v; struct mfc *m; + u_long pmfchashtbl, pmfctablesize, pviftbl; int banner_printed; int saved_numeric_addr; size_t len; @@ -221,6 +237,16 @@ mroutepr(u_long pmfchashtbl, u_long pmfc */ maxvif = 0; + kresolve_list(mrl); + pmfchashtbl = mrl[N_MFCHASHTBL].n_value; + pmfctablesize = mrl[N_MFCTABLESIZE].n_value; + pviftbl = mrl[N_VIFTABLE].n_value; + + if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } + len = sizeof(viftable); if (live) { if (sysctlbyname("net.inet.ip.viftable", viftable, &len, NULL, @@ -338,15 +364,24 @@ mroutepr(u_long pmfchashtbl, u_long pmfc } void -mrt_stats(u_long mstaddr) +mrt_stats() { struct mrtstat mrtstat; - size_t len = sizeof mrtstat; + u_long mstaddr; + size_t len = sizeof(mrtstat); + + kresolve_list(mrl); + mstaddr = mrl[N_MRTSTAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } if (live) { if (sysctlbyname("net.inet.ip.mrtstat", &mrtstat, &len, NULL, 0) < 0) { - warn("sysctl: net.inet.ip.mrtstat"); + warn("sysctl: net.inet.ip.mrtstat failed."); return; } } else Modified: head/usr.bin/netstat/mroute6.c ============================================================================== --- head/usr.bin/netstat/mroute6.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/mroute6.c Fri Dec 20 00:17:26 2013 (r259638) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -95,17 +96,32 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MF6CTABLE 0 + { .n_name = "_mf6ctable" }, +#define N_MIF6TABLE 1 + { .n_name = "_mif6table" }, +#define N_MRT6STAT 2 + { .n_name = "_mrt6stat" }, + { .n_name = NULL }, +}; + + #define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */ #define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ void -mroute6pr(u_long mfcaddr, u_long mifaddr) +mroute6pr() { struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp; struct mif6 mif6table[MAXMIFS]; struct mf6c mfc; struct rtdetq rte, *rtep; struct mif6 *mifp; + u_long mfcaddr, mifaddr; mifi_t mifi; int i; int banner_printed; @@ -114,6 +130,15 @@ mroute6pr(u_long mfcaddr, u_long mifaddr long int waitings; size_t len; + kresolve_list(mrl); + mfcaddr = mrl[N_MF6CTABLE].n_value; + mifaddr = mrl[N_MIF6TABLE].n_value; + + if (mfcaddr == 0 || mifaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + len = sizeof(mif6table); if (live) { if (sysctlbyname("net.inet6.ip6.mif6table", mif6table, &len, @@ -217,11 +242,20 @@ mroute6pr(u_long mfcaddr, u_long mifaddr } void -mrt6_stats(u_long mstaddr) +mrt6_stats() { struct mrt6stat mrtstat; + u_long mstaddr; size_t len = sizeof mrtstat; + kresolve_list(mrl); + mstaddr = mrl[N_MRT6STAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + if (live) { if (sysctlbyname("net.inet6.ip6.mrt6stat", &mrtstat, &len, NULL, 0) < 0) { Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/netgraph.c Fri Dec 20 00:17:26 2013 (r259638) @@ -72,53 +72,10 @@ netgraphprotopr(u_long off, const char * /* If symbol not found, try looking in the KLD module */ if (off == 0) { - const char *const modname = "ng_socket.ko"; -/* XXX We should get "mpath" from "sysctl kern.module_path" */ - const char *mpath[] = { "/", "/boot/", "/modules/", NULL }; - struct nlist sym[] = { { .n_name = "_ngsocklist" }, - { .n_name = NULL } }; - const char **pre; - struct kld_file_stat ks; - int fileid; - - /* Can't do this for core dumps. */ - if (!live) - return; - - /* See if module is loaded */ - if ((fileid = kldfind(modname)) < 0) { - if (debug) - warn("kldfind(%s)", modname); - return; - } - - /* Get module info */ - memset(&ks, 0, sizeof(ks)); - ks.version = sizeof(struct kld_file_stat); - if (kldstat(fileid, &ks) < 0) { - if (debug) - warn("kldstat(%d)", fileid); - return; - } - - /* Get symbol table from module file */ - for (pre = mpath; *pre; pre++) { - char path[MAXPATHLEN]; - - snprintf(path, sizeof(path), "%s%s", *pre, modname); - if (nlist(path, sym) == 0) - break; - } - - /* Did we find it? */ - if (sym[0].n_value == 0) { - if (debug) - warnx("%s not found", modname); - return; - } - - /* Symbol found at load address plus symbol offset */ - off = (u_long) ks.address + sym[0].n_value; + if (debug) + fprintf(stderr, + "Error reading symbols from ng_socket.ko"); + return; } /* Get pointer to first socket */ Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/netstat.h Fri Dec 20 00:17:26 2013 (r259638) @@ -40,7 +40,6 @@ extern int gflag; /* show group (multica extern int hflag; /* show counters in human readable format */ extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ -extern int Mflag; /* read statistics from core */ extern int mflag; /* show memory stats */ extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ @@ -57,11 +56,12 @@ extern int interval; /* repeat interval extern char *interface; /* desired i/f for stats, or NULL for all i/fs */ extern int unit; /* unit number for above */ -extern int af; /* address family */ extern int live; /* true if we are examining a live system */ +struct nlist; int kread(u_long addr, void *buf, size_t size); int kread_counters(u_long addr, void *buf, size_t size); +int kresolve_list(struct nlist *); const char *plural(uintmax_t); const char *plurales(uintmax_t); const char *pluralies(uintmax_t); @@ -98,8 +98,8 @@ void icmp6_stats(u_long, const char *, i void icmp6_ifstats(char *); void pim6_stats(u_long, const char *, int, int); void rip6_stats(u_long, const char *, int, int); -void mroute6pr(u_long, u_long); -void mrt6_stats(u_long); +void mroute6pr(void); +void mrt6_stats(void); struct sockaddr_in6; struct in6_addr; @@ -120,11 +120,11 @@ void netisr_stats(void *); void hostpr(u_long, u_long); void impstats(u_long, u_long); -void intpr(int, void (*)(char *)); +void intpr(int, void (*)(char *), int); void pr_rthdr(int); void pr_family(int); -void rt_stats(u_long, u_long); +void rt_stats(void); char *ipx_pnet(struct sockaddr *); char *ipx_phost(struct sockaddr *); char *ns_phost(struct sockaddr *); @@ -136,7 +136,7 @@ char *atalk_print(struct sockaddr *, int char *atalk_print2(struct sockaddr *, struct sockaddr *, int); char *ipx_print(struct sockaddr *); char *ns_print(struct sockaddr *); -void routepr(u_long, int); +void routepr(int, int); void ipxprotopr(u_long, const char *, int, int); void spx_stats(u_long, const char *, int, int); @@ -166,6 +166,6 @@ void tp_protopr(u_long, const char *, in void tp_inproto(u_long); void tp_stats(caddr_t, caddr_t); -void mroutepr(u_long, u_long, u_long); -void mrt_stats(u_long); +void mroutepr(void); +void mrt_stats(void); void bpf_stats(char *); Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/route.c Fri Dec 20 00:17:26 2013 (r259638) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -106,6 +107,19 @@ struct bits { { 0 , 0 } }; +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist rl[] = { +#define N_RTSTAT 0 + { .n_name = "_rtstat" }, +#define N_RTREE 1 + { .n_name = "_rt_tables"}, +#define N_RTTRASH 2 + { .n_name = "_rttrash" }, + { .n_name = NULL }, +}; + typedef union { long dummy; /* Helps align structure. */ struct sockaddr u_sa; @@ -151,9 +165,10 @@ static void domask(char *, in_addr_t, u_ * Print routing tables. */ void -routepr(u_long rtree, int fibnum) +routepr(int fibnum, int af) { struct radix_node_head **rnhp, *rnh, head; + u_long rtree; size_t intsize; int fam, numfibs; @@ -165,10 +180,6 @@ routepr(u_long rtree, int fibnum) numfibs = 1; if (fibnum < 0 || fibnum > numfibs - 1) errx(EX_USAGE, "%d: invalid fib", fibnum); - rt_tables = calloc(numfibs * (AF_MAX+1), - sizeof(struct radix_node_head *)); - if (rt_tables == NULL) - err(EX_OSERR, "memory allocation failed"); /* * Since kernel & userland use different timebase * (time_uptime vs time_second) and we are reading kernel memory @@ -182,14 +193,20 @@ routepr(u_long rtree, int fibnum) printf(" (fib: %d)", fibnum); printf("\n"); - if (Aflag == 0 && Mflag == 0 && NewTree) + if (Aflag == 0 && live != 0 && NewTree) ntreestuff(fibnum, af); else { - if (rtree == 0) { + kresolve_list(rl); + if ((rtree = rl[N_RTREE].n_value) == 0) { printf("rt_tables: symbol not in namelist\n"); return; } + rt_tables = calloc(numfibs * (AF_MAX + 1), + sizeof(struct radix_node_head *)); + if (rt_tables == NULL) + err(EX_OSERR, "memory allocation failed"); + if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) return; @@ -572,14 +589,14 @@ ntreestuff(int fibnum, int af) mib[5] = 0; mib[6] = fibnum; if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump estimate"); + err(1, "sysctl: net.route.0.%d.dump.%d estimate", af, fibnum); } if ((buf = malloc(needed)) == 0) { errx(2, "malloc(%lu)", (unsigned long)needed); } if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump"); + err(1, "sysctl: net.route.0.%d.dump.%d", af, fibnum); } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { @@ -1071,16 +1088,19 @@ routename6(struct sockaddr_in6 *sa6) * Print routing statistics */ void -rt_stats(u_long rtsaddr, u_long rttaddr) +rt_stats(void) { struct rtstat rtstat; + u_long rtsaddr, rttaddr; int rttrash; - if (rtsaddr == 0) { + kresolve_list(rl); + + if ((rtsaddr = rl[N_RTSTAT].n_value) == 0) { printf("rtstat: symbol not in namelist\n"); return; } - if (rttaddr == 0) { + if ((rttaddr = rl[N_RTTRASH].n_value) == 0) { printf("rttrash: symbol not in namelist\n"); return; } From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 00:28:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34FDCB28; Fri, 20 Dec 2013 00:28:53 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF1217D4; Fri, 20 Dec 2013 00:28:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBK0SoMg073864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 04:28:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBK0Sooh073863; Fri, 20 Dec 2013 04:28:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 04:28:50 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220002849.GH71033@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312191552.04202.jhb@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 00:28:53 -0000 John, On Thu, Dec 19, 2013 at 03:52:03PM -0500, John Baldwin wrote: J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's J> > J> fine if kvm mode is fragile and requires the binary to be in sync with the J> > J> kernel and is only used for crash dumps, but it is very useful to extract J> > J> all sorts of info out of a crash dump. J> > J> > The problem is that these tools (netstat, and some others) prevent us from J> > improving the kernel network stack. We can't make improvements that are J> > mergeable to stable/x branch, since the tools would be broken. J> J> No, I explicitly said "it's fine if the kvm mode is fragile and requires the J> binary to be in sync and is only used for crash dumps". That means it's J> fine to merge changes as long as you merge the whole thing together. It also J> means you don't have to support all possible internal kernel ABIs in a branch. Sorry but this is not true. Yeah, I'm grateful that you personally allow me to break ABIs, but the general FreeBSD project policy doesn't allow that anymore in stable branches. I don't have strong opinion on this, I really think that running kernel and world out of sync is a bad idea, so I may agree with you. But the project as a whole have established a policy that within a stable branch newer kernel can run tools from x.0-RELEASE. And agree or not, I abide. J> > Moreover J> > any improvement in head/, requires from developer additional work in netstat J> > code, which I must admit isn't a pleasure to work with. J> J> Well, yes, there all sorts of things like, say, documentation that one has to J> do beyond the original hacking in order to make a logical change more complete. J> Plus, if you think writing netstat stuff in C is bad, try writing the equivalent J> in kgdb scripts instead (which is what you'd need to do to provide equivalent J> functionality) Actually I do that often, and find it easier to make kgdb scripts. J> > I agree that usage of tools on vmcores is useful. But we all should agree that J> > it has very limited use. Only kernel hackers and developers are expected to J> > do this. J> J> If users enable crashinfo then they all run this for each crash, so not just J> developers. Having worked in an environment with hundreds of crashes per day, J> having some post-processed output to dig through rather than firing up kgdb J> every time is quite valuable. I've fixed quite a lot of PRs in network stack and never payed attention to the routing table or ifnet stats provided by netstat in that long submissions attached to PRs. As said, w/o addresses this output is quite useless for debugging. J> > My suggestion is that all this code is deleted from src/usr.bin/netstat, and J> > moved to src/tools, and we relax assertion that src/tools must be compatible J> > with any kernel within the branch. So, any person who wants this functionality, J> > needs to keep his src/tools in sync with kernel and compile a tool when he J> > desires to dump routing table from a vmcore. J> J> That is mostly what I suggested in terms of not having the same ABI guarantees, J> but I still want crashinfo to provide a comprehensive set of details to developers J> so that users can just mail that file to a developer without having to be walked J> through intricate gdb gymnastics. Good, then this stuff just needs to migrate to a special crashdump tool. And probably its output shouldn't resemble netstat(1), since there is no reason for that. Perfectly if structures are just dumped as a whole. Yeah, here gdb scripting comes into mind. J> > Finally, when we remove all the kvm(3) usage from a tool, then we can remove J> > the sugid bit from it, which would be a another fine point. J> J> That is 100% irrelevant to crash dumps. I only ask that the KVM mode needs J> to work for crash dumps. I am more than happy for all "live" access to use J> sysctls instead of kvm and to not need the set-gid bit as a result. Looks like we are coming to agreement. The way to go is to remove kvm access from netstat, substituting it with proper APIs. The better crashdump utility needs to be started. Not yet sure that C + kvm(3) is a proper framework for it. I don't understand the plan with dtrace based tool well, but reading John-Marks' email I find it interesting. gdb scripting is also an option. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 00:56:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A88D4179; Fri, 20 Dec 2013 00:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88A8119DA; Fri, 20 Dec 2013 00:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK0uQ59091450; Fri, 20 Dec 2013 00:56:26 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK0uO2H091437; Fri, 20 Dec 2013 00:56:24 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201312200056.rBK0uO2H091437@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Fri, 20 Dec 2013 00:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259640 - in head/sys: arm/arm arm/include 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.17 Precedence: list List-Id: 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, 20 Dec 2013 00:56:26 -0000 Author: ganbold (doc committer) Date: Fri Dec 20 00:56:23 2013 New Revision: 259640 URL: http://svnweb.freebsd.org/changeset/base/259640 Log: Add identification and necessary type checks for Krait CPU cores. Krait CPU is used in Qualcomm Snapdragon S4 and Snapdragon 400/600/800 SoCs and has architectural similarities to ARM Cortex-A15. As for development boards IFC6400 series embedded boards from Inforce Computing uses Snapdragon S4 Pro/APQ8064. Approved by: stas (mentor) Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/identcpu.c head/sys/arm/arm/locore.S head/sys/arm/arm/swtch.S head/sys/arm/include/armreg.h head/sys/arm/include/cpuconf.h head/sys/arm/include/cpufunc.h head/sys/arm/include/intr.h head/sys/arm/include/md_var.h head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/cpufunc.c Fri Dec 20 00:56:23 2013 (r259640) @@ -1038,7 +1038,7 @@ struct cpu_functions arm1176_cpufuncs = }; #endif /*CPU_ARM1176 */ -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) struct cpu_functions cortexa_cpufuncs = { /* CPU functions */ @@ -1118,7 +1118,7 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_FA526) || defined(CPU_FA626TE) || defined(CPU_MV_PJ4B) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_CORTEXA) + defined(CPU_CORTEXA) || defined(CPU_KRAIT) static void get_cachetype_cp15(void); @@ -1416,7 +1416,7 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM1136 || CPU_ARM1176 */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) if (cputype == CPU_ID_CORTEXA5 || cputype == CPU_ID_CORTEXA7 || cputype == CPU_ID_CORTEXA8R1 || @@ -1425,7 +1425,8 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA15 ) { + cputype == CPU_ID_CORTEXA15 || + cputype == CPU_ID_KRAIT ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); @@ -2407,7 +2408,7 @@ pj4bv7_setup(args) } #endif /* CPU_MV_PJ4B */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) void cortexa_setup(char *args) Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/elf_trampoline.c Fri Dec 20 00:56:23 2013 (r259640) @@ -102,7 +102,7 @@ extern void xscalec3_l2cache_purge(void) #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all extern void sheeva_l2cache_wbinv_all(void); -#elif defined(CPU_CORTEXA) +#elif defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define cpu_idcache_wbinv_all armv7_idcache_wbinv_all #define cpu_l2cache_wbinv_all() #else Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/identcpu.c Fri Dec 20 00:56:23 2013 (r259640) @@ -254,6 +254,8 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA15, CPU_CLASS_CORTEXA, "Cortex A15", generic_steppings }, + { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait", + generic_steppings }, { CPU_ID_SA110, CPU_CLASS_SA1, "SA-110", sa110_steppings }, @@ -353,6 +355,7 @@ const struct cpu_classtab cpu_classes[] { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ { "Cortex-A", "CPU_CORTEXA" }, /* CPU_CLASS_CORTEXA */ + { "Krait", "CPU_KRAIT" }, /* CPU_CLASS_KRAIT */ { "SA-1", "CPU_SA110" }, /* CPU_CLASS_SA1 */ { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ { "ARM11J", "CPU_ARM11" }, /* CPU_CLASS_ARM11J */ Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/locore.S Fri Dec 20 00:56:23 2013 (r259640) @@ -170,7 +170,7 @@ Lunmapped: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -377,7 +377,7 @@ Ltag: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -389,7 +389,7 @@ Ltag: mcr p15, 0, r0, c3, c0, 0 /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE orr r0, r0, #CPU_CONTROL_AF_ENABLE #endif Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/swtch.S Fri Dec 20 00:56:23 2013 (r259640) @@ -131,7 +131,7 @@ ENTRY(cpu_throw) /* Switch to lwp0 context */ ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) mov lr, pc ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] #endif @@ -361,7 +361,7 @@ ENTRY(cpu_switch) cmpeq r0, r5 /* Same DACR? */ beq .Lcs_context_switched /* yes! */ -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) /* * Definately need to flush the cache. */ Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/armreg.h Fri Dec 20 00:56:23 2013 (r259640) @@ -158,6 +158,7 @@ #define CPU_ID_CORTEXA15 0x410fc0f0 #define CPU_ID_SA110 0x4401a100 #define CPU_ID_SA1100 0x4401a110 +#define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ #define CPU_ID_MV88FR331 0x56153310 /* Marvell Feroceon 88FR331 Core */ Modified: head/sys/arm/include/cpuconf.h ============================================================================== --- head/sys/arm/include/cpuconf.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/cpuconf.h Fri Dec 20 00:56:23 2013 (r259640) @@ -66,6 +66,7 @@ defined(CPU_FA626TE) + \ defined(CPU_XSCALE_IXP425)) + \ defined(CPU_CORTEXA) + \ + defined(CPU_KRAIT) + \ defined(CPU_MV_PJ4B) /* @@ -97,7 +98,7 @@ #endif #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_ARCH_7A 1 #else #define ARM_ARCH_7A 0 @@ -156,7 +157,7 @@ #define ARM_MMU_V6 0 #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_MMU_V7 1 #else #define ARM_MMU_V7 0 Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/cpufunc.h Fri Dec 20 00:56:23 2013 (r259640) @@ -188,7 +188,7 @@ extern u_int cputype; #else void tlb_broadcast(int); -#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) #define TLB_BROADCAST /* No need to explicitely send an IPI */ #else #define TLB_BROADCAST tlb_broadcast(7) @@ -463,7 +463,7 @@ void sheeva_l2cache_wbinv_all (void); #endif #if defined(CPU_ARM1136) || defined(CPU_ARM1176) || \ - defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) + defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) void arm11_setttb (u_int); void arm11_sleep (int); Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/intr.h Fri Dec 20 00:56:23 2013 (r259640) @@ -52,6 +52,8 @@ #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 160 +#elif defined(CPU_KRAIT) +#define NIRQ 288 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) #define NIRQ 128 #elif defined(SOC_MV_ARMADAXP) Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/md_var.h Fri Dec 20 00:56:23 2013 (r259640) @@ -63,6 +63,7 @@ enum cpu_class { CPU_CLASS_ARM10E, CPU_CLASS_ARM10EJ, CPU_CLASS_CORTEXA, + CPU_CLASS_KRAIT, CPU_CLASS_SA1, CPU_CLASS_XSCALE, CPU_CLASS_ARM11J, Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/conf/files.arm Fri Dec 20 00:56:23 2013 (r259640) @@ -6,7 +6,7 @@ arm/arm/blockio.S standard arm/arm/bootconfig.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/busdma_machdep.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard @@ -36,7 +36,7 @@ arm/arm/nexus.c standard arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/conf/options.arm Fri Dec 20 00:56:23 2013 (r259640) @@ -12,6 +12,7 @@ CPU_ARM9E opt_global.h CPU_ARM1136 opt_global.h CPU_ARM1176 opt_global.h CPU_CORTEXA opt_global.h +CPU_KRAIT opt_global.h CPU_FA526 opt_global.h CPU_FA626TE opt_global.h CPU_MV_PJ4B opt_global.h From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 02:14:03 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89D0DA50; Fri, 20 Dec 2013 02:14:03 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 440441F68; Fri, 20 Dec 2013 02:14:02 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBK2E1NH051428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 18:14:02 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBK2E1It051427; Thu, 19 Dec 2013 18:14:01 -0800 (PST) (envelope-from jmg) Date: Thu, 19 Dec 2013 18:14:01 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220021401.GX99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220002849.GH71033@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 19 Dec 2013 18:14:02 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Alexander V. Chernikov" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 02:14:03 -0000 Gleb Smirnoff wrote this message on Fri, Dec 20, 2013 at 04:28 +0400: > Looks like we are coming to agreement. The way to go is to remove kvm access > from netstat, substituting it with proper APIs. The better crashdump utility > needs to be started. Not yet sure that C + kvm(3) is a proper framework for > it. I don't understand the plan with dtrace based tool well, but reading > John-Marks' email I find it interesting. gdb scripting is also an option. So, CTF contains all the type information necessary and the members of the struct... For example: ctfdump -t /boot/kernel/kernel contains: <919> POINTER (anon) refers to 1556 [...] [1377] POINTER (anon) refers to 919 [1378] STRUCT (anon) (16 bytes) le_next type=919 off=0 le_prev type=1377 off=64 [...] <1556> STRUCT proc (1208 bytes) p_list type=1378 off=0 [...] So, we can now, assuming we don't repurpose field names, have a "copy kernel struct to userland struct" function that uses CTF to make the proper mappings... Obviously if userland has a field that is missing in the kernel or vise versa, or size/type doesn't match, then some handling will be needed, but for the most part we could ignore the new fields as that's often what the tools have to do when we change a padded field to not be padding... The interesting thing about this also is that it would mean we could also remove the need for padding, since the CTF would describe the struct size, etc. I have not looked at the internals of CTF, so I don't know how easy it would be to just extract the parts that we need for the struct, or if we'd need a sysctl to fetch all CTF data, or fetch it from the kernel.. Having the data split may be better so the kernel wouldn't have to fetch it all out each time, etc, plus it could be cached in the library... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 03:32:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 407577B9; Fri, 20 Dec 2013 03:32:49 +0000 (UTC) Date: Fri, 20 Dec 2013 03:32:49 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220033249.GA38281@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220002849.GH71033@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: src-committers@freebsd.org, "Alexander V. Chernikov" , John Baldwin , John-Mark Gurney , svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 03:32:49 -0000 On Fri, Dec 20, 2013 at 04:28:50AM +0400, Gleb Smirnoff wrote: > in stable branches. I don't have strong opinion on this, I really think that > running kernel and world out of sync is a bad idea, so I may agree with you. This notorious requirement (or strong recommendation) of keeping one's world and kernel in sync is a pain in the ass and an indication of certain design (or implementation) deficiencies. Linux does not have this problem, for instance. It should be perfectly OK to run any kernel and userland within reasonable time frame, instead of it being a bad idea. > Looks like we are coming to agreement. The way to go is to remove kvm access > from netstat, substituting it with proper APIs. Correct. Proper APIs. This would definitely help to decouple kernel and userland. ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 04:46:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79ACF847; Fri, 20 Dec 2013 04:46:59 +0000 (UTC) Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com [IPv6:2607:f8b0:400d:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3B67197E; Fri, 20 Dec 2013 04:46:58 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id i13so2278155qae.2 for ; Thu, 19 Dec 2013 20:46:58 -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=89ePiRYMafFVVSrYCHo/BcvdbtCfVTrPuyJep49RQ8Q=; b=l0hX54+OuFLtvDiG+gmKDKNTou0mJRLPdNCspwOO1o8tjTM1LiJyhtva/sqC+xz2G5 5MWRjcjcjvXJdtbcEMmM3cHWa2PCZhwPqzrLiHSxar1AfbJA1uPmkLAbKELerg3l169H OMDH1dmdIqx9hl/bNKb66xa/vxLThEfzYWCTjyfFddR5pP3X234qosLZQ789quoj3b6o P7vez9zDVTxbu9XsqIA17BUE0Xq9tXCgjHPSgXwKkYKOKfAWbCJ60tLmn96mz2y1cD5D 6SEgn+Vyvsgt/+g3+PZ2LxjyEveAGpJO4GZchzkAOeeWRqhlfNwpZHmL3Ul9AMPwVQ/S 2VHA== MIME-Version: 1.0 X-Received: by 10.229.56.200 with SMTP id z8mr10213809qcg.1.1387514818158; Thu, 19 Dec 2013 20:46:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Thu, 19 Dec 2013 20:46:58 -0800 (PST) In-Reply-To: <52B3620A.8050603@freebsd.org> References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> <52B35B37.5070809@FreeBSD.org> <52B3620A.8050603@freebsd.org> Date: Thu, 19 Dec 2013 20:46:58 -0800 X-Google-Sender-Auth: TeffFGI9SevtEAGLaI4IBOIWFOs Message-ID: Subject: Re: svn commit: r259609 - head/sys/kern From: Adrian Chadd To: Stefan Esser Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andreas Tobler , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 04:46:59 -0000 On 19 December 2013 13:15, Stefan Esser wrote: > NB: I should have known better and should have asked for a review of > this change before it wa committed. Sorry for the inconvenience > caused :( Hey, don't be (too) sorry - you chased down and debugged a substantially annoying bug that's been around since forever. Great work. :) -a From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 05:26:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65045306; Fri, 20 Dec 2013 05:26:28 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAAA71D73; Fri, 20 Dec 2013 05:26:27 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so1860112qcv.15 for ; Thu, 19 Dec 2013 21:26:26 -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=3JOOEd9V1CXSpEwmO2s8pvmsqjegroVffDZfI3SPYs4=; b=SS8yox9aeUAnoe4IpkJ830d/LMGyOxerT01CuSmL91bf+044ypjLwWLNKQAT3Y1fLB fIOtwSbffAPSHTk9blrqW3xqDfK2W+G2wMzXFI9ivo/SUaBu0/mP9709PvL2/FFSVzwQ pmsTfgsa92KH7XU6j+MvoMPYXSU1k01Hd+dbhGMvu9sFGeurCRKKwICXbWA8o1jZZXla VPxZ86s1jWvntQH1S9kSHW26/8Gsj+e3cvOJK6sLwcKguGZbMCNq+OSJOAyYToVKstop Z2EgZyy2OLL3tcn0QszVC4j9pdXQPnznrhkK4cTTU1J0ACqxNxb3nmgwZCUUsuHka7O4 lMkQ== MIME-Version: 1.0 X-Received: by 10.224.13.141 with SMTP id c13mr2723599qaa.76.1387517186881; Thu, 19 Dec 2013 21:26:26 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Thu, 19 Dec 2013 21:26:26 -0800 (PST) In-Reply-To: <20131220033249.GA38281@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> <20131220033249.GA38281@FreeBSD.org> Date: Thu, 19 Dec 2013 21:26:26 -0800 X-Google-Sender-Auth: ucbTBGbuJY8i8j3Ne-3aGSyO1Mc Message-ID: Subject: Re: svn commit: r259562 - head/usr.bin/netstat From: Adrian Chadd To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , "Alexander V. Chernikov" , John Baldwin , John-Mark Gurney , Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 05:26:28 -0000 Linux doesn't have this problem because debugging LInux is a wildly different thing. Maybe it's time we actually just bit the bullet and made libkvm much more fleshed out for pulling out stuff like this from core files. -a From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 05:50:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A554BC6; Fri, 20 Dec 2013 05:50:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFB391F4B; Fri, 20 Dec 2013 05:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK5oNEk098490; Fri, 20 Dec 2013 05:50:23 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK5oNmw098487; Fri, 20 Dec 2013 05:50:23 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312200550.rBK5oNmw098487@svn.freebsd.org> From: Neel Natu Date: Fri, 20 Dec 2013 05:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel 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.17 Precedence: list List-Id: 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, 20 Dec 2013 05:50:24 -0000 Author: neel Date: Fri Dec 20 05:50:22 2013 New Revision: 259641 URL: http://svnweb.freebsd.org/changeset/base/259641 Log: Re-arrange bits in the amd64/pmap 'pm_flags' field. The least significant 8 bits of 'pm_flags' are now used for the IPI vector to use for nested page table TLB shootdown. Previously we used IPI_AST to interrupt the host cpu which is functionally correct but could lead to misleading interrupt counts for AST handler. The AST handler was also doing a lot more than what is required for the nested page table TLB shootdown (EOI and IRET). Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/vmm/intel/ept.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/amd64/pmap.c Fri Dec 20 05:50:22 2013 (r259641) @@ -1295,6 +1295,7 @@ pmap_invalidate_page_pcid(pmap_t pmap, v static __inline void pmap_invalidate_ept(pmap_t pmap) { + int ipinum; sched_pin(); KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active), @@ -1319,11 +1320,9 @@ pmap_invalidate_ept(pmap_t pmap) /* * Force the vcpu to exit and trap back into the hypervisor. - * - * XXX this is not optimal because IPI_AST builds a trapframe - * whereas all we need is an 'eoi' followed by 'iret'. */ - ipi_selected(pmap->pm_active, IPI_AST); + ipinum = pmap->pm_flags & PMAP_NESTED_IPIMASK; + ipi_selected(pmap->pm_active, ipinum); sched_unpin(); } Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/include/pmap.h Fri Dec 20 05:50:22 2013 (r259641) @@ -312,9 +312,10 @@ struct pmap { }; /* flags */ -#define PMAP_PDE_SUPERPAGE (1 << 0) /* supports 2MB superpages */ -#define PMAP_EMULATE_AD_BITS (1 << 1) /* needs A/D bits emulation */ -#define PMAP_SUPPORTS_EXEC_ONLY (1 << 2) /* execute only mappings ok */ +#define PMAP_NESTED_IPIMASK 0xff +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ +#define PMAP_EMULATE_AD_BITS (1 << 9) /* needs A/D bits emulation */ +#define PMAP_SUPPORTS_EXEC_ONLY (1 << 10) /* execute only mappings ok */ typedef struct pmap *pmap_t; Modified: head/sys/amd64/vmm/intel/ept.c ============================================================================== --- head/sys/amd64/vmm/intel/ept.c Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/vmm/intel/ept.c Fri Dec 20 05:50:22 2013 (r259641) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include "vmx_cpufunc.h" +#include "vmm_ipi.h" #include "vmx_msr.h" #include "ept.h" @@ -98,6 +99,8 @@ ept_init(void) !INVEPT_ALL_TYPES_SUPPORTED(cap)) return (EINVAL); + ept_pmap_flags = vmm_ipinum & PMAP_NESTED_IPIMASK; + use_superpages = 1; TUNABLE_INT_FETCH("hw.vmm.ept.use_superpages", &use_superpages); if (use_superpages && EPT_PDE_SUPERPAGE(cap)) From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 07:41:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4559E6E6; Fri, 20 Dec 2013 07:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 187E516E3; Fri, 20 Dec 2013 07:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK7f3JC038124; Fri, 20 Dec 2013 07:41:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK7f3tL038123; Fri, 20 Dec 2013 07:41:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312200741.rBK7f3tL038123@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Dec 2013 07:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259642 - 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.17 Precedence: list List-Id: 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, 20 Dec 2013 07:41:04 -0000 Author: adrian Date: Fri Dec 20 07:41:03 2013 New Revision: 259642 URL: http://svnweb.freebsd.org/changeset/base/259642 Log: Disable the now unpredicably bogus check for whether we have eneough queue space before queuing a bunch of IP fragments. As the comment in the committed change says, in the post-if_transmit(), post-SMP, post-preemption world, there's just too much overlapping concurrent code paths and different approaches to driver transmit queue management to have this code even remotely be effective. The only specific place it could be useful is if ALTQ is enabled but again it doesn't at all promise that all the fragments will be transmitted anyway. The main reason for committing this change is to disable a parallel place where the drops counter is incremented. This is a side effect of an upcoming change to ixgbe/cxgbe to handle the queue drops counter slightly better. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Dec 20 05:50:22 2013 (r259641) +++ head/sys/netinet/ip_output.c Fri Dec 20 07:41:03 2013 (r259642) @@ -123,7 +123,9 @@ ip_output(struct mbuf *m, struct mbuf *o struct mbuf *m0; int hlen = sizeof (struct ip); int mtu; +#if 0 int n; /* scratchpad */ +#endif int error = 0; struct sockaddr_in *dst; const struct sockaddr_in *gw; @@ -431,6 +433,25 @@ again: } /* + * Both in the SMP world, pre-emption world if_transmit() world, + * the following code doesn't really function as intended any further. + * + * + There can and will be multiple CPUs running this code path + * in parallel, and we do no lock holding when checking the + * queue depth; + * + And since other threads can be running concurrently, even if + * we do pass this check, another thread may queue some frames + * before this thread does and it will end up partially or fully + * failing to send anyway; + * + if_transmit() based drivers don't necessarily set ifq_len + * at all. + * + * This should be replaced with a method of pushing an entire list + * of fragment frames to the driver and have the driver decide + * whether it can queue or not queue the entire set. + */ +#if 0 + /* * Verify that we have any chance at all of being able to queue the * packet or packet fragments, unless ALTQ is enabled on the given * interface in which case packetdrop should be done by queueing. @@ -446,6 +467,7 @@ again: ifp->if_snd.ifq_drops += n; goto bad; } +#endif /* * Look for broadcast address and From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 08:44:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A024A7F2; Fri, 20 Dec 2013 08:44:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1741CBB; Fri, 20 Dec 2013 08:44:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBK8iJGq075862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 12:44:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBK8iJnG075861; Fri, 20 Dec 2013 12:44:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 12:44:19 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259642 - head/sys/netinet Message-ID: <20131220084419.GK71033@FreeBSD.org> References: <201312200741.rBK7f3tL038123@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312200741.rBK7f3tL038123@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 08:44:37 -0000 On Fri, Dec 20, 2013 at 07:41:03AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Fri Dec 20 07:41:03 2013 A> New Revision: 259642 A> URL: http://svnweb.freebsd.org/changeset/base/259642 A> A> Log: A> Disable the now unpredicably bogus check for whether we have A> eneough queue space before queuing a bunch of IP fragments. A> A> As the comment in the committed change says, in the post-if_transmit(), A> post-SMP, post-preemption world, there's just too much overlapping A> concurrent code paths and different approaches to driver transmit A> queue management to have this code even remotely be effective. A> A> The only specific place it could be useful is if ALTQ is enabled A> but again it doesn't at all promise that all the fragments will be A> transmitted anyway. A> A> The main reason for committing this change is to disable a parallel A> place where the drops counter is incremented. This is a side effect A> of an upcoming change to ixgbe/cxgbe to handle the queue drops A> counter slightly better. I didn't get to review of actual patch, but IMO it would be better just to remove the code, not ifdef 0 it. The code ifdefed has zero probability to be enabled in its current form. If we ever fix it, code would look very different. No reason to do followup commit, that was just me muttering. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 10:57:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF3D592F; Fri, 20 Dec 2013 10:57:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB6BB1780; Fri, 20 Dec 2013 10:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKAvlvs010158; Fri, 20 Dec 2013 10:57:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKAvlpg010156; Fri, 20 Dec 2013 10:57:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201057.rBKAvlpg010156@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 10:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259644 - head/sys/dev/ixgbe 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.17 Precedence: list List-Id: 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, 20 Dec 2013 10:57:47 -0000 Author: glebius Date: Fri Dec 20 10:57:47 2013 New Revision: 259644 URL: http://svnweb.freebsd.org/changeset/base/259644 Log: ixgbe(4) takes packet counters from hardware in ixgbe_update_stats_counters(), so we don't need to do a per packet increment, which trashes cache line. Submitted by: oleg Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:49:57 2013 (r259643) +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:57:47 2013 (r259644) @@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr) } ++txr->packets; ++processed; - ++ifp->if_opackets; txr->watchdog_time = ticks; /* Try the next packet */ @@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que) mp->m_next = nbuf->buf; } else { /* Sending this frame */ sendmp->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; rxr->rx_packets++; /* capture data for AIM */ rxr->bytes += sendmp->m_pkthdr.len; From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 12:08:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34713E46; Fri, 20 Dec 2013 12:08:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF6F1DED; Fri, 20 Dec 2013 12:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKC8a6o036130; Fri, 20 Dec 2013 12:08:36 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKC8ab3036129; Fri, 20 Dec 2013 12:08:36 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312201208.rBKC8ab3036129@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 20 Dec 2013 12:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259645 - head/usr.bin/netstat 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.17 Precedence: list List-Id: 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, 20 Dec 2013 12:08:37 -0000 Author: melifaro Date: Fri Dec 20 12:08:36 2013 New Revision: 259645 URL: http://svnweb.freebsd.org/changeset/base/259645 Log: Further split kvm(3) and sysctl interfaces for route table printing. MFC after: 4 weeks Sponsored by: Yandex LLC Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Fri Dec 20 10:57:47 2013 (r259644) +++ head/usr.bin/netstat/route.c Fri Dec 20 12:08:36 2013 (r259645) @@ -139,7 +139,6 @@ int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; -struct radix_node_head **rt_tables; int NewTree = 1; @@ -149,16 +148,17 @@ static struct sockaddr *kgetsa(struct so static void size_cols(int ef, struct radix_node *rn); static void size_cols_tree(struct radix_node *rn); static void size_cols_rtentry(struct rtentry *rt); -static void p_tree(struct radix_node *); -static void p_rtnode(void); -static void ntreestuff(int fibnum, int af); -static void np_rtentry(struct rt_msghdr *); +static void p_rtnode_kvm(void); +static void p_rtable_sysctl(int, int); +static void p_rtable_kvm(int, int ); +static void p_rtree_kvm(struct radix_node *); +static void p_rtentry_sysctl(struct rt_msghdr *); static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags); static void p_flags(int, const char *); static const char *fmt_flags(int f); -static void p_rtentry(struct rtentry *); +static void p_rtentry_kvm(struct rtentry *); static void domask(char *, in_addr_t, u_long); /* @@ -167,10 +167,8 @@ static void domask(char *, in_addr_t, u_ void routepr(int fibnum, int af) { - struct radix_node_head **rnhp, *rnh, head; - u_long rtree; size_t intsize; - int fam, numfibs; + int numfibs; intsize = sizeof(int); if (fibnum == -1 && @@ -194,60 +192,12 @@ routepr(int fibnum, int af) printf("\n"); if (Aflag == 0 && live != 0 && NewTree) - ntreestuff(fibnum, af); - else { - kresolve_list(rl); - if ((rtree = rl[N_RTREE].n_value) == 0) { - printf("rt_tables: symbol not in namelist\n"); - return; - } - - rt_tables = calloc(numfibs * (AF_MAX + 1), - sizeof(struct radix_node_head *)); - if (rt_tables == NULL) - err(EX_OSERR, "memory allocation failed"); - - if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * - (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) - return; - for (fam = 0; fam <= AF_MAX; fam++) { - int tmpfib; - - switch (fam) { - case AF_INET6: - case AF_INET: - tmpfib = fibnum; - break; - default: - tmpfib = 0; - } - rnhp = (struct radix_node_head **)*rt_tables; - /* Calculate the in-kernel address. */ - rnhp += tmpfib * (AF_MAX+1) + fam; - /* Read the in kernel rhn pointer. */ - if (kget(rnhp, rnh) != 0) - continue; - if (rnh == NULL) - continue; - /* Read the rnh data. */ - if (kget(rnh, head) != 0) - continue; - if (fam == AF_UNSPEC) { - if (Aflag && af == 0) { - printf("Netmasks:\n"); - p_tree(head.rnh_treetop); - } - } else if (af == AF_UNSPEC || af == fam) { - size_cols(fam, head.rnh_treetop); - pr_family(fam); - do_rtent = 1; - pr_rthdr(fam); - p_tree(head.rnh_treetop); - } - } - } + p_rtable_sysctl(fibnum, af); + else + p_rtable_kvm(fibnum, af); } + /* * Print address family header before a section of the routing table. */ @@ -451,8 +401,75 @@ kgetsa(struct sockaddr *dst) return (&pt_u.u_sa); } +/* + * Print kernel routing tables for given fib + * using debugging kvm(3) interface. + */ +static void +p_rtable_kvm(int fibnum, int af) +{ + struct radix_node_head **rnhp, *rnh, head; + struct radix_node_head **rt_tables; + u_long rtree; + int fam, af_size; + + kresolve_list(rl); + if ((rtree = rl[N_RTREE].n_value) == 0) { + printf("rt_tables: symbol not in namelist\n"); + return; + } + + af_size = (AF_MAX + 1) * sizeof(struct radix_node_head *); + rt_tables = calloc(1, af_size); + if (rt_tables == NULL) + err(EX_OSERR, "memory allocation failed"); + + if (kread((u_long)(rtree), (char *)(rt_tables) + fibnum * af_size, + af_size) != 0) + return; + for (fam = 0; fam <= AF_MAX; fam++) { + int tmpfib; + + switch (fam) { + case AF_INET6: + case AF_INET: + tmpfib = fibnum; + break; + default: + tmpfib = 0; + } + rnhp = (struct radix_node_head **)*rt_tables; + /* Calculate the in-kernel address. */ + rnhp += tmpfib * (AF_MAX + 1) + fam; + /* Read the in kernel rhn pointer. */ + if (kget(rnhp, rnh) != 0) + continue; + if (rnh == NULL) + continue; + /* Read the rnh data. */ + if (kget(rnh, head) != 0) + continue; + if (fam == AF_UNSPEC) { + if (Aflag && af == 0) { + printf("Netmasks:\n"); + p_rtree_kvm(head.rnh_treetop); + } + } else if (af == AF_UNSPEC || af == fam) { + size_cols(fam, head.rnh_treetop); + pr_family(fam); + do_rtent = 1; + pr_rthdr(fam); + p_rtree_kvm(head.rnh_treetop); + } + } +} + +/* + * Print given kernel radix tree using + * debugging kvm(3) interface. + */ static void -p_tree(struct radix_node *rn) +p_rtree_kvm(struct radix_node *rn) { again: @@ -469,9 +486,9 @@ again: rnode.rn_dupedkey ? " =>\n" : "\n"); } else if (do_rtent) { if (kget(rn, rtentry) == 0) { - p_rtentry(&rtentry); + p_rtentry_kvm(&rtentry); if (Aflag) - p_rtnode(); + p_rtnode_kvm(); } } else { p_sockaddr(kgetsa((struct sockaddr *)rnode.rn_key), @@ -483,18 +500,18 @@ again: } else { if (Aflag && do_rtent) { printf("%-8.8lx ", (u_long)rn); - p_rtnode(); + p_rtnode_kvm(); } rn = rnode.rn_right; - p_tree(rnode.rn_left); - p_tree(rn); + p_rtree_kvm(rnode.rn_left); + p_rtree_kvm(rn); } } char nbuf[20]; static void -p_rtnode(void) +p_rtnode_kvm(void) { struct radix_mask *rm = rnode.rn_mklist; @@ -534,7 +551,7 @@ p_rtnode(void) } static void -ntreestuff(int fibnum, int af) +p_rtable_sysctl(int fibnum, int af) { size_t needed; int mib[7]; @@ -611,12 +628,12 @@ ntreestuff(int fibnum, int af) pr_family(fam); pr_rthdr(fam); } - np_rtentry(rtm); + p_rtentry_sysctl(rtm); } } static void -np_rtentry(struct rt_msghdr *rtm) +p_rtentry_sysctl(struct rt_msghdr *rtm) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); char buffer[128]; @@ -833,7 +850,7 @@ fmt_flags(int f) } static void -p_rtentry(struct rtentry *rt) +p_rtentry_kvm(struct rtentry *rt) { static struct ifnet ifnet, *lastif; static char buffer[128]; From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 13:12:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77372E1; Fri, 20 Dec 2013 13:12:46 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09E52134A; Fri, 20 Dec 2013 13:12:46 +0000 (UTC) Received: from [192.168.1.200] (p508F063C.dip0.t-ipconnect.de [80.143.6.60]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 343411C0C0693; Fri, 20 Dec 2013 14:12:44 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r259644 - head/sys/dev/ixgbe From: Michael Tuexen In-Reply-To: <201312201057.rBKAvlpg010156@svn.freebsd.org> Date: Fri, 20 Dec 2013 14:12:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> References: <201312201057.rBKAvlpg010156@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1510) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 13:12:46 -0000 On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff wrote: I think you need something like [bsd5:~/head] tuexen% svn diff Index: sys/dev/ixgbe/ixgbe.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/ixgbe/ixgbe.c (revision 259645) +++ sys/dev/ixgbe/ixgbe.c (working copy) @@ -3592,8 +3592,10 @@ static void ixgbe_txeof(struct tx_ring *txr) { +#ifdef DEV_NETMAP struct adapter *adapter =3D txr->adapter; struct ifnet *ifp =3D adapter->ifp; +#endif u32 work, processed =3D 0; u16 limit =3D txr->process_limit; struct ixgbe_tx_buf *buf; to get it compiling if DEV_NETMAP is not defined. Best regards Michael > Author: glebius > Date: Fri Dec 20 10:57:47 2013 > New Revision: 259644 > URL: http://svnweb.freebsd.org/changeset/base/259644 >=20 > Log: > ixgbe(4) takes packet counters from hardware in = ixgbe_update_stats_counters(), > so we don't need to do a per packet increment, which trashes cache = line. >=20 > Submitted by: oleg >=20 > Modified: > head/sys/dev/ixgbe/ixgbe.c >=20 > Modified: head/sys/dev/ixgbe/ixgbe.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/ixgbe/ixgbe.c Fri Dec 20 10:49:57 2013 = (r259643) > +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:57:47 2013 = (r259644) > @@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr) > } > ++txr->packets; > ++processed; > - ++ifp->if_opackets; > txr->watchdog_time =3D ticks; >=20 > /* Try the next packet */ > @@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que) > mp->m_next =3D nbuf->buf; > } else { /* Sending this frame */ > sendmp->m_pkthdr.rcvif =3D ifp; > - ifp->if_ipackets++; > rxr->rx_packets++; > /* capture data for AIM */ > rxr->bytes +=3D sendmp->m_pkthdr.len; >=20 From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 13:17:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D260F497; Fri, 20 Dec 2013 13:17:02 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD011387; Fri, 20 Dec 2013 13:17:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBKDGxm6077345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 17:16:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBKDGx7c077344; Fri, 20 Dec 2013 17:16:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 17:16:59 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r259644 - head/sys/dev/ixgbe Message-ID: <20131220131659.GQ71033@FreeBSD.org> References: <201312201057.rBKAvlpg010156@svn.freebsd.org> <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 13:17:02 -0000 On Fri, Dec 20, 2013 at 02:12:42PM +0100, Michael Tuexen wrote: M> On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff wrote: M> M> I think you need something like M> M> [bsd5:~/head] tuexen% svn diff M> Index: sys/dev/ixgbe/ixgbe.c M> =================================================================== M> --- sys/dev/ixgbe/ixgbe.c (revision 259645) M> +++ sys/dev/ixgbe/ixgbe.c (working copy) M> @@ -3592,8 +3592,10 @@ M> static void M> ixgbe_txeof(struct tx_ring *txr) M> { M> +#ifdef DEV_NETMAP M> struct adapter *adapter = txr->adapter; M> struct ifnet *ifp = adapter->ifp; M> +#endif M> u32 work, processed = 0; M> u16 limit = txr->process_limit; M> struct ixgbe_tx_buf *buf; M> M> to get it compiling if DEV_NETMAP is not defined. Thanks, Michael. And sorry for broken build. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 13:18:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7957A68C; Fri, 20 Dec 2013 13:18:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6544B139F; Fri, 20 Dec 2013 13:18:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKDIpge061898; Fri, 20 Dec 2013 13:18:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKDIpI9061897; Fri, 20 Dec 2013 13:18:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201318.rBKDIpI9061897@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 13:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259646 - head/sys/dev/ixgbe 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.17 Precedence: list List-Id: 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, 20 Dec 2013 13:18:51 -0000 Author: glebius Date: Fri Dec 20 13:18:50 2013 New Revision: 259646 URL: http://svnweb.freebsd.org/changeset/base/259646 Log: Fix build broken in r259644. Submitted by: tuexen Pointy hat to: glebius Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 12:08:36 2013 (r259645) +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 13:18:50 2013 (r259646) @@ -3592,8 +3592,10 @@ ixgbe_atr(struct tx_ring *txr, struct mb static void ixgbe_txeof(struct tx_ring *txr) { +#ifdef DEV_NETMAP struct adapter *adapter = txr->adapter; struct ifnet *ifp = adapter->ifp; +#endif u32 work, processed = 0; u16 limit = txr->process_limit; struct ixgbe_tx_buf *buf; From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 14:03:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A9C93BC; Fri, 20 Dec 2013 14:03:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 863D91741; Fri, 20 Dec 2013 14:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKE3vPW079027; Fri, 20 Dec 2013 14:03:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKE3ubm079021; Fri, 20 Dec 2013 14:03:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201312201403.rBKE3ubm079021@svn.freebsd.org> From: Attilio Rao Date: Fri, 20 Dec 2013 14:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259647 - head/sys/dev/hwpmc 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.17 Precedence: list List-Id: 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, 20 Dec 2013 14:03:57 -0000 Author: attilio Date: Fri Dec 20 14:03:56 2013 New Revision: 259647 URL: http://svnweb.freebsd.org/changeset/base/259647 Log: o Remove assertions on ipa_version as sometimes the version detection using cpuid can be quirky (this is the case of VMWare without the vPMC support) but fail to probe hwpmc. o Apply the fix for XEON family of processors as established by 315338-020 document (bug AJ85). Sponsored by: EMC / Isilon storage division Reviewed by: fabient Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 14:03:56 2013 (r259647) @@ -2627,35 +2627,33 @@ core2_intr(int cpu, struct trapframe *tf } int -pmc_core_initialize(struct pmc_mdep *md, int maxcpu) +pmc_core_initialize(struct pmc_mdep *md, int maxcpu, int version_override) { int cpuid[CORE_CPUID_REQUEST_SIZE]; int ipa_version, flags, nflags; do_cpuid(CORE_CPUID_REQUEST, cpuid); - ipa_version = cpuid[CORE_CPUID_EAX] & 0xFF; + ipa_version = (version_override > 0) ? version_override : + cpuid[CORE_CPUID_EAX] & 0xFF; + core_cputype = md->pmd_cputype; PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", - md->pmd_cputype, maxcpu, ipa_version); + core_cputype, maxcpu, ipa_version); - if (ipa_version < 1 || ipa_version > 3) { + if (ipa_version < 1 || ipa_version > 3 || + (core_cputype != PMC_CPU_INTEL_CORE && ipa_version == 1)) { /* Unknown PMC architecture. */ printf("hwpc_core: unknown PMC architecture: %d\n", ipa_version); return (EPROGMISMATCH); } - core_cputype = md->pmd_cputype; - core_pmcmask = 0; /* * Initialize programmable counters. */ - KASSERT(ipa_version >= 1, - ("[core,%d] ipa_version %d too small", __LINE__, ipa_version)); - core_iap_npmc = (cpuid[CORE_CPUID_EAX] >> 8) & 0xFF; core_iap_width = (cpuid[CORE_CPUID_EAX] >> 16) & 0xFF; @@ -2670,10 +2668,6 @@ pmc_core_initialize(struct pmc_mdep *md, * Initialize fixed function counters, if present. */ if (core_cputype != PMC_CPU_INTEL_CORE) { - KASSERT(ipa_version >= 2, - ("[core,%d] ipa_version %d too small", __LINE__, - ipa_version)); - core_iaf_ri = core_iap_npmc; core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F; core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF; Modified: head/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 14:03:56 2013 (r259647) @@ -175,7 +175,8 @@ struct pmc_md_iap_pmc { * Prototypes. */ -int pmc_core_initialize(struct pmc_mdep *_md, int _maxcpu); +int pmc_core_initialize(struct pmc_mdep *_md, int _maxcpu, + int _version_override); void pmc_core_finalize(struct pmc_mdep *_md); void pmc_core_mark_started(int _cpu, int _pmc); Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 14:03:56 2013 (r259647) @@ -78,7 +78,7 @@ pmc_intel_initialize(void) { struct pmc_mdep *pmc_mdep; enum pmc_cputype cputype; - int error, model, nclasses, ncpus; + int error, model, nclasses, ncpus, stepping, verov; KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[intel,%d] Initializing non-intel processor", __LINE__)); @@ -88,7 +88,9 @@ pmc_intel_initialize(void) cputype = -1; nclasses = 2; error = 0; + verov = 0; model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); + stepping = cpu_id & 0xF; switch (cpu_id & 0xF00) { #if defined(__i386__) @@ -119,8 +121,14 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_CORE; break; case 0xF: - cputype = PMC_CPU_INTEL_CORE2; - nclasses = 3; + /* Per Intel document 315338-020. */ + if (stepping == 0x7) { + cputype = PMC_CPU_INTEL_CORE; + verov = 1; + } else { + cputype = PMC_CPU_INTEL_CORE2; + nclasses = 3; + } break; case 0x17: cputype = PMC_CPU_INTEL_CORE2EXTREME; @@ -210,7 +218,7 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: case PMC_CPU_INTEL_HASWELL: - error = pmc_core_initialize(pmc_mdep, ncpus); + error = pmc_core_initialize(pmc_mdep, ncpus, verov); break; /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 14:43:34 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B192E23; Fri, 20 Dec 2013 14:43:34 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D03301A18; Fri, 20 Dec 2013 14:43:32 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBKEgsNG092114; Fri, 20 Dec 2013 15:43:23 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B4576E.7030203@FreeBSD.org> Date: Fri, 20 Dec 2013 15:42:54 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r259619 - in head/contrib/gcc: . cp doc References: <201312191827.rBJIRWPc047314@svn.freebsd.org> In-Reply-To: <201312191827.rBJIRWPc047314@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 14:43:34 -0000 On 19.12.13 19:27, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 19 18:27:32 2013 > New Revision: 259619 > URL: http://svnweb.freebsd.org/changeset/base/259619 > > Log: > gcc: backport upstream fix for issue with C++'s placement new > > Fixes GCC libstdc++/29286 > > Obtained from: gcc 4.3 (rev. 125603, 125653; GPLv2) > MFC after: 2 weeks Pedro, is this commit complete? If so, please revert. I get a compiler on powerpc64 which immediately segfaults. Thanks, Andreas From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 14:56:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B76AC80D; Fri, 20 Dec 2013 14:56:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96F201AE7; Fri, 20 Dec 2013 14:56:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKEutiY098389; Fri, 20 Dec 2013 14:56:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKEurZW098371; Fri, 20 Dec 2013 14:56:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201456.rBKEurZW098371@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 14:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259649 - in head/contrib/gcc: . config cp 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.17 Precedence: list List-Id: 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, 20 Dec 2013 14:56:55 -0000 Author: pfg Date: Fri Dec 20 14:56:52 2013 New Revision: 259649 URL: http://svnweb.freebsd.org/changeset/base/259649 Log: gcc: more diff reductions against Apple GCC. Mostly cosmetical changes to aid further merges. Obtained from: gcc 4.3 (rev. 120611, 124839; GPLv2) MFC after: 1 week Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/darwin.h head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/Make-lang.in head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/rtti.c head/contrib/gcc/doc/tm.texi head/contrib/gcc/dwarf2out.c head/contrib/gcc/sched-vis.c head/contrib/gcc/target-def.h head/contrib/gcc/target.h head/contrib/gcc/tree-dump.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 14:56:52 2013 (r259649) @@ -150,6 +150,14 @@ regs_invalidated_by_call, rather than just checking the membership of REGNO (REG). +2007-05-18 Geoffrey Keating (r124839) + + * dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'. + (output_die): Use 'unsigned long' with %x. + * sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and + HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT. + * tree-dump.c (dump_pointer): Use 'unsigned long' for %lx. + 2007-05-16 Eric Christopher (r124763) * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register @@ -470,6 +478,14 @@ * c-common.c (vector_types_convertible_p): Treat opaque types as always convertible if they have the same size, but not otherwise. +2007-01-08 Geoffrey Keating (r120611) + + * target.h (struct gcc_target): New field library_rtti_comdat. + * target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New. + (TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT. + * doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT. + * config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define. + 2007-01-08 Mark Shinwell (r120572) * c.opt: Add -flax-vector-conversions. Modified: head/contrib/gcc/config/darwin.h ============================================================================== --- head/contrib/gcc/config/darwin.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/config/darwin.h Fri Dec 20 14:56:52 2013 (r259649) @@ -467,6 +467,10 @@ extern GTY(()) int darwin_ms_struct; with names, so it's safe to make the class data not comdat. */ #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false +/* For efficiency, on Darwin the RTTI information that is always + emitted in the standard C++ library should not be COMDAT. */ +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false + /* We make exception information linkonce. */ #undef TARGET_USES_WEAK_UNWIND_INFO #define TARGET_USES_WEAK_UNWIND_INFO 1 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:56:52 2013 (r259649) @@ -35,6 +35,10 @@ * typeck.c (build_binary_op): Include types in error. +2007-05-18 Geoffrey Keating (r124839) + + * mangle.c (write_real_cst): Use 'unsigned long' for %lx. + 2007-05-05 Geoffrey Keating (r124467) PR 31775 Modified: head/contrib/gcc/cp/Make-lang.in ============================================================================== --- head/contrib/gcc/cp/Make-lang.in Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/Make-lang.in Fri Dec 20 14:56:52 2013 (r259649) @@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_ $(TARGET_H) debug.h cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ - gt-cp-rtti.h + $(TARGET_H) gt-cp-rtti.h cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 14:56:52 2013 (r259649) @@ -1340,7 +1340,7 @@ write_real_cst (const tree value) for (; i != limit; i += dir) { - sprintf (buffer, "%08lx", target_real[i]); + sprintf (buffer, "%08lx", (unsigned long) target_real[i]); write_chars (buffer, 8); } } Modified: head/contrib/gcc/cp/rtti.c ============================================================================== --- head/contrib/gcc/cp/rtti.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/rtti.c Fri Dec 20 14:56:52 2013 (r259649) @@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA. */ #include "assert.h" #include "toplev.h" #include "convert.h" +#include "target.h" /* C++ returns type information to the user in struct type_info objects. We also use type information to implement dynamic_cast and @@ -1427,8 +1428,11 @@ emit_support_tinfos (void) comdat_linkage for details.) Since we want these objects to have external linkage so that copies do not have to be emitted in code outside the runtime library, we make them - non-COMDAT here. */ - if (!flag_weak) + non-COMDAT here. + + It might also not be necessary to follow this detail of the + ABI. */ + if (!flag_weak || ! targetm.cxx.library_rtti_comdat ()) { gcc_assert (TREE_PUBLIC (tinfo) && !DECL_COMDAT (tinfo)); DECL_INTERFACE_KNOWN (tinfo) = 1; Modified: head/contrib/gcc/doc/tm.texi ============================================================================== --- head/contrib/gcc/doc/tm.texi Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/doc/tm.texi Fri Dec 20 14:56:52 2013 (r259649) @@ -8953,6 +8953,12 @@ classes whose virtual table will be emit unit will not be COMDAT. @end deftypefn +@deftypefn {Target Hook} bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void) +This hook returns true (the default) if the RTTI information for +the basic types which is defined in the C++ runtime should always +be COMDAT, false if it should not be COMDAT. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void) This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI) should be used to register static destructors when @option{-fuse-cxa-atexit} Modified: head/contrib/gcc/dwarf2out.c ============================================================================== --- head/contrib/gcc/dwarf2out.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/dwarf2out.c Fri Dec 20 14:56:52 2013 (r259649) @@ -5741,11 +5741,11 @@ print_die (dw_die_ref die, FILE *outfile unsigned ix; print_spaces (outfile); - fprintf (outfile, "DIE %4lu: %s\n", + fprintf (outfile, "DIE %4ld: %s\n", die->die_offset, dwarf_tag_name (die->die_tag)); print_spaces (outfile); fprintf (outfile, " abbrev id: %lu", die->die_abbrev); - fprintf (outfile, " offset: %lu\n", die->die_offset); + fprintf (outfile, " offset: %ld\n", die->die_offset); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -5793,7 +5793,7 @@ print_die (dw_die_ref die, FILE *outfile if (AT_ref (a)->die_symbol) fprintf (outfile, "die -> label: %s", AT_ref (a)->die_symbol); else - fprintf (outfile, "die -> %lu", AT_ref (a)->die_offset); + fprintf (outfile, "die -> %ld", AT_ref (a)->die_offset); } else fprintf (outfile, "die -> "); @@ -7063,7 +7063,8 @@ output_die (dw_die_ref die) output_die_symbol (die); dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (0x%lx) %s)", - die->die_offset, dwarf_tag_name (die->die_tag)); + (unsigned long)die->die_offset, + dwarf_tag_name (die->die_tag)); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -7245,7 +7246,7 @@ output_die (dw_die_ref die) /* Add null byte to terminate sibling list. */ if (die->die_child != NULL) dw2_asm_output_data (1, 0, "end of children of DIE 0x%lx", - die->die_offset); + (unsigned long) die->die_offset); } /* Output the compilation unit that appears at the beginning of the Modified: head/contrib/gcc/sched-vis.c ============================================================================== --- head/contrib/gcc/sched-vis.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/sched-vis.c Fri Dec 20 14:56:52 2013 (r259649) @@ -430,7 +430,10 @@ print_value (char *buf, rtx x, int verbo if (FLOAT_MODE_P (GET_MODE (x))) real_to_decimal (t, CONST_DOUBLE_REAL_VALUE (x), sizeof (t), 0, 1); else - sprintf (t, "<0x%lx,0x%lx>", (long) CONST_DOUBLE_LOW (x), (long) CONST_DOUBLE_HIGH (x)); + sprintf (t, + "<" HOST_WIDE_INT_PRINT_HEX "," HOST_WIDE_INT_PRINT_HEX ">", + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x), + (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x)); cur = safe_concat (buf, cur, t); break; case CONST_STRING: Modified: head/contrib/gcc/target-def.h ============================================================================== --- head/contrib/gcc/target-def.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/target-def.h Fri Dec 20 14:56:52 2013 (r259649) @@ -587,6 +587,10 @@ Foundation, 51 Franklin Street, Fifth Fl #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_true #endif +#ifndef TARGET_CXX_LIBRARY_RTTI_COMDAT +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_true +#endif + #ifndef TARGET_CXX_USE_AEABI_ATEXIT #define TARGET_CXX_USE_AEABI_ATEXIT hook_bool_void_false #endif @@ -606,6 +610,7 @@ Foundation, 51 Franklin Street, Fifth Fl TARGET_CXX_KEY_METHOD_MAY_BE_INLINE, \ TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY, \ TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT, \ + TARGET_CXX_LIBRARY_RTTI_COMDAT, \ TARGET_CXX_USE_AEABI_ATEXIT, \ TARGET_CXX_ADJUST_CLASS_AT_DEFINITION \ } Modified: head/contrib/gcc/target.h ============================================================================== --- head/contrib/gcc/target.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/target.h Fri Dec 20 14:56:52 2013 (r259649) @@ -783,6 +783,10 @@ struct gcc_target class data for classes whose virtual table will be emitted in only one translation unit will not be COMDAT. */ bool (*class_data_always_comdat) (void); + /* Returns true (the default) if the RTTI for the basic types, + which is always defined in the C++ runtime, should be COMDAT; + false if it should not be COMDAT. */ + bool (*library_rtti_comdat) (void); /* Returns true if __aeabi_atexit should be used to register static destructors. */ bool (*use_aeabi_atexit) (void); Modified: head/contrib/gcc/tree-dump.c ============================================================================== --- head/contrib/gcc/tree-dump.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/tree-dump.c Fri Dec 20 14:56:52 2013 (r259649) @@ -166,7 +166,7 @@ void dump_pointer (dump_info_p di, const char *field, void *ptr) { dump_maybe_newline (di); - fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr); + fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr); di->column += 15; } From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 15:37:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C94924F5; Fri, 20 Dec 2013 15:37:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B556F1EA0; Fri, 20 Dec 2013 15:37:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFbvGO013398; Fri, 20 Dec 2013 15:37:57 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFbv9M013396; Fri, 20 Dec 2013 15:37:57 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312201537.rBKFbv9M013396@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 20 Dec 2013 15:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259650 - head/sys/dev/vt 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.17 Precedence: list List-Id: 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, 20 Dec 2013 15:37:57 -0000 Author: ray Date: Fri Dec 20 15:37:57 2013 New Revision: 259650 URL: http://svnweb.freebsd.org/changeset/base/259650 Log: Set mouse level per window, instead of global. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Dec 20 14:56:52 2013 (r259649) +++ head/sys/dev/vt/vt.h Fri Dec 20 15:37:57 2013 (r259650) @@ -244,6 +244,7 @@ struct vt_window { int vw_kbdmode; /* (?) Keyboard mode. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ + int vw_mouse_level;/* Mouse op mode. */ #define VWF_BUSY 0x1 /* Busy reconfiguring device. */ #define VWF_OPENED 0x2 /* TTY in use. */ #define VWF_SCROLL 0x4 /* Keys influence scrollback. */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 14:56:52 2013 (r259649) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 15:37:57 2013 (r259650) @@ -633,6 +633,9 @@ vtterm_param(struct terminal *tm, int cm case TP_SHOWCURSOR: vtbuf_cursor_visibility(&vw->vw_buf, arg); break; + case TP_MOUSE: + vw->vw_mouse_level = arg; + break; } } @@ -1206,7 +1209,7 @@ vt_mouse_event(int type, int x, int y, i * under mouse pointer when nothing changed. */ - if (mlevel > 0) + if (vw->vw_mouse_level > 0) vt_mouse_terminput(vd, type, x, y, event, cnt); switch (type) { From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 15:45:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A8D6783; Fri, 20 Dec 2013 15:45:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16C511F38; Fri, 20 Dec 2013 15:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFjMQC016905; Fri, 20 Dec 2013 15:45:22 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFjMkG016904; Fri, 20 Dec 2013 15:45:22 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312201545.rBKFjMkG016904@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 20 Dec 2013 15:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259651 - head/sys/dev/vt 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.17 Precedence: list List-Id: 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, 20 Dec 2013 15:45:23 -0000 Author: ray Date: Fri Dec 20 15:45:22 2013 New Revision: 259651 URL: http://svnweb.freebsd.org/changeset/base/259651 Log: Enable AltGr key by default. Asked by: many Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 15:37:57 2013 (r259650) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 15:45:22 2013 (r259651) @@ -113,7 +113,7 @@ const struct terminal_class vt_termclass int sc_txtmouse_no_retrace_wait; static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "Newcons parameters"); -VT_SYSCTL_INT(enable_altgr, 0, "Enable AltGr key (Do not assume R.Alt as Alt)"); +VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "Newcons debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 16:01:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C08021D; Fri, 20 Dec 2013 16:01:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36F4110BB; Fri, 20 Dec 2013 16:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKG15lh023605; Fri, 20 Dec 2013 16:01:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKG123g023587; Fri, 20 Dec 2013 16:01:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201601.rBKG123g023587@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 16:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259655 - head/contrib/gcc/cp 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.17 Precedence: list List-Id: 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, 20 Dec 2013 16:01:05 -0000 Author: pfg Date: Fri Dec 20 16:01:02 2013 New Revision: 259655 URL: http://svnweb.freebsd.org/changeset/base/259655 Log: gcc: merge upstream fix and new feature. Fix for PR c++/29928 Add support for Rvalue references as described here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html Obtained from: gcc 4.3 (rev. 124724, 125211; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/call.c head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/error.c head/contrib/gcc/cp/except.c head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/parser.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/rtti.c head/contrib/gcc/cp/tree.c head/contrib/gcc/cp/typeck.c Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 16:01:02 2013 (r259655) @@ -35,10 +35,75 @@ * typeck.c (build_binary_op): Include types in error. +2007-05-30 Russell Yanofsky (r125211) + Douglas Gregor + Pedro Lamarao + Howard Hinnant + + PR c++/7412 + PR c++/29939 + * typeck.c (comptypes): Don't consider rvalue and lvalue + reference types to be equivalent. + (check_return_expr): Move from certain lvalues when returning + them. + * decl.c (grokdeclarator): Implement reference collapsing. + (copy_fn_p): Don't consider constructors taking rvalue references + to be copy constructors. + (move_fn_p): New. + * call.c (conversion): New "rvaluedness_matches_p" member. + (convert_class_to_reference): Require reference type as first + parameter instead of base type. + (reference_binding): Add logic to handle rvalue references. + (implicit_conversion): Update inaccurate comment. + (convert_like_real): Disable creation of temporaries that are + impossible to initialize for types with move constructors. + (build_over_call): Elide move constructors when possible. + (maybe_handle_implicit_object): Set "rvaluedness_matches_p". + (maybe_handle_ref_bind): Return conversion instead of type node. + (compare_ics): Add logic to use "rvaluedness_matches_p" values to + determine preferred conversion sequences. + * cp-tree.h (TYPE_REF_IS_RVALUE): New. + (LOOKUP_PREFER_RVALUE): New. + (DECL_MOVE_CONSTRUCTOR_P): New. + (struct cp_declarator): Add "reference" member for reference + types, with new "rvalue_ref" flag. + (cp_build_reference_type): Declare. + (move_fn_p): Declare. + * error.c (dump_type_prefix): Format rvalue reference types + correctly in error messages. + * except.c (build_throw): Move from certain lvalues when + throwing. + * mangle.c (write_type): Mangle rvalue references differently + than regular references. + * parser.c (make_reference_declarator): Add boolean parameter for + rvalue references. + (cp_parser_make_indirect_declarator): New. + (cp_parser_new_declarator_opt): Call + cp_parser_make_indirect_declarator. + (cp_parser_conversion_declarator_opt): Ditto. + (cp_parser_declarator): Ditto. + (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference + declarators. + * pt.c (tsubst): Implement reference collapsing. + (maybe_adjust_types_for_deduction): Implement special template + parameter deduction rule for rvalue references. + (type_unification_real): Update calls to + maybe_adjust_types_for_deduction. + (try_one_overload): Ditto. + (unify_pack_expansion): Ditto. + * tree.c (lvalue_p_1): Handle rvalue reference types. + (cp_build_reference_type): New. + 2007-05-18 Geoffrey Keating (r124839) * mangle.c (write_real_cst): Use 'unsigned long' for %lx. +2007-05-14 Paolo Carlini (r124724) + + PR c++/29928 + * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the + type only if is a class type (5.2.8/4). + 2007-05-05 Geoffrey Keating (r124467) PR 31775 Modified: head/contrib/gcc/cp/call.c ============================================================================== --- head/contrib/gcc/cp/call.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/call.c Fri Dec 20 16:01:02 2013 (r259655) @@ -95,6 +95,10 @@ struct conversion { /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion from a pointer-to-derived to pointer-to-base is being performed. */ BOOL_BITFIELD base_p : 1; + /* If KIND is ck_ref_bind, true when either an lvalue reference is + being bound to an lvalue expression or an rvalue reference is + being bound to an rvalue expression. */ + BOOL_BITFIELD rvaluedness_matches_p: 1; /* The type of the expression resulting from the conversion. */ tree type; union { @@ -174,7 +178,7 @@ static conversion *standard_conversion ( static conversion *reference_binding (tree, tree, tree, bool, int); static conversion *build_conv (conversion_kind, tree, conversion *); static bool is_subseq (conversion *, conversion *); -static tree maybe_handle_ref_bind (conversion **); +static conversion *maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); static struct z_candidate *add_candidate (struct z_candidate **, tree, tree, size_t, @@ -895,12 +899,12 @@ reference_compatible_p (tree t1, tree t2 converted to T as in [over.match.ref]. */ static conversion * -convert_class_to_reference (tree t, tree s, tree expr) +convert_class_to_reference (tree reference_type, tree s, tree expr) { tree conversions; tree arglist; conversion *conv; - tree reference_type; + tree t; struct z_candidate *candidates; struct z_candidate *cand; bool any_viable_p; @@ -934,7 +938,7 @@ convert_class_to_reference (tree t, tree arglist = build_int_cst (build_pointer_type (s), 0); arglist = build_tree_list (NULL_TREE, arglist); - reference_type = build_reference_type (t); + t = TREE_TYPE (reference_type); while (conversions) { @@ -997,6 +1001,9 @@ convert_class_to_reference (tree t, tree cand->second_conv = (direct_reference_binding (reference_type, identity_conv)); + cand->second_conv->rvaluedness_matches_p + = TYPE_REF_IS_RVALUE (TREE_TYPE (TREE_TYPE (cand->fn))) + == TYPE_REF_IS_RVALUE (reference_type); cand->second_conv->bad_p |= cand->convs[0]->bad_p; } } @@ -1123,7 +1130,16 @@ reference_binding (tree rto, tree rfrom, to = build_qualified_type (to, cp_type_quals (from)); compatible_p = reference_compatible_p (to, from); - if (lvalue_p && compatible_p) + /* Directly bind reference when target expression's type is compatible with + the reference and expression is an lvalue. In C++0x, the wording in + [8.5.3/5 dcl.init.ref] is changed to also allow direct bindings for const + and rvalue references to rvalues of compatible class type, as part of + DR391. */ + if (compatible_p + && (lvalue_p + || (flag_cpp0x + && (CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) + && CLASS_TYPE_P (from)))) { /* [dcl.init.ref] @@ -1136,6 +1152,15 @@ reference_binding (tree rto, tree rfrom, lvalue. */ conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); + + if (flags & LOOKUP_PREFER_RVALUE) + /* The top-level caller requested that we pretend that the lvalue + be treated as an rvalue. */ + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); + else + conv->rvaluedness_matches_p + = (TYPE_REF_IS_RVALUE (rto) == !lvalue_p); + if ((lvalue_p & clk_bitfield) != 0 || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to))) /* For the purposes of overload resolution, we ignore the fact @@ -1168,7 +1193,7 @@ reference_binding (tree rto, tree rfrom, the reference is bound to the lvalue result of the conversion in the second case. */ - conv = convert_class_to_reference (to, from, expr); + conv = convert_class_to_reference (rto, from, expr); if (conv) return conv; } @@ -1191,8 +1216,10 @@ reference_binding (tree rto, tree rfrom, /* [dcl.init.ref] - Otherwise, the reference shall be to a non-volatile const type. */ - if (!CP_TYPE_CONST_NON_VOLATILE_P (to)) + Otherwise, the reference shall be to a non-volatile const type. + + Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */ + if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto)) return NULL; /* [dcl.init.ref] @@ -1215,6 +1242,7 @@ reference_binding (tree rto, tree rfrom, { conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)) conv->u.next->check_copy_constructor_p = true; return conv; @@ -1239,6 +1267,7 @@ reference_binding (tree rto, tree rfrom, /* This reference binding, unlike those above, requires the creation of a temporary. */ conv->need_temporary_p = true; + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); return conv; } @@ -1280,7 +1309,7 @@ implicit_conversion (tree to, tree from, conv = cand->second_conv; /* We used to try to bind a reference to a temporary here, but that - is now handled by the recursive call to this function at the end + is now handled after the recursive call to this function at the end of reference_binding. */ return conv; } @@ -4409,13 +4438,22 @@ convert_like_real (conversion *convs, tr { tree ref_type = totype; - /* If necessary, create a temporary. */ - if (convs->need_temporary_p || !lvalue_p (expr)) + /* If necessary, create a temporary. + + VA_ARG_EXPR and CONSTRUCTOR expressions are special cases + that need temporaries, even when their types are reference + compatible with the type of reference being bound, so the + upcoming call to build_unary_op (ADDR_EXPR, expr, ...) + doesn't fail. */ + if (convs->need_temporary_p + || TREE_CODE (expr) == CONSTRUCTOR + || TREE_CODE (expr) == VA_ARG_EXPR) { tree type = convs->u.next->type; cp_lvalue_kind lvalue = real_lvalue_p (expr); - if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type))) + if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) + && !TYPE_REF_IS_RVALUE (ref_type)) { /* If the reference is volatile or non-const, we cannot create a temporary. */ @@ -4938,7 +4976,9 @@ build_over_call (struct z_candidate *can if (! flag_elide_constructors) /* Do things the hard way. */; - else if (cand->num_convs == 1 && DECL_COPY_CONSTRUCTOR_P (fn)) + else if (cand->num_convs == 1 + && (DECL_COPY_CONSTRUCTOR_P (fn) + || DECL_MOVE_CONSTRUCTOR_P (fn))) { tree targ; arg = skip_artificial_parms_for (fn, converted_args); @@ -5676,28 +5716,28 @@ maybe_handle_implicit_object (conversion t = t->u.next; t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); t = direct_reference_binding (reference_type, t); + t->rvaluedness_matches_p = 1; *ics = t; } } /* If *ICS is a REF_BIND set *ICS to the remainder of the conversion, - and return the type to which the reference refers. Otherwise, - leave *ICS unchanged and return NULL_TREE. */ + and return the initial reference binding conversion. Otherwise, + leave *ICS unchanged and return NULL. */ -static tree +static conversion * maybe_handle_ref_bind (conversion **ics) { if ((*ics)->kind == ck_ref_bind) { conversion *old_ics = *ics; - tree type = TREE_TYPE (old_ics->type); *ics = old_ics->u.next; (*ics)->user_conv_p = old_ics->user_conv_p; (*ics)->bad_p = old_ics->bad_p; - return type; + return old_ics; } - return NULL_TREE; + return NULL; } /* Compare two implicit conversion sequences according to the rules set out in @@ -5721,18 +5761,18 @@ compare_ics (conversion *ics1, conversio conversion_rank rank1, rank2; /* REF_BINDING is nonzero if the result of the conversion sequence - is a reference type. In that case TARGET_TYPE is the - type referred to by the reference. */ - tree target_type1; - tree target_type2; + is a reference type. In that case REF_CONV is the reference + binding conversion. */ + conversion *ref_conv1; + conversion *ref_conv2; /* Handle implicit object parameters. */ maybe_handle_implicit_object (&ics1); maybe_handle_implicit_object (&ics2); /* Handle reference parameters. */ - target_type1 = maybe_handle_ref_bind (&ics1); - target_type2 = maybe_handle_ref_bind (&ics2); + ref_conv1 = maybe_handle_ref_bind (&ics1); + ref_conv2 = maybe_handle_ref_bind (&ics2); /* [over.ics.rank] @@ -6023,15 +6063,31 @@ compare_ics (conversion *ics1, conversio /* [over.ics.rank] + --S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers + to an implicit object parameter, and either S1 binds an lvalue reference + to an lvalue and S2 binds an rvalue reference or S1 binds an rvalue + reference to an rvalue and S2 binds an lvalue reference + (C++0x draft standard, 13.3.3.2) + --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - if (target_type1 && target_type2 + if (ref_conv1 && ref_conv2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) - return comp_cv_qualification (target_type2, target_type1); + { + if (ref_conv1->rvaluedness_matches_p + && !ref_conv2->rvaluedness_matches_p) + return 1; + else if (!ref_conv1->rvaluedness_matches_p + && ref_conv2->rvaluedness_matches_p) + return -1; + + return comp_cv_qualification (TREE_TYPE (ref_conv2->type), + TREE_TYPE (ref_conv1->type)); + } /* Neither conversion sequence is better than the other. */ return 0; Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/cp-tree.h Fri Dec 20 16:01:02 2013 (r259655) @@ -56,6 +56,7 @@ struct diagnostic_context; OMP_FOR_GIMPLIFYING_P (in OMP_FOR) BASELINK_QUALIFIED_P (in BASELINK) TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) + TYPE_REF_IS_RVALUE (in REFERENCE_TYPE) 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. @@ -1666,6 +1667,10 @@ struct lang_decl GTY(()) #define DECL_COPY_CONSTRUCTOR_P(NODE) \ (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0) +/* Nonzero if NODE (a FUNCTION_DECL) is a move constructor. */ +#define DECL_MOVE_CONSTRUCTOR_P(NODE) \ + (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) + /* Nonzero if NODE is a destructor. */ #define DECL_DESTRUCTOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr) @@ -2561,6 +2566,10 @@ extern void decl_shadowed_for_var_insert #define TYPE_REF_OBJ_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) +/* True if reference type NODE is an rvalue reference */ +#define TYPE_REF_IS_RVALUE(NODE) \ + TREE_LANG_FLAG_0 (REFERENCE_TYPE_CHECK (NODE)) + /* Returns true if NODE is a pointer to an object, or a pointer to void. Keep these checks in ascending tree code order. */ #define TYPE_PTROBV_P(NODE) \ @@ -3444,6 +3453,8 @@ enum overload_flags { NO_SPECIAL = 0, DT (Normally, these entities are registered in the symbol table, but not found by lookup.) */ #define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) +/* Prefer that the lvalue be treated as an rvalue. */ +#define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3750,13 +3761,21 @@ struct cp_declarator { /* The bounds to the array. */ tree bounds; } array; - /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */ + /* For cdk_pointer and cdk_ptrmem. */ struct { /* The cv-qualifiers for the pointer. */ cp_cv_quals qualifiers; /* For cdk_ptrmem, the class type containing the member. */ tree class_type; } pointer; + /* For cdk_reference */ + struct { + /* The cv-qualifiers for the reference. These qualifiers are + only used to diagnose ill-formed code. */ + cp_cv_quals qualifiers; + /* Whether this is an rvalue reference */ + bool rvalue_ref; + } reference; } u; }; @@ -3917,6 +3936,7 @@ extern tree build_ptrmem_type (tree, t /* the grokdeclarator prototype is in decl.h */ extern tree build_this_parm (tree, cp_cv_quals); extern int copy_fn_p (tree); +extern bool move_fn_p (tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); @@ -4416,6 +4436,7 @@ extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); +extern tree cp_build_reference_type (tree, bool); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/decl.c Fri Dec 20 16:01:02 2013 (r259655) @@ -7823,10 +7823,24 @@ grokdeclarator (const cp_declarator *dec if (TREE_CODE (type) == REFERENCE_TYPE) { - error (declarator->kind == cdk_reference - ? "cannot declare reference to %q#T" - : "cannot declare pointer to %q#T", type); - type = TREE_TYPE (type); + if (declarator->kind != cdk_reference) + { + error ("cannot declare pointer to %q#T", type); + type = TREE_TYPE (type); + } + + /* In C++0x, we allow reference to reference declarations + that occur indirectly through typedefs [7.1.3/8 dcl.typedef] + and template type arguments [14.3.1/4 temp.arg.type]. The + check for direct reference to reference declarations, which + are still forbidden, occurs below. Reasoning behind the change + can be found in DR106, DR540, and the rvalue reference + proposals. */ + else if (!flag_cpp0x) + { + error ("cannot declare reference to %q#T", type); + type = TREE_TYPE (type); + } } else if (VOID_TYPE_P (type)) { @@ -7852,8 +7866,39 @@ grokdeclarator (const cp_declarator *dec if (declarator->kind == cdk_reference) { + /* In C++0x, the type we are creating a reference to might be + a typedef which is itself a reference type. In that case, + we follow the reference collapsing rules in + [7.1.3/8 dcl.typedef] to create the final reference type: + + "If a typedef TD names a type that is a reference to a type + T, an attempt to create the type 'lvalue reference to cv TD' + creates the type 'lvalue reference to T,' while an attempt + to create the type "rvalue reference to cv TD' creates the + type TD." + */ if (!VOID_TYPE_P (type)) - type = build_reference_type (type); + type = cp_build_reference_type + ((TREE_CODE (type) == REFERENCE_TYPE + ? TREE_TYPE (type) : type), + (declarator->u.reference.rvalue_ref + && (TREE_CODE(type) != REFERENCE_TYPE + || TYPE_REF_IS_RVALUE (type)))); + + /* In C++0x, we need this check for direct reference to + reference declarations, which are forbidden by + [8.3.2/5 dcl.ref]. Reference to reference declarations + are only allowed indirectly through typedefs and template + type arguments. Example: + + void foo(int & &); // invalid ref-to-ref decl + + typedef int & int_ref; + void foo(int_ref &); // valid ref-to-ref decl + */ + if (inner_declarator && inner_declarator->kind == cdk_reference) + error ("cannot declare reference to %q#T, which is not " + "a typedef or a template type argument", type); } else if (TREE_CODE (type) == METHOD_TYPE) type = build_ptrmemfunc_type (build_pointer_type (type)); @@ -9078,6 +9123,7 @@ copy_fn_p (tree d) result = -1; } else if (TREE_CODE (arg_type) == REFERENCE_TYPE + && !TYPE_REF_IS_RVALUE (arg_type) && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d)) { if (CP_TYPE_CONST_P (TREE_TYPE (arg_type))) @@ -9095,6 +9141,57 @@ copy_fn_p (tree d) return result; } +/* D is a constructor or overloaded `operator='. + + Let T be the class in which D is declared. Then, this function + returns true when D is a move constructor or move assignment + operator, false otherwise. */ + +bool +move_fn_p (tree d) +{ + tree args; + tree arg_type; + bool result = false; + + gcc_assert (DECL_FUNCTION_MEMBER_P (d)); + + if (!flag_cpp0x) + /* There are no move constructors if we aren't in C++0x mode. */ + return false; + + if (TREE_CODE (d) == TEMPLATE_DECL + || (DECL_TEMPLATE_INFO (d) + && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))) + /* Instantiations of template member functions are never copy + functions. Note that member functions of templated classes are + represented as template functions internally, and we must + accept those as copy functions. */ + return 0; + + args = FUNCTION_FIRST_USER_PARMTYPE (d); + if (!args) + return 0; + + arg_type = TREE_VALUE (args); + if (arg_type == error_mark_node) + return 0; + + if (TREE_CODE (arg_type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (arg_type) + && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)), + DECL_CONTEXT (d))) + result = true; + + args = TREE_CHAIN (args); + + if (args && args != void_list_node && !TREE_PURPOSE (args)) + /* There are more non-optional args. */ + return false; + + return result; +} + /* Remember any special properties of member function DECL. */ void grok_special_member_properties (tree decl) Modified: head/contrib/gcc/cp/error.c ============================================================================== --- head/contrib/gcc/cp/error.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/error.c Fri Dec 20 16:01:02 2013 (r259655) @@ -507,7 +507,15 @@ dump_type_prefix (tree t, int flags) pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); } - pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); + if (TREE_CODE (t) == POINTER_TYPE) + pp_character(cxx_pp, '*'); + else if (TREE_CODE (t) == REFERENCE_TYPE) + { + if (TYPE_REF_IS_RVALUE (t)) + pp_string (cxx_pp, "&&"); + else + pp_character (cxx_pp, '&'); + } pp_base (cxx_pp)->padding = pp_before; pp_cxx_cv_qualifier_seq (cxx_pp, t); } Modified: head/contrib/gcc/cp/except.c ============================================================================== --- head/contrib/gcc/cp/except.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/except.c Fri Dec 20 16:01:02 2013 (r259655) @@ -709,12 +709,25 @@ build_throw (tree exp) /* And initialize the exception object. */ if (CLASS_TYPE_P (temp_type)) { + int flags = LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING; + + /* Under C++0x [12.8/16 class.copy], a thrown lvalue is sometimes + treated as an rvalue for the purposes of overload resolution + to favor move constructors over copy constructors. */ + if (/* Must be a local, automatic variable. */ + TREE_CODE (exp) == VAR_DECL + && DECL_CONTEXT (exp) == current_function_decl + && ! TREE_STATIC (exp) + /* The variable must not have the `volatile' qualifier. */ + && !(cp_type_quals (TREE_TYPE (exp)) & TYPE_QUAL_VOLATILE)) + flags = flags | LOOKUP_PREFER_RVALUE; + /* Call the copy constructor. */ exp = (build_special_member_call (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING)); + flags)); if (exp == error_mark_node) { error (" in thrown expression"); Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 16:01:02 2013 (r259655) @@ -1541,6 +1541,10 @@ write_local_name (const tree function, c ::= G # imaginary (C 2000) [not supported] ::= U # vendor extended type qualifier + C++0x extensions + + ::= RR # rvalue reference-to + TYPE is a type node. */ static void @@ -1635,6 +1639,8 @@ write_type (tree type) break; case REFERENCE_TYPE: + if (TYPE_REF_IS_RVALUE (type)) + write_char('R'); write_char ('R'); write_type (TREE_TYPE (type)); break; Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/parser.c Fri Dec 20 16:01:02 2013 (r259655) @@ -843,7 +843,7 @@ static cp_declarator *make_array_declara static cp_declarator *make_pointer_declarator (cp_cv_quals, cp_declarator *); static cp_declarator *make_reference_declarator - (cp_cv_quals, cp_declarator *); + (cp_cv_quals, cp_declarator *, bool); static cp_parameter_declarator *make_parameter_declarator (cp_decl_specifier_seq *, cp_declarator *, tree); static cp_declarator *make_ptrmem_declarator @@ -937,14 +937,15 @@ make_pointer_declarator (cp_cv_quals cv_ /* Like make_pointer_declarator -- but for references. */ cp_declarator * -make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target) +make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target, + bool rvalue_ref) { cp_declarator *declarator; declarator = make_declarator (cdk_reference); declarator->declarator = target; - declarator->u.pointer.qualifiers = cv_qualifiers; - declarator->u.pointer.class_type = NULL_TREE; + declarator->u.reference.qualifiers = cv_qualifiers; + declarator->u.reference.rvalue_ref = rvalue_ref; return declarator; } @@ -1926,6 +1927,8 @@ static bool cp_parser_is_keyword (cp_token *, enum rid); static tree cp_parser_make_typename_type (cp_parser *, tree, tree); +static cp_declarator * cp_parser_make_indirect_declarator + (enum tree_code, tree, cp_cv_quals, cp_declarator *); /* Returns nonzero if we are parsing tentatively. */ @@ -2599,6 +2602,27 @@ cp_parser_make_typename_type (cp_parser return make_typename_type (scope, id, typename_type, tf_error); } +/* This is a wrapper around the + make_{pointer,ptrmem,reference}_declarator functions that decides + which one to call based on the CODE and CLASS_TYPE arguments. The + CODE argument should be one of the values returned by + cp_parser_ptr_operator. */ +static cp_declarator * +cp_parser_make_indirect_declarator (enum tree_code code, tree class_type, + cp_cv_quals cv_qualifiers, + cp_declarator *target) +{ + if (code == INDIRECT_REF) + if (class_type == NULL_TREE) + return make_pointer_declarator (cv_qualifiers, target); + else + return make_ptrmem_declarator (cv_qualifiers, class_type, target); + else if (code == ADDR_EXPR && class_type == NULL_TREE) + return make_reference_declarator (cv_qualifiers, target, false); + else if (code == NON_LVALUE_EXPR && class_type == NULL_TREE) + return make_reference_declarator (cv_qualifiers, target, true); + gcc_unreachable (); +} /* Create a new C++ parser. */ @@ -5387,15 +5411,8 @@ cp_parser_new_declarator_opt (cp_parser* /* Parse another optional declarator. */ declarator = cp_parser_new_declarator_opt (parser); - /* Create the representation of the declarator. */ - if (type) - declarator = make_ptrmem_declarator (cv_quals, type, declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); - - return declarator; + return cp_parser_make_indirect_declarator + (code, type, cv_quals, declarator); } /* If the next token is a `[', there is a direct-new-declarator. */ @@ -8054,16 +8071,8 @@ cp_parser_conversion_declarator_opt (cp_ /* Parse another optional declarator. */ declarator = cp_parser_conversion_declarator_opt (parser); - /* Create the representation of the declarator. */ - if (class_type) - declarator = make_ptrmem_declarator (cv_quals, class_type, - declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); - - return declarator; + return cp_parser_make_indirect_declarator + (code, class_type, cv_quals, declarator); } return NULL; @@ -11522,15 +11531,8 @@ cp_parser_declarator (cp_parser* parser, && !cp_parser_parse_definitely (parser)) declarator = NULL; - /* Build the representation of the ptr-operator. */ - if (class_type) - declarator = make_ptrmem_declarator (cv_quals, - class_type, - declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); + declarator = cp_parser_make_indirect_declarator + (code, class_type, cv_quals, declarator); } /* Everything else is a direct-declarator. */ else @@ -11971,12 +11973,15 @@ cp_parser_direct_declarator (cp_parser* & cv-qualifier-seq [opt] Returns INDIRECT_REF if a pointer, or pointer-to-member, was used. - Returns ADDR_EXPR if a reference was used. In the case of a - pointer-to-member, *TYPE is filled in with the TYPE containing the - member. *CV_QUALS is filled in with the cv-qualifier-seq, or - TYPE_UNQUALIFIED, if there are no cv-qualifiers. Returns - ERROR_MARK if an error occurred. */ - + Returns ADDR_EXPR if a reference was used, or NON_LVALUE_EXPR for + an rvalue reference. In the case of a pointer-to-member, *TYPE is + filled in with the TYPE containing the member. *CV_QUALS is + filled in with the cv-qualifier-seq, or TYPE_UNQUALIFIED, if there + are no cv-qualifiers. Returns ERROR_MARK if an error occurred. + Note that the tree codes returned by this function have nothing + to do with the types of trees that will be eventually be created + to represent the pointer or reference type being parsed. They are + just constants with suggestive names. */ static enum tree_code cp_parser_ptr_operator (cp_parser* parser, tree* type, @@ -11992,13 +11997,18 @@ cp_parser_ptr_operator (cp_parser* parse /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); - /* If it's a `*' or `&' we have a pointer or reference. */ - if (token->type == CPP_MULT || token->type == CPP_AND) - { - /* Remember which ptr-operator we were processing. */ - code = (token->type == CPP_AND ? ADDR_EXPR : INDIRECT_REF); - /* Consume the `*' or `&'. */ + /* If it's a `*', `&' or `&&' we have a pointer or reference. */ + if (token->type == CPP_MULT) + code = INDIRECT_REF; + else if (token->type == CPP_AND) + code = ADDR_EXPR; + else if (flag_cpp0x && token->type == CPP_AND_AND) /* C++0x only */ + code = NON_LVALUE_EXPR; + + if (code != ERROR_MARK) + { + /* Consume the `*', `&' or `&&'. */ cp_lexer_consume_token (parser->lexer); /* A `*' can be followed by a cv-qualifier-seq, and so can a Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 16:01:02 2013 (r259655) @@ -110,7 +110,8 @@ static void tsubst_enum (tree, tree, tre static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); static bool check_instantiated_args (tree, tree, tsubst_flags_t); -static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*); +static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, + tree); static int type_unification_real (tree, tree, tree, tree, int, unification_kind_t, int); static void note_template_header (int); @@ -7546,8 +7547,13 @@ tsubst (tree t, tree args, tsubst_flags_ -- Attempting to create a pointer to reference type. -- Attempting to create a reference to a reference type or - a reference to void. */ - if (TREE_CODE (type) == REFERENCE_TYPE + a reference to void. + + Core issue 106 says that creating a reference to a reference + during instantiation is no longer a cause for failure. We + only enforce this check in strict C++98 mode. */ + if ((TREE_CODE (type) == REFERENCE_TYPE + && ((!flag_cpp0x && flag_iso) || code != REFERENCE_TYPE)) || (code == REFERENCE_TYPE && TREE_CODE (type) == VOID_TYPE)) { static location_t last_loc; @@ -7581,8 +7587,22 @@ tsubst (tree t, tree args, tsubst_flags_ if (TREE_CODE (type) == METHOD_TYPE) r = build_ptrmemfunc_type (r); } + else if (TREE_CODE (type) == REFERENCE_TYPE) + /* In C++0x, during template argument substitution, when there is an + attempt to create a reference to a reference type, reference + collapsing is applied as described in [14.3.1/4 temp.arg.type]: + + "If a template-argument for a template-parameter T names a type + that is a reference to a type A, an attempt to create the type + 'lvalue reference to cv T' creates the type 'lvalue reference to + A,' while an attempt to create the type type rvalue reference to + cv T' creates the type T" + */ + r = cp_build_reference_type + (TREE_TYPE (type), + TYPE_REF_IS_RVALUE (t) && TYPE_REF_IS_RVALUE (type)); else - r = build_reference_type (type); + r = cp_build_reference_type (type, TYPE_REF_IS_RVALUE (t)); r = cp_build_qualified_type_real (r, TYPE_QUALS (t), complain); if (r != error_mark_node) @@ -9792,12 +9812,14 @@ fn_type_unification (tree fn, sections are symmetric. PARM is the type of a function parameter or the return type of the conversion function. ARG is the type of the argument passed to the call, or the type of the value - initialized with the result of the conversion function. */ + initialized with the result of the conversion function. + ARG_EXPR is the original argument expression, which may be null. */ static int maybe_adjust_types_for_deduction (unification_kind_t strict, tree* parm, - tree* arg) + tree* arg, + tree arg_expr) { int result = 0; @@ -9851,6 +9873,16 @@ maybe_adjust_types_for_deduction (unific *arg = TYPE_MAIN_VARIANT (*arg); } + /* From C++0x [14.8.2.1/3 temp.deduct.call] (after DR606), "If P is + of the form T&&, where T is a template parameter, and the argument + is an lvalue, T is deduced as A& */ + if (TREE_CODE (*parm) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (*parm) + && TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM + && cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED + && arg_expr && real_lvalue_p (arg_expr)) + *arg = build_reference_type (*arg); + /* [temp.deduct.call] If P is a cv-qualified type, the top level cv-qualifiers @@ -9887,7 +9919,7 @@ type_unification_real (tree tparms, unification_kind_t strict, int flags) { - tree parm, arg; + tree parm, arg, arg_expr; int i; int ntparms = TREE_VEC_LENGTH (tparms); int sub_strict; @@ -9929,6 +9961,7 @@ type_unification_real (tree tparms, parms = TREE_CHAIN (parms); arg = TREE_VALUE (args); args = TREE_CHAIN (args); + arg_expr = NULL; if (arg == error_mark_node) return 1; @@ -9978,6 +10011,7 @@ type_unification_real (tree tparms, return 1; } + arg_expr = arg; arg = unlowered_expr_type (arg); if (arg == error_mark_node) return 1; @@ -9987,7 +10021,8 @@ type_unification_real (tree tparms, int arg_strict = sub_strict; if (!subr) - arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); + arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, + arg_expr); if (unify (tparms, targs, parm, arg, arg_strict)) return 1; @@ -10164,7 +10199,7 @@ try_one_overload (tree tparms, else if (addr_p) arg = build_pointer_type (arg); - sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); + sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, NULL); /* We don't copy orig_targs for this because if we have already deduced some template args from previous args, unify would complain when we Modified: head/contrib/gcc/cp/rtti.c ============================================================================== --- head/contrib/gcc/cp/rtti.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/rtti.c Fri Dec 20 16:01:02 2013 (r259655) @@ -238,7 +238,7 @@ get_tinfo_decl_dynamic (tree exp) /* Peel off cv qualifiers. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, exp); if (!type) @@ -430,7 +430,7 @@ get_typeid (tree type) that is the operand of typeid are always ignored. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, NULL_TREE); if (!type) Modified: head/contrib/gcc/cp/tree.c ============================================================================== --- head/contrib/gcc/cp/tree.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/tree.c Fri Dec 20 16:01:02 2013 (r259655) @@ -64,8 +64,28 @@ lvalue_p_1 (tree ref, cp_lvalue_kind op1_lvalue_kind = clk_none; cp_lvalue_kind op2_lvalue_kind = clk_none; + /* Expressions of reference type are sometimes wrapped in + INDIRECT_REFs. INDIRECT_REFs are just internal compiler + representation, not part of the language, so we have to look + through them. */ + if (TREE_CODE (ref) == INDIRECT_REF + && TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) + == REFERENCE_TYPE) + return lvalue_p_1 (TREE_OPERAND (ref, 0), + treat_class_rvalues_as_lvalues); + if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE) - return clk_ordinary; + { + /* unnamed rvalue references are rvalues */ + if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref)) + && TREE_CODE (ref) != PARM_DECL + && TREE_CODE (ref) != VAR_DECL + && TREE_CODE (ref) != COMPONENT_REF) + return clk_none; + + /* lvalue references and named rvalue refences are lvalues */ + return clk_ordinary; + } if (ref == current_class_ptr) return clk_none; @@ -451,6 +471,53 @@ build_cplus_array_type (tree elt_type, t return t; } + +/* Return a reference type node referring to TO_TYPE. If RVAL is + true, return an rvalue reference type, otherwise return an lvalue + reference type. If a type node exists, reuse it, otherwise create + a new one. */ +tree +cp_build_reference_type (tree to_type, bool rval) +{ + tree lvalue_ref, t; + lvalue_ref = build_reference_type (to_type); + if (!rval) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 16:37:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C8505D6; Fri, 20 Dec 2013 16:37:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9EA1346; Fri, 20 Dec 2013 16:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKGb3ER036205; Fri, 20 Dec 2013 16:37:03 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKGb3Cm036204; Fri, 20 Dec 2013 16:37:03 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312201637.rBKGb3Cm036204@svn.freebsd.org> From: Justin Hibbits Date: Fri, 20 Dec 2013 16:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259657 - head/sys/powerpc/powermac 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.17 Precedence: list List-Id: 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, 20 Dec 2013 16:37:03 -0000 Author: jhibbits Date: Fri Dec 20 16:37:03 2013 New Revision: 259657 URL: http://svnweb.freebsd.org/changeset/base/259657 Log: Add suspend/resume handlers for ATI backlight ppc driver. With this, also shut shut off the display (DPMS-style) and disable the clocking when the backlight level is set to 0. This is taken from the radeonkms driver (radeon_legacy_encoders.c) which doesn't yet support PowerPC, and won't for a while, as it's missing full AGP support. Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Fri Dec 20 16:15:25 2013 (r259656) +++ head/sys/powerpc/powermac/atibl.c Fri Dec 20 16:37:03 2013 (r259657) @@ -52,10 +52,15 @@ __FBSDID("$FreeBSD$"); #define RADEON_LVDS_BL_MOD_EN (1 << 16) #define RADEON_LVDS_DIGON (1 << 18) #define RADEON_LVDS_BLON (1 << 19) +#define RADEON_LVDS_PLL_CNTL 0x02d4 +#define RADEON_LVDS_PLL_EN (1 << 16) +#define RADEON_LVDS_PLL_RESET (1 << 17) +#define RADEON_PIXCLKS_CNTL 0x002d +#define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) struct atibl_softc { - device_t dev; struct resource *sc_memr; + int sc_level; }; static void atibl_identify(driver_t *driver, device_t parent); @@ -63,13 +68,17 @@ static int atibl_probe(device_t dev); static int atibl_attach(device_t dev); static int atibl_setlevel(struct atibl_softc *sc, int newlevel); static int atibl_getlevel(struct atibl_softc *sc); +static int atibl_resume(device_t dev); +static int atibl_suspend(device_t dev); static int atibl_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t atibl_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, atibl_identify), - DEVMETHOD(device_probe, atibl_probe), - DEVMETHOD(device_attach, atibl_attach), + DEVMETHOD(device_identify, atibl_identify), + DEVMETHOD(device_probe, atibl_probe), + DEVMETHOD(device_attach, atibl_attach), + DEVMETHOD(device_suspend, atibl_suspend), + DEVMETHOD(device_resume, atibl_resume), {0, 0}, }; @@ -136,8 +145,8 @@ atibl_attach(device_t dev) tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - atibl_sysctl, "I", "Backlight level (0-100)"); + "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + atibl_sysctl, "I", "Backlight level (0-100)"); return (0); } @@ -146,6 +155,8 @@ static int atibl_setlevel(struct atibl_softc *sc, int newlevel) { uint32_t lvds_gen_cntl; + uint32_t lvds_pll_cntl; + uint32_t pixclks_cntl; if (newlevel > 100) newlevel = 100; @@ -153,13 +164,38 @@ atibl_setlevel(struct atibl_softc *sc, i if (newlevel < 0) newlevel = 0; - newlevel = (newlevel * 5) / 2 + 5; lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); - lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_LEVEL_MASK; - lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & - RADEON_LVDS_BL_MOD_LEVEL_MASK; - bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + + if (newlevel > 0) { + newlevel = (newlevel * 5) / 2 + 5; + lvds_pll_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL); + lvds_pll_cntl |= RADEON_LVDS_PLL_EN; + bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET; + bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + + lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS | + RADEON_LVDS_BL_MOD_LEVEL_MASK); + lvds_gen_cntl |= RADEON_LVDS_ON | RADEON_LVDS_EN | + RADEON_LVDS_DIGON | RADEON_LVDS_BLON; + lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & + RADEON_LVDS_BL_MOD_LEVEL_MASK; + lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; + DELAY(2000); + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + } else { + pixclks_cntl = bus_read_4(sc->sc_memr, RADEON_PIXCLKS_CNTL); + bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, + pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); + lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; + lvds_gen_cntl &= RADEON_LVDS_BL_MOD_EN; + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); + DELAY(2000); + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + + bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, pixclks_cntl); + } return (0); } @@ -173,13 +209,39 @@ atibl_getlevel(struct atibl_softc *sc) lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); level = ((lvds_gen_cntl & RADEON_LVDS_BL_MOD_LEVEL_MASK) >> - RADEON_LVDS_BL_MOD_LEVEL_SHIFT); - level = ((level - 5) * 2) / 5; + RADEON_LVDS_BL_MOD_LEVEL_SHIFT); + if (level != 0) + level = ((level - 5) * 2) / 5; return (level); } static int +atibl_suspend(device_t dev) +{ + struct atibl_softc *sc; + + sc = device_get_softc(dev); + + sc->sc_level = atibl_getlevel(sc); + atibl_setlevel(sc, 0); + + return (0); +} + +static int +atibl_resume(device_t dev) +{ + struct atibl_softc *sc; + + sc = device_get_softc(dev); + + atibl_setlevel(sc, sc->sc_level); + + return (0); +} + +static int atibl_sysctl(SYSCTL_HANDLER_ARGS) { struct atibl_softc *sc; From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 17:05:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA8EE48D; Fri, 20 Dec 2013 17:05:43 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53F981611; Fri, 20 Dec 2013 17:05:43 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id w7so2456949qcr.11 for ; Fri, 20 Dec 2013 09:05:42 -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=d6I2ymUaVjTk7b5OW/LMzZA5wZJ5gxKwqkSy3ak2Nzk=; b=e+fuxmklGHS1aQ4f4vxO6gLk4dC/O3zqrVIrnM9py1t337KKmt1Te5YI1sgqd97XzW kCorzBFGKav0a6mx+4QKAJTGr78cS7QPq4tYRe7z7UZPReYKS/3vAjXgH2joOsGskCEW N4XD6s70N88Vckqmn2sjlip14V2W8zFxGtVzxAxCPh7YddfFHk/k4scGX760/AQvxx3P GabPxUAzvoB3ZFvUtzMhgSROfGN5m7XgjN0cn88qCdQMNgeRD1Cfan0bUuH8sD9SfJlV t/TP+0Kc8+VvDj6txEsm1/lJOVGPEuSMg87ddKbx2a+1nlj1B7Ha+e55SoY7/QwSvN9W irkg== MIME-Version: 1.0 X-Received: by 10.49.76.66 with SMTP id i2mr15764513qew.35.1387559142458; Fri, 20 Dec 2013 09:05:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Fri, 20 Dec 2013 09:05:42 -0800 (PST) In-Reply-To: <20131220084419.GK71033@FreeBSD.org> References: <201312200741.rBK7f3tL038123@svn.freebsd.org> <20131220084419.GK71033@FreeBSD.org> Date: Fri, 20 Dec 2013 09:05:42 -0800 X-Google-Sender-Auth: dBjenF2o2H2n3TgCCyZgyxScIRQ Message-ID: Subject: Re: svn commit: r259642 - head/sys/netinet From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 17:05:43 -0000 On 20 December 2013 00:44, Gleb Smirnoff wrote: > I didn't get to review of actual patch, but IMO it would be better > just to remove the code, not ifdef 0 it. The code ifdefed has zero > probability to be enabled in its current form. If we ever fix it, code > would look very different. > > No reason to do followup commit, that was just me muttering. I figured it would be nicer in the short term to #if 0 it out whilst some other discussions went on, just to make it really obvious in the short term where the check was done. It's quite possible I'll eventually just trim it entirely out. Thanks, -a From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 17:39:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4ED1BA29; Fri, 20 Dec 2013 17:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F20E18A6; Fri, 20 Dec 2013 17:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKHd86D059255; Fri, 20 Dec 2013 17:39:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKHd73M059252; Fri, 20 Dec 2013 17:39:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312201739.rBKHd73M059252@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Dec 2013 17:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259659 - in head/sys: nfs rpc 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.17 Precedence: list List-Id: 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, 20 Dec 2013 17:39:08 -0000 Author: mav Date: Fri Dec 20 17:39:07 2013 New Revision: 259659 URL: http://svnweb.freebsd.org/changeset/base/259659 Log: Remove several linear list traversals per request from RPC server code. Do not insert active ports into pool->sp_active list if they are success- fully assigned to some thread. This makes that list include only ports that really require attention, and so traversal can be reduced to simple taking the first one. Remove idle thread from pool->sp_idlethreads list when assigning some work (port of requests) to it. That again makes possible to replace list traversals with simple taking the first element. Modified: head/sys/nfs/nfs_fha.c head/sys/rpc/svc.c head/sys/rpc/svc.h Modified: head/sys/nfs/nfs_fha.c ============================================================================== --- head/sys/nfs/nfs_fha.c Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/nfs/nfs_fha.c Fri Dec 20 17:39:07 2013 (r259659) @@ -289,19 +289,6 @@ fha_hash_entry_add_op(struct fha_hash_en fhe->num_rw += count; } -static SVCTHREAD * -get_idle_thread(SVCPOOL *pool) -{ - SVCTHREAD *st; - - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) { - if (st->st_xprt == NULL && STAILQ_EMPTY(&st->st_reqs)) - return (st); - } - return (NULL); -} - - /* * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. @@ -386,7 +373,7 @@ fha_hash_entry_choose_thread(struct fha_ ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)t", thread, thread->st_reqcount); #endif - } else if ((thread = get_idle_thread(pool))) { + } else if ((thread = LIST_FIRST(&pool->sp_idlethreads))) { #if 0 ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)i", thread, thread->st_reqcount); @@ -418,7 +405,6 @@ SVCTHREAD * fha_assign(SVCTHREAD *this_thread, struct svc_req *req, struct fha_params *softc) { - SVCPOOL *pool; SVCTHREAD *thread; struct fha_info i; struct fha_hash_entry *fhe; @@ -439,7 +425,6 @@ fha_assign(SVCTHREAD *this_thread, struc if (req->rq_vers != 2 && req->rq_vers != 3) return (this_thread); - pool = req->rq_xprt->xp_pool; fha_extract_info(req, &i, cb); /* Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/rpc/svc.c Fri Dec 20 17:39:07 2013 (r259659) @@ -293,12 +293,10 @@ xprt_unregister_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_assert(&xprt->xp_mlock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); - if (xprt->xp_active) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - xprt->xp_active = FALSE; - } + xprt_inactive_locked(xprt); TAILQ_REMOVE(&pool->sp_xlist, xprt, xp_link); xprt->xp_registered = FALSE; } @@ -320,25 +318,25 @@ xprt_unregister(SVCXPRT *xprt) SVC_RELEASE(xprt); } -static void +/* + * Attempt to assign a service thread to this transport. + */ +static int xprt_assignthread(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; SVCTHREAD *st; - /* - * Attempt to assign a service thread to this - * transport. - */ - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) { - if (st->st_xprt == NULL && STAILQ_EMPTY(&st->st_reqs)) - break; - } + mtx_assert(&xprt->xp_mlock, MA_OWNED); + st = LIST_FIRST(&pool->sp_idlethreads); if (st) { + LIST_REMOVE(st, st_ilink); + st->st_idle = FALSE; SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; cv_signal(&st->st_cond); + return (TRUE); } else { /* * See if we can create a new thread. The @@ -354,6 +352,7 @@ xprt_assignthread(SVCXPRT *xprt) pool->sp_state = SVCPOOL_THREADWANTED; } } + return (FALSE); } void @@ -372,9 +371,12 @@ xprt_active(SVCXPRT *xprt) } if (!xprt->xp_active) { - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, xp_alink); xprt->xp_active = TRUE; - xprt_assignthread(xprt); + if (xprt->xp_thread == NULL) { + if (!xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, xprt, + xp_alink); + } } mtx_unlock(&pool->sp_lock); @@ -385,8 +387,10 @@ xprt_inactive_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_assert(&xprt->xp_mlock, MA_OWNED); if (xprt->xp_active) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + if (xprt->xp_thread == NULL) + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); xprt->xp_active = FALSE; } } @@ -948,10 +952,11 @@ svc_assign_waiting_sockets(SVCPOOL *pool { SVCXPRT *xprt; - TAILQ_FOREACH(xprt, &pool->sp_active, xp_alink) { - if (!xprt->xp_thread) { - xprt_assignthread(xprt); - } + while ((xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { + if (xprt_assignthread(xprt)) + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + else + break; } } @@ -1042,21 +1047,17 @@ svc_run_internal(SVCPOOL *pool, bool_t i * active transport which isn't being serviced * by a thread. */ - if (svc_request_space_available(pool)) { - TAILQ_FOREACH(xprt, &pool->sp_active, - xp_alink) { - if (!xprt->xp_thread) { - SVC_ACQUIRE(xprt); - xprt->xp_thread = st; - st->st_xprt = xprt; - break; - } - } - } - if (st->st_xprt) + if (svc_request_space_available(pool) && + (xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + SVC_ACQUIRE(xprt); + xprt->xp_thread = st; + st->st_xprt = xprt; continue; + } LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); + st->st_idle = TRUE; if (ismaster || (!ismaster && pool->sp_threadcount > pool->sp_minthreads)) error = cv_timedwait_sig(&st->st_cond, @@ -1064,7 +1065,10 @@ svc_run_internal(SVCPOOL *pool, bool_t i else error = cv_wait_sig(&st->st_cond, &pool->sp_lock); - LIST_REMOVE(st, st_ilink); + if (st->st_idle) { + LIST_REMOVE(st, st_ilink); + st->st_idle = FALSE; + } /* * Reduce worker thread count when idle. @@ -1132,11 +1136,12 @@ svc_run_internal(SVCPOOL *pool, bool_t i * execute the request * immediately. */ - if (stpref != st) { - cv_signal(&stpref->st_cond); - continue; - } else { + if (stpref == st) break; + if (stpref->st_idle) { + LIST_REMOVE(stpref, st_ilink); + stpref->st_idle = FALSE; + cv_signal(&stpref->st_cond); } } } while (stat == XPRT_MOREREQS @@ -1153,10 +1158,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i xprt->xp_thread = NULL; st->st_xprt = NULL; if (xprt->xp_active) { - xprt_assignthread(xprt); - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, - xp_alink); + if (!xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, + xprt, xp_alink); } mtx_unlock(&pool->sp_lock); SVC_RELEASE(xprt); Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/rpc/svc.h Fri Dec 20 17:39:07 2013 (r259659) @@ -278,6 +278,7 @@ typedef struct __rpc_svcthread { SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ int st_reqcount; /* number of queued reqs */ + int st_idle; /* thread is on idle list */ struct cv st_cond; /* sleeping for work */ LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 18:01:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A1354A1; Fri, 20 Dec 2013 18:01:18 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03FBB1AA0; Fri, 20 Dec 2013 18:01:16 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id u56so2839404wes.36 for ; Fri, 20 Dec 2013 10:01:15 -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=bET6xWZS8aFaOBfsk6U2HnIZGN3jk0OZ9hjbeaWp7wc=; b=JpjT1QRIL/Zsn9RTTD0B5/8I4h7MXBkbMEOjzADhdw+PQI528InvkGu25LFD7E+x2g 69o+UeDlVPylmkz2pKC3le8cRmjkbVkbtBlB5+i/g6oL3DP69G9nmpFz4QHN6E/so12C +BLxgu3iZgReiSY6Xr2dHqYjtNjptBi5LatDyFhGdmixxKXNF1Vai53Jcs+cyIeP9ZvS KHecvm/51uIe7M1/tyq6jKsPgD3GITYp8GnRGo1Y/g+aXEJZbtURDhKOY+HU3MDhGA1C bnsFBtGkgkkBvQYnGifPqSFGu407hHfzPDpuCJio9BMjWKCXTUU7LMLmQ3DjEJSNMMD3 gVXg== MIME-Version: 1.0 X-Received: by 10.180.103.193 with SMTP id fy1mr9160868wib.10.1387562475319; Fri, 20 Dec 2013 10:01:15 -0800 (PST) Received: by 10.194.65.37 with HTTP; Fri, 20 Dec 2013 10:01:15 -0800 (PST) In-Reply-To: References: <201312200741.rBK7f3tL038123@svn.freebsd.org> <20131220084419.GK71033@FreeBSD.org> Date: Fri, 20 Dec 2013 10:01:15 -0800 Message-ID: Subject: Re: svn commit: r259642 - head/sys/netinet From: Jack Vogel To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 18:01:18 -0000 I agree with Gleb, ifdef 0 is silly, after all, that's why we have source history, its not like the offending code is gone forever :) So I guess its both of us muttering Gleb :) Jack On Fri, Dec 20, 2013 at 9:05 AM, Adrian Chadd wrote: > On 20 December 2013 00:44, Gleb Smirnoff wrote: > > > I didn't get to review of actual patch, but IMO it would be better > > just to remove the code, not ifdef 0 it. The code ifdefed has zero > > probability to be enabled in its current form. If we ever fix it, code > > would look very different. > > > > No reason to do followup commit, that was just me muttering. > > I figured it would be nicer in the short term to #if 0 it out whilst > some other discussions went on, just to make it really obvious in the > short term where the check was done. It's quite possible I'll > eventually just trim it entirely out. > > Thanks, > > > -a > From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 18:09:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B39C4A1C; Fri, 20 Dec 2013 18:09:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD331AF2; Fri, 20 Dec 2013 18:09:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKI9bdB070497; Fri, 20 Dec 2013 18:09:37 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKI9Zp3070481; Fri, 20 Dec 2013 18:09:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201809.rBKI9Zp3070481@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 18:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259660 - head/contrib/gcc/cp 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.17 Precedence: list List-Id: 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, 20 Dec 2013 18:09:37 -0000 Author: pfg Date: Fri Dec 20 18:09:34 2013 New Revision: 259660 URL: http://svnweb.freebsd.org/changeset/base/259660 Log: gcc: revert Rvalue references. They are very useful but at this time I prefer not to figure out some minor conflicts with the bigger Apple's blocks support patch that is being worked on for current. Modified: head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/call.c head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/error.c head/contrib/gcc/cp/except.c head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/parser.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/tree.c head/contrib/gcc/cp/typeck.c Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) @@ -35,65 +35,6 @@ * typeck.c (build_binary_op): Include types in error. -2007-05-30 Russell Yanofsky (r125211) - Douglas Gregor - Pedro Lamarao - Howard Hinnant - - PR c++/7412 - PR c++/29939 - * typeck.c (comptypes): Don't consider rvalue and lvalue - reference types to be equivalent. - (check_return_expr): Move from certain lvalues when returning - them. - * decl.c (grokdeclarator): Implement reference collapsing. - (copy_fn_p): Don't consider constructors taking rvalue references - to be copy constructors. - (move_fn_p): New. - * call.c (conversion): New "rvaluedness_matches_p" member. - (convert_class_to_reference): Require reference type as first - parameter instead of base type. - (reference_binding): Add logic to handle rvalue references. - (implicit_conversion): Update inaccurate comment. - (convert_like_real): Disable creation of temporaries that are - impossible to initialize for types with move constructors. - (build_over_call): Elide move constructors when possible. - (maybe_handle_implicit_object): Set "rvaluedness_matches_p". - (maybe_handle_ref_bind): Return conversion instead of type node. - (compare_ics): Add logic to use "rvaluedness_matches_p" values to - determine preferred conversion sequences. - * cp-tree.h (TYPE_REF_IS_RVALUE): New. - (LOOKUP_PREFER_RVALUE): New. - (DECL_MOVE_CONSTRUCTOR_P): New. - (struct cp_declarator): Add "reference" member for reference - types, with new "rvalue_ref" flag. - (cp_build_reference_type): Declare. - (move_fn_p): Declare. - * error.c (dump_type_prefix): Format rvalue reference types - correctly in error messages. - * except.c (build_throw): Move from certain lvalues when - throwing. - * mangle.c (write_type): Mangle rvalue references differently - than regular references. - * parser.c (make_reference_declarator): Add boolean parameter for - rvalue references. - (cp_parser_make_indirect_declarator): New. - (cp_parser_new_declarator_opt): Call - cp_parser_make_indirect_declarator. - (cp_parser_conversion_declarator_opt): Ditto. - (cp_parser_declarator): Ditto. - (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference - declarators. - * pt.c (tsubst): Implement reference collapsing. - (maybe_adjust_types_for_deduction): Implement special template - parameter deduction rule for rvalue references. - (type_unification_real): Update calls to - maybe_adjust_types_for_deduction. - (try_one_overload): Ditto. - (unify_pack_expansion): Ditto. - * tree.c (lvalue_p_1): Handle rvalue reference types. - (cp_build_reference_type): New. - 2007-05-18 Geoffrey Keating (r124839) * mangle.c (write_real_cst): Use 'unsigned long' for %lx. Modified: head/contrib/gcc/cp/call.c ============================================================================== --- head/contrib/gcc/cp/call.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/call.c Fri Dec 20 18:09:34 2013 (r259660) @@ -95,10 +95,6 @@ struct conversion { /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion from a pointer-to-derived to pointer-to-base is being performed. */ BOOL_BITFIELD base_p : 1; - /* If KIND is ck_ref_bind, true when either an lvalue reference is - being bound to an lvalue expression or an rvalue reference is - being bound to an rvalue expression. */ - BOOL_BITFIELD rvaluedness_matches_p: 1; /* The type of the expression resulting from the conversion. */ tree type; union { @@ -178,7 +174,7 @@ static conversion *standard_conversion ( static conversion *reference_binding (tree, tree, tree, bool, int); static conversion *build_conv (conversion_kind, tree, conversion *); static bool is_subseq (conversion *, conversion *); -static conversion *maybe_handle_ref_bind (conversion **); +static tree maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); static struct z_candidate *add_candidate (struct z_candidate **, tree, tree, size_t, @@ -899,12 +895,12 @@ reference_compatible_p (tree t1, tree t2 converted to T as in [over.match.ref]. */ static conversion * -convert_class_to_reference (tree reference_type, tree s, tree expr) +convert_class_to_reference (tree t, tree s, tree expr) { tree conversions; tree arglist; conversion *conv; - tree t; + tree reference_type; struct z_candidate *candidates; struct z_candidate *cand; bool any_viable_p; @@ -938,7 +934,7 @@ convert_class_to_reference (tree referen arglist = build_int_cst (build_pointer_type (s), 0); arglist = build_tree_list (NULL_TREE, arglist); - t = TREE_TYPE (reference_type); + reference_type = build_reference_type (t); while (conversions) { @@ -1001,9 +997,6 @@ convert_class_to_reference (tree referen cand->second_conv = (direct_reference_binding (reference_type, identity_conv)); - cand->second_conv->rvaluedness_matches_p - = TYPE_REF_IS_RVALUE (TREE_TYPE (TREE_TYPE (cand->fn))) - == TYPE_REF_IS_RVALUE (reference_type); cand->second_conv->bad_p |= cand->convs[0]->bad_p; } } @@ -1130,16 +1123,7 @@ reference_binding (tree rto, tree rfrom, to = build_qualified_type (to, cp_type_quals (from)); compatible_p = reference_compatible_p (to, from); - /* Directly bind reference when target expression's type is compatible with - the reference and expression is an lvalue. In C++0x, the wording in - [8.5.3/5 dcl.init.ref] is changed to also allow direct bindings for const - and rvalue references to rvalues of compatible class type, as part of - DR391. */ - if (compatible_p - && (lvalue_p - || (flag_cpp0x - && (CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) - && CLASS_TYPE_P (from)))) + if (lvalue_p && compatible_p) { /* [dcl.init.ref] @@ -1152,15 +1136,6 @@ reference_binding (tree rto, tree rfrom, lvalue. */ conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); - - if (flags & LOOKUP_PREFER_RVALUE) - /* The top-level caller requested that we pretend that the lvalue - be treated as an rvalue. */ - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); - else - conv->rvaluedness_matches_p - = (TYPE_REF_IS_RVALUE (rto) == !lvalue_p); - if ((lvalue_p & clk_bitfield) != 0 || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to))) /* For the purposes of overload resolution, we ignore the fact @@ -1193,7 +1168,7 @@ reference_binding (tree rto, tree rfrom, the reference is bound to the lvalue result of the conversion in the second case. */ - conv = convert_class_to_reference (rto, from, expr); + conv = convert_class_to_reference (to, from, expr); if (conv) return conv; } @@ -1216,10 +1191,8 @@ reference_binding (tree rto, tree rfrom, /* [dcl.init.ref] - Otherwise, the reference shall be to a non-volatile const type. - - Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */ - if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto)) + Otherwise, the reference shall be to a non-volatile const type. */ + if (!CP_TYPE_CONST_NON_VOLATILE_P (to)) return NULL; /* [dcl.init.ref] @@ -1242,7 +1215,6 @@ reference_binding (tree rto, tree rfrom, { conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)) conv->u.next->check_copy_constructor_p = true; return conv; @@ -1267,7 +1239,6 @@ reference_binding (tree rto, tree rfrom, /* This reference binding, unlike those above, requires the creation of a temporary. */ conv->need_temporary_p = true; - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); return conv; } @@ -1309,7 +1280,7 @@ implicit_conversion (tree to, tree from, conv = cand->second_conv; /* We used to try to bind a reference to a temporary here, but that - is now handled after the recursive call to this function at the end + is now handled by the recursive call to this function at the end of reference_binding. */ return conv; } @@ -4438,22 +4409,13 @@ convert_like_real (conversion *convs, tr { tree ref_type = totype; - /* If necessary, create a temporary. - - VA_ARG_EXPR and CONSTRUCTOR expressions are special cases - that need temporaries, even when their types are reference - compatible with the type of reference being bound, so the - upcoming call to build_unary_op (ADDR_EXPR, expr, ...) - doesn't fail. */ - if (convs->need_temporary_p - || TREE_CODE (expr) == CONSTRUCTOR - || TREE_CODE (expr) == VA_ARG_EXPR) + /* If necessary, create a temporary. */ + if (convs->need_temporary_p || !lvalue_p (expr)) { tree type = convs->u.next->type; cp_lvalue_kind lvalue = real_lvalue_p (expr); - if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) - && !TYPE_REF_IS_RVALUE (ref_type)) + if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type))) { /* If the reference is volatile or non-const, we cannot create a temporary. */ @@ -4976,9 +4938,7 @@ build_over_call (struct z_candidate *can if (! flag_elide_constructors) /* Do things the hard way. */; - else if (cand->num_convs == 1 - && (DECL_COPY_CONSTRUCTOR_P (fn) - || DECL_MOVE_CONSTRUCTOR_P (fn))) + else if (cand->num_convs == 1 && DECL_COPY_CONSTRUCTOR_P (fn)) { tree targ; arg = skip_artificial_parms_for (fn, converted_args); @@ -5716,28 +5676,28 @@ maybe_handle_implicit_object (conversion t = t->u.next; t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); t = direct_reference_binding (reference_type, t); - t->rvaluedness_matches_p = 1; *ics = t; } } /* If *ICS is a REF_BIND set *ICS to the remainder of the conversion, - and return the initial reference binding conversion. Otherwise, - leave *ICS unchanged and return NULL. */ + and return the type to which the reference refers. Otherwise, + leave *ICS unchanged and return NULL_TREE. */ -static conversion * +static tree maybe_handle_ref_bind (conversion **ics) { if ((*ics)->kind == ck_ref_bind) { conversion *old_ics = *ics; + tree type = TREE_TYPE (old_ics->type); *ics = old_ics->u.next; (*ics)->user_conv_p = old_ics->user_conv_p; (*ics)->bad_p = old_ics->bad_p; - return old_ics; + return type; } - return NULL; + return NULL_TREE; } /* Compare two implicit conversion sequences according to the rules set out in @@ -5761,18 +5721,18 @@ compare_ics (conversion *ics1, conversio conversion_rank rank1, rank2; /* REF_BINDING is nonzero if the result of the conversion sequence - is a reference type. In that case REF_CONV is the reference - binding conversion. */ - conversion *ref_conv1; - conversion *ref_conv2; + is a reference type. In that case TARGET_TYPE is the + type referred to by the reference. */ + tree target_type1; + tree target_type2; /* Handle implicit object parameters. */ maybe_handle_implicit_object (&ics1); maybe_handle_implicit_object (&ics2); /* Handle reference parameters. */ - ref_conv1 = maybe_handle_ref_bind (&ics1); - ref_conv2 = maybe_handle_ref_bind (&ics2); + target_type1 = maybe_handle_ref_bind (&ics1); + target_type2 = maybe_handle_ref_bind (&ics2); /* [over.ics.rank] @@ -6063,31 +6023,15 @@ compare_ics (conversion *ics1, conversio /* [over.ics.rank] - --S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers - to an implicit object parameter, and either S1 binds an lvalue reference - to an lvalue and S2 binds an rvalue reference or S1 binds an rvalue - reference to an rvalue and S2 binds an lvalue reference - (C++0x draft standard, 13.3.3.2) - --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - if (ref_conv1 && ref_conv2 + if (target_type1 && target_type2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) - { - if (ref_conv1->rvaluedness_matches_p - && !ref_conv2->rvaluedness_matches_p) - return 1; - else if (!ref_conv1->rvaluedness_matches_p - && ref_conv2->rvaluedness_matches_p) - return -1; - - return comp_cv_qualification (TREE_TYPE (ref_conv2->type), - TREE_TYPE (ref_conv1->type)); - } + return comp_cv_qualification (target_type2, target_type1); /* Neither conversion sequence is better than the other. */ return 0; Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/cp-tree.h Fri Dec 20 18:09:34 2013 (r259660) @@ -56,7 +56,6 @@ struct diagnostic_context; OMP_FOR_GIMPLIFYING_P (in OMP_FOR) BASELINK_QUALIFIED_P (in BASELINK) TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) - TYPE_REF_IS_RVALUE (in REFERENCE_TYPE) 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. @@ -1667,10 +1666,6 @@ struct lang_decl GTY(()) #define DECL_COPY_CONSTRUCTOR_P(NODE) \ (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0) -/* Nonzero if NODE (a FUNCTION_DECL) is a move constructor. */ -#define DECL_MOVE_CONSTRUCTOR_P(NODE) \ - (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) - /* Nonzero if NODE is a destructor. */ #define DECL_DESTRUCTOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr) @@ -2566,10 +2561,6 @@ extern void decl_shadowed_for_var_insert #define TYPE_REF_OBJ_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) -/* True if reference type NODE is an rvalue reference */ -#define TYPE_REF_IS_RVALUE(NODE) \ - TREE_LANG_FLAG_0 (REFERENCE_TYPE_CHECK (NODE)) - /* Returns true if NODE is a pointer to an object, or a pointer to void. Keep these checks in ascending tree code order. */ #define TYPE_PTROBV_P(NODE) \ @@ -3453,8 +3444,6 @@ enum overload_flags { NO_SPECIAL = 0, DT (Normally, these entities are registered in the symbol table, but not found by lookup.) */ #define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) -/* Prefer that the lvalue be treated as an rvalue. */ -#define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3761,21 +3750,13 @@ struct cp_declarator { /* The bounds to the array. */ tree bounds; } array; - /* For cdk_pointer and cdk_ptrmem. */ + /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */ struct { /* The cv-qualifiers for the pointer. */ cp_cv_quals qualifiers; /* For cdk_ptrmem, the class type containing the member. */ tree class_type; } pointer; - /* For cdk_reference */ - struct { - /* The cv-qualifiers for the reference. These qualifiers are - only used to diagnose ill-formed code. */ - cp_cv_quals qualifiers; - /* Whether this is an rvalue reference */ - bool rvalue_ref; - } reference; } u; }; @@ -3936,7 +3917,6 @@ extern tree build_ptrmem_type (tree, t /* the grokdeclarator prototype is in decl.h */ extern tree build_this_parm (tree, cp_cv_quals); extern int copy_fn_p (tree); -extern bool move_fn_p (tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); @@ -4436,7 +4416,6 @@ extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); -extern tree cp_build_reference_type (tree, bool); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/decl.c Fri Dec 20 18:09:34 2013 (r259660) @@ -7823,24 +7823,10 @@ grokdeclarator (const cp_declarator *dec if (TREE_CODE (type) == REFERENCE_TYPE) { - if (declarator->kind != cdk_reference) - { - error ("cannot declare pointer to %q#T", type); - type = TREE_TYPE (type); - } - - /* In C++0x, we allow reference to reference declarations - that occur indirectly through typedefs [7.1.3/8 dcl.typedef] - and template type arguments [14.3.1/4 temp.arg.type]. The - check for direct reference to reference declarations, which - are still forbidden, occurs below. Reasoning behind the change - can be found in DR106, DR540, and the rvalue reference - proposals. */ - else if (!flag_cpp0x) - { - error ("cannot declare reference to %q#T", type); - type = TREE_TYPE (type); - } + error (declarator->kind == cdk_reference + ? "cannot declare reference to %q#T" + : "cannot declare pointer to %q#T", type); + type = TREE_TYPE (type); } else if (VOID_TYPE_P (type)) { @@ -7866,39 +7852,8 @@ grokdeclarator (const cp_declarator *dec if (declarator->kind == cdk_reference) { - /* In C++0x, the type we are creating a reference to might be - a typedef which is itself a reference type. In that case, - we follow the reference collapsing rules in - [7.1.3/8 dcl.typedef] to create the final reference type: - - "If a typedef TD names a type that is a reference to a type - T, an attempt to create the type 'lvalue reference to cv TD' - creates the type 'lvalue reference to T,' while an attempt - to create the type "rvalue reference to cv TD' creates the - type TD." - */ if (!VOID_TYPE_P (type)) - type = cp_build_reference_type - ((TREE_CODE (type) == REFERENCE_TYPE - ? TREE_TYPE (type) : type), - (declarator->u.reference.rvalue_ref - && (TREE_CODE(type) != REFERENCE_TYPE - || TYPE_REF_IS_RVALUE (type)))); - - /* In C++0x, we need this check for direct reference to - reference declarations, which are forbidden by - [8.3.2/5 dcl.ref]. Reference to reference declarations - are only allowed indirectly through typedefs and template - type arguments. Example: - - void foo(int & &); // invalid ref-to-ref decl - - typedef int & int_ref; - void foo(int_ref &); // valid ref-to-ref decl - */ - if (inner_declarator && inner_declarator->kind == cdk_reference) - error ("cannot declare reference to %q#T, which is not " - "a typedef or a template type argument", type); + type = build_reference_type (type); } else if (TREE_CODE (type) == METHOD_TYPE) type = build_ptrmemfunc_type (build_pointer_type (type)); @@ -9123,7 +9078,6 @@ copy_fn_p (tree d) result = -1; } else if (TREE_CODE (arg_type) == REFERENCE_TYPE - && !TYPE_REF_IS_RVALUE (arg_type) && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d)) { if (CP_TYPE_CONST_P (TREE_TYPE (arg_type))) @@ -9141,57 +9095,6 @@ copy_fn_p (tree d) return result; } -/* D is a constructor or overloaded `operator='. - - Let T be the class in which D is declared. Then, this function - returns true when D is a move constructor or move assignment - operator, false otherwise. */ - -bool -move_fn_p (tree d) -{ - tree args; - tree arg_type; - bool result = false; - - gcc_assert (DECL_FUNCTION_MEMBER_P (d)); - - if (!flag_cpp0x) - /* There are no move constructors if we aren't in C++0x mode. */ - return false; - - if (TREE_CODE (d) == TEMPLATE_DECL - || (DECL_TEMPLATE_INFO (d) - && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))) - /* Instantiations of template member functions are never copy - functions. Note that member functions of templated classes are - represented as template functions internally, and we must - accept those as copy functions. */ - return 0; - - args = FUNCTION_FIRST_USER_PARMTYPE (d); - if (!args) - return 0; - - arg_type = TREE_VALUE (args); - if (arg_type == error_mark_node) - return 0; - - if (TREE_CODE (arg_type) == REFERENCE_TYPE - && TYPE_REF_IS_RVALUE (arg_type) - && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)), - DECL_CONTEXT (d))) - result = true; - - args = TREE_CHAIN (args); - - if (args && args != void_list_node && !TREE_PURPOSE (args)) - /* There are more non-optional args. */ - return false; - - return result; -} - /* Remember any special properties of member function DECL. */ void grok_special_member_properties (tree decl) Modified: head/contrib/gcc/cp/error.c ============================================================================== --- head/contrib/gcc/cp/error.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/error.c Fri Dec 20 18:09:34 2013 (r259660) @@ -507,15 +507,7 @@ dump_type_prefix (tree t, int flags) pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); } - if (TREE_CODE (t) == POINTER_TYPE) - pp_character(cxx_pp, '*'); - else if (TREE_CODE (t) == REFERENCE_TYPE) - { - if (TYPE_REF_IS_RVALUE (t)) - pp_string (cxx_pp, "&&"); - else - pp_character (cxx_pp, '&'); - } + pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); pp_base (cxx_pp)->padding = pp_before; pp_cxx_cv_qualifier_seq (cxx_pp, t); } Modified: head/contrib/gcc/cp/except.c ============================================================================== --- head/contrib/gcc/cp/except.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/except.c Fri Dec 20 18:09:34 2013 (r259660) @@ -709,25 +709,12 @@ build_throw (tree exp) /* And initialize the exception object. */ if (CLASS_TYPE_P (temp_type)) { - int flags = LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING; - - /* Under C++0x [12.8/16 class.copy], a thrown lvalue is sometimes - treated as an rvalue for the purposes of overload resolution - to favor move constructors over copy constructors. */ - if (/* Must be a local, automatic variable. */ - TREE_CODE (exp) == VAR_DECL - && DECL_CONTEXT (exp) == current_function_decl - && ! TREE_STATIC (exp) - /* The variable must not have the `volatile' qualifier. */ - && !(cp_type_quals (TREE_TYPE (exp)) & TYPE_QUAL_VOLATILE)) - flags = flags | LOOKUP_PREFER_RVALUE; - /* Call the copy constructor. */ exp = (build_special_member_call (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - flags)); + LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING)); if (exp == error_mark_node) { error (" in thrown expression"); Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 18:09:34 2013 (r259660) @@ -1541,10 +1541,6 @@ write_local_name (const tree function, c ::= G # imaginary (C 2000) [not supported] ::= U # vendor extended type qualifier - C++0x extensions - - ::= RR # rvalue reference-to - TYPE is a type node. */ static void @@ -1639,8 +1635,6 @@ write_type (tree type) break; case REFERENCE_TYPE: - if (TYPE_REF_IS_RVALUE (type)) - write_char('R'); write_char ('R'); write_type (TREE_TYPE (type)); break; Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/parser.c Fri Dec 20 18:09:34 2013 (r259660) @@ -843,7 +843,7 @@ static cp_declarator *make_array_declara static cp_declarator *make_pointer_declarator (cp_cv_quals, cp_declarator *); static cp_declarator *make_reference_declarator - (cp_cv_quals, cp_declarator *, bool); + (cp_cv_quals, cp_declarator *); static cp_parameter_declarator *make_parameter_declarator (cp_decl_specifier_seq *, cp_declarator *, tree); static cp_declarator *make_ptrmem_declarator @@ -937,15 +937,14 @@ make_pointer_declarator (cp_cv_quals cv_ /* Like make_pointer_declarator -- but for references. */ cp_declarator * -make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target, - bool rvalue_ref) +make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target) { cp_declarator *declarator; declarator = make_declarator (cdk_reference); declarator->declarator = target; - declarator->u.reference.qualifiers = cv_qualifiers; - declarator->u.reference.rvalue_ref = rvalue_ref; + declarator->u.pointer.qualifiers = cv_qualifiers; + declarator->u.pointer.class_type = NULL_TREE; return declarator; } @@ -1927,8 +1926,6 @@ static bool cp_parser_is_keyword (cp_token *, enum rid); static tree cp_parser_make_typename_type (cp_parser *, tree, tree); -static cp_declarator * cp_parser_make_indirect_declarator - (enum tree_code, tree, cp_cv_quals, cp_declarator *); /* Returns nonzero if we are parsing tentatively. */ @@ -2602,27 +2599,6 @@ cp_parser_make_typename_type (cp_parser return make_typename_type (scope, id, typename_type, tf_error); } -/* This is a wrapper around the - make_{pointer,ptrmem,reference}_declarator functions that decides - which one to call based on the CODE and CLASS_TYPE arguments. The - CODE argument should be one of the values returned by - cp_parser_ptr_operator. */ -static cp_declarator * -cp_parser_make_indirect_declarator (enum tree_code code, tree class_type, - cp_cv_quals cv_qualifiers, - cp_declarator *target) -{ - if (code == INDIRECT_REF) - if (class_type == NULL_TREE) - return make_pointer_declarator (cv_qualifiers, target); - else - return make_ptrmem_declarator (cv_qualifiers, class_type, target); - else if (code == ADDR_EXPR && class_type == NULL_TREE) - return make_reference_declarator (cv_qualifiers, target, false); - else if (code == NON_LVALUE_EXPR && class_type == NULL_TREE) - return make_reference_declarator (cv_qualifiers, target, true); - gcc_unreachable (); -} /* Create a new C++ parser. */ @@ -5411,8 +5387,15 @@ cp_parser_new_declarator_opt (cp_parser* /* Parse another optional declarator. */ declarator = cp_parser_new_declarator_opt (parser); - return cp_parser_make_indirect_declarator - (code, type, cv_quals, declarator); + /* Create the representation of the declarator. */ + if (type) + declarator = make_ptrmem_declarator (cv_quals, type, declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); + + return declarator; } /* If the next token is a `[', there is a direct-new-declarator. */ @@ -8071,8 +8054,16 @@ cp_parser_conversion_declarator_opt (cp_ /* Parse another optional declarator. */ declarator = cp_parser_conversion_declarator_opt (parser); - return cp_parser_make_indirect_declarator - (code, class_type, cv_quals, declarator); + /* Create the representation of the declarator. */ + if (class_type) + declarator = make_ptrmem_declarator (cv_quals, class_type, + declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); + + return declarator; } return NULL; @@ -11531,8 +11522,15 @@ cp_parser_declarator (cp_parser* parser, && !cp_parser_parse_definitely (parser)) declarator = NULL; - declarator = cp_parser_make_indirect_declarator - (code, class_type, cv_quals, declarator); + /* Build the representation of the ptr-operator. */ + if (class_type) + declarator = make_ptrmem_declarator (cv_quals, + class_type, + declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); } /* Everything else is a direct-declarator. */ else @@ -11973,15 +11971,12 @@ cp_parser_direct_declarator (cp_parser* & cv-qualifier-seq [opt] Returns INDIRECT_REF if a pointer, or pointer-to-member, was used. - Returns ADDR_EXPR if a reference was used, or NON_LVALUE_EXPR for - an rvalue reference. In the case of a pointer-to-member, *TYPE is - filled in with the TYPE containing the member. *CV_QUALS is - filled in with the cv-qualifier-seq, or TYPE_UNQUALIFIED, if there - are no cv-qualifiers. Returns ERROR_MARK if an error occurred. - Note that the tree codes returned by this function have nothing - to do with the types of trees that will be eventually be created - to represent the pointer or reference type being parsed. They are - just constants with suggestive names. */ + Returns ADDR_EXPR if a reference was used. In the case of a + pointer-to-member, *TYPE is filled in with the TYPE containing the + member. *CV_QUALS is filled in with the cv-qualifier-seq, or + TYPE_UNQUALIFIED, if there are no cv-qualifiers. Returns + ERROR_MARK if an error occurred. */ + static enum tree_code cp_parser_ptr_operator (cp_parser* parser, tree* type, @@ -11997,18 +11992,13 @@ cp_parser_ptr_operator (cp_parser* parse /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); - - /* If it's a `*', `&' or `&&' we have a pointer or reference. */ - if (token->type == CPP_MULT) - code = INDIRECT_REF; - else if (token->type == CPP_AND) - code = ADDR_EXPR; - else if (flag_cpp0x && token->type == CPP_AND_AND) /* C++0x only */ - code = NON_LVALUE_EXPR; - - if (code != ERROR_MARK) + /* If it's a `*' or `&' we have a pointer or reference. */ + if (token->type == CPP_MULT || token->type == CPP_AND) { - /* Consume the `*', `&' or `&&'. */ + /* Remember which ptr-operator we were processing. */ + code = (token->type == CPP_AND ? ADDR_EXPR : INDIRECT_REF); + + /* Consume the `*' or `&'. */ cp_lexer_consume_token (parser->lexer); /* A `*' can be followed by a cv-qualifier-seq, and so can a Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 18:09:34 2013 (r259660) @@ -110,8 +110,7 @@ static void tsubst_enum (tree, tree, tre static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); static bool check_instantiated_args (tree, tree, tsubst_flags_t); -static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, - tree); +static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*); static int type_unification_real (tree, tree, tree, tree, int, unification_kind_t, int); static void note_template_header (int); @@ -7547,13 +7546,8 @@ tsubst (tree t, tree args, tsubst_flags_ -- Attempting to create a pointer to reference type. -- Attempting to create a reference to a reference type or - a reference to void. - - Core issue 106 says that creating a reference to a reference - during instantiation is no longer a cause for failure. We - only enforce this check in strict C++98 mode. */ - if ((TREE_CODE (type) == REFERENCE_TYPE - && ((!flag_cpp0x && flag_iso) || code != REFERENCE_TYPE)) + a reference to void. */ + if (TREE_CODE (type) == REFERENCE_TYPE || (code == REFERENCE_TYPE && TREE_CODE (type) == VOID_TYPE)) { static location_t last_loc; @@ -7587,22 +7581,8 @@ tsubst (tree t, tree args, tsubst_flags_ if (TREE_CODE (type) == METHOD_TYPE) r = build_ptrmemfunc_type (r); } - else if (TREE_CODE (type) == REFERENCE_TYPE) - /* In C++0x, during template argument substitution, when there is an - attempt to create a reference to a reference type, reference - collapsing is applied as described in [14.3.1/4 temp.arg.type]: - - "If a template-argument for a template-parameter T names a type - that is a reference to a type A, an attempt to create the type - 'lvalue reference to cv T' creates the type 'lvalue reference to - A,' while an attempt to create the type type rvalue reference to - cv T' creates the type T" - */ - r = cp_build_reference_type - (TREE_TYPE (type), - TYPE_REF_IS_RVALUE (t) && TYPE_REF_IS_RVALUE (type)); else - r = cp_build_reference_type (type, TYPE_REF_IS_RVALUE (t)); + r = build_reference_type (type); r = cp_build_qualified_type_real (r, TYPE_QUALS (t), complain); if (r != error_mark_node) @@ -9812,14 +9792,12 @@ fn_type_unification (tree fn, sections are symmetric. PARM is the type of a function parameter or the return type of the conversion function. ARG is the type of the argument passed to the call, or the type of the value - initialized with the result of the conversion function. - ARG_EXPR is the original argument expression, which may be null. */ + initialized with the result of the conversion function. */ static int maybe_adjust_types_for_deduction (unification_kind_t strict, tree* parm, - tree* arg, - tree arg_expr) + tree* arg) { int result = 0; @@ -9873,16 +9851,6 @@ maybe_adjust_types_for_deduction (unific *arg = TYPE_MAIN_VARIANT (*arg); } - /* From C++0x [14.8.2.1/3 temp.deduct.call] (after DR606), "If P is - of the form T&&, where T is a template parameter, and the argument - is an lvalue, T is deduced as A& */ - if (TREE_CODE (*parm) == REFERENCE_TYPE - && TYPE_REF_IS_RVALUE (*parm) - && TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM - && cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED - && arg_expr && real_lvalue_p (arg_expr)) - *arg = build_reference_type (*arg); - /* [temp.deduct.call] If P is a cv-qualified type, the top level cv-qualifiers @@ -9919,7 +9887,7 @@ type_unification_real (tree tparms, unification_kind_t strict, int flags) { - tree parm, arg, arg_expr; + tree parm, arg; int i; int ntparms = TREE_VEC_LENGTH (tparms); int sub_strict; @@ -9961,7 +9929,6 @@ type_unification_real (tree tparms, parms = TREE_CHAIN (parms); arg = TREE_VALUE (args); args = TREE_CHAIN (args); - arg_expr = NULL; if (arg == error_mark_node) return 1; @@ -10011,7 +9978,6 @@ type_unification_real (tree tparms, return 1; } - arg_expr = arg; arg = unlowered_expr_type (arg); if (arg == error_mark_node) return 1; @@ -10021,8 +9987,7 @@ type_unification_real (tree tparms, int arg_strict = sub_strict; if (!subr) - arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, - arg_expr); + arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); if (unify (tparms, targs, parm, arg, arg_strict)) return 1; @@ -10199,7 +10164,7 @@ try_one_overload (tree tparms, else if (addr_p) arg = build_pointer_type (arg); - sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, NULL); + sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); /* We don't copy orig_targs for this because if we have already deduced some template args from previous args, unify would complain when we Modified: head/contrib/gcc/cp/tree.c ============================================================================== --- head/contrib/gcc/cp/tree.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/tree.c Fri Dec 20 18:09:34 2013 (r259660) @@ -64,28 +64,8 @@ lvalue_p_1 (tree ref, cp_lvalue_kind op1_lvalue_kind = clk_none; cp_lvalue_kind op2_lvalue_kind = clk_none; - /* Expressions of reference type are sometimes wrapped in - INDIRECT_REFs. INDIRECT_REFs are just internal compiler - representation, not part of the language, so we have to look - through them. */ - if (TREE_CODE (ref) == INDIRECT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) - == REFERENCE_TYPE) - return lvalue_p_1 (TREE_OPERAND (ref, 0), - treat_class_rvalues_as_lvalues); - if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE) - { - /* unnamed rvalue references are rvalues */ - if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref)) - && TREE_CODE (ref) != PARM_DECL - && TREE_CODE (ref) != VAR_DECL - && TREE_CODE (ref) != COMPONENT_REF) - return clk_none; - - /* lvalue references and named rvalue refences are lvalues */ - return clk_ordinary; - } + return clk_ordinary; if (ref == current_class_ptr) return clk_none; @@ -471,53 +451,6 @@ build_cplus_array_type (tree elt_type, t return t; } - -/* Return a reference type node referring to TO_TYPE. If RVAL is - true, return an rvalue reference type, otherwise return an lvalue - reference type. If a type node exists, reuse it, otherwise create - a new one. */ -tree -cp_build_reference_type (tree to_type, bool rval) -{ - tree lvalue_ref, t; - lvalue_ref = build_reference_type (to_type); - if (!rval) - return lvalue_ref; - - /* This code to create rvalue reference types is based on and tied - to the code creating lvalue reference types in the middle-end - functions build_reference_type_for_mode and build_reference_type. - - It works by putting the rvalue reference type nodes after the - lvalue reference nodes in the TYPE_NEXT_REF_TO linked list, so - they will effectively be ignored by the middle end. */ - - for (t = lvalue_ref; (t = TYPE_NEXT_REF_TO (t)); ) - if (TYPE_REF_IS_RVALUE (t)) - return t; - - t = copy_node (lvalue_ref); - - TYPE_REF_IS_RVALUE (t) = true; - TYPE_NEXT_REF_TO (t) = TYPE_NEXT_REF_TO (lvalue_ref); - TYPE_NEXT_REF_TO (lvalue_ref) = t; - TYPE_MAIN_VARIANT (t) = t; - - if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) - SET_TYPE_STRUCTURAL_EQUALITY (t); - else if (TYPE_CANONICAL (to_type) != to_type) - TYPE_CANONICAL (t) - = cp_build_reference_type (TYPE_CANONICAL (to_type), rval); - else - TYPE_CANONICAL (t) = t; - - layout_type (t); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 18:16:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E9F8F61; Fri, 20 Dec 2013 18:16:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68B741CAA; Fri, 20 Dec 2013 18:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKIG6Q2074111; Fri, 20 Dec 2013 18:16:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKIG27b074084; Fri, 20 Dec 2013 18:16:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201816.rBKIG27b074084@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 18:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259661 - in head/contrib/gcc: . cp 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.17 Precedence: list List-Id: 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, 20 Dec 2013 18:16:06 -0000 Author: pfg Date: Fri Dec 20 18:16:02 2013 New Revision: 259661 URL: http://svnweb.freebsd.org/changeset/base/259661 Log: Revert r259619: Fixes GCC libstdc++/29286 The fix seems to work for amd64 but causes segfaults on powerpc. At this time gcc is much more important on powerpc than on amd64. Reported by: andreast Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/init.c head/contrib/gcc/doc/c-tree.texi head/contrib/gcc/expr.c head/contrib/gcc/gimple-low.c head/contrib/gcc/gimplify.c head/contrib/gcc/omp-low.c head/contrib/gcc/print-tree.c head/contrib/gcc/tree-gimple.c head/contrib/gcc/tree-inline.c head/contrib/gcc/tree-pretty-print.c head/contrib/gcc/tree-ssa-alias.c head/contrib/gcc/tree-ssa-dce.c head/contrib/gcc/tree-ssa-operands.c head/contrib/gcc/tree-ssa-structalias.c head/contrib/gcc/tree.def head/contrib/gcc/tree.h Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 18:16:02 2013 (r259661) @@ -65,48 +65,6 @@ fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. -2007-06-12 Ian Lance Taylor (r125653) - Daniel Berlin - - PR libstdc++/29286 - * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR. - * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define. - (CHANGE_DYNAMIC_TYPE_LOCATION): Define. - (DECL_NO_TBAA_P): Define. - (struct tree_decl_common): Add no_tbaa_flag field. - * tree-ssa-structalias.c (struct variable_info): Add - no_tbaa_pruning field. - (new_var_info): Initialize no_tbaa_pruning field. - (unify_nodes): Copy no_tbaa_pruning field. - (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR. - (dump_solution_for_var): Print no_tbaa_pruning flag. - (set_uids_in_ptset): Add no_tbaa_pruning parameter. Change all - callers. - (compute_tbaa_pruning): New static function. - (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes. - Call compute_tbaa_pruning. - * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers. - * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR. - * gimple-low.c (lower_stmt): Likewise. - * tree-gimple.c (is_gimple_stmt): Likewise. - * tree-ssa-operands.c (get_expr_operands): Likewise. - * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. - * tree-inline.c (estimate_num_insns_1): Likewise. - (copy_result_decl_to_var): Likewise. - * expr.c (expand_expr_real_1): Likewise. - * tree-pretty-print.c (dump_generic_node): Likewise. - * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag. - * omp-low.c (omp_copy_decl_2): Likewise. - * print-tree.c (print_node): Print DECL_NO_TBAA_P flag. - * doc/c-tree.texi (Expression trees): Document - CHANGE_DYNAMIC_TYPE_EXPR. - -2007-06-09 Daniel Berlin (r125603) - - * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd - parameter, use it. - (find_what_p_points_to): Pass new parameter to set_uids_in_ptset. - 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:16:02 2013 (r259661) @@ -25,12 +25,6 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. -2007-06-12 Ian Lance Taylor (r125653) - - PR libstdc++/29286 - * init.c (avoid_placement_new_aliasing): New static function. - (build_new_1): Call it. - 2007-05-31 Daniel Berlin (r125239) * typeck.c (build_binary_op): Include types in error. Modified: head/contrib/gcc/cp/init.c ============================================================================== --- head/contrib/gcc/cp/init.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/cp/init.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,7 +1,6 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1565,55 +1564,6 @@ build_raw_new_expr (tree placement, tree return new_expr; } -/* Make sure that there are no aliasing issues with T, a placement new - expression applied to PLACEMENT, by recording the change in dynamic - type. If placement new is inlined, as it is with libstdc++, and if - the type of the placement new differs from the type of the - placement location itself, then alias analysis may think it is OK - to interchange writes to the location from before the placement new - and from after the placement new. We have to prevent type-based - alias analysis from applying. PLACEMENT may be NULL, which means - that we couldn't capture it in a temporary variable, in which case - we use a memory clobber. */ - -static tree -avoid_placement_new_aliasing (tree t, tree placement) -{ - tree type_change; - - if (processing_template_decl) - return t; - - /* If we are not using type based aliasing, we don't have to do - anything. */ - if (!flag_strict_aliasing) - return t; - - /* If we have a pointer and a location, record the change in dynamic - type. Otherwise we need a general memory clobber. */ - if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE - && placement != NULL_TREE - && TREE_CODE (TREE_TYPE (placement)) == POINTER_TYPE) - type_change = build_stmt (CHANGE_DYNAMIC_TYPE_EXPR, - TREE_TYPE (t), - placement); - else - { - /* Build a memory clobber. */ - type_change = build_stmt (ASM_EXPR, - build_string (0, ""), - NULL_TREE, - NULL_TREE, - tree_cons (NULL_TREE, - build_string (6, "memory"), - NULL_TREE)); - - ASM_VOLATILE_P (type_change) = 1; - } - - return build2 (COMPOUND_EXPR, TREE_TYPE (t), type_change, t); -} - /* Generate code for a new-expression, including calling the "operator new" function, initializing the object, and, if an exception occurs during construction, cleaning up. The arguments are as for @@ -1657,7 +1607,6 @@ build_new_1 (tree placement, tree type, beginning of the storage allocated for an array-new expression in order to store the number of elements. */ tree cookie_size = NULL_TREE; - tree placement_var; /* True if the function we are calling is a placement allocation function. */ bool placement_allocation_fn_p; @@ -1751,20 +1700,6 @@ build_new_1 (tree placement, tree type, alloc_fn = NULL_TREE; - /* If PLACEMENT is a simple pointer type, then copy it into - PLACEMENT_VAR. */ - if (processing_template_decl - || placement == NULL_TREE - || TREE_CHAIN (placement) != NULL_TREE - || TREE_CODE (TREE_TYPE (TREE_VALUE (placement))) != POINTER_TYPE) - placement_var = NULL_TREE; - else - { - placement_var = get_temp_regvar (TREE_TYPE (TREE_VALUE (placement)), - TREE_VALUE (placement)); - placement = tree_cons (NULL_TREE, placement_var, NULL_TREE); - } - /* Allocate the object. */ if (! placement && TYPE_FOR_JAVA (elt_type)) { @@ -1857,12 +1792,7 @@ build_new_1 (tree placement, tree type, /* In the simple case, we can stop now. */ pointer_type = build_pointer_type (type); if (!cookie_size && !is_initialized) - { - rval = build_nop (pointer_type, alloc_call); - if (placement != NULL) - rval = avoid_placement_new_aliasing (rval, placement_var); - return rval; - } + return build_nop (pointer_type, alloc_call); /* While we're working, use a pointer to the type we've actually allocated. Store the result of the call in a variable so that we @@ -2121,9 +2051,6 @@ build_new_1 (tree placement, tree type, /* A new-expression is never an lvalue. */ gcc_assert (!lvalue_p (rval)); - if (placement != NULL) - rval = avoid_placement_new_aliasing (rval, placement_var); - return rval; } Modified: head/contrib/gcc/doc/c-tree.texi ============================================================================== --- head/contrib/gcc/doc/c-tree.texi Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/doc/c-tree.texi Fri Dec 20 18:16:02 2013 (r259661) @@ -1916,7 +1916,6 @@ This macro returns the attributes on the @tindex TARGET_EXPR @tindex AGGR_INIT_EXPR @tindex VA_ARG_EXPR -@tindex CHANGE_DYNAMIC_TYPE_EXPR @tindex OMP_PARALLEL @tindex OMP_FOR @tindex OMP_SECTIONS @@ -2573,13 +2572,6 @@ mechanism. It represents expressions li Its @code{TREE_TYPE} yields the tree representation for @code{type} and its sole argument yields the representation for @code{ap}. -@item CHANGE_DYNAMIC_TYPE_EXPR -Indicates the special aliasing required by C++ placement new. It has -two operands: a type and a location. It means that the dynamic type -of the location is changing to be the specified type. The alias -analysis code takes this into account when doing type based alias -analysis. - @item OMP_PARALLEL Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/expr.c Fri Dec 20 18:16:02 2013 (r259661) @@ -8718,13 +8718,6 @@ expand_expr_real_1 (tree exp, rtx target /* Lowered by gimplify.c. */ gcc_unreachable (); - case CHANGE_DYNAMIC_TYPE_EXPR: - /* This is ignored at the RTL level. The tree level set - DECL_POINTER_ALIAS_SET of any variable to be 0, which is - overkill for the RTL layer but is all that we can - represent. */ - return const0_rtx; - case EXC_PTR_EXPR: return get_exception_pointer (cfun); Modified: head/contrib/gcc/gimple-low.c ============================================================================== --- head/contrib/gcc/gimple-low.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/gimple-low.c Fri Dec 20 18:16:02 2013 (r259661) @@ -243,7 +243,6 @@ lower_stmt (tree_stmt_iterator *tsi, str case GOTO_EXPR: case LABEL_EXPR: case SWITCH_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: case OMP_FOR: case OMP_SECTIONS: case OMP_SECTION: Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/gimplify.c Fri Dec 20 18:16:02 2013 (r259661) @@ -5748,11 +5748,6 @@ gimplify_expr (tree *expr_p, tree *pre_p ret = GS_ALL_DONE; break; - case CHANGE_DYNAMIC_TYPE_EXPR: - ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p), - pre_p, post_p, is_gimple_reg, fb_lvalue); - break; - case OBJ_TYPE_REF: { enum gimplify_status r0, r1; Modified: head/contrib/gcc/omp-low.c ============================================================================== --- head/contrib/gcc/omp-low.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/omp-low.c Fri Dec 20 18:16:02 2013 (r259661) @@ -518,7 +518,6 @@ omp_copy_decl_2 (tree var, tree name, tr TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (var); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (var); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (var); DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); DECL_IGNORED_P (copy) = DECL_IGNORED_P (var); TREE_USED (copy) = 1; Modified: head/contrib/gcc/print-tree.c ============================================================================== --- head/contrib/gcc/print-tree.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/print-tree.c Fri Dec 20 18:16:02 2013 (r259661) @@ -401,9 +401,7 @@ print_node (FILE *file, const char *pref if (DECL_VIRTUAL_P (node)) fputs (" virtual", file); if (DECL_PRESERVE_P (node)) - fputs (" preserve", file); - if (DECL_NO_TBAA_P (node)) - fputs (" no-tbaa", file); + fputs (" preserve", file); if (DECL_LANG_FLAG_0 (node)) fputs (" decl_0", file); if (DECL_LANG_FLAG_1 (node)) Modified: head/contrib/gcc/tree-gimple.c ============================================================================== --- head/contrib/gcc/tree-gimple.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-gimple.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,6 +1,5 @@ /* Functions to analyze and validate GIMPLE trees. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo Rewritten by Jason Merrill @@ -216,7 +215,6 @@ is_gimple_stmt (tree t) case TRY_FINALLY_EXPR: case EH_FILTER_EXPR: case CATCH_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: case ASM_EXPR: case RESX_EXPR: case PHI_NODE: Modified: head/contrib/gcc/tree-inline.c ============================================================================== --- head/contrib/gcc/tree-inline.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-inline.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1649,11 +1649,6 @@ estimate_num_insns_1 (tree *tp, int *wal *walk_subtrees = 0; return NULL; - /* CHANGE_DYNAMIC_TYPE_EXPR explicitly expands to nothing. */ - case CHANGE_DYNAMIC_TYPE_EXPR: - *walk_subtrees = 0; - return NULL; - /* Try to estimate the cost of assignments. We have three cases to deal with: 1) Simple assignments to registers; @@ -2640,7 +2635,6 @@ copy_decl_to_var (tree decl, copy_body_d TREE_READONLY (copy) = TREE_READONLY (decl); TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); return copy_decl_for_dup_finish (id, decl, copy); } @@ -2667,7 +2661,6 @@ copy_result_decl_to_var (tree decl, copy { TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); } return copy_decl_for_dup_finish (id, decl, copy); Modified: head/contrib/gcc/tree-pretty-print.c ============================================================================== --- head/contrib/gcc/tree-pretty-print.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-pretty-print.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1443,17 +1443,6 @@ dump_generic_node (pretty_printer *buffe is_expr = false; break; - case CHANGE_DYNAMIC_TYPE_EXPR: - pp_string (buffer, "<<>>"); - is_expr = false; - break; - case LABEL_EXPR: op0 = TREE_OPERAND (node, 0); /* If this is for break or continue, don't bother printing it. */ Modified: head/contrib/gcc/tree-ssa-alias.c ============================================================================== --- head/contrib/gcc/tree-ssa-alias.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-alias.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,5 +1,5 @@ /* Alias analysis for trees. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -1961,29 +1961,28 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG); - if (!DECL_NO_TBAA_P (ptr)) + alias_stats.tbaa_queries++; + + /* If the alias sets don't conflict then MEM cannot alias VAR. */ + if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) { - alias_stats.tbaa_queries++; + alias_stats.alias_noalias++; + alias_stats.tbaa_resolved++; + return false; + } - /* If the alias sets don't conflict then MEM cannot alias VAR. */ - if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) - { - alias_stats.alias_noalias++; - alias_stats.tbaa_resolved++; - return false; - } + /* If var is a record or union type, ptr cannot point into var + unless there is some operation explicit address operation in the + program that can reference a field of the ptr's dereferenced + type. This also assumes that the types of both var and ptr are + contained within the compilation unit, and that there is no fancy + addressing arithmetic associated with any of the types + involved. */ - /* If VAR is a record or union type, PTR cannot point into VAR - unless there is some explicit address operation in the - program that can reference a field of the type pointed-to by - PTR. This also assumes that the types of both VAR and PTR - are contained within the compilation unit, and that there is - no fancy addressing arithmetic associated with any of the - types involved. */ - if (mem_alias_set != 0 && var_alias_set != 0) - { - tree ptr_type = TREE_TYPE (ptr); - tree var_type = TREE_TYPE (var); + if ((mem_alias_set != 0) && (var_alias_set != 0)) + { + tree ptr_type = TREE_TYPE (ptr); + tree var_type = TREE_TYPE (var); /* The star count is -1 if the type at the end of the pointer_to chain is not a record or union type. */ @@ -1992,41 +1991,41 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem { int ptr_star_count = 0; - /* ipa_type_escape_star_count_of_interesting_type is a - little too restrictive for the pointer type, need to - allow pointers to primitive types as long as those - types cannot be pointers to everything. */ - while (POINTER_TYPE_P (ptr_type)) - { - /* Strip the *s off. */ - ptr_type = TREE_TYPE (ptr_type); - ptr_star_count++; - } + /* Ipa_type_escape_star_count_of_interesting_type is a little to + restrictive for the pointer type, need to allow pointers to + primitive types as long as those types cannot be pointers + to everything. */ + while (POINTER_TYPE_P (ptr_type)) + /* Strip the *'s off. */ + { + ptr_type = TREE_TYPE (ptr_type); + ptr_star_count++; + } - /* There does not appear to be a better test to see if - the pointer type was one of the pointer to everything - types. */ - if (ptr_star_count > 0) - { - alias_stats.structnoaddress_queries++; - if (ipa_type_escape_field_does_not_clobber_p (var_type, - TREE_TYPE (ptr))) - { - alias_stats.structnoaddress_resolved++; - alias_stats.alias_noalias++; - return false; - } - } - else if (ptr_star_count == 0) + /* There does not appear to be a better test to see if the + pointer type was one of the pointer to everything + types. */ + + if (ptr_star_count > 0) + { + alias_stats.structnoaddress_queries++; + if (ipa_type_escape_field_does_not_clobber_p (var_type, + TREE_TYPE (ptr))) { - /* If PTR_TYPE was not really a pointer to type, it cannot - alias. */ - alias_stats.structnoaddress_queries++; alias_stats.structnoaddress_resolved++; alias_stats.alias_noalias++; return false; } } + else if (ptr_star_count == 0) + { + /* If ptr_type was not really a pointer to type, it cannot + alias. */ + alias_stats.structnoaddress_queries++; + alias_stats.structnoaddress_resolved++; + alias_stats.alias_noalias++; + return false; + } } } Modified: head/contrib/gcc/tree-ssa-dce.c ============================================================================== --- head/contrib/gcc/tree-ssa-dce.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-dce.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,6 +1,5 @@ /* Dead code elimination pass for the GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Ben Elliston and Andrew MacLeod Adapted to use control dependence by Steven Bosscher, SUSE Labs. @@ -308,7 +307,6 @@ mark_stmt_if_obviously_necessary (tree s case ASM_EXPR: case RESX_EXPR: case RETURN_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: mark_stmt_necessary (stmt, true); return; Modified: head/contrib/gcc/tree-ssa-operands.c ============================================================================== --- head/contrib/gcc/tree-ssa-operands.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-operands.c Fri Dec 20 18:16:02 2013 (r259661) @@ -2057,10 +2057,6 @@ get_expr_operands (tree stmt, tree *expr return; } - case CHANGE_DYNAMIC_TYPE_EXPR: - get_expr_operands (stmt, &CHANGE_DYNAMIC_TYPE_LOCATION (expr), opf_none); - return; - case BLOCK: case FUNCTION_DECL: case EXC_PTR_EXPR: Modified: head/contrib/gcc/tree-ssa-structalias.c ============================================================================== --- head/contrib/gcc/tree-ssa-structalias.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-structalias.c Fri Dec 20 18:16:02 2013 (r259661) @@ -251,10 +251,6 @@ struct variable_info /* True if this is a heap variable. */ unsigned int is_heap_var:1; - /* True if we may not use TBAA to prune references to this - variable. This is used for C++ placement new. */ - unsigned int no_tbaa_pruning : 1; - /* Points-to set for this variable. */ bitmap solution; @@ -372,7 +368,6 @@ static varinfo_t new_var_info (tree t, unsigned int id, const char *name) { varinfo_t ret = pool_alloc (variable_info_pool); - tree var; ret->id = id; ret->name = name; @@ -383,12 +378,6 @@ new_var_info (tree t, unsigned int id, c ret->is_special_var = false; ret->is_unknown_size_var = false; ret->has_union = false; - var = t; - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - ret->no_tbaa_pruning = (DECL_P (var) - && POINTER_TYPE_P (TREE_TYPE (var)) - && DECL_NO_TBAA_P (var)); ret->solution = BITMAP_ALLOC (&pta_obstack); ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack); ret->next = NULL; @@ -1232,9 +1221,6 @@ unify_nodes (constraint_graph_t graph, u merge_graph_nodes (graph, to, from); merge_node_constraints (graph, to, from); - if (get_varinfo (from)->no_tbaa_pruning) - get_varinfo (to)->no_tbaa_pruning = true; - if (update_changed && TEST_BIT (changed, from)) { RESET_BIT (changed, from); @@ -3578,14 +3564,6 @@ find_func_aliases (tree origt) } } } - else if (TREE_CODE (t) == CHANGE_DYNAMIC_TYPE_EXPR) - { - unsigned int j; - - get_constraint_for (CHANGE_DYNAMIC_TYPE_LOCATION (t), &lhsc); - for (j = 0; VEC_iterate (ce_s, lhsc, j, c); ++j) - get_varinfo (c->var)->no_tbaa_pruning = true; - } /* After promoting variables and computing aliasing we will need to re-scan most statements. FIXME: Try to minimize the @@ -4272,10 +4250,7 @@ dump_solution_for_var (FILE *file, unsig { fprintf (file, "%s ", get_varinfo (i)->name); } - fprintf (file, "}"); - if (vi->no_tbaa_pruning) - fprintf (file, " no-tbaa-pruning"); - fprintf (file, "\n"); + fprintf (file, "}\n"); } } @@ -4447,15 +4422,10 @@ shared_bitmap_add (bitmap pt_vars) /* Set bits in INTO corresponding to the variable uids in solution set FROM, which came from variable PTR. For variables that are actually dereferenced, we also use type - based alias analysis to prune the points-to sets. - IS_DEREFED is true if PTR was directly dereferenced, which we use to - help determine whether we are we are allowed to prune using TBAA. - If NO_TBAA_PRUNING is true, we do not perform any TBAA pruning of - the from set. */ + based alias analysis to prune the points-to sets. */ static void -set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed, - bool no_tbaa_pruning) +set_uids_in_ptset (tree ptr, bitmap into, bitmap from) { unsigned int i; bitmap_iterator bi; @@ -4492,8 +4462,7 @@ set_uids_in_ptset (tree ptr, bitmap into if (sft) { var_alias_set = get_alias_set (sft); - if (no_tbaa_pruning - || (!is_derefed && !vi->directly_dereferenced) + if (!vi->directly_dereferenced || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (sft)); } @@ -4507,8 +4476,7 @@ set_uids_in_ptset (tree ptr, bitmap into else { var_alias_set = get_alias_set (vi->decl); - if (no_tbaa_pruning - || (!is_derefed && !vi->directly_dereferenced) + if (!vi->directly_dereferenced || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (vi->decl)); } @@ -4596,9 +4564,7 @@ find_what_p_points_to (tree p) return false; finished_solution = BITMAP_GGC_ALLOC (); - set_uids_in_ptset (vi->decl, finished_solution, vi->solution, - vi->directly_dereferenced, - vi->no_tbaa_pruning); + set_uids_in_ptset (vi->decl, finished_solution, vi->solution); result = shared_bitmap_lookup (finished_solution); if (!result) @@ -4947,142 +4913,6 @@ remove_preds_and_fake_succs (constraint_ bitmap_obstack_release (&predbitmap_obstack); } -/* Compute the set of variables we can't TBAA prune. */ - -static void -compute_tbaa_pruning (void) -{ - unsigned int size = VEC_length (varinfo_t, varmap); - unsigned int i; - bool any; - - changed_count = 0; - changed = sbitmap_alloc (size); - sbitmap_zero (changed); - - /* Mark all initial no_tbaa_pruning nodes as changed. */ - any = false; - for (i = 0; i < size; ++i) - { - varinfo_t ivi = get_varinfo (i); - - if (find (i) == i && ivi->no_tbaa_pruning) - { - any = true; - if ((graph->succs[i] && !bitmap_empty_p (graph->succs[i])) - || VEC_length (constraint_t, graph->complex[i]) > 0) - { - SET_BIT (changed, i); - ++changed_count; - } - } - } - - while (changed_count > 0) - { - struct topo_info *ti = init_topo_info (); - ++stats.iterations; - - bitmap_obstack_initialize (&iteration_obstack); - - compute_topo_order (graph, ti); - - while (VEC_length (unsigned, ti->topo_order) != 0) - { - bitmap_iterator bi; - - i = VEC_pop (unsigned, ti->topo_order); - - /* If this variable is not a representative, skip it. */ - if (find (i) != i) - continue; - - /* If the node has changed, we need to process the complex - constraints and outgoing edges again. */ - if (TEST_BIT (changed, i)) - { - unsigned int j; - constraint_t c; - VEC(constraint_t,heap) *complex = graph->complex[i]; - - RESET_BIT (changed, i); - --changed_count; - - /* Process the complex copy constraints. */ - for (j = 0; VEC_iterate (constraint_t, complex, j, c); ++j) - { - if (c->lhs.type == SCALAR && c->rhs.type == SCALAR) - { - varinfo_t lhsvi = get_varinfo (find (c->lhs.var)); - - if (!lhsvi->no_tbaa_pruning) - { - lhsvi->no_tbaa_pruning = true; - if (!TEST_BIT (changed, lhsvi->id)) - { - SET_BIT (changed, lhsvi->id); - ++changed_count; - } - } - } - } - - /* Propagate to all successors. */ - EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i], 0, j, bi) - { - unsigned int to = find (j); - varinfo_t tovi = get_varinfo (to); - - /* Don't propagate to ourselves. */ - if (to == i) - continue; - - if (!tovi->no_tbaa_pruning) - { - tovi->no_tbaa_pruning = true; - if (!TEST_BIT (changed, to)) - { - SET_BIT (changed, to); - ++changed_count; - } - } - } - } - } - - free_topo_info (ti); - bitmap_obstack_release (&iteration_obstack); - } - - sbitmap_free (changed); - - if (any) - { - for (i = 0; i < size; ++i) - { - varinfo_t ivi = get_varinfo (i); - varinfo_t ivip = get_varinfo (find (i)); - - if (ivip->no_tbaa_pruning) - { - tree var = ivi->decl; - - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - - if (POINTER_TYPE_P (TREE_TYPE (var))) - { - DECL_NO_TBAA_P (var) = 1; - - /* Tell the RTL layer that this pointer can alias - anything. */ - DECL_POINTER_ALIAS_SET (var) = 0; - } - } - } - } -} - /* Create points-to sets for the current function. See the comments at the start of the file for an algorithmic overview. */ @@ -5118,7 +4948,7 @@ compute_points_to_sets (struct alias_inf } } - for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) { tree stmt = bsi_stmt (bsi); @@ -5129,13 +4959,6 @@ compute_points_to_sets (struct alias_inf This is used when creating name tags and alias sets. */ update_alias_info (stmt, ai); - - /* The information in CHANGE_DYNAMIC_TYPE_EXPR nodes has now - been captured, and we can remove them. */ - if (TREE_CODE (stmt) == CHANGE_DYNAMIC_TYPE_EXPR) - bsi_remove (&bsi, true); - else - bsi_next (&bsi); } } @@ -5168,8 +4991,6 @@ compute_points_to_sets (struct alias_inf solve_graph (graph); - compute_tbaa_pruning (); - if (dump_file) dump_sa_points_to_info (dump_file); have_alias_info = true; Modified: head/contrib/gcc/tree.def ============================================================================== --- head/contrib/gcc/tree.def Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree.def Fri Dec 20 18:16:02 2013 (r259661) @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the tree codes used in GCC. Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -880,15 +880,6 @@ DEFTREECODE (CATCH_EXPR, "catch_expr", t expanding. */ DEFTREECODE (EH_FILTER_EXPR, "eh_filter_expr", tcc_statement, 2) -/* Indicates a change in the dynamic type of a memory location. This - has no value and generates no executable code. It is only used for - type based alias analysis. This is generated by C++ placement new. - CHANGE_DYNAMIC_TYPE_NEW_TYPE, the first operand, is the new type. - CHNAGE_DYNAMIC_TYPE_LOCATION, the second operand, is the location - whose type is being changed. */ -DEFTREECODE (CHANGE_DYNAMIC_TYPE_EXPR, "change_dynamic_type_expr", - tcc_statement, 2) - /* Node used for describing a property that is known at compile time. */ DEFTREECODE (SCEV_KNOWN, "scev_known", tcc_expression, 0) Modified: head/contrib/gcc/tree.h ============================================================================== --- head/contrib/gcc/tree.h Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree.h Fri Dec 20 18:16:02 2013 (r259661) @@ -1548,12 +1548,6 @@ struct tree_constructor GTY(()) #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1) #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE)) -/* CHANGE_DYNAMIC_TYPE_EXPR accessors. */ -#define CHANGE_DYNAMIC_TYPE_NEW_TYPE(NODE) \ - TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 0) -#define CHANGE_DYNAMIC_TYPE_LOCATION(NODE) \ - TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 1) - /* OBJ_TYPE_REF accessors. */ #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0) #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1) @@ -2544,11 +2538,6 @@ struct tree_struct_field_tag GTY(()) #define DECL_CALL_CLOBBERED(DECL) \ DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag -/* For a DECL with pointer type, this is set if Type Based Alias - Analysis should not be applied to this DECL. */ -#define DECL_NO_TBAA_P(DECL) \ - DECL_COMMON_CHECK (DECL)->decl_common.no_tbaa_flag - struct tree_decl_common GTY(()) { struct tree_decl_minimal common; @@ -2590,8 +2579,6 @@ struct tree_decl_common GTY(()) parm decl. */ unsigned gimple_reg_flag : 1; unsigned call_clobbered_flag : 1; - /* In a DECL with pointer type, set if no TBAA should be done. */ - unsigned no_tbaa_flag : 1; unsigned int align : 24; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 18:27:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 426F3B28; Fri, 20 Dec 2013 18:27:22 +0000 (UTC) Received: from mail-oa0-x22c.google.com (mail-oa0-x22c.google.com [IPv6:2607:f8b0:4003:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D66E71DB9; Fri, 20 Dec 2013 18:27:21 +0000 (UTC) Received: by mail-oa0-f44.google.com with SMTP id m1so3283514oag.31 for ; Fri, 20 Dec 2013 10:27:21 -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=SaUEgQPuwCCaXmaP6rHh8uRAsbXE3mIczyobFVemo8I=; b=cGlkgUPRN6xgwg3G2ggLGfa0axUXloZMX4x99PogcG1S+pCJCvQKWPfn/06oFrAP4Q EfQqNygN8MsJKurUM8fJ3e31Zq2T5Lg/9C4dPttdLRJjxCelWDwjY6xTJnnG5X/OU4wH cdWECIuKR0yTGdwfm/NL4hUs+c1KsNvwe2zX5kTU+mlXzqTBttDLL8MZ3UI9+jpM+Nrf eq/o6hf0/xlgUewgd+0NqPC7PfEF9qysj7mWIJ8k2oFkcln4JBMJIqV7CcWmWTMjl5tN F6UJX3VLqblQu/E1t4aoePWU7RzCvbc+cE+q0Z6eEWz7Gyoiq0tVuNvmgJ0Hjq4Pjvbl +wmg== MIME-Version: 1.0 X-Received: by 10.182.99.231 with SMTP id et7mr7427510obb.10.1387564041175; Fri, 20 Dec 2013 10:27:21 -0800 (PST) Received: by 10.182.142.101 with HTTP; Fri, 20 Dec 2013 10:27:21 -0800 (PST) In-Reply-To: <201312200550.rBK5oNmw098487@svn.freebsd.org> References: <201312200550.rBK5oNmw098487@svn.freebsd.org> Date: Fri, 20 Dec 2013 10:27:21 -0800 Message-ID: Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel From: Benjamin Kaduk To: Neel Natu Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 18:27:22 -0000 On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: > Author: neel > Date: Fri Dec 20 05:50:22 2013 > New Revision: 259641 > URL: http://svnweb.freebsd.org/changeset/base/259641 > > Log: > Re-arrange bits in the amd64/pmap 'pm_flags' field. > > The least significant 8 bits of 'pm_flags' are now used for the IPI > vector > to use for nested page table TLB shootdown. > > Previously we used IPI_AST to interrupt the host cpu which is > functionally > correct but could lead to misleading interrupt counts for AST handler. > The > AST handler was also doing a lot more than what is required for the > nested > page table TLB shootdown (EOI and IRET). > This represents a KBI change, does it not? Should __FreeBSD_version be bumped? -Ben From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 19:27:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A49893; Fri, 20 Dec 2013 19:27:01 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA25612BE; Fri, 20 Dec 2013 19:27:00 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id n7so2644265qcx.33 for ; Fri, 20 Dec 2013 11:26:59 -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=QcQeA2Vt9zvHFLbeTRpWUel4QCUr/JvcPE5hYHaSZY4=; b=PSLlhefnXjMaFWnZ0HzYH3HgXoEQ9WL/iSsEHgTQsE9PN6Azv6L46JeqsPWZorCrVi RuiHtA4PFIrIKftWVe4JfYrxXKAuEqFnzzFb3ZvyHgBruBjXlnQa/4lcH2EKIbcuYe6C ZMUGHo9EYUSsvbgf52BY35HlLkw/x4L0Or1LiBf/2TE+puXVzHmVVkim7b6rgRPQKAZk DYrvApeLwwA9VFTJ3u2Di6WzTNimQUXDvisV7M9uLO3aR9X0vwNOS5xXa7ms+3h5WPme S4lJw5ynv/6jBAAsjmEYWw2G+4Zkn0WUVEw72WvSC+x7RURBYo28ZFvlhRxGT8pJgrI5 xwAQ== MIME-Version: 1.0 X-Received: by 10.49.15.202 with SMTP id z10mr17400556qec.46.1387567619788; Fri, 20 Dec 2013 11:26:59 -0800 (PST) Received: by 10.140.34.17 with HTTP; Fri, 20 Dec 2013 11:26:59 -0800 (PST) In-Reply-To: References: <201312200550.rBK5oNmw098487@svn.freebsd.org> Date: Fri, 20 Dec 2013 11:26:59 -0800 Message-ID: Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel From: Neel Natu To: Benjamin Kaduk Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 19:27:01 -0000 Hi Ben, On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk wrote: > On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: >> >> Author: neel >> Date: Fri Dec 20 05:50:22 2013 >> New Revision: 259641 >> URL: http://svnweb.freebsd.org/changeset/base/259641 >> >> Log: >> Re-arrange bits in the amd64/pmap 'pm_flags' field. >> >> The least significant 8 bits of 'pm_flags' are now used for the IPI >> vector >> to use for nested page table TLB shootdown. >> >> Previously we used IPI_AST to interrupt the host cpu which is >> functionally >> correct but could lead to misleading interrupt counts for AST handler. >> The >> AST handler was also doing a lot more than what is required for the >> nested >> page table TLB shootdown (EOI and IRET). > > > This represents a KBI change, does it not? Should __FreeBSD_version be > bumped? > I was under the impression that a bump would be required only if this change is MFCed to a stable branch. I could be wrong about this and if so would be happy to rectify it. best Neel > -Ben From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 19:44:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BFF27D6; Fri, 20 Dec 2013 19:44:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 581B21470; Fri, 20 Dec 2013 19:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKJiUes008608; Fri, 20 Dec 2013 19:44:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKJiUwS008607; Fri, 20 Dec 2013 19:44:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201944.rBKJiUwS008607@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 19:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259662 - head/sys/rpc 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.17 Precedence: list List-Id: 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, 20 Dec 2013 19:44:30 -0000 Author: glebius Date: Fri Dec 20 19:44:29 2013 New Revision: 259662 URL: http://svnweb.freebsd.org/changeset/base/259662 Log: Fix build. Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Fri Dec 20 18:16:02 2013 (r259661) +++ head/sys/rpc/svc.c Fri Dec 20 19:44:29 2013 (r259662) @@ -293,7 +293,7 @@ xprt_unregister_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); xprt_inactive_locked(xprt); @@ -327,7 +327,7 @@ xprt_assignthread(SVCXPRT *xprt) SVCPOOL *pool = xprt->xp_pool; SVCTHREAD *st; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); st = LIST_FIRST(&pool->sp_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); @@ -387,7 +387,7 @@ xprt_inactive_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); if (xprt->xp_active) { if (xprt->xp_thread == NULL) TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 19:45:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97632A2B; Fri, 20 Dec 2013 19:45:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 837C71483; Fri, 20 Dec 2013 19:45:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKJjp11009107; Fri, 20 Dec 2013 19:45:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKJjpuj009106; Fri, 20 Dec 2013 19:45:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201945.rBKJjpuj009106@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 19:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259663 - 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.17 Precedence: list List-Id: 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, 20 Dec 2013 19:45:51 -0000 Author: glebius Date: Fri Dec 20 19:45:51 2013 New Revision: 259663 URL: http://svnweb.freebsd.org/changeset/base/259663 Log: Move list of ttys handling from the allocating procedures, to the device creation stage. A device creation can fail, and in that case an entry already on the list will be freed. Sponsored by: Nginx, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Dec 20 19:44:29 2013 (r259662) +++ head/sys/kern/tty.c Fri Dec 20 19:45:51 2013 (r259663) @@ -1007,11 +1007,6 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx); knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx); - sx_xlock(&tty_list_sx); - TAILQ_INSERT_TAIL(&tty_list, tp, t_list); - tty_list_count++; - sx_xunlock(&tty_list_sx); - return (tp); } @@ -1020,11 +1015,6 @@ tty_dealloc(void *arg) { struct tty *tp = arg; - sx_xlock(&tty_list_sx); - TAILQ_REMOVE(&tty_list, tp, t_list); - tty_list_count--; - sx_xunlock(&tty_list_sx); - /* Make sure we haven't leaked buffers. */ MPASS(ttyinq_getsize(&tp->t_inq) == 0); MPASS(ttyoutq_getsize(&tp->t_outq) == 0); @@ -1065,6 +1055,11 @@ tty_rel_free(struct tty *tp) tp->t_dev = NULL; tty_unlock(tp); + sx_xlock(&tty_list_sx); + TAILQ_REMOVE(&tty_list, tp, t_list); + tty_list_count--; + sx_xunlock(&tty_list_sx); + if (dev != NULL) destroy_dev_sched_cb(dev, tty_dealloc, tp); } @@ -1279,6 +1274,11 @@ tty_makedevf(struct tty *tp, struct ucre } } + sx_xlock(&tty_list_sx); + TAILQ_INSERT_TAIL(&tty_list, tp, t_list); + tty_list_count++; + sx_xunlock(&tty_list_sx); + return (0); fail: From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 20:22:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDB5B906; Fri, 20 Dec 2013 20:22:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA1B8174E; Fri, 20 Dec 2013 20:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKMA2H026552; Fri, 20 Dec 2013 20:22:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKMATA026551; Fri, 20 Dec 2013 20:22:10 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201312202022.rBKKMATA026551@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 20 Dec 2013 20:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259665 - head/sys/dev/hwpmc 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.17 Precedence: list List-Id: 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, 20 Dec 2013 20:22:11 -0000 Author: gnn Date: Fri Dec 20 20:22:10 2013 New Revision: 259665 URL: http://svnweb.freebsd.org/changeset/base/259665 Log: Add another Haswell model (0x45) to the set of supported chips. Model 0x45 appears, for example, in late 2013 Mac Book Pro models and is properly emulated by VMware. Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 20:14:54 2013 (r259664) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 20:22:10 2013 (r259665) @@ -173,6 +173,7 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x3C: /* Per Intel document 325462-045US 01/2013. */ + case 0x45: cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 20:57:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB0FA57F; Fri, 20 Dec 2013 20:57:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D62F419D1; Fri, 20 Dec 2013 20:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKvG7g039010; Fri, 20 Dec 2013 20:57:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKvECG038994; Fri, 20 Dec 2013 20:57:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312202057.rBKKvECG038994@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 20:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259666 - in head/contrib/gcc: . cp 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.17 Precedence: list List-Id: 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, 20 Dec 2013 20:57:17 -0000 Author: pfg Date: Fri Dec 20 20:57:13 2013 New Revision: 259666 URL: http://svnweb.freebsd.org/changeset/base/259666 Log: gcc: clean some warnings from -Wformat-security Obtained from: Apple GCC 4.2 - 5646 (Radar 5764921) MFC after: 1 week Modified: head/contrib/gcc/c-common.c head/contrib/gcc/c-convert.c head/contrib/gcc/c-incpath.c head/contrib/gcc/c-typeck.c head/contrib/gcc/cfg.c head/contrib/gcc/collect2.c head/contrib/gcc/cp/cvt.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/typeck.c head/contrib/gcc/fold-const.c head/contrib/gcc/gcc.c head/contrib/gcc/gcov.c head/contrib/gcc/tlink.c Modified: head/contrib/gcc/c-common.c ============================================================================== --- head/contrib/gcc/c-common.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-common.c Fri Dec 20 20:57:13 2013 (r259666) @@ -6014,11 +6014,11 @@ c_parse_error (const char *gmsgid, enum message = NULL; } else - error (gmsgid); + error (gmsgid, ""); if (message) { - error (message); + error (message, ""); free (message); } #undef catenate_messages Modified: head/contrib/gcc/c-convert.c ============================================================================== --- head/contrib/gcc/c-convert.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-convert.c Fri Dec 20 20:57:13 2013 (r259666) @@ -80,7 +80,7 @@ convert (tree type, tree expr) if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/c-incpath.c ============================================================================== --- head/contrib/gcc/c-incpath.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-incpath.c Fri Dec 20 20:57:13 2013 (r259666) @@ -72,7 +72,7 @@ free_path (struct cpp_dir *path, int rea case REASON_DUP_SYS: fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name); if (reason == REASON_DUP_SYS) - fprintf (stderr, + fprintf (stderr, "%s", _(" as it is a non-system directory that duplicates a system directory\n")); break; @@ -292,16 +292,16 @@ merge_include_chains (cpp_reader *pfile, { struct cpp_dir *p; - fprintf (stderr, _("#include \"...\" search starts here:\n")); + fprintf (stderr, "%s", _("#include \"...\" search starts here:\n")); for (p = heads[QUOTE];; p = p->next) { if (p == heads[BRACKET]) - fprintf (stderr, _("#include <...> search starts here:\n")); + fprintf (stderr, "%s", _("#include <...> search starts here:\n")); if (!p) break; fprintf (stderr, " %s\n", p->name); } - fprintf (stderr, _("End of search list.\n")); + fprintf (stderr, "%s", _("End of search list.\n")); } } Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-typeck.c Fri Dec 20 20:57:13 2013 (r259666) @@ -2584,7 +2584,7 @@ convert_arguments (tree typelist, tree v else if ((invalid_func_diag = targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val))) { - error (invalid_func_diag); + error (invalid_func_diag, ""); return error_mark_node; } else @@ -2781,7 +2781,7 @@ build_unary_op (enum tree_code code, tre if ((invalid_op_diag = targetm.invalid_unary_op (code, TREE_TYPE (xarg)))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } @@ -7819,7 +7819,7 @@ build_binary_op (enum tree_code code, tr if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/cfg.c ============================================================================== --- head/contrib/gcc/cfg.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cfg.c Fri Dec 20 20:57:13 2013 (r259666) @@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc else fprintf (file, ", "); first = false; - fputs (bb_bitnames[i], file); + fprintf (file, "%s", bb_bitnames[i]); } if (!first) fprintf (file, ")"); Modified: head/contrib/gcc/collect2.c ============================================================================== --- head/contrib/gcc/collect2.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/collect2.c Fri Dec 20 20:57:13 2013 (r259666) @@ -1562,10 +1562,10 @@ collect_execute (const char *prog, char if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } return pex; @@ -2050,10 +2050,10 @@ scan_prog_file (const char *prog_name, e if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); Modified: head/contrib/gcc/cp/cvt.c ============================================================================== --- head/contrib/gcc/cp/cvt.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/cvt.c Fri Dec 20 20:57:13 2013 (r259666) @@ -615,7 +615,7 @@ ocp_convert (tree type, tree expr, int c if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 20:57:13 2013 (r259666) @@ -8925,7 +8925,7 @@ tsubst_copy_and_build (tree t, /*template_arg_p=*/false, &error_msg); if (error_msg) - error (error_msg); + error ("%s", error_msg); if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE) decl = unqualified_name_lookup_error (decl); return decl; Modified: head/contrib/gcc/cp/typeck.c ============================================================================== --- head/contrib/gcc/cp/typeck.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/typeck.c Fri Dec 20 20:57:13 2013 (r259666) @@ -3107,7 +3107,7 @@ build_binary_op (enum tree_code code, tr if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } @@ -4034,7 +4034,7 @@ build_unary_op (enum tree_code code, tre : code), TREE_TYPE (xarg)))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/fold-const.c ============================================================================== --- head/contrib/gcc/fold-const.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/fold-const.c Fri Dec 20 20:57:13 2013 (r259666) @@ -992,7 +992,7 @@ fold_overflow_warning (const char* gmsgi } } else if (issue_strict_overflow_warning (wc)) - warning (OPT_Wstrict_overflow, gmsgid); + warning (OPT_Wstrict_overflow, "%s", gmsgid); } /* Return true if the built-in mathematical function specified by CODE Modified: head/contrib/gcc/gcc.c ============================================================================== --- head/contrib/gcc/gcc.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/gcc.c Fri Dec 20 20:57:13 2013 (r259666) @@ -2974,7 +2974,7 @@ execute (void) if (errmsg != NULL) { if (err == 0) - fatal (errmsg); + fatal ("%s", errmsg); else { errno = err; @@ -6525,7 +6525,7 @@ main (int argc, char **argv) if (! verbose_flag) { - printf (_("\nFor bug reporting instructions, please see:\n")); + printf ("%s", _("\nFor bug reporting instructions, please see:\n")); printf ("%s.\n", bug_report_url); return (0); Modified: head/contrib/gcc/gcov.c ============================================================================== --- head/contrib/gcc/gcov.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/gcov.c Fri Dec 20 20:57:13 2013 (r259666) @@ -414,7 +414,7 @@ print_usage (int error_p) static void print_version (void) { - fnotice (stdout, "gcov (GCC) %s\n", version_string); + fnotice (stdout, "%s", "gcov (GCC) %s\n", version_string); fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n", _("(C)")); fnotice (stdout, Modified: head/contrib/gcc/tlink.c ============================================================================== --- head/contrib/gcc/tlink.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/tlink.c Fri Dec 20 20:57:13 2013 (r259666) @@ -381,7 +381,7 @@ read_repo_file (file *f) FILE *stream = fopen (f->key, "r"); if (tlink_verbose >= 2) - fprintf (stderr, _("collect: reading %s\n"), f->key); + fprintf (stderr, "%s", _("collect: reading %s\n"), f->key); while (fscanf (stream, "%c ", &c) == 1) { From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 21:31:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D95F2199; Fri, 20 Dec 2013 21:31:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4DD21D48; Fri, 20 Dec 2013 21:31:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKLVqms054866; Fri, 20 Dec 2013 21:31:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKLVpsA054857; Fri, 20 Dec 2013 21:31:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312202131.rBKLVpsA054857@svn.freebsd.org> From: Ed Schouten Date: Fri, 20 Dec 2013 21:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259667 - in head/sys: dev/syscons dev/vt kern sys teken teken/demo 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.17 Precedence: list List-Id: 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, 20 Dec 2013 21:31:53 -0000 Author: ed Date: Fri Dec 20 21:31:50 2013 New Revision: 259667 URL: http://svnweb.freebsd.org/changeset/base/259667 Log: Extend libteken to support CJK fullwidth characters. Introduce a new formatting bit (TF_CJK_RIGHT) that is set when putting a cell that is the right part of a CJK fullwidth character. This will allow drivers like vt(9) to support fullwidth characters properly. emaste@ has a patch to extend vt(9)'s font handling to increase the number of Unicode -> glyph maps from 2 ({normal,bold)} to 4 ({normal,bold} x {left,right}). This will need to use this formatting bit to determine whether to draw the left or right glyph. Reviewed by: emaste Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/vt/vt_font.c head/sys/kern/subr_terminal.c head/sys/sys/terminal.h head/sys/teken/demo/teken_demo.c head/sys/teken/teken.h head/sys/teken/teken_subr.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/dev/syscons/scterm-teken.c Fri Dec 20 21:31:50 2013 (r259667) @@ -553,7 +553,14 @@ scteken_putchar(void *arg, const teken_p vm_offset_t p; int cursor, attr; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ attr = scteken_attr(a) << 8; + if (a->ta_format & TF_CJK_RIGHT) + c = ' '; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/dev/vt/vt_font.c Fri Dec 20 21:31:50 2013 (r259667) @@ -87,7 +87,15 @@ vtfont_lookup(const struct vt_font *vf, uint16_t dst; size_t stride; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ src = TCHAR_CHARACTER(c); + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) + src = ' '; + if (TCHAR_FORMAT(c) & TF_BOLD) { dst = vtfont_bisearch(vf->vf_bold, vf->vf_bold_length, src); if (dst != 0) Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/kern/subr_terminal.c Fri Dec 20 21:31:50 2013 (r259667) @@ -128,7 +128,7 @@ static const teken_attr_t default_messag }; #define TCHAR_CREATE(c, a) ((c) | \ - (a)->ta_format << 22 | \ + (a)->ta_format << 21 | \ teken_256to8((a)->ta_fgcolor) << 26 | \ teken_256to8((a)->ta_bgcolor) << 29) Modified: head/sys/sys/terminal.h ============================================================================== --- head/sys/sys/terminal.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/sys/terminal.h Fri Dec 20 21:31:50 2013 (r259667) @@ -62,15 +62,14 @@ struct tty; * * Bits Meaning * 0-20: Character value - * 21: Unused - * 22-25: Bold, underline, blink, reverse + * 21-25: Bold, underline, blink, reverse, right part of CJK fullwidth character * 26-28: Foreground color * 29-31: Background color */ typedef uint32_t term_char_t; #define TCHAR_CHARACTER(c) ((c) & 0x1fffff) -#define TCHAR_FORMAT(c) (((c) >> 22) & 0xf) +#define TCHAR_FORMAT(c) (((c) >> 21) & 0x1f) #define TCHAR_FGCOLOR(c) (((c) >> 26) & 0x7) #define TCHAR_BGCOLOR(c) ((c) >> 29) Modified: head/sys/teken/demo/teken_demo.c ============================================================================== --- head/sys/teken/demo/teken_demo.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/demo/teken_demo.c Fri Dec 20 21:31:50 2013 (r259667) @@ -86,9 +86,10 @@ printchar(const teken_pos_t *p) assert(p->tp_row < NROWS); assert(p->tp_col < NCOLS); - getyx(stdscr, y, x); - px = &buffer[p->tp_col][p->tp_row]; + /* No need to print right hand side of CJK character manually. */ + if (px->a.ta_format & TF_CJK_RIGHT) + return; /* Convert Unicode to UTF-8. */ if (px->c < 0x80) { @@ -118,8 +119,8 @@ printchar(const teken_pos_t *p) bkgdset(attr | COLOR_PAIR(teken_256to8(px->a.ta_fgcolor) + 8 * teken_256to8(px->a.ta_bgcolor))); + getyx(stdscr, y, x); mvaddstr(p->tp_row, p->tp_col, str); - move(y, x); } Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/teken.h Fri Dec 20 21:31:50 2013 (r259667) @@ -41,10 +41,11 @@ typedef uint32_t teken_char_t; typedef unsigned short teken_unit_t; typedef unsigned char teken_format_t; -#define TF_BOLD 0x01 -#define TF_UNDERLINE 0x02 -#define TF_BLINK 0x04 -#define TF_REVERSE 0x08 +#define TF_BOLD 0x01 /* Bold character. */ +#define TF_UNDERLINE 0x02 /* Underline character. */ +#define TF_BLINK 0x04 /* Blinking character. */ +#define TF_REVERSE 0x08 /* Reverse rendered character. */ +#define TF_CJK_RIGHT 0x10 /* Right-hand side of CJK character. */ typedef unsigned char teken_color_t; #define TC_BLACK 0 #define TC_RED 1 Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/teken_subr.h Fri Dec 20 21:31:50 2013 (r259667) @@ -791,21 +791,19 @@ teken_subr_do_putchar(teken_t *t, const teken_funcs_copy(t, &ctr, &ctp); } + teken_funcs_putchar(t, tp, c, &t->t_curattr); + if (width == 2 && tp->tp_col + 1 < t->t_winsize.tp_col) { teken_pos_t tp2; + teken_attr_t attr; - /* - * Store a space behind double width characters before - * actually printing them. This prevents artifacts when - * the consumer doesn't render it using double width - * glyphs. - */ + /* Print second half of CJK fullwidth character. */ tp2.tp_row = tp->tp_row; tp2.tp_col = tp->tp_col + 1; - teken_funcs_putchar(t, &tp2, BLANK, &t->t_curattr); + attr = t->t_curattr; + attr.ta_format |= TF_CJK_RIGHT; + teken_funcs_putchar(t, &tp2, c, &attr); } - - teken_funcs_putchar(t, tp, c, &t->t_curattr); } static void From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 21:38:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51B94324; Fri, 20 Dec 2013 21:38:52 +0000 (UTC) Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu [18.7.68.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1B21D71; Fri, 20 Dec 2013 21:38:51 +0000 (UTC) X-AuditID: 12074425-f79906d000000cf9-e8-52b4b8e4c36b Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 83.E9.03321.4E8B4B25; Fri, 20 Dec 2013 16:38:44 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id rBKLch2w018361; Fri, 20 Dec 2013 16:38:43 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBKLcfte031360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Dec 2013 16:38:42 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id rBKLceKL021585; Fri, 20 Dec 2013 16:38:40 -0500 (EST) Date: Fri, 20 Dec 2013 16:38:40 -0500 (EST) From: Benjamin Kaduk To: Neel Natu Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel In-Reply-To: Message-ID: References: <201312200550.rBK5oNmw098487@svn.freebsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsUixCmqrftkx5Ygg8btqhbHHh5lt/izbCWj xZ/2KSwWfzYtZLVo+rKAyYHVY8an+SweO2fdZQ9giuKySUnNySxLLdK3S+DK6FwtXDCfu2LX 7UesDYwPOboYOTkkBEwk+s4dZYKwxSQu3FvP1sXIxSEkMJtJYt/7LVDORkaJz2sfsUI4h5gk DvU2s0A4DYwS/funsYH0swhoS7w/c40ZxGYTUJGY+WYjUJyDQ0RASeLetmKQemaBF4wSTYfn MYLUCAv4Sxx6Nh2sl1MgUKLn5UUWEJtXwFFix7SLUKsPM0pc2fEcbKiogI7E6v1ToIoEJU7O fAJmMwtYSpz7c51tAqPgLCSpWUhSCxiZVjHKpuRW6eYmZuYUpybrFicn5uWlFula6OVmluil ppRuYgSFMruL6g7GCYeUDjEKcDAq8fBKRG4JEmJNLCuuzD3EKMnBpCTKy7oNKMSXlJ9SmZFY nBFfVJqTWnyIUYKDWUmEd94EoBxvSmJlVWpRPkxKmoNFSZz3Fod9kJBAemJJanZqakFqEUxW hoNDSYL37HagRsGi1PTUirTMnBKENBMHJ8hwHqDhl0FqeIsLEnOLM9Mh8qcYFaXEeQWAyUJI ACSRUZoH1wtLNa8YxYFeEeY9CNLOA0xTcN2vgAYzAQ02XrsJZHBJIkJKqoFxvdDCFM9V+qaq /BbJ9TofN6T4RXQatYWdupSYeDT1X87i+zO4+BIirm06XJ99z9D98YJboQwmYncXaEY9f2js 4Wu8caeZbfqLTr+SuTJ3Tb4u253Gcvwb48TF0549lTjXG3Z1wp/iCauPq//8Uh7wqnv2yfR2 Xu/Y4/qvBBOncknX2mm3iq1RYinOSDTUYi4qTgQAB4fV5RADAAA= Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 21:38:52 -0000 On Fri, 20 Dec 2013, Neel Natu wrote: > Hi Ben, > > On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk wrote: >> On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: >>> >>> Author: neel >>> Date: Fri Dec 20 05:50:22 2013 >>> New Revision: 259641 >>> URL: http://svnweb.freebsd.org/changeset/base/259641 >>> >>> Log: >>> Re-arrange bits in the amd64/pmap 'pm_flags' field. >>> >>> The least significant 8 bits of 'pm_flags' are now used for the IPI >>> vector >>> to use for nested page table TLB shootdown. >>> >>> Previously we used IPI_AST to interrupt the host cpu which is >>> functionally >>> correct but could lead to misleading interrupt counts for AST handler. >>> The >>> AST handler was also doing a lot more than what is required for the >>> nested >>> page table TLB shootdown (EOI and IRET). >> >> >> This represents a KBI change, does it not? Should __FreeBSD_version be >> bumped? >> > > I was under the impression that a bump would be required only if this > change is MFCed to a stable branch. I could be wrong about this and if > so would be happy to rectify it. I guess KBI is probably okay, that's true. I have had a lot of headaches with KPI changes on -current and third-party modules, so I am a bit sensitive. I'm also recovering from a laptop theft while on vacation, and thus a bit discombobulated. Thanks, Ben From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 23:18:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4795AD8F; Fri, 20 Dec 2013 23:18:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 332EC1337; Fri, 20 Dec 2013 23:18:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNIFPm097431; Fri, 20 Dec 2013 23:18:15 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNIFbS097430; Fri, 20 Dec 2013 23:18:15 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312202318.rBKNIFbS097430@svn.freebsd.org> From: Justin Hibbits Date: Fri, 20 Dec 2013 23:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259668 - head/sys/cddl/dev/fbt 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.17 Precedence: list List-Id: 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, 20 Dec 2013 23:18:15 -0000 Author: jhibbits Date: Fri Dec 20 23:18:14 2013 New Revision: 259668 URL: http://svnweb.freebsd.org/changeset/base/259668 Log: Fix a couple bugs in FBT PowerPC. Clamp the size to a 'instruction size' not 'byte size', and fix a typo. MFC after: 2 weeks Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 (r259667) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 (r259668) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) (symval->value + symval->size); + limit = (u_int32_t *) (symval->value + symval->size / sizeof(u_int32_t)); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) @@ -278,7 +278,7 @@ again: instr++; for (j = 0; j < 12 && instr < limit; j++, instr++) { - if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) | + if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) || FBT_IS_JUMP(*instr)) break; } From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 23:34:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8706433D; Fri, 20 Dec 2013 23:34:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72E1A1486; Fri, 20 Dec 2013 23:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNYBBn005057; Fri, 20 Dec 2013 23:34:11 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNYB3i005056; Fri, 20 Dec 2013 23:34:11 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312202334.rBKNYB3i005056@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 20 Dec 2013 23:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259669 - 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.17 Precedence: list List-Id: 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, 20 Dec 2013 23:34:11 -0000 Author: jmg Date: Fri Dec 20 23:34:10 2013 New Revision: 259669 URL: http://svnweb.freebsd.org/changeset/base/259669 Log: document how to install when src is newer than the world.. This allows people to build -current systems from older systems... Thanks to: Thomas Mueller Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 20 23:18:14 2013 (r259668) +++ head/UPDATING Fri Dec 20 23:34:10 2013 (r259669) @@ -1943,7 +1943,7 @@ COMMON ITEMS: make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installworld DESTDIR=${CURRENT_ROOT} + make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT} cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 23:57:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06D5A7A2; Fri, 20 Dec 2013 23:57:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E67E815D1; Fri, 20 Dec 2013 23:57:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNv5Qn013432; Fri, 20 Dec 2013 23:57:05 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNv5Pn013426; Fri, 20 Dec 2013 23:57:05 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312202357.rBKNv5Pn013426@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 20 Dec 2013 23:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259670 - head/share/man/man9 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.17 Precedence: list List-Id: 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, 20 Dec 2013 23:57:06 -0000 Author: jmg Date: Fri Dec 20 23:57:05 2013 New Revision: 259670 URL: http://svnweb.freebsd.org/changeset/base/259670 Log: document the m_getjcl function... Modified: head/share/man/man9/Makefile head/share/man/man9/mbuf.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) @@ -901,6 +901,7 @@ MLINKS+=\ mbuf.9 m_freem.9 \ mbuf.9 MGET.9 \ mbuf.9 m_get.9 \ + mbuf.9 m_getjcl.9 \ mbuf.9 m_getcl.9 \ mbuf.9 m_getclr.9 \ mbuf.9 MGETHDR.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) @@ -74,6 +74,8 @@ .Ft struct mbuf * .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" .Ft struct mbuf * +.Fn m_getjcl "int how" "short type" "int flags" "int size" +.Ft struct mbuf * .Fn m_getcl "int how" "short type" "int flags" .Ft struct mbuf * .Fn m_getclr "int how" "int type" @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ Returns .Dv NULL on failure. +.It Fn m_getjcl how type flags size +This is like +.Fn m_getcl +but it the size of the cluster allocated will be large enough for +.Fa size +bytes. .It Fn m_getclr how type Allocate an .Vt mbuf From owner-svn-src-head@FreeBSD.ORG Fri Dec 20 23:59:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 792CB90B; Fri, 20 Dec 2013 23:59:32 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33CB915E1; Fri, 20 Dec 2013 23:59:32 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id BF5BB2138D; Fri, 20 Dec 2013 23:59:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us BF5BB2138D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 20 Dec 2013 18:59:29 -0500 From: Glen Barber To: John-Mark Gurney Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131220235929.GE3148@glenbarber.us> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EXKGNeO8l0xGFBjy" Content-Disposition: inline In-Reply-To: <201312202357.rBKNv5Pn013426@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 20 Dec 2013 23:59:32 -0000 --EXKGNeO8l0xGFBjy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2013 at 11:57:05PM +0000, John-Mark Gurney wrote: > Author: jmg > Date: Fri Dec 20 23:57:05 2013 > New Revision: 259670 > URL: http://svnweb.freebsd.org/changeset/base/259670 >=20 > Log: > document the m_getjcl function... >=20 > Modified: > head/share/man/man9/Makefile > head/share/man/man9/mbuf.9 >=20 > Modified: head/share/man/man9/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) > +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) > @@ -901,6 +901,7 @@ MLINKS+=3D\ > mbuf.9 m_freem.9 \ > mbuf.9 MGET.9 \ > mbuf.9 m_get.9 \ > + mbuf.9 m_getjcl.9 \ > mbuf.9 m_getcl.9 \ > mbuf.9 m_getclr.9 \ > mbuf.9 MGETHDR.9 \ >=20 > Modified: head/share/man/man9/mbuf.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) > +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) > @@ -74,6 +74,8 @@ > .Ft struct mbuf * > .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" > .Ft struct mbuf * > +.Fn m_getjcl "int how" "short type" "int flags" "int size" > +.Ft struct mbuf * > .Fn m_getcl "int how" "short type" "int flags" > .Ft struct mbuf * > .Fn m_getclr "int how" "int type" > @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ > Returns > .Dv NULL > on failure. > +.It Fn m_getjcl how type flags size > +This is like > +.Fn m_getcl > +but it the size of the cluster allocated will be large enough for > +.Fa size > +bytes. > .It Fn m_getclr how type > Allocate an > .Vt mbuf Please bump .Dd. Glen --EXKGNeO8l0xGFBjy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJStNngAAoJELls3eqvi17QWnEP/3d/Roik1y1y1Sij0uheiWL9 PMkNBqdIS21LrNqCkt9pY0HvDNlu/HyJ/gtCjHX4OEqmRIThqauv65Ul6EW7sfOQ Qc6ZdhRKPYmGg/iJ78pYjtXj3WpVs2OQZmTQhPdP55Zgro780uX9uy0nFfbyrBNv UOnrelRS4O/I9Twlc7FVhctwWlKDOKVCN8y63/T2qqvzrKVrEYiquZRhXtdMjlQe L+Vo+jldQvHtcgw1OL6Y67mwP437YSBp/f73f8uU1c16cMaDnxu2T2nbLLXDE/8a K8/akImC0AzJC3De9eFbcfBAM3yXZMetiRqvlX9IUO30XchVNF5FvKOq2XtFs5lN QB3R5s3byxU32tHIpMuT3tSAKabZlfoRNpTAej7ef6odyX4NJTBVrWBTIJBKnVAI 86ripb9whkuxfQV9KaYOSbe3wMOhcnJ11hrj1q1a/p8t2k/G+8pJjVabYkz/uMEC NhqhcRLEZSsijxwhUGstDP4dOINHr1wKt9lDk15JGZ1KxY3g+XBQuPctAEMNl23N I3cWFRxRDw4jwD/KOOhuTNDn2/tZ0CyB/OeijMc+PzFRx56LiMjjvSwiFrAUeWlN X8EjvTolJzlQ8vwXIwGWVx/1YOCEOvGpG/7ldOdcClQlhaBOz7xsbNYs8n+7ThuR EWyxNIYCWASUvih3V8ac =rG4w -----END PGP SIGNATURE----- --EXKGNeO8l0xGFBjy-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:07:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F076FBE4; Sat, 21 Dec 2013 00:07:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB954165E; Sat, 21 Dec 2013 00:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL07vQR018847; Sat, 21 Dec 2013 00:07:57 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL07vj2018843; Sat, 21 Dec 2013 00:07:57 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210007.rBL07vj2018843@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 00:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259671 - head/sys/powerpc/powermac 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.17 Precedence: list List-Id: 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, 21 Dec 2013 00:07:58 -0000 Author: jhibbits Date: Sat Dec 21 00:07:56 2013 New Revision: 259671 URL: http://svnweb.freebsd.org/changeset/base/259671 Log: Add suspend/resume to DBDMA and ATA on PowerMacs. This, and several subsequent commits, are suspend/resume for various PowerMac drivers, which will include a change to the global suspend/resume code eventually. Modified: head/sys/powerpc/powermac/ata_macio.c head/sys/powerpc/powermac/dbdma.c head/sys/powerpc/powermac/dbdmavar.h Modified: head/sys/powerpc/powermac/ata_macio.c ============================================================================== --- head/sys/powerpc/powermac/ata_macio.c Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/ata_macio.c Sat Dec 21 00:07:56 2013 (r259671) @@ -114,11 +114,15 @@ static int ata_macio_probe(device_t de static int ata_macio_setmode(device_t dev, int target, int mode); static int ata_macio_attach(device_t dev); static int ata_macio_begin_transaction(struct ata_request *request); +static int ata_macio_suspend(device_t dev); +static int ata_macio_resume(device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_macio_attach), + DEVMETHOD(device_suspend, ata_macio_suspend), + DEVMETHOD(device_resume, ata_macio_resume), /* ATA interface */ DEVMETHOD(ata_setmode, ata_macio_setmode), @@ -336,3 +340,34 @@ ata_macio_begin_transaction(struct ata_r return ata_begin_transaction(request); } + +static int +ata_macio_suspend(device_t dev) +{ + struct ata_dbdma_channel *ch = device_get_softc(dev); + int error; + + if (!ch->sc_ch.attached) + return (0); + + error = ata_suspend(dev); + dbdma_save_state(ch->dbdma); + + return (error); +} + +static int +ata_macio_resume(device_t dev) +{ + struct ata_dbdma_channel *ch = device_get_softc(dev); + int error; + + if (!ch->sc_ch.attached) + return (0); + + dbdma_restore_state(ch->dbdma); + error = ata_resume(dev); + + return (error); +} + Modified: head/sys/powerpc/powermac/dbdma.c ============================================================================== --- head/sys/powerpc/powermac/dbdma.c Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/dbdma.c Sat Dec 21 00:07:56 2013 (r259671) @@ -343,6 +343,31 @@ dbdma_sync_commands(dbdma_channel_t *cha bus_dmamap_sync(chan->sc_dmatag, chan->sc_dmamap, op); } +void +dbdma_save_state(dbdma_channel_t *chan) +{ + + chan->sc_saved_regs[0] = dbdma_read_reg(chan, CHAN_CMDPTR); + chan->sc_saved_regs[1] = dbdma_read_reg(chan, CHAN_CMDPTR_HI); + chan->sc_saved_regs[2] = dbdma_read_reg(chan, CHAN_INTR_SELECT); + chan->sc_saved_regs[3] = dbdma_read_reg(chan, CHAN_BRANCH_SELECT); + chan->sc_saved_regs[4] = dbdma_read_reg(chan, CHAN_WAIT_SELECT); + + dbdma_stop(chan); +} + +void +dbdma_restore_state(dbdma_channel_t *chan) +{ + + dbdma_wake(chan); + dbdma_write_reg(chan, CHAN_CMDPTR, chan->sc_saved_regs[0]); + dbdma_write_reg(chan, CHAN_CMDPTR_HI, chan->sc_saved_regs[1]); + dbdma_write_reg(chan, CHAN_INTR_SELECT, chan->sc_saved_regs[2]); + dbdma_write_reg(chan, CHAN_BRANCH_SELECT, chan->sc_saved_regs[3]); + dbdma_write_reg(chan, CHAN_WAIT_SELECT, chan->sc_saved_regs[4]); +} + static uint32_t dbdma_read_reg(dbdma_channel_t *chan, u_int offset) { Modified: head/sys/powerpc/powermac/dbdmavar.h ============================================================================== --- head/sys/powerpc/powermac/dbdmavar.h Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/dbdmavar.h Sat Dec 21 00:07:56 2013 (r259671) @@ -60,6 +60,7 @@ struct dbdma_channel { bus_dma_tag_t sc_dmatag; bus_dmamap_t sc_dmamap; + uint32_t sc_saved_regs[5]; }; From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:15:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB8CD7C; Sat, 21 Dec 2013 00:15:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9091C16D1; Sat, 21 Dec 2013 00:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL0FbSi022829; Sat, 21 Dec 2013 00:15:37 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL0FbZQ022828; Sat, 21 Dec 2013 00:15:37 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312210015.rBL0FbZQ022828@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 21 Dec 2013 00:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259672 - head/share/man/man9 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.17 Precedence: list List-Id: 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, 21 Dec 2013 00:15:37 -0000 Author: jmg Date: Sat Dec 21 00:15:37 2013 New Revision: 259672 URL: http://svnweb.freebsd.org/changeset/base/259672 Log: bump Dd Reminded by: gjb Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Sat Dec 21 00:07:56 2013 (r259671) +++ head/share/man/man9/mbuf.9 Sat Dec 21 00:15:37 2013 (r259672) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd December 20, 2013 .Dt MBUF 9 .Os .\" From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:15:59 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70C42EB9; Sat, 21 Dec 2013 00:15:59 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32A0A16D5; Sat, 21 Dec 2013 00:15:58 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBL0Fvlf069934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Dec 2013 16:15:58 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBL0FvfE069933; Fri, 20 Dec 2013 16:15:57 -0800 (PST) (envelope-from jmg) Date: Fri, 20 Dec 2013 16:15:57 -0800 From: John-Mark Gurney To: Glen Barber Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131221001557.GA99167@funkthat.com> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> <20131220235929.GE3148@glenbarber.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220235929.GE3148@glenbarber.us> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 20 Dec 2013 16:15:58 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 00:15:59 -0000 Glen Barber wrote this message on Fri, Dec 20, 2013 at 18:59 -0500: > On Fri, Dec 20, 2013 at 11:57:05PM +0000, John-Mark Gurney wrote: > > Author: jmg > > Date: Fri Dec 20 23:57:05 2013 > > New Revision: 259670 > > URL: http://svnweb.freebsd.org/changeset/base/259670 > > > > Log: > > document the m_getjcl function... > > > > Modified: > > head/share/man/man9/Makefile > > head/share/man/man9/mbuf.9 > > > > Modified: head/share/man/man9/Makefile > > ============================================================================== > > --- head/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) > > +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) > > @@ -901,6 +901,7 @@ MLINKS+=\ > > mbuf.9 m_freem.9 \ > > mbuf.9 MGET.9 \ > > mbuf.9 m_get.9 \ > > + mbuf.9 m_getjcl.9 \ > > mbuf.9 m_getcl.9 \ > > mbuf.9 m_getclr.9 \ > > mbuf.9 MGETHDR.9 \ > > > > Modified: head/share/man/man9/mbuf.9 > > ============================================================================== > > --- head/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) > > +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) > > @@ -74,6 +74,8 @@ > > .Ft struct mbuf * > > .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" > > .Ft struct mbuf * > > +.Fn m_getjcl "int how" "short type" "int flags" "int size" > > +.Ft struct mbuf * > > .Fn m_getcl "int how" "short type" "int flags" > > .Ft struct mbuf * > > .Fn m_getclr "int how" "int type" > > @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ > > Returns > > .Dv NULL > > on failure. > > +.It Fn m_getjcl how type flags size > > +This is like > > +.Fn m_getcl > > +but it the size of the cluster allocated will be large enough for > > +.Fa size > > +bytes. > > .It Fn m_getclr how type > > Allocate an > > .Vt mbuf > > Please bump .Dd. Sorry, done in r259672. Thanks for the reminder. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:19:28 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34FC918F; Sat, 21 Dec 2013 00:19:28 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0558316F3; Sat, 21 Dec 2013 00:19:27 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 26AB82158E; Sat, 21 Dec 2013 00:19:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 26AB82158E Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 20 Dec 2013 19:19:24 -0500 From: Glen Barber To: John-Mark Gurney Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131221001924.GF3148@glenbarber.us> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> <20131220235929.GE3148@glenbarber.us> <20131221001557.GA99167@funkthat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oPmsXEqKQNHCSXW7" Content-Disposition: inline In-Reply-To: <20131221001557.GA99167@funkthat.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 00:19:28 -0000 --oPmsXEqKQNHCSXW7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2013 at 04:15:57PM -0800, John-Mark Gurney wrote: > > Please bump .Dd. >=20 > Sorry, done in r259672. >=20 > Thanks for the reminder. >=20 Thank you. Glen --oPmsXEqKQNHCSXW7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJStN6MAAoJELls3eqvi17QF3sP/i7y5ZWRnKWNcZadwG8o4yXQ vQwxVQsNMWCE5jk0ym3ff1RVUnHau8KuzHABGbpehzQRCIcnPBj6sOMF/RiZ6UZM Wez7v7iBiqaZJmapTusa6nUaMt55EQya+HyKDetMuV9vs0dQBu0BX8WX7KhiuHDk /3qkruXnCuZoycxGFP3emdKQmHiaYxi1nEVLl+ybImK+fZYU9rUzkO88ojhmH1MY epnrPRpi5YFzdDbgZVo9cTuxmi6TOV5EK7NjlELN/ZnRrnUohDIY+ZevfL14vhTN umHqFm8QFHz3UZ6rPkxq/D/1+wluzKs7d2H4s8L/UxhMKXzlCyzn74mTWH1olcQC dt57r+6bpki3glHaUPo5xeRnA/MISXxy2tu73m67v7YkFCN4BSEons0i6xIw8+0P aLCJ3Bb5yHVHTm8Axh0KYN7KTEWREPxf82HrpQEzfE8yuRKM0FqcVtC2rfX8765r +krRiiMnxQbIkBuOin8qPPOKOxGUFDtx5oK6n1bUIXkNDHwT6Bm5Wtb08RjTIrN9 +CC1XGlh8uJSDNVCHSYWd7Q6H/ul2Ansa3duhphk5EsSA1wmwl8MwneErtWLPdR2 BEQo3ALgJA9Q/G/PNZFl5powVORuIE69WRgGQS+kt5VlEmBwhaP5fLiag6zKsrzN w/tRRBWYIJ8/XExvWC2F =zNS1 -----END PGP SIGNATURE----- --oPmsXEqKQNHCSXW7-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:31:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95B2D677; Sat, 21 Dec 2013 00:31:02 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E11A17D4; Sat, 21 Dec 2013 00:31:02 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id e9so2873296qcy.6 for ; Fri, 20 Dec 2013 16:31:01 -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=LdisjTC1n5NPwS1gKFB0ZQ1SB1ouS85IyN61pxQTvyc=; b=Vnd9c09qsAGSUNTM2veH4dGgYy0m40klYKXth/6vgAuhX9Oge9KaXiQhlsmTU0WOy3 kKSKDVLeIy2h+hwiyioWOuIxy2k0/mgceBVDXDC6ZRC20hvO+keH6MwOUEnVTh9x9OJQ urlR6GLLFs8bLMi2/9U5JxYKChrquysOTA/FOUvqqrdFanbkViABeF1ufj/osYNrfmev gSRDuX92T5hoaPd6fIYyCARfgKY53sCvpDl/xsbXZuP85V9KVKDcDvI0Vto9wpdzp7kD rSo9zyfsscT9bzFqcoGn3vdSJo72b+JWJWk4RPfRW7FoBbMC6it5n+APtVJb6LfNIsdi yGMg== MIME-Version: 1.0 X-Received: by 10.224.135.71 with SMTP id m7mr19777048qat.10.1387585861172; Fri, 20 Dec 2013 16:31:01 -0800 (PST) Received: by 10.224.130.194 with HTTP; Fri, 20 Dec 2013 16:31:01 -0800 (PST) In-Reply-To: <201312202318.rBKNIFbS097430@svn.freebsd.org> References: <201312202318.rBKNIFbS097430@svn.freebsd.org> Date: Sat, 21 Dec 2013 08:31:01 +0800 Message-ID: Subject: Re: svn commit: r259668 - head/sys/cddl/dev/fbt From: Howard Su To: Justin Hibbits Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 00:31:02 -0000 On Saturday, December 21, 2013, Justin Hibbits wrote: > Author: jhibbits > Date: Fri Dec 20 23:18:14 2013 > New Revision: 259668 > URL: http://svnweb.freebsd.org/changeset/base/259668 > > Log: > Fix a couple bugs in FBT PowerPC. Clamp the size to a 'instruction > size' not > 'byte size', and fix a typo. > > MFC after: 2 weeks > > Modified: > head/sys/cddl/dev/fbt/fbt_powerpc.c > > Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c > > ============================================================================== > --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 > (r259667) > +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 > (r259668) > @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ > return (0); > > instr = (u_int32_t *) symval->value; > - limit = (u_int32_t *) (symval->value + symval->size); > + limit = (u_int32_t *) (symval->value + symval->size / > sizeof(u_int32_t)); > > This change doesn't look right to me. symval->value is caddr_t (char*). why add instruction size to it? > for (; instr < limit; instr++) > if (*instr == FBT_MFLR_R0) > @@ -278,7 +278,7 @@ again: > instr++; > > for (j = 0; j < 12 && instr < limit; j++, instr++) { > - if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) | > + if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) || > FBT_IS_JUMP(*instr)) > break; > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > -- -Howard From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:37:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A455D8D8; Sat, 21 Dec 2013 00:37:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FFEC181D; Sat, 21 Dec 2013 00:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL0bWpo031503; Sat, 21 Dec 2013 00:37:32 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL0bW8I031502; Sat, 21 Dec 2013 00:37:32 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210037.rBL0bW8I031502@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 00:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259674 - head/sys/cddl/dev/fbt 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.17 Precedence: list List-Id: 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, 21 Dec 2013 00:37:32 -0000 Author: jhibbits Date: Sat Dec 21 00:37:32 2013 New Revision: 259674 URL: http://svnweb.freebsd.org/changeset/base/259674 Log: Fix a brain-o. I had misread the limit as a size, but it's a pointer. Submitted by: Howard Su MFC after: 2 weeks X-MFC-with: r259668 Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:20:06 2013 (r259673) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:37:32 2013 (r259674) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) (symval->value + symval->size / sizeof(u_int32_t)); + limit = (u_int32_t *) (symval->value + symval->size); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 00:37:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBF45A19; Sat, 21 Dec 2013 00:37:51 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDB11825; Sat, 21 Dec 2013 00:37:51 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id bj1so3288267pad.16 for ; Fri, 20 Dec 2013 16:37:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5putG4odMXujIhmJ3KJEwVawrSzkVldsYwpcHPdhFLk=; b=RL5kDK21UgjO7LoovuYlmv4wRkxWSAbdTe2GFUiaL6KhRe742IAj1dy56h9f8xxorr dWUzFGRFN8xa8dmYizaECDMOLfWF95QLiDkSxfFWOqerjG0B6tbXstYAEkV6+1ZRRrXB 2+DYI+KvG9+HImy1iYYzzjYjIqZDla6k+D4Aei+iNdYCaQPxLDCxxm912Ung8EVX01yb b2OMWb5AkLZTutoxFfhP6+xzu7ID79+FuSGl9yAjl8R8hiRI+E2h/iCUfG5JrtR6Whhj d7bPo5+LZF4BSt/0DMQC87KiYjALxOiKOAmBWwfb+yeapKHm9bayWMiHG9FqPy3Pdw1O Cw8A== X-Received: by 10.68.129.99 with SMTP id nv3mr12057358pbb.40.1387586271039; Fri, 20 Dec 2013 16:37:51 -0800 (PST) Received: from zhabar.gateway.2wire.net (76-253-2-5.lightspeed.sntcca.sbcglobal.net. [76.253.2.5]) by mx.google.com with ESMTPSA id pe3sm17143495pbc.23.2013.12.20.16.37.49 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 16:37:50 -0800 (PST) Date: Fri, 20 Dec 2013 16:37:45 -0800 From: Justin Hibbits To: Howard Su Subject: Re: svn commit: r259668 - head/sys/cddl/dev/fbt Message-ID: <20131220163745.479cb59d@zhabar.gateway.2wire.net> In-Reply-To: References: <201312202318.rBKNIFbS097430@svn.freebsd.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; powerpc64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Justin Hibbits , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 00:37:51 -0000 On Sat, 21 Dec 2013 08:31:01 +0800 Howard Su wrote: > On Saturday, December 21, 2013, Justin Hibbits wrote: > > > Author: jhibbits > > Date: Fri Dec 20 23:18:14 2013 > > New Revision: 259668 > > URL: http://svnweb.freebsd.org/changeset/base/259668 > > > > Log: > > Fix a couple bugs in FBT PowerPC. Clamp the size to a > > 'instruction size' not > > 'byte size', and fix a typo. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/cddl/dev/fbt/fbt_powerpc.c > > > > Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c > > > > ============================================================================== > > --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 > > (r259667) > > +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 > > (r259668) > > @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ > > return (0); > > > > instr = (u_int32_t *) symval->value; > > - limit = (u_int32_t *) (symval->value + symval->size); > > + limit = (u_int32_t *) (symval->value + symval->size / > > sizeof(u_int32_t)); > > > > This change doesn't look right to me. symval->value is caddr_t > > (char*). > why add instruction size to it? D'oh, complete brain-o. I had read it as a size field, not a pointer field. Fixed now. - Justin From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 03:05:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E2BCC11; Sat, 21 Dec 2013 03:05:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD3510CE; Sat, 21 Dec 2013 03:05:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL35ENI093694; Sat, 21 Dec 2013 03:05:14 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL35DS7093692; Sat, 21 Dec 2013 03:05:13 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312210305.rBL35DS7093692@svn.freebsd.org> From: Don Lewis Date: Sat, 21 Dec 2013 03:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259675 - in head/sys/dev/usb: . quirk 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.17 Precedence: list List-Id: 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, 21 Dec 2013 03:05:14 -0000 Author: truckman Date: Sat Dec 21 03:05:13 2013 New Revision: 259675 URL: http://svnweb.freebsd.org/changeset/base/259675 Log: Add quirks to make my old SanDisk Cruzer Mini 128MB happy. MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sat Dec 21 00:37:32 2013 (r259674) +++ head/sys/dev/usb/quirk/usb_quirk.c Sat Dec 21 03:05:13 2013 (r259675) @@ -332,6 +332,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(SANDISK, SDDR12, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SANDISK, SDCZ2_128, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE, + UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(SANDISK, SDCZ2_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDCZ4_128, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Dec 21 00:37:32 2013 (r259674) +++ head/sys/dev/usb/usbdevs Sat Dec 21 03:05:13 2013 (r259675) @@ -3718,6 +3718,7 @@ product SANDISK SDDR05 0x0005 ImageMate product SANDISK SDDR12 0x0100 ImageMate SDDR-12 product SANDISK SDDR09 0x0200 ImageMate SDDR-09 product SANDISK SDDR75 0x0810 ImageMate SDDR-75 +product SANDISK SDCZ2_128 0x7100 Cruzer Mini 128MB product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 04:31:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F2C674A; Sat, 21 Dec 2013 04:31:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE3BA167E; Sat, 21 Dec 2013 04:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL4Vtc8030895; Sat, 21 Dec 2013 04:31:55 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL4VsoZ030885; Sat, 21 Dec 2013 04:31:54 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210431.rBL4VsoZ030885@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 04:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259676 - in head/sys/powerpc: include ofw powermac powerpc psim 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.17 Precedence: list List-Id: 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, 21 Dec 2013 04:31:56 -0000 Author: jhibbits Date: Sat Dec 21 04:31:54 2013 New Revision: 259676 URL: http://svnweb.freebsd.org/changeset/base/259676 Log: Add suspend/resume state saving for OpenPIC on PowerMac. It's likely this can be used on the others (cpcht and psim), but that has not been tested. Modified: head/sys/powerpc/include/openpicreg.h head/sys/powerpc/include/openpicvar.h head/sys/powerpc/ofw/openpic_ofw.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/psim/openpic_iobus.c Modified: head/sys/powerpc/include/openpicreg.h ============================================================================== --- head/sys/powerpc/include/openpicreg.h Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/include/openpicreg.h Sat Dec 21 04:31:54 2013 (r259676) @@ -99,6 +99,7 @@ */ /* interrupt vector/priority reg */ +#define OPENPIC_SRC_VECTOR_COUNT 64 #ifndef OPENPIC_SRC_VECTOR #define OPENPIC_SRC_VECTOR(irq) (0x10000 + (irq) * 0x20) #endif Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/include/openpicvar.h Sat Dec 21 04:31:54 2013 (r259676) @@ -32,6 +32,14 @@ #define OPENPIC_IRQMAX 256 /* h/w allows more */ +/* Names match the macros in openpicreg.h. */ +struct openpic_timer { + uint32_t tcnt; + uint32_t tbase; + uint32_t tvec; + uint32_t tdst; +}; + struct openpic_softc { device_t sc_dev; struct resource *sc_memr; @@ -45,6 +53,14 @@ struct openpic_softc { u_int sc_ncpu; u_int sc_nirq; int sc_psim; + + /* Saved states. */ + uint32_t sc_saved_config; + uint32_t sc_saved_ipis[4]; + uint32_t sc_saved_prios[4]; + struct openpic_timer sc_saved_timers[OPENPIC_TIMERS]; + uint32_t sc_saved_vectors[OPENPIC_SRC_VECTOR_COUNT]; + }; extern devclass_t openpic_devclass; @@ -66,4 +82,7 @@ void openpic_ipi(device_t, u_int); void openpic_mask(device_t, u_int); void openpic_unmask(device_t, u_int); +int openpic_suspend(device_t dev); +int openpic_resume(device_t dev); + #endif /* _POWERPC_OPENPICVAR_H_ */ Modified: head/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- head/sys/powerpc/ofw/openpic_ofw.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/ofw/openpic_ofw.c Sat Dec 21 04:31:54 2013 (r259676) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "pic_if.h" @@ -68,6 +69,8 @@ static device_method_t openpic_ofw_meth /* Device interface */ DEVMETHOD(device_probe, openpic_ofw_probe), DEVMETHOD(device_attach, openpic_ofw_attach), + DEVMETHOD(device_suspend, openpic_suspend), + DEVMETHOD(device_resume, openpic_resume), /* PIC interface */ DEVMETHOD(pic_bind, openpic_bind), Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/powermac/cpcht.c Sat Dec 21 04:31:54 2013 (r259676) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/powerpc/openpic.c Sat Dec 21 04:31:54 2013 (r259676) @@ -380,3 +380,64 @@ openpic_unmask(device_t dev, u_int irq) openpic_write(sc, OPENPIC_IPI_VECTOR(0), x); } } + +int +openpic_suspend(device_t dev) +{ + struct openpic_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); + for (i = 0; i < 4; i++) { + sc->sc_saved_ipis[i] = bus_read_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i)); + } + + for (i = 0; i < 4; i++) { + sc->sc_saved_prios[i] = bus_read_4(sc->sc_memr, OPENPIC_PCPU_TPR(i)); + } + + for (i = 0; i < OPENPIC_TIMERS; i++) { + sc->sc_saved_timers[i].tcnt = bus_read_4(sc->sc_memr, OPENPIC_TCNT(i)); + sc->sc_saved_timers[i].tbase = bus_read_4(sc->sc_memr, OPENPIC_TBASE(i)); + sc->sc_saved_timers[i].tvec = bus_read_4(sc->sc_memr, OPENPIC_TVEC(i)); + sc->sc_saved_timers[i].tdst = bus_read_4(sc->sc_memr, OPENPIC_TDST(i)); + } + + for (i = 0; i < OPENPIC_SRC_VECTOR_COUNT; i++) + sc->sc_saved_vectors[i] = + bus_read_4(sc->sc_memr, OPENPIC_SRC_VECTOR(i)) & ~OPENPIC_ACTIVITY; + + return (0); +} + +int +openpic_resume(device_t dev) +{ + struct openpic_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); + for (i = 0; i < 4; i++) { + bus_write_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i), sc->sc_saved_ipis[i]); + } + + for (i = 0; i < 4; i++) { + bus_write_4(sc->sc_memr, OPENPIC_PCPU_TPR(i), sc->sc_saved_prios[i]); + } + + for (i = 0; i < OPENPIC_TIMERS; i++) { + bus_write_4(sc->sc_memr, OPENPIC_TCNT(i), sc->sc_saved_timers[i].tcnt); + bus_write_4(sc->sc_memr, OPENPIC_TBASE(i), sc->sc_saved_timers[i].tbase); + bus_write_4(sc->sc_memr, OPENPIC_TVEC(i), sc->sc_saved_timers[i].tvec); + bus_write_4(sc->sc_memr, OPENPIC_TDST(i), sc->sc_saved_timers[i].tdst); + } + + for (i = 0; i < OPENPIC_SRC_VECTOR_COUNT; i++) + bus_write_4(sc->sc_memr, OPENPIC_SRC_VECTOR(i), sc->sc_saved_vectors[i]); + + return (0); +} Modified: head/sys/powerpc/psim/openpic_iobus.c ============================================================================== --- head/sys/powerpc/psim/openpic_iobus.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/psim/openpic_iobus.c Sat Dec 21 04:31:54 2013 (r259676) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 07:09:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CACBE26C; Sat, 21 Dec 2013 07:09:19 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD0DB1EDF; Sat, 21 Dec 2013 07:09:19 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id rBL79784057651; Fri, 20 Dec 2013 23:09:07 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id rBL797JA057650; Fri, 20 Dec 2013 23:09:07 -0800 (PST) (envelope-from sgk) Date: Fri, 20 Dec 2013 23:09:07 -0800 From: Steve Kargl To: Alexander Motin Subject: Re: svn commit: r259659 - in head/sys: nfs rpc Message-ID: <20131221070907.GA57639@troutmask.apl.washington.edu> References: <201312201739.rBKHd73M059252@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312201739.rBKHd73M059252@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 07:09:20 -0000 On Fri, Dec 20, 2013 at 05:39:07PM +0000, Alexander Motin wrote: > Author: mav > Date: Fri Dec 20 17:39:07 2013 > New Revision: 259659 > URL: http://svnweb.freebsd.org/changeset/base/259659 > > Log: > Remove several linear list traversals per request from RPC server code. > > Do not insert active ports into pool->sp_active list if they are success- > fully assigned to some thread. This makes that list include only ports that > really require attention, and so traversal can be reduced to simple taking > the first one. > > Remove idle thread from pool->sp_idlethreads list when assigning some > work (port of requests) to it. That again makes possible to replace list > traversals with simple taking the first element. > > Modified: > head/sys/nfs/nfs_fha.c > head/sys/rpc/svc.c > head/sys/rpc/svc.h FYI. cc -c -O -pipe -march=core2 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -Werror /usr/src/sys/rpc/svc.c /usr/src/sys/rpc/svc.c:296:20: error: no member named 'xp_mlock' in 'struct __rpc_svcxprt'; did you mean 'xp_lock'? mtx_assert(&xprt->xp_mlock, MA_OWNED); ^ /usr/src/sys/sys/mutex.h:379:15: note: expanded from macro 'mtx_assert' mtx_assert_((m), (what), __FILE__, __LINE__) ^ /usr/src/sys/sys/mutex.h:359:15: note: expanded from macro 'mtx_assert_' _mtx_assert((m), (what), (file), (line)) ^ /usr/src/sys/sys/mutex.h:158:17: note: expanded from macro '_mtx_assert' __mtx_assert(&(m)->mtx_lock, w, f, l) ^ /usr/src/sys/rpc/svc.h:149:12: note: 'xp_lock' declared here struct sx xp_lock; ^ /usr/src/sys/rpc/svc.c:296:2: error: no member named 'mtx_lock' in 'struct sx'; did you mean 'sx_lock'? mtx_assert(&xprt->xp_mlock, MA_OWNED); ^ /usr/src/sys/sys/mutex.h:379:2: note: expanded from macro 'mtx_assert' mtx_assert_((m), (what), __FILE__, __LINE__) ^ /usr/src/sys/sys/mutex.h:359:2: note: expanded from macro 'mtx_assert_' _mtx_assert((m), (what), (file), (line)) ^ /usr/src/sys/sys/mutex.h:158:21: note: expanded from macro '_mtx_assert' __mtx_assert(&(m)->mtx_lock, w, f, l) ^ /usr/src/sys/sys/_sx.h:39:21: note: 'sx_lock' declared here volatile uintptr_t sx_lock; -- steve From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 11:59:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8086AE7A; Sat, 21 Dec 2013 11:59:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 676961001; Sat, 21 Dec 2013 11:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLBxxhu011771; Sat, 21 Dec 2013 11:59:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLBxxOE011770; Sat, 21 Dec 2013 11:59:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312211159.rBLBxxOE011770@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 21 Dec 2013 11:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259677 - head/sbin/swapon 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.17 Precedence: list List-Id: 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, 21 Dec 2013 11:59:59 -0000 Author: jilles Date: Sat Dec 21 11:59:58 2013 New Revision: 259677 URL: http://svnweb.freebsd.org/changeset/base/259677 Log: swapon: Fix buffer overflow when configuring encrypted swap on GBDE. PR: bin/184950 Tested by: Radim Kolar MFC after: 3 days Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Dec 21 04:31:54 2013 (r259676) +++ head/sbin/swapon/swapon.c Sat Dec 21 11:59:58 2013 (r259677) @@ -266,7 +266,8 @@ static const char * swap_on_off_gbde(const char *name, int doingall) { const char *ret; - char pass[64 * 2 + 1], bpass[64]; + char pass[64 * 2 + 1]; + unsigned char bpass[64]; char *dname; int i, error; From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 12:45:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43FA73B5; Sat, 21 Dec 2013 12:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3040E1284; Sat, 21 Dec 2013 12:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLCja7o029359; Sat, 21 Dec 2013 12:45:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLCjaXQ029358; Sat, 21 Dec 2013 12:45:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211245.rBLCjaXQ029358@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 12:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259678 - head/contrib/tcpdump 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.17 Precedence: list List-Id: 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, 21 Dec 2013 12:45:36 -0000 Author: gjb Date: Sat Dec 21 12:45:35 2013 New Revision: 259678 URL: http://svnweb.freebsd.org/changeset/base/259678 Log: Fix build with WITHOUT_CAPSICUM. Submitted by: dt71 gmx com Sponsored by: The FreeBSD Foundation Modified: head/contrib/tcpdump/addrtoname.c Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Sat Dec 21 11:59:58 2013 (r259677) +++ head/contrib/tcpdump/addrtoname.c Sat Dec 21 12:45:35 2013 (r259678) @@ -33,8 +33,10 @@ static const char rcsid[] _U_ = #endif #ifdef __FreeBSD__ +#ifdef HAVE_LIBCAPSICUM #include #include +#endif /* HAVE_LIBCAPSICUM */ #endif #include From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 12:55:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4598EABB; Sat, 21 Dec 2013 12:55:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25F0D1365; Sat, 21 Dec 2013 12:55:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLCthwE033325; Sat, 21 Dec 2013 12:55:43 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLCth6j033324; Sat, 21 Dec 2013 12:55:43 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312211255.rBLCth6j033324@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 21 Dec 2013 12:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259679 - 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.17 Precedence: list List-Id: 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, 21 Dec 2013 12:55:43 -0000 Author: dumbbell Date: Sat Dec 21 12:55:42 2013 New Revision: 259679 URL: http://svnweb.freebsd.org/changeset/base/259679 Log: vga_pci: Improve boot display detection The previous code was checking the "VGA Enable" bit on the video card's parent PCI-to-PCI bridge only. This didn't work for the case where the video card is attached to the root PCI bus (ie. the card has no parent PCI-to-PCI bridge). Now, the new code: 1. checks the "VGA Enable" bit on the parent bridge only if it's a PCI-to-PCI bridge; 2. always checks the "I/O" and "Memory address space decoding" bits on the video card itself. However, vendor-specific bits are not used. This fixes the use of many integrated Radeon cards: without this patch, we fail to detect them as the boot display and, when radeonkms looks for the Video BIOS, it skips the shadow copy made by the System BIOS. It then fails to fully initialize the card, because the shadow copy is the only way to read the Video BIOS in these situations. A workaround was to force the boot display selection using the "hw.pci.default_vgapci_unit" tunable. A previous version of this patch added a new function doing the checks. Now, the vga_pci_is_boot_display() function is used to perform the checks (only until the boot display is found) and return if the given device is the boot display or not. Furthermore, vga_pci_attach() logs "Boot video device" if the card being attached it the Chosen One: vgapci0: [...] vgapci0: Boot video device Reviewed by: kib@, jhb@ (both a previous version) Tested by: lunatic_ (#freebsd-xorg, integrated Radeon card, xmj (#freebsd-xorg, i915+NVIDIA cards) Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sat Dec 21 12:45:35 2013 (r259678) +++ head/sys/dev/pci/vga_pci.c Sat Dec 21 12:55:42 2013 (r259679) @@ -81,16 +81,58 @@ SYSCTL_INT(_hw_pci, OID_AUTO, default_vg int vga_pci_is_boot_display(device_t dev) { + int unit; + device_t pcib; + uint16_t config; + + /* Check that the given device is a video card */ + if ((pci_get_class(dev) != PCIC_DISPLAY && + (pci_get_class(dev) != PCIC_OLD || + pci_get_subclass(dev) != PCIS_OLD_VGA))) + return (0); + + unit = device_get_unit(dev); + + if (vga_pci_default_unit >= 0) { + /* + * The boot display device was determined by a previous + * call to this function, or the user forced it using + * the hw.pci.default_vgapci_unit tunable. + */ + return (vga_pci_default_unit == unit); + } /* - * Return true if the given device is the default display used - * at boot time. + * The primary video card used as a boot display must have the + * "I/O" and "Memory Address Space Decoding" bits set in its + * Command register. + * + * Furthermore, if the card is attached to a bridge, instead of + * the root PCI bus, the bridge must have the "VGA Enable" bit + * set in its Control register. */ - return ( - (pci_get_class(dev) == PCIC_DISPLAY || - (pci_get_class(dev) == PCIC_OLD && - pci_get_subclass(dev) == PCIS_OLD_VGA)) && - device_get_unit(dev) == vga_pci_default_unit); + + pcib = device_get_parent(device_get_parent(dev)); + if (device_get_devclass(device_get_parent(pcib)) == + devclass_find("pci")) { + /* + * The parent bridge is a PCI-to-PCI bridge: check the + * value of the "VGA Enable" bit. + */ + config = pci_read_config(pcib, PCIR_BRIDGECTL_1, 2); + if ((config & PCIB_BCR_VGA_ENABLE) == 0) + return (0); + } + + config = pci_read_config(dev, PCIR_COMMAND, 2); + if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0) + return (0); + + /* This video card is the boot display: record its unit number. */ + vga_pci_default_unit = unit; + device_set_flags(dev, 1); + + return (1); } void * @@ -159,9 +201,6 @@ vga_pci_unmap_bios(device_t dev, void *b static int vga_pci_probe(device_t dev) { - device_t bdev; - int unit; - uint16_t bctl; switch (pci_get_class(dev)) { case PCIC_DISPLAY: @@ -175,13 +214,7 @@ vga_pci_probe(device_t dev) } /* Probe default display. */ - unit = device_get_unit(dev); - bdev = device_get_parent(device_get_parent(dev)); - bctl = pci_read_config(bdev, PCIR_BRIDGECTL_1, 2); - if (vga_pci_default_unit < 0 && (bctl & PCIB_BCR_VGA_ENABLE) != 0) - vga_pci_default_unit = unit; - if (vga_pci_default_unit == unit) - device_set_flags(dev, 1); + vga_pci_is_boot_display(dev); device_set_desc(dev, "VGA-compatible display"); return (BUS_PROBE_GENERIC); @@ -197,6 +230,10 @@ vga_pci_attach(device_t dev) device_add_child(dev, "drm", -1); device_add_child(dev, "drmn", -1); bus_generic_attach(dev); + + if (vga_pci_is_boot_display(dev)) + device_printf(dev, "Boot video device\n"); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 13:58:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57E4E6B0; Sat, 21 Dec 2013 13:58:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37DF61711; Sat, 21 Dec 2013 13:58:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLDwvGe055132; Sat, 21 Dec 2013 13:58:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLDwtvX055123; Sat, 21 Dec 2013 13:58:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312211358.rBLDwtvX055123@svn.freebsd.org> From: Ed Maste Date: Sat, 21 Dec 2013 13:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259680 - in head: sys/dev/vt sys/dev/vt/font sys/sys tools/tools/vt/fontcvt tools/tools/vt/mkkfont tools/tools/vt/setfont 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.17 Precedence: list List-Id: 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, 21 Dec 2013 13:58:57 -0000 Author: emaste Date: Sat Dec 21 13:58:55 2013 New Revision: 259680 URL: http://svnweb.freebsd.org/changeset/base/259680 Log: Support double-width characters in vt(9) Normal and bold fonts each have a glyph map for single or left half- glyphs, and right half glyphs. The flag TF_CJK_RIGHT in term_char_t requests the right half-glyph. Reviewed by: ed@ Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_font_default.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_font.c head/sys/sys/consio.h head/tools/tools/vt/fontcvt/fontcvt.c head/tools/tools/vt/mkkfont/mkkfont.c head/tools/tools/vt/setfont/setfont.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/font/vt_font_default.c Sat Dec 21 13:58:55 2013 (r259680) @@ -2194,9 +2194,8 @@ struct vt_font vt_font_default = { .vf_width = 8, .vf_height = 16, .vf_bytes = font_bytes, - .vf_normal = font_mapping_normal, - .vf_normal_length = 248, - .vf_bold = font_mapping_bold, - .vf_bold_length = 260, + .vf_map = { font_mapping_normal, NULL, + font_mapping_bold, NULL }, + .vf_map_count = { 248, 0, 260, 0 }, .vf_refcount = 1, }; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/vt.h Sat Dec 21 13:58:55 2013 (r259680) @@ -388,11 +388,10 @@ struct vt_font_map { }; struct vt_font { - struct vt_font_map *vf_bold; - struct vt_font_map *vf_normal; + struct vt_font_map *vf_map[VFNT_MAPS]; uint8_t *vf_bytes; - unsigned int vf_height, vf_width, - vf_normal_length, vf_bold_length; + unsigned int vf_height, vf_width; + unsigned int vf_map_count[VFNT_MAPS]; unsigned int vf_refcount; }; Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/vt_font.c Sat Dec 21 13:58:55 2013 (r259680) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ -#define VTFONT_MAXMAPPINGS 1024 +#define VTFONT_MAXMAPPINGS 8192 #define VTFONT_MAXGLYPHSIZE 262144 #define VTFONT_MAXDIMENSION 128 @@ -86,6 +86,8 @@ vtfont_lookup(const struct vt_font *vf, uint32_t src; uint16_t dst; size_t stride; + unsigned int normal_map; + unsigned int bold_map; /* * No support for printing right hand sides for CJK fullwidth @@ -93,15 +95,22 @@ vtfont_lookup(const struct vt_font *vf, * hand side describes the entire character. */ src = TCHAR_CHARACTER(c); - if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) - src = ' '; + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) { + normal_map = VFNT_MAP_NORMAL_RIGHT; + bold_map = VFNT_MAP_BOLD_RIGHT; + } else { + normal_map = VFNT_MAP_NORMAL; + bold_map = VFNT_MAP_BOLD; + } if (TCHAR_FORMAT(c) & TF_BOLD) { - dst = vtfont_bisearch(vf->vf_bold, vf->vf_bold_length, src); + dst = vtfont_bisearch(vf->vf_map[bold_map], + vf->vf_map_count[bold_map], src); if (dst != 0) goto found; } - dst = vtfont_bisearch(vf->vf_normal, vf->vf_normal_length, src); + dst = vtfont_bisearch(vf->vf_map[normal_map], + vf->vf_map_count[normal_map], src); found: stride = howmany(vf->vf_width, 8) * vf->vf_height; @@ -119,10 +128,11 @@ vtfont_ref(struct vt_font *vf) void vtfont_unref(struct vt_font *vf) { + unsigned int i; if (refcount_release(&vf->vf_refcount)) { - free(vf->vf_normal, M_VTFONT); - free(vf->vf_bold, M_VTFONT); + for (i = 0; i < VFNT_MAPS; i++) + free(vf->vf_map[i], M_VTFONT); free(vf->vf_bytes, M_VTFONT); free(vf, M_VTFONT); } @@ -130,7 +140,7 @@ vtfont_unref(struct vt_font *vf) static int vtfont_validate_map(struct vt_font_map *vfm, unsigned int length, - unsigned int nglyphs) + unsigned int glyph_count) { unsigned int i, last = 0; @@ -141,8 +151,8 @@ vtfont_validate_map(struct vt_font_map * /* * Destination extends amount of glyphs. */ - if (vfm[i].vfm_dst >= nglyphs || - vfm[i].vfm_dst + vfm[i].vfm_len >= nglyphs) + if (vfm[i].vfm_dst >= glyph_count || + vfm[i].vfm_dst + vfm[i].vfm_len >= glyph_count) return (EINVAL); last = vfm[i].vfm_src + vfm[i].vfm_len; } @@ -153,9 +163,10 @@ vtfont_validate_map(struct vt_font_map * int vtfont_load(vfnt_t *f, struct vt_font **ret) { - size_t glyphsize; + size_t glyphsize, mapsize; struct vt_font *vf; int error; + unsigned int i; /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) @@ -164,50 +175,43 @@ vtfont_load(vfnt_t *f, struct vt_font ** return (E2BIG); /* Not too many mappings. */ - if (f->nnormal > VTFONT_MAXMAPPINGS || f->nbold > VTFONT_MAXMAPPINGS) - return (E2BIG); + for (i = 0; i < VFNT_MAPS; i++) + if (f->map_count[i] > VTFONT_MAXMAPPINGS) + return (E2BIG); /* Character 0 must always be present. */ - if (f->nglyphs < 1) + if (f->glyph_count < 1) return (EINVAL); - glyphsize = howmany(f->width, 8) * f->height * f->nglyphs; + glyphsize = howmany(f->width, 8) * f->height * f->glyph_count; if (glyphsize > VTFONT_MAXGLYPHSIZE) return (E2BIG); /* Allocate new font structure. */ - vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK); - vf->vf_normal = malloc(f->nnormal * sizeof(struct vt_font_map), - M_VTFONT, M_WAITOK); - vf->vf_bold = malloc(f->nbold * sizeof(struct vt_font_map), - M_VTFONT, M_WAITOK); + vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK | M_ZERO); vf->vf_bytes = malloc(glyphsize, M_VTFONT, M_WAITOK); vf->vf_height = f->height; vf->vf_width = f->width; - vf->vf_normal_length = f->nnormal; - vf->vf_bold_length = f->nbold; vf->vf_refcount = 1; - /* Copy in data. */ - error = copyin(f->normal, vf->vf_normal, - vf->vf_normal_length * sizeof(struct vt_font_map)); - if (error) - goto bad; - error = copyin(f->bold, vf->vf_bold, - vf->vf_bold_length * sizeof(struct vt_font_map)); - if (error) - goto bad; - error = copyin(f->glyphs, vf->vf_bytes, glyphsize); - if (error) - goto bad; + /* Allocate, copy in, and validate mappings. */ + for (i = 0; i < VFNT_MAPS; i++) { + vf->vf_map_count[i] = f->map_count[i]; + if (f->map_count[i] == 0) + continue; + mapsize = f->map_count[i] * sizeof(struct vt_font_map); + vf->vf_map[i] = malloc(mapsize, M_VTFONT, M_WAITOK); + error = copyin(f->map[i], vf->vf_map[i], mapsize); + if (error) + goto bad; + error = vtfont_validate_map(vf->vf_map[i], vf->vf_map_count[i], + f->glyph_count); + if (error) + goto bad; + } - /* Validate mappings. */ - error = vtfont_validate_map(vf->vf_normal, vf->vf_normal_length, - f->nglyphs); - if (error) - goto bad; - error = vtfont_validate_map(vf->vf_bold, vf->vf_bold_length, - f->nglyphs); + /* Copy in glyph data. */ + error = copyin(f->glyphs, vf->vf_bytes, glyphsize); if (error) goto bad; Modified: head/sys/sys/consio.h ============================================================================== --- head/sys/sys/consio.h Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/sys/consio.h Sat Dec 21 13:58:55 2013 (r259680) @@ -216,13 +216,16 @@ struct vfnt_map { }; typedef struct vfnt_map vfnt_map_t; +#define VFNT_MAP_NORMAL 0 +#define VFNT_MAP_NORMAL_RIGHT 1 +#define VFNT_MAP_BOLD 2 +#define VFNT_MAP_BOLD_RIGHT 3 +#define VFNT_MAPS 4 struct vfnt { - vfnt_map_t *normal; - vfnt_map_t *bold; + vfnt_map_t *map[VFNT_MAPS]; uint8_t *glyphs; - unsigned int nnormal; - unsigned int nbold; - unsigned int nglyphs; + unsigned int map_count[VFNT_MAPS]; + unsigned int glyph_count; unsigned int width; unsigned int height; }; Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/fontcvt/fontcvt.c Sat Dec 21 13:58:55 2013 (r259680) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#define VFNT_MAPS 4 +#define VFNT_MAP_NORMAL 0 +#define VFNT_MAP_BOLD 2 + static unsigned int width, wbytes, height; struct glyph { @@ -48,9 +52,14 @@ struct glyph { unsigned int g_index; }; -static TAILQ_HEAD(, glyph) glyph_list = TAILQ_HEAD_INITIALIZER(glyph_list); -static unsigned int glyph_total, glyph_normal, glyph_bold, - glyph_unique, glyph_dupe; +TAILQ_HEAD(glyph_list, glyph); +static struct glyph_list glyphs[VFNT_MAPS] = { + TAILQ_HEAD_INITIALIZER(glyphs[0]), + TAILQ_HEAD_INITIALIZER(glyphs[1]), + TAILQ_HEAD_INITIALIZER(glyphs[2]), + TAILQ_HEAD_INITIALIZER(glyphs[3]), +}; +static unsigned int glyph_total, glyph_count[4], glyph_unique, glyph_dupe; struct mapping { TAILQ_ENTRY(mapping) m_list; @@ -60,12 +69,14 @@ struct mapping { }; TAILQ_HEAD(mapping_list, mapping); -static struct mapping_list mapping_list_normal = - TAILQ_HEAD_INITIALIZER(mapping_list_normal); -static struct mapping_list mapping_list_bold = - TAILQ_HEAD_INITIALIZER(mapping_list_bold); -static unsigned int mapping_total, mapping_normal, mapping_normal_folded, - mapping_bold, mapping_bold_folded, mapping_unique, mapping_dupe; +static struct mapping_list maps[VFNT_MAPS] = { + TAILQ_HEAD_INITIALIZER(maps[0]), + TAILQ_HEAD_INITIALIZER(maps[1]), + TAILQ_HEAD_INITIALIZER(maps[2]), + TAILQ_HEAD_INITIALIZER(maps[3]), +}; +static unsigned int mapping_total, map_count[4], map_folded_count[4], + mapping_unique, mapping_dupe; static void usage(void) @@ -77,17 +88,18 @@ usage(void) } static int -add_mapping(struct glyph *gl, unsigned int c, int bold) +add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) { struct mapping *mp; struct mapping_list *ml; mapping_total++; - if (bold) { + if (map_idx >= VFNT_MAP_BOLD) { int found = 0; + unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; - TAILQ_FOREACH(mp, &mapping_list_normal, m_list) { + TAILQ_FOREACH(mp, &maps[normal_map_idx], m_list) { if (mp->m_char < c) continue; else if (mp->m_char > c) @@ -116,7 +128,7 @@ add_mapping(struct glyph *gl, unsigned i mp->m_glyph = gl; mp->m_length = 0; - ml = bold ? &mapping_list_bold : &mapping_list_normal; + ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && TAILQ_LAST(ml, mapping_list)->m_char >= c) { fprintf(stderr, "Bad ordering at character %u\n", c); @@ -124,30 +136,27 @@ add_mapping(struct glyph *gl, unsigned i } TAILQ_INSERT_TAIL(ml, mp, m_list); - if (bold) - mapping_bold++; - else - mapping_normal++; + map_count[map_idx]++; mapping_unique++; return (0); } static struct glyph * -add_glyph(const uint8_t *bytes, int bold, int fallback) +add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) { struct glyph *gl; + unsigned int i; glyph_total++; - if (bold) - glyph_bold++; - else - glyph_normal++; + glyph_count[map_idx]++; - TAILQ_FOREACH(gl, &glyph_list, g_list) { - if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { - glyph_dupe++; - return (gl); + for (i = 0; i < VFNT_MAPS; i++) { + TAILQ_FOREACH(gl, &glyphs[i], g_list) { + if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { + glyph_dupe++; + return (gl); + } } } @@ -155,22 +164,61 @@ add_glyph(const uint8_t *bytes, int bold gl->g_data = malloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); if (fallback) - TAILQ_INSERT_HEAD(&glyph_list, gl, g_list); + TAILQ_INSERT_HEAD(&glyphs[map_idx], gl, g_list); else - TAILQ_INSERT_TAIL(&glyph_list, gl, g_list); + TAILQ_INSERT_TAIL(&glyphs[map_idx], gl, g_list); glyph_unique++; return (gl); } static int -parse_bdf(const char *filename, int bold __unused) +parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, + unsigned int dwidth) +{ + uint8_t *p; + unsigned int i, subline; + + if (dwidth != width && dwidth != width * 2) { + fprintf(stderr, + "Unsupported width %u!\n", dwidth); + return (1); + } + + /* Move pixel data right to simplify splitting double characters. */ + line >>= (howmany(dwidth, 8) * 8) - dwidth; + + for (i = dwidth / width; i > 0; i--) { + p = (i == 2) ? right : left; + + subline = line & ((1 << width) - 1); + subline <<= (howmany(width, 8) * 8) - width; + + if (wbytes == 1) { + *p = subline; + } else if (wbytes == 2) { + *p++ = subline >> 8; + *p = subline; + } else { + fprintf(stderr, + "Unsupported wbytes %u!\n", wbytes); + return (1); + } + + line >>= width; + } + + return (0); +} + +static int +parse_bdf(const char *filename, unsigned int map_idx) { FILE *fp; char *ln; size_t length; - uint8_t bytes[wbytes * height]; - unsigned int curchar = 0, i, line; + uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; + unsigned int curchar = 0, dwidth = 0, i, line; struct glyph *gl; fp = fopen(filename, "r"); @@ -186,6 +234,10 @@ parse_bdf(const char *filename, int bold curchar = atoi(ln + 9); } + if (strncmp(ln, "DWIDTH ", 7) == 0) { + dwidth = atoi(ln + 7); + } + if (strcmp(ln, "BITMAP") == 0) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) { @@ -194,26 +246,25 @@ parse_bdf(const char *filename, int bold } ln[length - 1] = '\0'; sscanf(ln, "%x", &line); - if (wbytes == 1) { - bytes[i] = line; - } else if (wbytes == 2) { - bytes[i * 2 + 0] = line >> 8; - bytes[i * 2 + 1] = line; - } else { - fprintf(stderr, - "Unsupported wbytes!\n"); + if (parse_bitmap_line(bytes + i * wbytes, + bytes_r + i * wbytes, line, dwidth) != 0) return (1); - } } /* Prevent adding two glyphs for 0xFFFD */ if (curchar == 0xFFFD) { - if (!bold) - gl = add_glyph(bytes, bold, 1); + if (map_idx < VFNT_MAP_BOLD) + gl = add_glyph(bytes, 0, 1); } else if (curchar >= 0x20) { - gl = add_glyph(bytes, bold, 0); - if (add_mapping(gl, curchar, bold) != 0) + gl = add_glyph(bytes, map_idx, 0); + if (add_mapping(gl, curchar, map_idx) != 0) return (1); + if (dwidth == width * 2) { + gl = add_glyph(bytes_r, map_idx + 1, 0); + if (add_mapping(gl, curchar, + map_idx + 1) != 0) + return (1); + } } } } @@ -225,32 +276,31 @@ static void number_glyphs(void) { struct glyph *gl; - unsigned int idx = 0; + unsigned int i, idx = 0; - TAILQ_FOREACH(gl, &glyph_list, g_list) - gl->g_index = idx++; + for (i = 0; i < VFNT_MAPS; i++) + TAILQ_FOREACH(gl, &glyphs[i], g_list) + gl->g_index = idx++; } static void write_glyphs(FILE *fp) { struct glyph *gl; + unsigned int i; - TAILQ_FOREACH(gl, &glyph_list, g_list) - fwrite(gl->g_data, wbytes * height, 1, fp); + for (i = 0; i < VFNT_MAPS; i++) { + TAILQ_FOREACH(gl, &glyphs[i], g_list) + fwrite(gl->g_data, wbytes * height, 1, fp); + } } static void -fold_mappings(int bold) +fold_mappings(unsigned int map_idx) { - struct mapping_list *ml; + struct mapping_list *ml = &maps[map_idx]; struct mapping *mn, *mp, *mbase; - if (bold) - ml = &mapping_list_bold; - else - ml = &mapping_list_normal; - mp = mbase = TAILQ_FIRST(ml); for (mp = mbase = TAILQ_FIRST(ml); mp != NULL; mp = mn) { mn = TAILQ_NEXT(mp, m_list); @@ -259,10 +309,7 @@ fold_mappings(int bold) continue; mbase->m_length = mp->m_char - mbase->m_char + 1; mbase = mp = mn; - if (bold) - mapping_bold_folded++; - else - mapping_normal_folded++; + map_folded_count[map_idx]++; } } @@ -273,18 +320,13 @@ struct file_mapping { } __packed; static void -write_mappings(FILE *fp, int bold) +write_mappings(FILE *fp, unsigned int map_idx) { - struct mapping_list *ml; + struct mapping_list *ml = &maps[map_idx]; struct mapping *mp; struct file_mapping fm; unsigned int i = 0, j = 0; - if (bold) - ml = &mapping_list_bold; - else - ml = &mapping_list_normal; - TAILQ_FOREACH(mp, ml, m_list) { j++; if (mp->m_length > 0) { @@ -302,9 +344,9 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static int @@ -312,7 +354,7 @@ write_fnt(const char *filename) { FILE *fp; struct file_header fh = { - .magic = "VFNT 1.0", + .magic = "VFNT0002", }; fp = fopen(filename, "wb"); @@ -323,14 +365,18 @@ write_fnt(const char *filename) fh.width = width; fh.height = height; - fh.nglyphs = htobe16(glyph_unique); - fh.nmappings_normal = htobe16(mapping_normal_folded); - fh.nmappings_bold = htobe16(mapping_bold_folded); + fh.glyph_count = htobe32(glyph_unique); + fh.map_count[0] = htobe32(map_folded_count[0]); + fh.map_count[1] = htobe32(map_folded_count[1]); + fh.map_count[2] = htobe32(map_folded_count[2]); + fh.map_count[3] = htobe32(map_folded_count[3]); fwrite(&fh, sizeof fh, 1, fp); write_glyphs(fp); - write_mappings(fp, 0); + write_mappings(fp, VFNT_MAP_NORMAL); write_mappings(fp, 1); + write_mappings(fp, VFNT_MAP_BOLD); + write_mappings(fp, 3); return (0); } @@ -339,7 +385,7 @@ int main(int argc, char *argv[]) { - assert(sizeof(struct file_header) == 16); + assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); if (argc != 6) @@ -349,36 +395,49 @@ main(int argc, char *argv[]) wbytes = howmany(width, 8); height = atoi(argv[2]); - if (parse_bdf(argv[3], 0) != 0) + if (parse_bdf(argv[3], VFNT_MAP_NORMAL) != 0) return (1); - if (parse_bdf(argv[4], 1) != 0) + if (parse_bdf(argv[4], VFNT_MAP_BOLD) != 0) return (1); number_glyphs(); fold_mappings(0); fold_mappings(1); + fold_mappings(2); + fold_mappings(3); if (write_fnt(argv[5]) != 0) return (1); printf( "Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", +"- glyph_total: %5u\n" +"- glyph_normal: %5u\n" +"- glyph_normal_right: %5u\n" +"- glyph_bold: %5u\n" +"- glyph_bold_right: %5u\n" +"- glyph_unique: %5u\n" +"- glyph_dupe: %5u\n" +"- mapping_total: %5u\n" +"- mapping_normal: %5u\n" +"- mapping_normal_folded: %5u\n" +"- mapping_normal_right: %5u\n" +"- mapping_normal_right_folded: %5u\n" +"- mapping_bold: %5u\n" +"- mapping_bold_folded: %5u\n" +"- mapping_bold_right: %5u\n" +"- mapping_bold_right_folded: %5u\n" +"- mapping_unique: %5u\n" +"- mapping_dupe: %5u\n", glyph_total, - glyph_normal, glyph_bold, + glyph_count[0], + glyph_count[1], + glyph_count[2], + glyph_count[3], glyph_unique, glyph_dupe, mapping_total, - mapping_normal, mapping_normal_folded, - mapping_bold, mapping_bold_folded, + map_count[0], map_folded_count[0], + map_count[1], map_folded_count[1], + map_count[2], map_folded_count[2], + map_count[3], map_folded_count[3], mapping_unique, mapping_dupe); return (0); Modified: head/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- head/tools/tools/vt/mkkfont/mkkfont.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/mkkfont/mkkfont.c Sat Dec 21 13:58:55 2013 (r259680) @@ -48,22 +48,22 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static int print_glyphs(struct file_header *fh) { - unsigned int gbytes, nglyphs, j, k, total; + unsigned int gbytes, glyph_count, j, k, total; uint8_t *gbuf; gbytes = howmany(fh->width, 8) * fh->height; - nglyphs = be16toh(fh->nglyphs); + glyph_count = be32toh(fh->glyph_count); - printf("\nstatic uint8_t font_bytes[%u * %u] = {", nglyphs, gbytes); - total = nglyphs * gbytes; + printf("\nstatic uint8_t font_bytes[%u * %u] = {", glyph_count, gbytes); + total = glyph_count * gbytes; gbuf = malloc(total); if (fread(gbuf, total, 1, stdin) != 1) { @@ -84,26 +84,23 @@ print_glyphs(struct file_header *fh) return (0); } +static const char *map_names[4] = { + "normal", "normal_right", "bold", "bold_right" }; + static int -print_mappings(struct file_header *fh, int bold) +print_mappings(struct file_header *fh, int map_index) { struct file_mapping fm; - const char *name; unsigned int nmappings, i, col = 0; - if (bold) { - nmappings = be16toh(fh->nmappings_bold); - name = "bold"; - } else { - nmappings = be16toh(fh->nmappings_normal); - name = "normal"; - } + + nmappings = be32toh(fh->map_count[map_index]); if (nmappings == 0) return (0); printf("\nstatic struct vt_font_map font_mapping_%s[%u] = {", - name, nmappings); + map_names[map_index], nmappings); for (i = 0; i < nmappings; i++) { if (fread(&fm, sizeof fm, 1, stdin) != 1) { @@ -126,7 +123,7 @@ print_mappings(struct file_header *fh, i static int print_info(struct file_header *fh) { - unsigned int nnormal, nbold; + unsigned int i; printf( "\nstruct vt_font vt_font_default = {\n" @@ -135,17 +132,19 @@ print_info(struct file_header *fh) "\t.vf_bytes\t\t= font_bytes,\n", fh->width, fh->height); - nnormal = be16toh(fh->nmappings_normal); - nbold = be16toh(fh->nmappings_bold); - - if (nnormal != 0) - printf( - "\t.vf_normal\t\t= font_mapping_normal,\n" - "\t.vf_normal_length\t= %u,\n", nnormal); - if (nbold != 0) - printf( - "\t.vf_bold\t\t= font_mapping_bold,\n" - "\t.vf_bold_length\t\t= %u,\n", nbold); + printf("\t.vf_map\t\t\t= {\n"); + for (i = 0; i < 4; i++) { + if (fh->map_count[i] > 0) + printf("\t\t\t\t font_mapping_%s,\n", map_names[i]); + else + printf("\t\t\t\t NULL,\n"); + } + printf("\t\t\t\t }\n"); + printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", + be32toh(fh->map_count[0]), + be32toh(fh->map_count[1]), + be32toh(fh->map_count[2]), + be32toh(fh->map_count[3])); printf("\t.vf_refcount\t\t= 1,\n};\n"); return (0); @@ -161,7 +160,7 @@ main(int argc __unused, char *argv[] __u return (1); } - if (memcmp(fh.magic, "VFNT 1.0", 8) != 0) { + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { fprintf(stderr, "Bad magic\n"); return (1); } Modified: head/tools/tools/vt/setfont/setfont.c ============================================================================== --- head/tools/tools/vt/setfont/setfont.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/setfont/setfont.c Sat Dec 21 13:58:55 2013 (r259680) @@ -1,3 +1,6 @@ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -12,9 +15,9 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static vfnt_map_t * @@ -48,24 +51,25 @@ main(int argc __unused, char *argv[] __u struct file_header fh; static vfnt_t vfnt; size_t glyphsize; + unsigned int i; if (fread(&fh, sizeof fh, 1, stdin) != 1) { perror("file_header"); return (1); } - if (memcmp(fh.magic, "VFNT 1.0", 8) != 0) { + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { fprintf(stderr, "Bad magic\n"); return (1); } - vfnt.nnormal = be16toh(fh.nmappings_normal); - vfnt.nbold = be16toh(fh.nmappings_bold); - vfnt.nglyphs = be16toh(fh.nglyphs); + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map_count[i] = be32toh(fh.map_count[i]); + vfnt.glyph_count = be32toh(fh.glyph_count); vfnt.width = fh.width; vfnt.height = fh.height; - glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.nglyphs; + glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count; vfnt.glyphs = malloc(glyphsize); if (fread(vfnt.glyphs, glyphsize, 1, stdin) != 1) { @@ -73,8 +77,8 @@ main(int argc __unused, char *argv[] __u return (1); } - vfnt.normal = load_mappingtable(vfnt.nnormal); - vfnt.bold = load_mappingtable(vfnt.nbold); + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map[i] = load_mappingtable(vfnt.map_count[i]); if (ioctl(STDOUT_FILENO, PIO_VFONT, &vfnt) == -1) { perror("PIO_VFONT"); From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 14:41:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13F16E65; Sat, 21 Dec 2013 14:41:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D894619D5; Sat, 21 Dec 2013 14:41:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLEfWWG072414; Sat, 21 Dec 2013 14:41:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLEfWko072413; Sat, 21 Dec 2013 14:41:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312211441.rBLEfWko072413@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 21 Dec 2013 14:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259681 - head/sys/netgraph 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.17 Precedence: list List-Id: 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, 21 Dec 2013 14:41:33 -0000 Author: glebius Date: Sat Dec 21 14:41:32 2013 New Revision: 259681 URL: http://svnweb.freebsd.org/changeset/base/259681 Log: In r248885 I have reduced size of fake uio resid that ng_ksocket(4) passes to the soreceive(). This exposed a bug. When reading from a raw socket, when our fake limit is depleted, we receive a truncated mbuf chain, with m->m_pkthdr.len > m_length(m). The first problem is that MSG_TRUNC was not handled. The second one is that we didn't reinit uio_resid in our endless loop (neither flags), and if socket buffer contained several records, then we quickly deplete our fake limit. The third bug, actually introduced in r248885, is that MJUMPAGESIZE isn't enough to handle maximum packet that ng_ksocket(4) can theoretically receive. Changes: - Reinit uio_resid and flags before every call to soreceive(). - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the module doesn't support INET6. - Properly handle MSG_TRUNC return from soreceive(). PR: 184601 Submitted & tested by: Viktor Velichkin Sponsored by: Nginx, Inc. Modified: head/sys/netgraph/ng_ksocket.c Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Sat Dec 21 13:58:55 2013 (r259680) +++ head/sys/netgraph/ng_ksocket.c Sat Dec 21 14:41:32 2013 (r259681) @@ -66,6 +66,7 @@ #include #include +#include #include #ifdef NG_SEPARATE_MALLOC @@ -1043,8 +1044,7 @@ ng_ksocket_incoming2(node_p node, hook_p struct socket *so = arg1; const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *response; - struct uio auio; - int flags, error; + int error; KASSERT(so == priv->so, ("%s: wrong socket", __func__)); @@ -1093,20 +1093,27 @@ ng_ksocket_incoming2(node_p node, hook_p if (priv->hook == NULL) return; - /* Read and forward available mbuf's */ - auio.uio_td = NULL; - auio.uio_resid = MJUMPAGESIZE; /* XXXGL: sane limit? */ - flags = MSG_DONTWAIT; + /* Read and forward available mbufs. */ while (1) { - struct sockaddr *sa = NULL; + struct uio uio; + struct sockaddr *sa; struct mbuf *m; + int flags; - /* Try to get next packet from socket */ + /* Try to get next packet from socket. */ + uio.uio_td = NULL; + uio.uio_resid = IP_MAXPACKET; + flags = MSG_DONTWAIT; + sa = NULL; if ((error = soreceive(so, (so->so_state & SS_ISCONNECTED) ? - NULL : &sa, &auio, &m, NULL, &flags)) != 0) + NULL : &sa, &uio, &m, NULL, &flags)) != 0) break; - /* See if we got anything */ + /* See if we got anything. */ + if (flags & MSG_TRUNC) { + m_freem(m); + m = NULL; + } if (m == NULL) { if (sa != NULL) free(sa, M_SONAME); From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 14:50:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AA5016A; Sat, 21 Dec 2013 14:50:06 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 663041A15; Sat, 21 Dec 2013 14:50:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500G00V4L6W00@smtpauth2.wiscmail.wisc.edu>; Sat, 21 Dec 2013 08:49:59 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.143916, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY50015TVV89720@smtpauth2.wiscmail.wisc.edu>; Sat, 21 Dec 2013 08:49:58 -0600 (CST) Message-id: <52B5AA94.3060009@freebsd.org> Date: Sat, 21 Dec 2013 08:49:56 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> In-reply-to: <52AF2502.1060503@freebsd.org> X-Enigmail-Version: 1.5.2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 14:50:06 -0000 Could you please revert this and move the fix to the correct place? -Nathan On 12/16/13 10:06, Nathan Whitehorn wrote: > Please add this to release/rc.local instead under the console setup. > There is no guarantee that "auto" is running from an environment where > this is defined -- for example, it may be running from a serial > console or an xterm -- and the actual installer should not be polluted > with assumptions about the media from which it runs. > -Nathan > > On 12/16/13 09:50, Devin Teske wrote: >> Author: dteske >> Date: Mon Dec 16 15:50:59 2013 >> New Revision: 259468 >> URL: http://svnweb.freebsd.org/changeset/base/259468 >> >> Log: >> Add a fix for Long-standing problem with VMware. Described in >> below links: >> https://communities.vmware.com/thread/107230 >> https://communities.vmware.com/docs/DOC-11677 >> Basically, ignore the ``function 62'' and ``function 63'' >> interpretations >> of the left/right command key when we're in the lengthiest portion >> of the >> installation (initiated by the `auto' module). >> The net effect is that you can now (once you've started the >> installer from >> the media) escape the VM without prematurely terminating the >> current action >> due to spurious escape sequence. >> MFC after: 3 days >> >> Modified: >> head/usr.sbin/bsdinstall/scripts/auto >> >> Modified: head/usr.sbin/bsdinstall/scripts/auto >> ============================================================================== >> >> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >> 2013 (r259467) >> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >> 2013 (r259468) >> @@ -49,6 +49,10 @@ error() { >> ############################################################ MAIN >> +# Don't send ESC on function-key 62/63 (left/right command key) >> +f_quietly kbdcontrol -f 62 '' >> +f_quietly kbdcontrol -f 63 '' >> + >> f_dprintf "Began Installation at %s" "$( date )" >> rm -rf $BSDINSTALL_TMPETC > From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 15:02:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39BC052D; Sat, 21 Dec 2013 15:02:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 269BA1B19; Sat, 21 Dec 2013 15:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLF2l7h079591; Sat, 21 Dec 2013 15:02:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLF2lOc079590; Sat, 21 Dec 2013 15:02:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211502.rBLF2lOc079590@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 15:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259682 - head/etc/rc.d 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.17 Precedence: list List-Id: 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, 21 Dec 2013 15:02:48 -0000 Author: gjb Date: Sat Dec 21 15:02:47 2013 New Revision: 259682 URL: http://svnweb.freebsd.org/changeset/base/259682 Log: Honor WITHOUT_CASPER. Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Dec 21 14:41:32 2013 (r259681) +++ head/etc/rc.d/Makefile Sat Dec 21 15:02:47 2013 (r259682) @@ -26,7 +26,7 @@ FILES= DAEMON \ bridge \ bsnmpd \ ${_bthidd} \ - casperd \ + ${_casperd} \ ccd \ cleanvar \ cleartmp \ @@ -188,6 +188,10 @@ _hcsecd= hcsecd _ubthidhci= ubthidhci .endif +.if ${MK_CASPER} != "no" +_casperd= casperd +.endif + .if ${MK_UNBOUND} != "no" _unbound= local_unbound .endif From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 15:16:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55D058A4; Sat, 21 Dec 2013 15:16:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41A271CE2; Sat, 21 Dec 2013 15:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLFGT95083894; Sat, 21 Dec 2013 15:16:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLFGT1E083893; Sat, 21 Dec 2013 15:16:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211516.rBLFGT1E083893@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 15:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259683 - 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.17 Precedence: list List-Id: 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, 21 Dec 2013 15:16:29 -0000 Author: gjb Date: Sat Dec 21 15:16:28 2013 New Revision: 259683 URL: http://svnweb.freebsd.org/changeset/base/259683 Log: Honor WITHOUT_CASPER. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 15:02:47 2013 (r259682) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 15:16:28 2013 (r259683) @@ -358,6 +358,13 @@ OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz .endif +.if ${MK_CASPER} == no +OLD_FILES+=etc/rc.d/casperd +OLD_LIBS+=lib/libcasper.so.0 +OLD_FILES+=sbin/casper +OLD_FILES+=usr/lib/libcasper.a +.endif + .if ${MK_CDDL} == no OLD_LIBS+=lib/libavl.so.2 OLD_LIBS+=lib/libctf.so.2 From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 15:40:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1E14EF6; Sat, 21 Dec 2013 15:40:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD8911E30; Sat, 21 Dec 2013 15:40:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLFebvX091648; Sat, 21 Dec 2013 15:40:37 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLFeblP091644; Sat, 21 Dec 2013 15:40:37 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312211540.rBLFeblP091644@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 21 Dec 2013 15:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259684 - in head/sys/dev/drm2: radeon ttm 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.17 Precedence: list List-Id: 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, 21 Dec 2013 15:40:38 -0000 Author: dumbbell Date: Sat Dec 21 15:40:36 2013 New Revision: 259684 URL: http://svnweb.freebsd.org/changeset/base/259684 Log: drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS... ... for msleep/cv_*wait() return values, where wait_event*() is used on Linux. ERESTARTSYS is the return code expected by callers when the operation was interrupted. For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an error. Note that ERESTARTSYS is defined as ERESTART, but this keeps callers' code close to Linux. Submitted by: avg@ (previous version) Modified: head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_sa.c head/sys/dev/drm2/ttm/ttm_bo.c head/sys/dev/drm2/ttm/ttm_lock.c Modified: head/sys/dev/drm2/radeon/radeon_fence.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_fence.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/radeon/radeon_fence.c Sat Dec 21 15:40:36 2013 (r259684) @@ -321,6 +321,8 @@ static int radeon_fence_wait_seq(struct &rdev->fence_queue_mtx, timeout); } + if (r == EINTR) + r = ERESTARTSYS; if (r != 0) { if (r == EWOULDBLOCK) { signaled = @@ -334,7 +336,7 @@ static int radeon_fence_wait_seq(struct mtx_unlock(&rdev->fence_queue_mtx); } radeon_irq_kms_sw_irq_put(rdev, ring); - if (unlikely(r == EINTR || r == ERESTART)) { + if (unlikely(r == ERESTARTSYS)) { return -r; } CTR2(KTR_DRM, "radeon fence: wait end (ring=%d, seq=%d)", @@ -514,6 +516,8 @@ static int radeon_fence_wait_any_seq(str &rdev->fence_queue_mtx, timeout); } + if (r == EINTR) + r = ERESTARTSYS; if (r != 0) { if (r == EWOULDBLOCK) { signaled = @@ -531,7 +535,7 @@ static int radeon_fence_wait_any_seq(str radeon_irq_kms_sw_irq_put(rdev, i); } } - if (unlikely(r == EINTR || r == ERESTART)) { + if (unlikely(r == ERESTARTSYS)) { return -r; } CTR2(KTR_DRM, "radeon fence: wait end (ring=%d, target_seq=%d)", Modified: head/sys/dev/drm2/radeon/radeon_sa.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_sa.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/radeon/radeon_sa.c Sat Dec 21 15:40:36 2013 (r259684) @@ -363,6 +363,8 @@ int radeon_sa_bo_new(struct radeon_devic while (!radeon_sa_event(sa_manager, size, align)) { r = -cv_wait_sig(&sa_manager->wq, &sa_manager->wq_lock); + if (r == -EINTR) + r = -ERESTARTSYS; if (r != 0) break; } Modified: head/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 21 15:40:36 2013 (r259684) @@ -147,6 +147,8 @@ ttm_bo_wait_unreserved_locked(struct ttm } while (ttm_bo_is_reserved(bo)) { ret = -msleep(bo, &bo->glob->lru_lock, flags, wmsg, 0); + if (ret == -EINTR) + ret = -ERESTARTSYS; if (ret != 0) break; } Modified: head/sys/dev/drm2/ttm/ttm_lock.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_lock.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/ttm/ttm_lock.c Sat Dec 21 15:40:36 2013 (r259684) @@ -107,6 +107,8 @@ ttm_read_lock(struct ttm_lock *lock, boo mtx_lock(&lock->lock); while (!__ttm_read_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (ret != 0) break; } @@ -151,6 +153,8 @@ int ttm_read_trylock(struct ttm_lock *lo mtx_lock(&lock->lock); while (!__ttm_read_trylock(lock, &locked)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (ret != 0) break; } @@ -204,6 +208,8 @@ ttm_write_lock(struct ttm_lock *lock, bo /* XXXKIB: linux uses __ttm_read_lock for uninterruptible sleeps */ while (!__ttm_write_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (interruptible && ret != 0) { lock->flags &= ~TTM_WRITE_LOCK_PENDING; wakeup(lock); @@ -280,6 +286,8 @@ int ttm_vt_lock(struct ttm_lock *lock, mtx_lock(&lock->lock); while (!__ttm_vt_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (interruptible && ret != 0) { lock->flags &= ~TTM_VT_LOCK_PENDING; wakeup(lock); From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:08:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56C3437E; Sat, 21 Dec 2013 16:08:28 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 121781F5B; Sat, 21 Dec 2013 16:08:27 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLG8Lel023986 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:08:21 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:08:19 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:08:18 +0000 Message-ID: References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> In-Reply-To: <52B5AA94.3060009@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: multipart/mixed; boundary="_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 21 Dec 2013 16:08:28 -0000 --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I tried to rationalize... "in what case is it actually _desirably_ that the left or right command key _should_ generate an escape sequence and thus cancel the existing dialog" and I couldn't think of any. That being said... I'm still happy to move it. Can you have a look at the attached patch to see if matches what you envision? -- Devin On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: > Could you please revert this and move the fix to the correct place? > -Nathan > > On 12/16/13 10:06, Nathan Whitehorn wrote: >> Please add this to release/rc.local instead under the console setup. >> There is no guarantee that "auto" is running from an environment where >> this is defined -- for example, it may be running from a serial >> console or an xterm -- and the actual installer should not be polluted >> with assumptions about the media from which it runs. >> -Nathan >> >> On 12/16/13 09:50, Devin Teske wrote: >>> Author: dteske >>> Date: Mon Dec 16 15:50:59 2013 >>> New Revision: 259468 >>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd= .org/changeset/base/259468&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs= 6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7Ca= Xvls%3D%0A&s=3Daed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459= e2a3 >>> >>> Log: >>> Add a fix for Long-standing problem with VMware. Described in >>> below links: >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmwa= re.com/thread/107230&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2= Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3= D%0A&s=3Deb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmwa= re.com/docs/DOC-11677&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%= 2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%= 3D%0A&s=3D2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd >>> Basically, ignore the ``function 62'' and ``function 63'' >>> interpretations >>> of the left/right command key when we're in the lengthiest portion >>> of the >>> installation (initiated by the `auto' module). >>> The net effect is that you can now (once you've started the >>> installer from >>> the media) escape the VM without prematurely terminating the >>> current action >>> due to spurious escape sequence. >>> MFC after: 3 days >>> >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/auto >>> >>> Modified: head/usr.sbin/bsdinstall/scripts/auto >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >>> 2013 (r259467) >>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >>> 2013 (r259468) >>> @@ -49,6 +49,10 @@ error() { >>> ############################################################ MAIN >>> +# Don't send ESC on function-key 62/63 (left/right command key) >>> +f_quietly kbdcontrol -f 62 '' >>> +f_quietly kbdcontrol -f 63 '' >>> + >>> f_dprintf "Began Installation at %s" "$( date )" >>> rm -rf $BSDINSTALL_TMPETC >> > _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_ Content-Type: text/plain; name="patch.txt" Content-Description: patch.txt Content-Disposition: attachment; filename="patch.txt"; size=1035; creation-date="Sat, 21 Dec 2013 16:08:18 GMT"; modification-date="Sat, 21 Dec 2013 16:08:18 GMT" Content-ID: <668BD9BA105D2E4C93304124F1A724C4@fisglobal.com> Content-Transfer-Encoding: base64 SW5kZXg6IHJlbGVhc2UvcmMubG9jYWwNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSByZWxlYXNlL3JjLmxvY2Fs CShyZXZpc2lvbiAyNTk2ODQpDQorKysgcmVsZWFzZS9yYy5sb2NhbAkod29ya2luZyBjb3B5KQ0K QEAgLTE5LDYgKzE5LDEwIEBAIGlmIFsgJD8gLWVxIDAgXTsgdGhlbg0KIAkJVEVSTT14dGVybQ0K IAlmaQ0KIA0KKwkjIERvbid0IHNlbmQgRVNDIG9uIGZ1bmN0aW9uLWtleSA2Mi82MyAobGVmdC9y aWdodCBjb21tYW5kIGtleSkNCisJZl9xdWlldGx5IGtiZGNvbnRyb2wgLWYgNjIgJycNCisJZl9x dWlldGx5IGtiZGNvbnRyb2wgLWYgNjMgJycNCisNCiAJaWYgWyAteiAiJEVYVEVSTkFMX1ZUWV9T VEFSVEVEIiBdOyB0aGVuDQogCQkjIEluaXQgd2lsbCBjbGVhbiB0aGVzZSBwcm9jZXNzZXMgdXAg aWYvd2hlbiB0aGUgc3lzdGVtDQogCQkjIGdvZXMgbXVsdGl1c2VyDQpJbmRleDogdXNyLnNiaW4v YnNkaW5zdGFsbC9zY3JpcHRzL2F1dG8NCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSB1c3Iuc2Jpbi9ic2RpbnN0 YWxsL3NjcmlwdHMvYXV0bwkocmV2aXNpb24gMjU5NjE4KQ0KKysrIHVzci5zYmluL2JzZGluc3Rh bGwvc2NyaXB0cy9hdXRvCSh3b3JraW5nIGNvcHkpDQpAQCAtNDksMTAgKzQ5LDYgQEAgZXJyb3Io KSB7DQogDQogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIE1BSU4NCiANCi0jIERvbid0IHNlbmQgRVNDIG9uIGZ1bmN0aW9uLWtleSA2 Mi82MyAobGVmdC9yaWdodCBjb21tYW5kIGtleSkNCi1mX3F1aWV0bHkga2JkY29udHJvbCAtZiA2 MiAnJw0KLWZfcXVpZXRseSBrYmRjb250cm9sIC1mIDYzICcnDQotDQogZl9kcHJpbnRmICJCZWdh biBJbnN0YWxsYXRpb24gYXQgJXMiICIkKCBkYXRlICkiDQogDQogcm0gLXJmICRCU0RJTlNUQUxM X1RNUEVUQw0K --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:12:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBD1C5B4; Sat, 21 Dec 2013 16:12:11 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 817401FBA; Sat, 21 Dec 2013 16:12:11 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500F00YNS1N00@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:12:04 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.160315, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY5001HSZO1RK20@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:12:03 -0600 (CST) Message-id: <52B5BDD1.3000106@freebsd.org> Date: Sat, 21 Dec 2013 10:12:01 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> In-reply-to: X-Enigmail-Version: 1.5.2 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 16:12:11 -0000 Looks great, thanks -- although you don't need the f_quietly, which isn't defined there. The issue is that this patch very specific to running the installer on a video console. There are many circumstances in which it is not, in which case this will fail (e.g. a serial console). The other thing is that the installer should not reconfigure the host system unless it has been explicitly asked to. It isn't always run from the install media. If you think the default bindings for these keys don't make sense, then that should ultimately be fixed in the console driver as well. -Nathan On 12/21/13 10:08, Teske, Devin wrote: > I tried to rationalize... "in what case is it actually _desirably_ > that the > left or right command key _should_ generate an escape sequence > and thus cancel the existing dialog" and I couldn't think of any. > > That being said... I'm still happy to move it. Can you have a look at the > attached patch to see if matches what you envision? > > > -- > Devin > > > On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: > > > Could you please revert this and move the fix to the correct place? > > -Nathan > > > > On 12/16/13 10:06, Nathan Whitehorn wrote: > >> Please add this to release/rc.local instead under the console setup. > >> There is no guarantee that "auto" is running from an environment where > >> this is defined -- for example, it may be running from a serial > >> console or an xterm -- and the actual installer should not be polluted > >> with assumptions about the media from which it runs. > >> -Nathan > >> > >> On 12/16/13 09:50, Devin Teske wrote: > >>> Author: dteske > >>> Date: Mon Dec 16 15:50:59 2013 > >>> New Revision: 259468 > >>> URL: > https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259468&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=aed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459e2a3 > >>> > >>> Log: > >>> Add a fix for Long-standing problem with VMware. Described in > >>> below links: > >>> > https://urldefense.proofpoint.com/v1/url?u=https://communities.vmware.com/thread/107230&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=eb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 > >>> > https://urldefense.proofpoint.com/v1/url?u=https://communities.vmware.com/docs/DOC-11677&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd > >>> Basically, ignore the ``function 62'' and ``function 63'' > >>> interpretations > >>> of the left/right command key when we're in the lengthiest portion > >>> of the > >>> installation (initiated by the `auto' module). > >>> The net effect is that you can now (once you've started the > >>> installer from > >>> the media) escape the VM without prematurely terminating the > >>> current action > >>> due to spurious escape sequence. > >>> MFC after: 3 days > >>> > >>> Modified: > >>> head/usr.sbin/bsdinstall/scripts/auto > >>> > >>> Modified: head/usr.sbin/bsdinstall/scripts/auto > >>> > ============================================================================== > >>> > >>> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 > >>> 2013 (r259467) > >>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 > >>> 2013 (r259468) > >>> @@ -49,6 +49,10 @@ error() { > >>> ############################################################ MAIN > >>> +# Don't send ESC on function-key 62/63 (left/right command key) > >>> +f_quietly kbdcontrol -f 62 '' > >>> +f_quietly kbdcontrol -f 63 '' > >>> + > >>> f_dprintf "Began Installation at %s" "$( date )" > >>> rm -rf $BSDINSTALL_TMPETC > >> > > > > _____________ > The information contained in this message is proprietary and/or > confidential. If you are not the intended recipient, please: (i) > delete the message and all copies; (ii) do not disclose, distribute or > use the message in any manner; and (iii) notify the sender > immediately. In addition, please be aware that any message addressed > to our domain is subject to archiving and review by persons other than > the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:23:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 883107F8; Sat, 21 Dec 2013 16:23:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 744011048; Sat, 21 Dec 2013 16:23:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLGNW3Y008810; Sat, 21 Dec 2013 16:23:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLGNVaq008807; Sat, 21 Dec 2013 16:23:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312211623.rBLGNVaq008807@svn.freebsd.org> From: Warner Losh Date: Sat, 21 Dec 2013 16:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259685 - in head/sys: arm/at91 dev/uart 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.17 Precedence: list List-Id: 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, 21 Dec 2013 16:23:32 -0000 Author: imp Date: Sat Dec 21 16:23:31 2013 New Revision: 259685 URL: http://svnweb.freebsd.org/changeset/base/259685 Log: Plumb the cn_grab and cn_ungrab routines down into the uart clients. Mask RX interrupts while grabbed on the atmel serial driver. This UART interrupts every character. When interrupts are enabled at the mountroot> prompt, this means the ISR eats the characters. Rather than try to create a cooperative buffering system for the low level kernel console, instead just mask out the ISR. For NS8250 and decsendents this isn't needed, since interrupts only happen after 14 or more characters (depending on the fifo settings). Plumb such that these are optional so there's no change in behavior for all the other UART clients. ddb worked on this platform because all interrupts were disabled while it was running, so this problem wasn't noticed. The mountroot> issue has been around for a very very long time. MFC after: 3 days Modified: head/sys/arm/at91/uart_dev_at91usart.c head/sys/dev/uart/uart_cpu.h head/sys/dev/uart/uart_tty.c Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 16:23:31 2013 (r259685) @@ -219,6 +219,20 @@ at91_usart_param(struct uart_bas *bas, i return (0); } +static void +at91_usart_grab(struct uart_bas *bas) +{ + + WR4(bas, USART_IDR, USART_CSR_RXRDY); +} + +static void +at91_usart_ungrab(struct uart_bas *bas) +{ + + WR4(bas, USART_IER, USART_CSR_RXRDY); +} + static struct uart_ops at91_usart_ops = { .probe = at91_usart_probe, .init = at91_usart_init, @@ -226,6 +240,8 @@ static struct uart_ops at91_usart_ops = .putc = at91_usart_putc, .rxready = at91_usart_rxready, .getc = at91_usart_getc, + .grab = at91_usart_grab, + .ungrab = at91_usart_ungrab, }; static int Modified: head/sys/dev/uart/uart_cpu.h ============================================================================== --- head/sys/dev/uart/uart_cpu.h Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/dev/uart/uart_cpu.h Sat Dec 21 16:23:31 2013 (r259685) @@ -43,6 +43,8 @@ struct uart_ops { void (*putc)(struct uart_bas *, int); int (*rxready)(struct uart_bas *); int (*getc)(struct uart_bas *, struct mtx *); + void (*grab)(struct uart_bas *); + void (*ungrab)(struct uart_bas *); }; extern bus_space_tag_t uart_bus_space_io; @@ -135,6 +137,27 @@ uart_putc(struct uart_devinfo *di, int c uart_unlock(di->hwmtx); } +static __inline void +uart_grab(struct uart_devinfo *di) +{ + + uart_lock(di->hwmtx); + if (di->ops->grab) + di->ops->grab(&di->bas); + uart_unlock(di->hwmtx); +} + +static __inline void +uart_ungrab(struct uart_devinfo *di) +{ + + uart_lock(di->hwmtx); + if (di->ops->ungrab) + di->ops->ungrab(&di->bas); + uart_unlock(di->hwmtx); +} + + static __inline int uart_rxready(struct uart_devinfo *di) { Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/dev/uart/uart_tty.c Sat Dec 21 16:23:31 2013 (r259685) @@ -112,11 +112,15 @@ uart_cnterm(struct consdev *cp) static void uart_cngrab(struct consdev *cp) { + + uart_grab(cp->cn_arg); } static void uart_cnungrab(struct consdev *cp) { + + uart_ungrab(cp->cn_arg); } static void From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:25:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F01394C; Sat, 21 Dec 2013 16:25:21 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF201052; Sat, 21 Dec 2013 16:25:20 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLGPKv3022286 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:25:20 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:25:18 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:25:18 +0000 Message-ID: <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> In-Reply-To: <52B5BDD1.3000106@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <4F302BF9A69A994CA4E515C0147E9C49@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 21 Dec 2013 16:25:21 -0000 On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: > Looks great, thanks -- although you don't need the f_quietly, which > isn't defined there. >=20 > The issue is that this patch very specific to running the installer on a > video console. There are many circumstances in which it is not, in which > case this will fail (e.g. a serial console). The other thing is that the > installer should not reconfigure the host system unless it has been > explicitly asked to. It isn't always run from the install media. If you > think the default bindings for these keys don't make sense, then that > should ultimately be fixed in the console driver as well. My inspiration for this change came from a tweet in which we were (unjustly or not; doesn't matter) slammed for not having addressed this issue since it (as the person claims) first appeared in 6.x. Having felt the persons pain (and verified that, indeed, we continue to be plagued in 10) I decided to do start researching the problem in-depth. The links I posted in the commit message give an excellent view of the issue and in-fact doesn't even mention using kbdcontrol. Instead it is suggested that we create an alternate keymap that ignores the command keys. That sounds like one approach (and wins points because it is opt- in) but it doesn't solve the problem for me or anyone else running the installer. Perhaps if we had this alternate keymap in the base which does the desired thing (ignore the command keys), then we could just say that the user ought to select said keymap at the onset of the installation process. But I'm not sure *I* like that approach because then it means that for my own testing, I have to select an alternate keymap everytime I run the installer in VMware. Rather, it seems to me that the installation process, if it ignored the command key on every non-serial platform... this would be fine. Afterall, once they get the system installed, they'll have the desired keymap set and they can forget. --=20 Devin > -Nathan >=20 > On 12/21/13 10:08, Teske, Devin wrote: >> I tried to rationalize... "in what case is it actually _desirably_ >> that the >> left or right command key _should_ generate an escape sequence >> and thus cancel the existing dialog" and I couldn't think of any. >>=20 >> That being said... I'm still happy to move it. Can you have a look at the >> attached patch to see if matches what you envision? >>=20 >>=20 >> --=20 >> Devin >>=20 >>=20 >> On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: >>=20 >>> Could you please revert this and move the fix to the correct place? >>> -Nathan >>>=20 >>> On 12/16/13 10:06, Nathan Whitehorn wrote: >>>> Please add this to release/rc.local instead under the console setup. >>>> There is no guarantee that "auto" is running from an environment where >>>> this is defined -- for example, it may be running from a serial >>>> console or an xterm -- and the actual installer should not be polluted >>>> with assumptions about the media from which it runs. >>>> -Nathan >>>>=20 >>>> On 12/16/13 09:50, Devin Teske wrote: >>>>> Author: dteske >>>>> Date: Mon Dec 16 15:50:59 2013 >>>>> New Revision: 259468 >>>>> URL: >> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.org/c= hangeset/base/259468&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2= Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3= D%0A&s=3Daed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459e2a3 >>>>>=20 >>>>> Log: >>>>> Add a fix for Long-standing problem with VMware. Described in >>>>> below links: >>>>>=20 >> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmware.= com/thread/107230&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2Faj= 2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0= A&s=3Deb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 >>>>>=20 >> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmware.= com/docs/DOC-11677&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2Fa= j2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%= 0A&s=3D2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd >>>>> Basically, ignore the ``function 62'' and ``function 63'' >>>>> interpretations >>>>> of the left/right command key when we're in the lengthiest portion >>>>> of the >>>>> installation (initiated by the `auto' module). >>>>> The net effect is that you can now (once you've started the >>>>> installer from >>>>> the media) escape the VM without prematurely terminating the >>>>> current action >>>>> due to spurious escape sequence. >>>>> MFC after: 3 days >>>>>=20 >>>>> Modified: >>>>> head/usr.sbin/bsdinstall/scripts/auto >>>>>=20 >>>>> Modified: head/usr.sbin/bsdinstall/scripts/auto >>>>>=20 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >>>>>=20 >>>>> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >>>>> 2013 (r259467) >>>>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >>>>> 2013 (r259468) >>>>> @@ -49,6 +49,10 @@ error() { >>>>> ############################################################ MAIN >>>>> +# Don't send ESC on function-key 62/63 (left/right command key) >>>>> +f_quietly kbdcontrol -f 62 '' >>>>> +f_quietly kbdcontrol -f 63 '' >>>>> + >>>>> f_dprintf "Began Installation at %s" "$( date )" >>>>> rm -rf $BSDINSTALL_TMPETC >>>>=20 >>>=20 >>=20 >> _____________ >> The information contained in this message is proprietary and/or >> confidential. If you are not the intended recipient, please: (i) >> delete the message and all copies; (ii) do not disclose, distribute or >> use the message in any manner; and (iii) notify the sender >> immediately. In addition, please be aware that any message addressed >> to our domain is subject to archiving and review by persons other than >> the intended recipient. Thank you. >=20 _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:31:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C240C1F; Sat, 21 Dec 2013 16:31:57 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03B5910C6; Sat, 21 Dec 2013 16:31:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500F00YNR1M00@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:31:55 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.162415, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY600K9W0L59000@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:31:54 -0600 (CST) Message-id: <52B5C279.4020103@freebsd.org> Date: Sat, 21 Dec 2013 10:31:53 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> In-reply-to: <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> X-Enigmail-Version: 1.5.2 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 16:31:57 -0000 On 12/21/13 10:25, Teske, Devin wrote: > On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: > >> Looks great, thanks -- although you don't need the f_quietly, which >> isn't defined there. >> >> The issue is that this patch very specific to running the installer on a >> video console. There are many circumstances in which it is not, in which >> case this will fail (e.g. a serial console). The other thing is that the >> installer should not reconfigure the host system unless it has been >> explicitly asked to. It isn't always run from the install media. If you >> think the default bindings for these keys don't make sense, then that >> should ultimately be fixed in the console driver as well. > My inspiration for this change came from a tweet in which we were > (unjustly or not; doesn't matter) slammed for not having addressed > this issue since it (as the person claims) first appeared in 6.x. > > Having felt the persons pain (and verified that, indeed, we continue > to be plagued in 10) I decided to do start researching the problem > in-depth. > > The links I posted in the commit message give an excellent view of > the issue and in-fact doesn't even mention using kbdcontrol. Instead > it is suggested that we create an alternate keymap that ignores the > command keys. > > That sounds like one approach (and wins points because it is opt- > in) but it doesn't solve the problem for me or anyone else running > the installer. > > Perhaps if we had this alternate keymap in the base which does the > desired thing (ignore the command keys), then we could just say that > the user ought to select said keymap at the onset of the installation > process. > > But I'm not sure *I* like that approach because then it means that for > my own testing, I have to select an alternate keymap everytime I run > the installer in VMware. > > Rather, it seems to me that the installation process, if it ignored the > command key on every non-serial platform... this would be fine. > Afterall, once they get the system installed, they'll have the desired > keymap set and they can forget. I'd prefer opt-out -- having the default be the option that is least surprising is a good idea. In any case, moving it to rc.local solves all the immediate problem. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:43:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE049DC0; Sat, 21 Dec 2013 16:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9DFC113C; Sat, 21 Dec 2013 16:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLGhfxD015769; Sat, 21 Dec 2013 16:43:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLGhfEZ015767; Sat, 21 Dec 2013 16:43:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312211643.rBLGhfEZ015767@svn.freebsd.org> From: Devin Teske Date: Sat, 21 Dec 2013 16:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259686 - in head: release usr.sbin/bsdinstall/scripts 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.17 Precedence: list List-Id: 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, 21 Dec 2013 16:43:41 -0000 Author: dteske Date: Sat Dec 21 16:43:40 2013 New Revision: 259686 URL: http://svnweb.freebsd.org/changeset/base/259686 Log: Move the installer's keymap solution introduced by SVN r259468. The new location of /etc/rc.local on the install media is more appropriate as it knows serial vs. non-serial and can also do the change earlier (so that even the initial Install dialog can benefit from the change). MFC after: 3 days Modified: head/release/rc.local head/usr.sbin/bsdinstall/scripts/auto Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Sat Dec 21 16:23:31 2013 (r259685) +++ head/release/rc.local Sat Dec 21 16:43:40 2013 (r259686) @@ -19,6 +19,10 @@ if [ $? -eq 0 ]; then TERM=xterm fi + # Don't send ESC on function-key 62/63 (left/right command key) + kbdcontrol -f 62 '' > /dev/null 2>&1 + kbdcontrol -f 63 '' > /dev/null 2>&1 + if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system # goes multiuser Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sat Dec 21 16:23:31 2013 (r259685) +++ head/usr.sbin/bsdinstall/scripts/auto Sat Dec 21 16:43:40 2013 (r259686) @@ -49,10 +49,6 @@ error() { ############################################################ MAIN -# Don't send ESC on function-key 62/63 (left/right command key) -f_quietly kbdcontrol -f 62 '' -f_quietly kbdcontrol -f 63 '' - f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 16:45:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26257FA5; Sat, 21 Dec 2013 16:45:18 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA1421152; Sat, 21 Dec 2013 16:45:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLGjGZP010314 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:45:16 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:45:15 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:45:14 +0000 Message-ID: <3D3536A7-B671-4170-99D0-B5C876BDEEAF@fisglobal.com> References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> <52B5C279.4020103@freebsd.org> In-Reply-To: <52B5C279.4020103@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <1FB00AF9F40C0B489216B98A539BB101@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: 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, 21 Dec 2013 16:45:18 -0000 On Dec 21, 2013, at 8:31 AM, Nathan Whitehorn wrote: > On 12/21/13 10:25, Teske, Devin wrote: >> On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: >>=20 >>> Looks great, thanks -- although you don't need the f_quietly, which >>> isn't defined there. >>>=20 >>> The issue is that this patch very specific to running the installer on a >>> video console. There are many circumstances in which it is not, in which >>> case this will fail (e.g. a serial console). The other thing is that the >>> installer should not reconfigure the host system unless it has been >>> explicitly asked to. It isn't always run from the install media. If you >>> think the default bindings for these keys don't make sense, then that >>> should ultimately be fixed in the console driver as well. >> My inspiration for this change came from a tweet in which we were >> (unjustly or not; doesn't matter) slammed for not having addressed >> this issue since it (as the person claims) first appeared in 6.x. >>=20 >> Having felt the persons pain (and verified that, indeed, we continue >> to be plagued in 10) I decided to do start researching the problem >> in-depth. >>=20 >> The links I posted in the commit message give an excellent view of >> the issue and in-fact doesn't even mention using kbdcontrol. Instead >> it is suggested that we create an alternate keymap that ignores the >> command keys. >>=20 >> That sounds like one approach (and wins points because it is opt- >> in) but it doesn't solve the problem for me or anyone else running >> the installer. >>=20 >> Perhaps if we had this alternate keymap in the base which does the >> desired thing (ignore the command keys), then we could just say that >> the user ought to select said keymap at the onset of the installation >> process. >>=20 >> But I'm not sure *I* like that approach because then it means that for >> my own testing, I have to select an alternate keymap everytime I run >> the installer in VMware. >>=20 >> Rather, it seems to me that the installation process, if it ignored the >> command key on every non-serial platform... this would be fine. >> Afterall, once they get the system installed, they'll have the desired >> keymap set and they can forget. >=20 > I'd prefer opt-out -- having the default be the option that is least > surprising is a good idea. In any case, moving it to rc.local solves all > the immediate problem. We can think about changing keymaps for the base later; for now, I've moved the kbdcontrol invocations to the new spot (SVN r259686). Much better if I do say so myself; much thanks for the suggested new location. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 19:29:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4AB4786; Sat, 21 Dec 2013 19:29:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D118E1D12; Sat, 21 Dec 2013 19:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLJT8FH073846; Sat, 21 Dec 2013 19:29:08 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLJT8Tc073845; Sat, 21 Dec 2013 19:29:08 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201312211929.rBLJT8Tc073845@svn.freebsd.org> From: Chris Rees Date: Sat, 21 Dec 2013 19:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259695 - head/bin/pax 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.17 Precedence: list List-Id: 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, 21 Dec 2013 19:29:09 -0000 Author: crees (doc,ports committer) Date: Sat Dec 21 19:29:08 2013 New Revision: 259695 URL: http://svnweb.freebsd.org/changeset/base/259695 Log: Document the lack of chflags support in pax(1) PR: docs/135516 Submitted by: arundel (based on) Approved by: gjb (mentor) Modified: head/bin/pax/pax.1 Modified: head/bin/pax/pax.1 ============================================================================== --- head/bin/pax/pax.1 Sat Dec 21 18:47:00 2013 (r259694) +++ head/bin/pax/pax.1 Sat Dec 21 19:29:08 2013 (r259695) @@ -33,7 +33,7 @@ .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 29, 2010 +.Dd December 21, 2013 .Dt PAX 1 .Os .Sh NAME @@ -587,6 +587,16 @@ precedence. For example, if .Dl Fl p Ar eme is specified, file modification times are still preserved. +.Pp +File flags set by +.Xr chflags 1 +are not understood by +.Nm , +however +.Xr tar 1 +and +.Xr dump 1 +will preserve these. .It Fl s Ar replstr Modify the file or archive member names specified by the .Ar pattern @@ -1195,3 +1205,11 @@ at the University of California, San Die The .Nm utility does not recognize multibyte characters. +.Pp +File flags set by +.Xr chflags 1 +are not preserved by +.Nm . +The BUGS section of +.Xr chflags 1 +has a list of utilities that are unaware of flags. From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 19:53:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64391B95; Sat, 21 Dec 2013 19:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 508F21E77; Sat, 21 Dec 2013 19:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLJrqSM083674; Sat, 21 Dec 2013 19:53:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLJrq7j083673; Sat, 21 Dec 2013 19:53:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312211953.rBLJrq7j083673@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 21 Dec 2013 19:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259696 - head/contrib/gcc 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.17 Precedence: list List-Id: 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, 21 Dec 2013 19:53:52 -0000 Author: pfg Date: Sat Dec 21 19:53:51 2013 New Revision: 259696 URL: http://svnweb.freebsd.org/changeset/base/259696 Log: gcc: warnings from -Wformat-security Minor mismatch in r259666. Obtained from: Apple GCC 4.2 - 5646 (Radar 5764921) MFC after: 1 week Modified: head/contrib/gcc/gcov.c Modified: head/contrib/gcc/gcov.c ============================================================================== --- head/contrib/gcc/gcov.c Sat Dec 21 19:29:08 2013 (r259695) +++ head/contrib/gcc/gcov.c Sat Dec 21 19:53:51 2013 (r259696) @@ -414,10 +414,10 @@ print_usage (int error_p) static void print_version (void) { - fnotice (stdout, "%s", "gcov (GCC) %s\n", version_string); + fnotice (stdout, "gcov (GCC) %s\n", version_string); fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n", _("(C)")); - fnotice (stdout, + fnotice (stdout, "%s", _("This is free software; see the source for copying conditions.\n" "There is NO warranty; not even for MERCHANTABILITY or \n" "FITNESS FOR A PARTICULAR PURPOSE.\n\n")); From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 21:56:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D13A980; Sat, 21 Dec 2013 21:56:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 292D8156C; Sat, 21 Dec 2013 21:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLLuDoc026980; Sat, 21 Dec 2013 21:56:13 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLLuDoY026979; Sat, 21 Dec 2013 21:56:13 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201312212156.rBLLuDoY026979@svn.freebsd.org> From: Chris Rees Date: Sat, 21 Dec 2013 21:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259697 - head/sbin/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.17 Precedence: list List-Id: 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, 21 Dec 2013 21:56:13 -0000 Author: crees (doc,ports committer) Date: Sat Dec 21 21:56:12 2013 New Revision: 259697 URL: http://svnweb.freebsd.org/changeset/base/259697 Log: Minor grammar fix PR: docs/185057 Submitted by: Yuri (yuri@rawbw.com) Approved by: gjb (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Dec 21 19:53:51 2013 (r259696) +++ head/sbin/ipfw/ipfw.8 Sat Dec 21 21:56:12 2013 (r259697) @@ -335,8 +335,7 @@ Section below for details. If the world and the kernel get out of sync the .Nm ABI may break, preventing you from being able to add any rules. -This can -adversely effect the booting process. +This can adversely affect the booting process. You can use .Nm .Cm disable From owner-svn-src-head@FreeBSD.ORG Sat Dec 21 23:35:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CFBCA92; Sat, 21 Dec 2013 23:35:12 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C7CD91ACB; Sat, 21 Dec 2013 23:35:11 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 328C7A71; Sun, 22 Dec 2013 00:28:19 +0100 (CET) Date: Sun, 22 Dec 2013 00:35:45 +0100 From: Pawel Jakub Dawidek To: Glen Barber Subject: Re: svn commit: r259678 - head/contrib/tcpdump Message-ID: <20131221233544.GA1673@garage.freebsd.pl> References: <201312211245.rBLCjaXQ029358@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312211245.rBLCjaXQ029358@svn.freebsd.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: 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, 21 Dec 2013 23:35:12 -0000 On Sat, Dec 21, 2013 at 12:45:36PM +0000, Glen Barber wrote: > Author: gjb > Date: Sat Dec 21 12:45:35 2013 > New Revision: 259678 > URL: http://svnweb.freebsd.org/changeset/base/259678 > > Log: > Fix build with WITHOUT_CAPSICUM. Thanks. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com